public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Josh Aas <josha@sgi.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	steiner@sgi.com
Subject: Re: bkl cleanup in do_sysctl
Date: Tue, 10 Aug 2004 10:28:26 -0700	[thread overview]
Message-ID: <1092158905.11212.18.camel@nighthawk> (raw)
In-Reply-To: <4118FE9D.2050304@sgi.com>

On Tue, 2004-08-10 at 09:58, Josh Aas wrote:
> I'd like to hear people's thoughts on replacing the bkl in do_sysctl 
> with a localized spin lock that protects the sysctl structures. Instead 
> of grabbing the bkl, anyone that needs to mess with those values could 
> grab the localized lock (1 to protect all structures). Such a localized 
> lock would allow us to get rid of bkl usage in at least one other place 
> as well (do_coredump). In order to do this though, we would have to make 
> sure all code that grabs the bkl instead of the localized lock while 
> using sysctl values switches to the new lock. Might be a big job, but 
> perhaps it would be a good one to start after 2.6.8 is out the door.

Remember that the BKL isn't a plain-old spinlock.  You're allowed to
sleep while holding it and it can be recursively held, which isn't true
for other spinlocks.

So, if you want to replace it with a spinlock, you'll need to do audits
looking for sysctl users that might_sleep() or get called recursively
somehow.  The might_sleep() debugging checks should help immensely for
the first part, but all you'll get are deadlocks at runtime for any
recursive holders.  But, those cases are increasingly rare, so you might
luck out and not have any.  

Or, you could just make it a semaphore and forget about the no sleeping
requirement.  

-- Dave


  reply	other threads:[~2004-08-10 18:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-10 16:58 bkl cleanup in do_sysctl Josh Aas
2004-08-10 17:28 ` Dave Hansen [this message]
2004-08-10 18:51   ` Lee Revell
2004-08-10 19:16     ` Roland Dreier
2004-08-10 19:21       ` Lee Revell
2004-08-10 19:46     ` Hans Reiser
2004-08-10 20:10       ` Lee Revell

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=1092158905.11212.18.camel@nighthawk \
    --to=haveblue@us.ibm.com \
    --cc=josha@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steiner@sgi.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