fs/locks.c: prepare for BKL removal
This prepares the removal of the big kernel lock from the file locking code. We still use the BKL as long as fs/lockd uses it and ceph might sleep, but we can flip the definition to a private spinlock as soon as that's done. All users outside of fs/lockd get converted to use lock_flocks() instead of lock_kernel() where appropriate. Based on an earlier patch to use a spinlock from Matthew Wilcox, who has attempted this a few times before, the earliest patch from over 10 years ago turned it into a semaphore, which ended up being slower than the BKL and was subsequently reverted. Someone should do some serious performance testing when this becomes a spinlock, since this has caused problems before. Using a spinlock should be at least as good as the BKL in theory, but who knows... Signed-off-by:Arnd Bergmann <arnd@arndb.de> Acked-by:
Matthew Wilcox <willy@linux.intel.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Miklos Szeredi <mszeredi@suse.cz> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: John Kacur <jkacur@redhat.com> Cc: Sage Weil <sage@newdream.net> Cc: linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org
Showing
- fs/afs/flock.c 2 additions, 3 deletionsfs/afs/flock.c
- fs/cifs/cifsfs.c 2 additions, 2 deletionsfs/cifs/cifsfs.c
- fs/gfs2/file.c 2 additions, 0 deletionsfs/gfs2/file.c
- fs/locks.c 68 additions, 44 deletionsfs/locks.c
- fs/nfs/delegation.c 5 additions, 5 deletionsfs/nfs/delegation.c
- fs/nfs/nfs4state.c 5 additions, 5 deletionsfs/nfs/nfs4state.c
- fs/nfsd/nfs4state.c 3 additions, 3 deletionsfs/nfsd/nfs4state.c
- include/linux/fs.h 10 additions, 4 deletionsinclude/linux/fs.h
Loading
Please register or sign in to comment