public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Paul Jackson <pj@sgi.com>
Cc: ego@in.ibm.com, mingo@elte.hu, nickpiggin@yahoo.com.au,
	arjan@infradead.org, rusty@rustcorp.com.au, torvalds@osdl.org,
	akpm@osdl.org, linux-kernel@vger.kernel.org,
	arjan@intel.linux.com, davej@redhat.com, dipankar@in.ibm.com,
	vatsa@in.ibm.com, ashok.raj@intel.com, josht@us.ibm.com
Subject: Re: [RFC][PATCH 4/4] Rename lock_cpu_hotplug/unlock_cpu_hotplug
Date: Wed, 30 Aug 2006 11:13:47 -0700	[thread overview]
Message-ID: <20060830181347.GF1296@us.ibm.com> (raw)
In-Reply-To: <20060830105434.d00ae4dc.pj@sgi.com>

On Wed, Aug 30, 2006 at 10:54:34AM -0700, Paul Jackson wrote:
> Paul E. McKenney wrote:
> > Well, my next question was going to be whether cpuset readers really
> > need to exclude the writers, or whether there can be a transition
> > period while the mastodon makes the change as long as it avoids stomping
> > the locusts.  ;-)
> 
> The mastodon's (aka mammoths ;) may make a batch of several related
> changes to the cpuset configuration.  What's important is that the
> locusts see either none or all of the changes in a given batch, not
> some intermediate inconsistent state, and that the locusts see the
> change batches in the same order they were applied.
> 
> Off the top of my head, I doubt I care when the locusts see the
> changes.  Some delay is ok, if that's your question.
> 
> But don't try too hard to fit any work you do to cpusets.  For now,
> I don't plan to mess with cpuset locking anytime soon.  And when I
> do next, it might be that all I need to do is to change the quick
> lock held by the locusts from a mutex to an ordinary rwsem, so that
> multiple readers (locusts) can access the cpuset configuration in
> parallel.

Sounds like a job for RCU (if locusts never sleep in critical sections)
or SRCU (if locusts do block).  ;-)  Seriously, this would get you
deterministic read-side acquisition overhead.  And very low overhead
at that -- no memory barriers, cache misses, or atomic instructions
in the common case of no mammoths/mastodons.

That said, I am not familiar enough with cpusets to know if there are
any gotchas in making the change appear atomic.  The usual approach
is to link updates in, so that readers either see the new state or
do not, but don't see any intermediate states.  I would guess that
updates sometimes involve moving resources from one set to another,
and that such moves must be atomic in the "mv" command sense.  There
are some reasonably straightforward ways of making this happen.

							Thanx, Paul

      reply	other threads:[~2006-08-30 18:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-24 10:34 [RFC][PATCH 4/4] Rename lock_cpu_hotplug/unlock_cpu_hotplug Gautham R Shenoy
2006-08-24 11:00 ` Arjan van de Ven
2006-08-24 14:03   ` Gautham R Shenoy
2006-08-24 14:16     ` Arjan van de Ven
2006-08-24 14:55       ` Nick Piggin
2006-08-24 15:00         ` Ingo Molnar
2006-08-24 15:53           ` Nick Piggin
2006-08-25  3:53           ` Gautham R Shenoy
2006-08-27  7:59             ` Paul Jackson
2006-08-27  8:42               ` Keith Owens
2006-08-27  9:10                 ` Paul Jackson
2006-08-29 18:05               ` Paul E. McKenney
2006-08-29 19:31                 ` Paul Jackson
2006-08-29 20:03                   ` Paul E. McKenney
2006-08-30  2:38                     ` Paul Jackson
2006-08-30 15:14                       ` Paul E. McKenney
2006-08-30 17:54                         ` Paul Jackson
2006-08-30 18:13                           ` Paul E. McKenney [this message]

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=20060830181347.GF1296@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=arjan@intel.linux.com \
    --cc=ashok.raj@intel.com \
    --cc=davej@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=ego@in.ibm.com \
    --cc=josht@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=pj@sgi.com \
    --cc=rusty@rustcorp.com.au \
    --cc=torvalds@osdl.org \
    --cc=vatsa@in.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox