public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org,
	rusty@rustcorp.com.au, paulmck@linux.vnet.ibm.com,
	namhyung@kernel.org, rjw@sisk.pl, nikunj@linux.vnet.ibm.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 6/6] CPU hotplug: Invoke CPU offline notifiers in reverse order
Date: Wed, 25 Jul 2012 09:43:39 -0700	[thread overview]
Message-ID: <20120725164339.GA32378@google.com> (raw)
In-Reply-To: <20120725115502.3900.10942.stgit@srivatsabhat.in.ibm.com>

Hello,

On Wed, Jul 25, 2012 at 05:25:13PM +0530, Srivatsa S. Bhat wrote:
> During CPU hotplug, we want to create the following effect:
>  * During CPU online, the CPU incrementally grows the number of services
>    it offers.
>  * During CPU offline, the services are incrementally retired, in the
>    reverse order of their growth during CPU online.
> 
> To achieve the above, invoke the registered CPU hotplug notifiers in the
> reverse order during CPU offline, with respect to the order in which they
> were invoked during CPU online.
> 
> This approach helps in making the hotplug path a lot more logically
> coherent: Services are started in a well-known order, perhaps with dependencies
> between them, while bringing up a CPU. While offlining the CPU, we honor
> many of the dependencies automatically by just backtracking the way we came;
> that is, by invoking the notifiers in the reverse order. Thus, this model of
> reverse notifier invocation helps us in avoiding the need for excessively
> messing with the notifier priorities while trying to get the ordering right.
> 
> Notes:
> 1. The workqueue code becomes simpler, since it now needs just a single CPU
> hotplug callback.
> 2. The scheduler's sched_cpu_[in]active() callbacks can also be merged into
> a single callback.
> 3. On similar lines, the cpusets' cpuset_cpu_[in]active() callbacks can also
> be merged.
> 
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>

For workqueue part,

 Acked-by: Tejun Heo <tj@kernel.org>

Now that we can reverse-walk notifier chain, it probably is a good
idea to make it a bit smarter and call CANCELs in reverse order of
PREPAREs too.

Thanks.

-- 
tejun

  reply	other threads:[~2012-07-25 16:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 11:53 [RFC PATCH 0/6] CPU hotplug: Reverse invocation of notifiers during CPU hotplug Srivatsa S. Bhat
2012-07-25 11:53 ` [RFC PATCH 1/6] list, rcu: Introduce rcu version of reverse list traversal Srivatsa S. Bhat
2012-07-25 11:53 ` [RFC PATCH 2/6] notifiers: Convert notifier chain to circular doubly linked-list Srivatsa S. Bhat
2012-07-25 11:54 ` [RFC PATCH 3/6] notifiers: Add support for reverse invocation of notifier chains Srivatsa S. Bhat
2012-07-25 11:54 ` [RFC PATCH 4/6] sched, cpuset: Prepare scheduler and cpuset CPU hotplug callbacks for reverse invocation Srivatsa S. Bhat
2012-07-25 11:54 ` [RFC PATCH 5/6] sched, perf: Prepare migration and perf " Srivatsa S. Bhat
2012-07-25 11:55 ` [RFC PATCH 6/6] CPU hotplug: Invoke CPU offline notifiers in reverse order Srivatsa S. Bhat
2012-07-25 16:43   ` Tejun Heo [this message]
2012-07-25 14:57 ` [RFC PATCH 0/6] CPU hotplug: Reverse invocation of notifiers during CPU hotplug Alan Stern
2012-07-25 15:56   ` Srivatsa S. Bhat
2012-07-25 16:10     ` Alan Stern
2012-07-25 16:37       ` Srivatsa S. Bhat
2012-07-25 16:43       ` Paul E. McKenney
2012-07-25 19:44         ` Alan Stern
2012-07-25 16:30     ` Thomas Gleixner
2012-07-25 16:51       ` Srivatsa S. Bhat
2012-07-26 11:02         ` Thomas Gleixner
2012-07-26 11:11           ` Srivatsa S. Bhat
2012-07-25 18:22       ` Srivatsa S. Bhat
2012-07-26 10:55         ` Thomas Gleixner
2012-07-26 11:13           ` Srivatsa S. Bhat
2012-07-26 11:22       ` Srivatsa S. Bhat
2012-07-27  7:40       ` Rusty Russell
2012-08-01  7:10         ` Thomas Gleixner

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=20120725164339.GA32378@google.com \
    --to=tj@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rjw@sisk.pl \
    --cc=rusty@rustcorp.com.au \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox