From: Rusty Russell <rusty@rustcorp.com.au>
To: paulmck@linux.vnet.ibm.com
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
Arjan van de Ven <arjan@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>,
"akpm\@linux-foundation.org" <akpm@linux-foundation.org>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Milton Miller <miltonm@bga.com>, "mingo\@elte.hu" <mingo@elte.hu>,
Tejun Heo <tj@kernel.org>,
KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Linux PM mailing list <linux-pm@vger.kernel.org>
Subject: Re: CPU Hotplug rework
Date: Mon, 26 Mar 2012 11:11:27 +1030 [thread overview]
Message-ID: <87bonkchxk.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20120324002347.GD2450@linux.vnet.ibm.com>
On Fri, 23 Mar 2012 17:23:47 -0700, "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> On Sat, Mar 24, 2012 at 09:57:32AM +1030, Rusty Russell wrote:
> > On Thu, 22 Mar 2012 15:49:20 -0700, "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> > > On Thu, Mar 22, 2012 at 02:55:04PM +1030, Rusty Russell wrote:
> > > > On Wed, 21 Mar 2012 10:01:59 +0100, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> > > > > Thing is, if its really too much for some people, they can orchestrate
> > > > > it such that its not. Just move everybody in a cpuset, clear the to be
> > > > > offlined cpu from the cpuset's mask -- this will migrate everybody away.
> > > > > Then hotplug will find an empty runqueue and its fast, no?
> > > >
> > > > I like this solution better.
> > >
> > > As long as we have some way to handle kthreads that are algorithmically
> > > tied to a given CPU. There are coding conventions to handle this, for
> > > example, do everything with preemption disabled and just after each
> > > preempt_disable() verify that you are in fact running on the correct
> > > CPU, but it is easy to imagine improvements.
> >
> > I don't think we should move per-cpu kthreads at all. Let's stop trying
> > to save a few bytes of memory, and just leave them frozen. They'll run
> > again if/when the CPU returns.
>
> OK, that would work for me. So, how do I go about freezing RCU's
> per-CPU kthreads?
Good question.
Obviously, having callbacks hanging around until the CPU comes back is
not viable, nor is blocking preempt during the callbacks. Calling
get_online_cpus() is too heavy.
I can think of three approaches:
1) Put the being-processed rcu calls into a per-cpu var, and pull them
off that list with preempt disabled. This lets us cleanup after the
thread gets frozen as its CPU goes ofline, but doesn't solve the case
of going offline during a callback.
2) Sync with the thread somehow during a notifier callback. This is the
same kind of logic as shutting the thread down, so it's not really
attractive from a simplicity POV.
3) Create to a per-cpu rwsem to stop a specific CPU from going down, and
just grab that while we're processing rcu callbacks.
If this pattern of kthread is common, then #3 (or some equiv lightwieght
way of stopping a specific CPU from going offline) is looking
attractive.
Cheers,
Rusty.
--
How could I marry someone with more hair than me? http://baldalex.org
next prev parent reply other threads:[~2012-03-26 4:25 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-19 14:44 CPU Hotplug rework Srivatsa S. Bhat
2012-03-19 14:48 ` Srivatsa S. Bhat
2012-03-20 11:28 ` Peter Zijlstra
2012-04-05 17:39 ` Paul E. McKenney
2012-04-05 17:55 ` Paul E. McKenney
2012-04-05 23:06 ` Paul E. McKenney
2012-04-06 20:15 ` Srivatsa S. Bhat
2012-04-09 16:46 ` Paul E. McKenney
2012-04-10 7:56 ` Nikunj A Dadhania
2012-04-06 19:52 ` Srivatsa S. Bhat
2012-04-09 17:13 ` Paul E. McKenney
2012-04-10 13:41 ` Srivatsa S. Bhat
2012-04-10 15:46 ` Paul E. McKenney
2012-04-10 17:26 ` Srivatsa S. Bhat
2012-04-11 0:09 ` Steven Rostedt
2012-04-11 0:28 ` Paul E. McKenney
2012-04-11 0:37 ` Steven Rostedt
2012-04-11 1:00 ` Paul E. McKenney
2012-04-11 6:02 ` Srivatsa S. Bhat
2012-04-11 12:28 ` Paul E. McKenney
2012-03-19 23:42 ` Rusty Russell
2012-03-20 10:42 ` Peter Zijlstra
2012-03-20 23:00 ` Rusty Russell
2012-03-21 9:01 ` Peter Zijlstra
2012-03-22 4:25 ` Rusty Russell
2012-03-22 22:49 ` Paul E. McKenney
2012-03-23 23:27 ` Rusty Russell
2012-03-24 0:23 ` Paul E. McKenney
2012-03-26 0:41 ` Rusty Russell [this message]
2012-03-26 8:02 ` Peter Zijlstra
2012-03-26 13:09 ` Steven Rostedt
2012-03-26 13:38 ` Peter Zijlstra
2012-03-26 15:22 ` Steven Rostedt
2012-03-26 16:13 ` Peter Zijlstra
2012-03-26 17:05 ` Steven Rostedt
2012-03-26 17:59 ` Peter Zijlstra
2012-03-27 1:32 ` Rusty Russell
2012-03-27 3:05 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bonkchxk.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=kosaki.motohiro@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=miltonm@bga.com \
--cc=mingo@elte.hu \
--cc=paul.gortmaker@windriver.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rjw@sisk.pl \
--cc=rostedt@goodmis.org \
--cc=srivatsa.bhat@linux.vnet.ibm.com \
--cc=tj@kernel.org \
--cc=vatsa@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.