mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Gooch <rgooch@ras.ucalgary.ca>
To: Alexander Viro <viro@math.psu.edu>
Cc: "David C. Hansen" <haveblue@us.ibm.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] Change locking in block_dev.c:do_open()
Date: Thu, 13 Dec 2001 10:24:52 -0700	[thread overview]
Message-ID: <200112131724.fBDHOqu27735@vindaloo.ras.ucalgary.ca> (raw)
In-Reply-To: <Pine.GSO.4.21.0112122101350.17470-100000@weyl.math.psu.edu>
In-Reply-To: <3C17F8B2.6080700@us.ibm.com> <Pine.GSO.4.21.0112122101350.17470-100000@weyl.math.psu.edu>

Alexander Viro writes:
> 
> 
> On Wed, 12 Dec 2001, David C. Hansen wrote:
> 
> > I've been looking at how the BKL is used throughout the kernel.  My end
> > goal is to eliminate the BKL, but I don't have any fanciful ideas that I
> > can get rid of it myself, or do it in a short period of time.  Right
> > now, I'm looking for interesting BKL uses and examining alternatives.
> > 
> > Lately, I've been examining do_open() in block_dev.c.  This particular
> > nugget of code uses the BKL for a couple of things.  First,
> > get_blkfops() can call request_module(), which requires the BKL.
> > Secondly, there needs to be protection so that the module isn't removed
> > between the get_blkfops() and the __MOD_INC_USE_COUNT().  Lastly, the
> > bd_op->open() calls expect the BKL to be held while they are called.  Is
> > this it?  Anybody know of more reasons?
> 
> Sigh...  First of all, the right thing to do is to call
> try_inc_mod_count() _in_ get_blkfops().  No need to reinvent the
> wheel.  But real problem with that area is not BKL.  It's *!@& damn
> devfs=only mess and code that does direct assignment of ->bd_op
> before calling blkdev_get().  Until it's solved (and the only decent
> way I see is to remove this misfeature) I'd seriously recommend to
> leave the damn thing as is.

Al, I came up with a proposed solution for this race days ago. After
switching to try_inc_mod_count() (based on your first comments), you
haven't responded with whether you still see a problem with this
approach (your first message implied there were multiple problems).

So instead of flaming, please explain where (if) there are remaining
problems in this area.

				Regards,

					Richard....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca

  parent reply	other threads:[~2001-12-13 17:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-13  0:39 David C. Hansen
2001-12-13  1:01 ` Ryan Cumming
2001-12-13  2:33   ` David C. Hansen
2001-12-13  2:16 ` Alexander Viro
2001-12-13 15:42   ` Roman Zippel
2001-12-13 17:24 ` Richard Gooch [this message]
2001-12-13 17:47   ` Alexander Viro
2001-12-13 18:26   ` Richard Gooch
2001-12-14 17:07     ` Richard Gooch
2001-12-13  2:40 Torrey Hoffman
2001-12-13  2:49 ` Ryan Cumming

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=200112131724.fBDHOqu27735@vindaloo.ras.ucalgary.ca \
    --to=rgooch@ras.ucalgary.ca \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@math.psu.edu \
    /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

all inboxes | Powered by JetHome®