login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
July
»
1
Re: [PATCH] fix rcu vs hotplug race
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Paul E. McKenney
Subject:
Re: [PATCH] fix rcu vs hotplug race
Date: Tuesday, July 1, 2008 - 12:46 pm
On Tue, Jul 01, 2008 at 11:09:00AM +0530, Gautham R Shenoy wrote:
quoted text
> On Fri, Jun 27, 2008 at 07:58:45AM -0700, Paul E. McKenney wrote: > > On Fri, Jun 27, 2008 at 11:19:59AM +0530, Dhaval Giani wrote: > > > On Fri, Jun 27, 2008 at 10:48:55AM +0530, Dipankar Sarma wrote: > > > > On Fri, Jun 27, 2008 at 10:17:38AM +0530, Gautham R Shenoy wrote: > > > > > IMHO the warning is a spurious one. > > > > > Here's the timeline. > > > > > CPU_A CPU_B > > > > > -------------------------------------------------------------- > > > > > cpu_down(): . > > > > > . . > > > > > . . > > > > > stop_machine(): /* disables preemption, . > > > > > * and irqs */ . > > > > > . . > > > > > . . > > > > > take_cpu_down(); . > > > > > . . > > > > > . . > > > > > . . > > > > > cpu_disable(); /*this removes cpu . > > > > > *from cpu_online_map . > > > > > */ . > > > > > . . > > > > > . . > > > > > restart_machine(); /* enables irqs */ . > > > > > ------WINDOW DURING WHICH rcp->cpumask is stale --------------- > > > > > . call_rcu(); > > > > > . /* disables irqs here */ > > > > > . .force_quiescent_state(); > > > > > .CPU_DEAD: .for_each_cpu(rcp->cpumask) > > > > > . . smp_send_reschedule(); > > > > > . . > > > > > . . WARN_ON() for offlined CPU! > > > > > . > > > > > > > > Exactly. The call_rcu()s are coming from a different subsystem > > > > and can happen anytime during the CPU hotplug path. So, RCU subsystem > > > > doesn't have anything to do to keep rcu->cpumask consistent. > > > > It is *safe* even if we miss poking a cpu or two while > > > > forcing quiescent state in all CPUs. The worst that can happen > > > > is a delay in grace period. No correctness problem here. > > > > > > > > > > One question. What is preventing a CPU from clearing its mask after we > > > have checked whether it is online but before we have called into > > > smp_send_reschedule? > > > > This is my concern as well. Gautham, at which point in the above > > timeline is the offlining CPU marked DYING? Before stop_machine(), right? > > No :) The offlining CPU is marked DYING after stop_machine(), inside > take_cpu_down() which is the work we want to execute after stopping the > machine. > > it's like > _cpu_down() > | > |-> stop_machine_run(); > | | > | |-> stop_machine(); /* All CPUs irqs disabled. */ > | | > | |-> take_cpu_down() --> sets state to CPU_DYING. disables irqs on > | | offlined cpu > | | > | |-> restart_machine(); /* All CPUs irqs reenabled */ > | > |-> send_CPU_DEAD_notification. > > The very fact that a thread is running with irqs disabled means that > stop_machine_run() thread cannot start executing the work it has been > assinged to execute. Because for Machine to be stopped, stop_machine() > needs to create n-1 high priority threads on n-1 online cpus, which will > disable interrupts and preemption, and stop the machine. Then it will > run the task assigned to it on the ith cpu, which in this case is the > cpu to be offlined. > > So, it's the design of stop_machine() that's preventing someone > from updating the cpu_online_map while > force_quiescent_state() is performing the > cpu_is_online() check. Becase we always call force_quiescent_state() > with irqs disabled :)
Got it, so the patch looks good. Thanx, Paul
quoted text
> > If so, can't we just disable irqs, check for DYING or DEAD, and invoke > > smp_send_reschedule() only if not DYING or DEAD? > > > > > > > Thanx, Paul > > -- > Thanks and Regards > gautham
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] fix rcu vs hotplug race
, Dhaval Giani
, (Mon Jun 23, 3:37 am)
Re: [PATCH] fix rcu vs hotplug race
, Ingo Molnar
, (Mon Jun 23, 3:58 am)
Re: [PATCH] fix rcu vs hotplug race
, Gautham R Shenoy
, (Mon Jun 23, 4:49 am)
Re: [PATCH] fix rcu vs hotplug race
, Ingo Molnar
, (Tue Jun 24, 4:01 am)
Re: [PATCH] fix rcu vs hotplug race
, Paul E. McKenney
, (Thu Jun 26, 8:27 am)
Re: [PATCH] fix rcu vs hotplug race
, Gautham R Shenoy
, (Thu Jun 26, 9:47 pm)
Re: [PATCH] fix rcu vs hotplug race
, Dipankar Sarma
, (Thu Jun 26, 10:18 pm)
Re: [PATCH] fix rcu vs hotplug race
, Dhaval Giani
, (Thu Jun 26, 10:49 pm)
Re: [PATCH] fix rcu vs hotplug race
, Paul E. McKenney
, (Fri Jun 27, 7:58 am)
Re: [PATCH] fix rcu vs hotplug race
, Gautham R Shenoy
, (Mon Jun 30, 10:39 pm)
Re: [PATCH] fix rcu vs hotplug race
, Ingo Molnar
, (Mon Jun 30, 11:16 pm)
Re: [PATCH] fix rcu vs hotplug race
, Dhaval Giani
, (Mon Jun 30, 11:28 pm)
Re: [PATCH] fix rcu vs hotplug race
, Ingo Molnar
, (Mon Jun 30, 11:35 pm)
Re: [PATCH] fix rcu vs hotplug race
, Ingo Molnar
, (Mon Jun 30, 11:52 pm)
Re: [PATCH] fix rcu vs hotplug race
, Ingo Molnar
, (Tue Jul 1, 12:48 am)
Re: [PATCH] fix rcu vs hotplug race
, Ingo Molnar
, (Tue Jul 1, 1:32 am)
Re: [PATCH] fix rcu vs hotplug race
, Paul E. McKenney
, (Tue Jul 1, 12:46 pm)
Re: [PATCH] fix rcu vs hotplug race
, Paul E. McKenney
, (Fri Aug 1, 2:01 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset
Tony Breeds
[LGUEST] Look in object dir for .config
git
:
Brian Downing
Re: Git in a Nutshell guide
John Benes
Re: master has some toys
Matthias Lederhofer
[PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree
Alexander Sulfrian
[RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set
Junio C Hamano
Re: Rss produced by git is not valid xml?
git-commits-head
:
Linux Kernel Mailing List
iSeries: fix section mismatch in iseries_veth
Linux Kernel Mailing List
ixbge: remove TX lock and redo TX accounting.
Linux Kernel Mailing List