compat_ioctl: Remove BKL
authorArnd Bergmann <arnd@arndb.de>
Fri, 16 Oct 2009 00:25:25 +0000 (02:25 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 10 Dec 2009 21:52:08 +0000 (22:52 +0100)
We have always called ioctl conversion handlers under the big kernel lock,
although that is generally not necessary.  In particular it is not needed
for conversion of data structures and for calling sys_ioctl or
do_vfs_ioctl, which will get the BKL again if needed.

Handlers doing more than those two have been moved out, so we can kill off
the BKL from compat_sys_ioctl.  This may significantly improve latencies
with 32 bit applications, and it avoids a common scenario where a thread
acquires the BKL twice.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/compat_ioctl.c

index 6ad1c56a6c0ef0a428ed31988b2d33340b4936e4..a383424f1b2581c402b0fecd8f948e2e779f282d 100644 (file)
@@ -1918,9 +1918,7 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
 
  found_handler:
        if (t->handler) {
-               lock_kernel();
                error = t->handler(fd, cmd, arg, filp);
-               unlock_kernel();
                goto out_fput;
        }