kernel-ark/fs/ceph
Jeff Layton 1c8c601a8c locks: protect most of the file_lock handling with i_lock
Having a global lock that protects all of this code is a clear
scalability problem. Instead of doing that, move most of the code to be
protected by the i_lock instead. The exceptions are the global lists
that the ->fl_link sits on, and the ->fl_block list.

->fl_link is what connects these structures to the
global lists, so we must ensure that we hold those locks when iterating
over or updating these lists.

Furthermore, sound deadlock detection requires that we hold the
blocked_list state steady while checking for loops. We also must ensure
that the search and update to the list are atomic.

For the checking and insertion side of the blocked_list, push the
acquisition of the global lock into __posix_lock_file and ensure that
checking and update of the  blocked_list is done without dropping the
lock in between.

On the removal side, when waking up blocked lock waiters, take the
global lock before walking the blocked list and dequeue the waiters from
the global list prior to removal from the fl_block list.

With this, deadlock detection should be race free while we minimize
excessive file_lock_lock thrashing.

Finally, in order to avoid a lock inversion problem when handling
/proc/locks output we must ensure that manipulations of the fl_block
list are also protected by the file_lock_lock.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-06-29 12:57:42 +04:00
..
addr.c libceph: kill off osd data write_request parameters 2013-05-01 21:18:58 -07:00
caps.c ceph: take i_mutex before getting Fw cap 2013-05-01 21:18:53 -07:00
ceph_frag.c ceph: factor out libceph from Ceph file system 2010-10-20 15:37:28 -07:00
debugfs.c libceph: delay debugfs initialization until we learn global_id 2012-08-20 10:03:15 -07:00
dir.c [readdir] convert ceph 2013-06-29 12:56:41 +04:00
export.c fs: encode_fh: return FILEID_INVALID if invalid fid_type 2013-02-26 02:46:10 -05:00
file.c aio: don't include aio.h in sched.h 2013-05-07 20:16:25 -07:00
inode.c ceph: fix symlink inode operations 2013-05-01 21:18:50 -07:00
ioctl.c libceph: rename ceph_calc_object_layout() 2013-05-01 21:16:17 -07:00
ioctl.h ceph: fully initialize new layout 2012-05-16 14:28:27 -05:00
Kconfig fs/ceph: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:39:04 -08:00
locks.c locks: protect most of the file_lock handling with i_lock 2013-06-29 12:57:42 +04:00
Makefile ceph: Makefile: Remove unnessary code 2011-01-12 15:15:13 -08:00
mds_client.c locks: protect most of the file_lock handling with i_lock 2013-06-29 12:57:42 +04:00
mds_client.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2013-02-28 17:43:09 -08:00
mdsmap.c ceph: Use pseudo-random numbers to choose mds 2013-05-01 21:18:49 -07:00
snap.c ceph: use ceph_create_snap_context() 2013-05-01 21:20:09 -07:00
strings.c libceph: update ceph_mds_state_name() and ceph_mds_op_name() 2013-02-18 12:20:34 -06:00
super.c ceph: set up page array mempool with correct size 2013-05-01 21:17:50 -07:00
super.h ceph: ceph_pagelist_append might sleep while atomic 2013-05-17 12:45:48 -05:00
xattr.c ceph: eliminate sparse warnings in fs code 2013-02-25 15:37:14 -06:00