All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Matthew Wilcox <willy@debian.org>
Cc: kernel-janitor-discuss
	<kernel-janitor-discuss@lists.sourceforge.net>,
	linux-fsdevel@vger.kernel.org
Subject: Re: BKL removal
Date: Thu, 04 Jul 2002 11:44:29 -0700	[thread overview]
Message-ID: <3D24978D.1030602@us.ibm.com> (raw)
In-Reply-To: 20020704134122.V27706@parcelfarce.linux.theplanet.co.uk

Matthew Wilcox wrote:
> aw.  you implemented the less useful check of the two you mentioned!
> i think the release-on-sleep property of the BKL is far more harmful
> than the recursive-holds.  release-on-sleep means that you probably
> have a race there you didn't know about (eg the one i found in setfl
> earlier this week), and means you need to do some serious work in order
> to redesign your code to eliminate the race.

Be careful what you ask for.  These release-on-sleep calls happen 
quite often, maybe as often as a few a second and I can't think of any 
elegant ways of limiting the number of unique printk()s in schedule(). 
  It was easy to limit the printing for a single un/lock_kernel() call 
with static variables, but the scheduling ones are a bit more 
complicated.  I can think of some convoluted ways of doing this, but 
no simple ones.  If you apply this patch, be ready for a load of stuff 
in dmesg!

> once you've done that redesign, chances are you'll understand the locking
> in that area well enough to know that there are no recursive holds in your
> code and you'll switch to a spinlock.  this will automagically reduce the
> number of recursive-holds simply because fewer places will take the BKL.

Some of the times that I've either broken someone else's code or 
simply pointed it out to them, they've fixed it.

> as an aside, replacing the BKL by a non-recursive spinlock isn't always a
> great idea:
...<snip> look at the original if you want to see the whole call sequence!
> it doesn't look _too_ hard to persuade ext2_new_block (btw, the problem
> also occurs with ext2_free_blocks) to unlock_super and retry, but that's
> slightly more dangerous work than i want to do right now ... particularly
> since some of these interfaces may change dramatically as a result of
> the aio work.

That's icky.  So, was this potential problem introduced during Al's 
BKL replacement in ext2?  The real problem here is the faulting 
operation while holding a spinlock which requires the spinlock to 
resolve, right?  I think that all you can do is release the lock, try 
to get some memory, and start the process over.  This is the kind of 
thing that I hope my patch will help us find so that we don't all need 
to have a Viroesque understanding of VFS :)

BTW, the Brits don't have any big parties today, do they?

-- 
Dave Hansen
haveblue@us.ibm.com


  reply	other threads:[~2002-07-04 18:44 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3D23F306.50703@us.ibm.com>
2002-07-04 12:41 ` BKL removal Matthew Wilcox
2002-07-04 18:44   ` Dave Hansen [this message]
2002-07-04 18:56   ` Dave Hansen
     [not found] <Pine.LNX.4.44L.0207061306440.8346-100000@imladris.surriel.com>
     [not found] ` <3D27390E.5060208@us.ibm.com>
2002-07-07 20:55   ` Greg KH
2002-07-07 21:28     ` Oliver Neukum
2002-07-07 21:58       ` Dave Hansen
2002-07-07 22:38         ` Oliver Neukum
2002-07-07 21:35     ` Dave Hansen
2002-07-07 21:55       ` Thunder from the hill
2002-07-07 22:42         ` Dave Hansen
2002-07-07 23:07           ` Thunder from the hill
2002-07-07 23:23             ` Dave Hansen
2002-07-07 23:34               ` Thunder from the hill
2002-07-07 23:42                 ` Sean Neakums
2002-07-07 23:31             ` Oliver Neukum
2002-07-07 23:45               ` Dave Hansen
2002-07-08  2:34                 ` Matthew Wilcox
2002-07-08  2:52                   ` Dave Hansen
2002-07-08  3:06                     ` Alexander Viro
2002-07-08 12:33                       ` Matthew Wilcox
2002-07-08 14:53                         ` Dave Hansen
2002-07-08 12:29                     ` Matthew Wilcox
2002-07-08  2:58                   ` Alexander Viro
2002-07-08  3:06                     ` Dave Hansen
2002-07-08 12:15                     ` Matthew Wilcox
2002-07-08  6:34                 ` Oliver Neukum
2002-07-07 23:23           ` Oliver Neukum
2002-07-07 23:31             ` Dave Hansen
2002-07-07 23:51           ` Greg KH
2002-07-08  0:07             ` Dave Hansen
2002-07-08  2:12               ` Greg KH
2002-07-09  1:46                 ` Rick Lindsley
2002-07-09  4:38                   ` Greg KH
2002-07-09 19:31                     ` Rick Lindsley
2002-07-09 20:17                       ` Greg KH
2002-07-09 20:55                         ` Rick Lindsley
2002-07-09 21:00                           ` William Lee Irwin III
2002-07-09 21:12                             ` Robert Love
2002-07-09 14:19                               ` Dave Hansen
2002-07-09 21:29                                 ` Robert Love
2002-07-09 14:44                                   ` Dave Hansen
2002-07-09 21:47                                     ` Robert Love
2002-07-10  1:15                                       ` Arnaldo Carvalho de Melo
2002-07-10  3:27                                         ` Alexander Viro
2002-07-09 20:49                                           ` Dave Hansen
2002-07-10  5:30                                             ` Alexander Viro
2002-07-10 10:28                                               ` Sandy Harris
2002-07-18  0:30                                     ` David Wagner
2002-07-18  1:03                                       ` Daniel Phillips
2002-07-09 21:59                               ` William Lee Irwin III
2002-07-09 22:21                               ` Alan Cox
2002-07-10 13:31                                 ` jlnance
2002-07-10 14:17                                   ` Alan Cox
2002-07-15 20:53                                     ` Alexander Hoogerhuis
2002-07-15 22:07                                       ` Rik van Riel
2002-07-15 22:25                                         ` Thunder from the hill
2002-07-09 19:33                     ` Rick Lindsley
2002-07-09 20:12                       ` Greg KH
2002-07-09  4:49                   ` Drew P. Vogel
2002-07-09  5:25                     ` Dave Hansen
2002-07-09  5:21                   ` Larry McVoy
2002-07-09  7:59                     ` Roman Zippel
2002-07-10 10:03                     ` Marco Colombo
2002-07-10 14:40                       ` Matthew Wilcox
2002-07-10 16:46                         ` William Lee Irwin III
2002-07-11  9:57                           ` Marco Colombo
2002-07-10 21:28                     ` Rick Lindsley
2002-07-10 22:24                       ` Daniel Phillips
2002-07-07 22:24       ` Greg KH
2002-07-08  0:56         ` Bernd Eckenfels
2002-07-10  0:30     ` Pavel Machek
     [not found] <0C01A29FBAE24448A792F5C68F5EA47D2B0C8A@nasdaq.ms.ensim.com>
2002-07-08 19:00 ` pmenage
2002-07-08 21:45   ` Oliver Neukum
2002-07-10  7:32 dan carpenter

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=3D24978D.1030602@us.ibm.com \
    --to=haveblue@us.ibm.com \
    --cc=kernel-janitor-discuss@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=willy@debian.org \
    /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.