All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gautham R Shenoy <ego@in.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
	Arjan van de Ven <arjan@infradead.org>,
	ego@in.ibm.com, 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
Subject: Re: [RFC][PATCH 4/4] Rename lock_cpu_hotplug/unlock_cpu_hotplug
Date: Fri, 25 Aug 2006 09:23:28 +0530	[thread overview]
Message-ID: <20060825035328.GA6322@in.ibm.com> (raw)
In-Reply-To: <20060824150026.GA14853@elte.hu>

On Thu, Aug 24, 2006 at 05:00:26PM +0200, Ingo Molnar wrote:
> 
> * Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> 
> > It really is just like a reentrant rw semaphore... I don't see the 
> > point of the name change, but I guess we don't like reentrant locks so 
> > calling it something else might go down better with Linus ;)
> 
> what would fit best is a per-cpu scalable (on the read-side) 
> self-reentrant rw mutex. We are doing cpu hotplug locking in things like 
> fork or the slab code, while most boxes will do a CPU hotplug event only 
> once in the kernel's lifetime (during bootup), so a classic global 
> read-write lock is unjustified.

I agree. However, I was not sure if anything else other than for cpu_hotplug,
needs a self-reentrent rwmutex in the kernel. 
Which is why I did not expose the locking(at least the write side of it)
outside. We don't want too many lazy programmers anyway! 

However, even in case of cpu_hotplug, if we want to prevent
a hotplug event in some critical region where we are not going to sleep, 
we may as well use preempt_disable[/enable]. Because __stop_machine_run waits 
for all the tasks in the fast-path to complete before it changes
the online_cpus map, if I am not mistaken.

Only when you want your local online cpu_map to remain intact when 
you wake up from sleep, should you use cpu_hotplug *lock*.

Ingo?

-- 
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"

  parent reply	other threads:[~2006-08-25  3:52 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 [this message]
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

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=20060825035328.GA6322@in.ibm.com \
    --to=ego@in.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=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --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 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.