Re: [PATCH -tip] remove the BKL: Replace BKL in mount/umount syscallswith a mutex

From: Linus Torvalds
Date: Fri Apr 17 2009 - 13:28:30 EST




On Fri, 17 Apr 2009, Peter Zijlstra wrote:
>
> Anyway, it seems quite clear that the first thing is to push the current
> BKL usage down into the filesystems -- which should be somewhat
> straight-forward.

Yes, if somebody sends the obvious mechanical patch, we can apply that
easily. Then, most common filesystems can probably remove the BKL
trivially by maintainers that know that they don't do anything at all with
it.

Of course, right now we do hold the BKL over _multiple_ downcalls, so in
that sense it's not actually totally 100% correct and straightforward to
just move it down. Eg in the generic_shutdown_super() case we do

lock_kernel();
->write_super();
->put_super();
invalidate_inodes();
unlock_kernel();

and obviously if we split it up so that we push a lock_kernel() into both,
we end up unlocking in between. I doubt anything cares, but it's still a
technical difference.

There are similar issues with 'remount' holding the BKL over longer
sequences.

Btw, the superblock code really does seem to depend on lock_kernel. Those
"sb->s_flags" accesses are literally not protected by anything else afaik.

That said, I think that fs/locks.c is likely a much bigger issue. Very few
people care about any realtimeness of mount/unmount/remount. But file
locking? That is much more likely to be an issue.

And I know we had patches for file locking BKL-removal at some point. What
happened to them? Were they just broken, or forgotten, or waiting in Jon's
tree, or what?

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