Re: Moving BKL from generic code into drivers

Alexander Viro (viro@math.psu.edu)
Tue, 4 Dec 2001 23:03:33 -0500 (EST)


On Tue, 4 Dec 2001, David C. Hansen wrote:

> As a first step toward removing the BKL from some block device drivers,
> I'm planning on moving the BKL out of the generic code and into the
> drivers themselves.
>
> I plan on doing this indiscriminately. All block devices will have a
> lock_kernel() at the top of their open() and an unlock_kernel() at the
> bottom. Later on, we can remove it from individual drivers as we see fit.
>
> Now the big question:
> In block_dev.c:do_open(), the BKL is held in addition to bdev->bd_sem.
> Why is the BKL held here, other than to protect all of the drivers' open
> functions? What doesn't the semaphore provide?

get_blkfops() and module {un,}loading.

Please, don't step into that mess right now - there's a bunch of bad races
in devfs-related side of ->bd_op handling and the last thing we need is
additional set of complications.

Naive fix won't work due to devfs mess and correct one will take serious
massage of generic code _and_ devfs.

Besides, for block devices ->open() and ->release() are absolutely not
interesting wrt BKL contention. Just how often are they called?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/