summaryrefslogtreecommitdiffstats
path: root/mm/memory_hotplug.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-01-02 13:37:12 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-04 12:34:46 -0800
commit846f99749ab68bbc7f75c74fec305de675b1a1bf (patch)
tree4c1ca68cfea804bd5215d57844a16f69c566aedc /mm/memory_hotplug.c
parent3e27249c84beed1c79d767b350e52ad038db9053 (diff)
downloadop-kernel-dev-846f99749ab68bbc7f75c74fec305de675b1a1bf.zip
op-kernel-dev-846f99749ab68bbc7f75c74fec305de675b1a1bf.tar.gz
sysfs: Add lockdep annotations for the sysfs active reference
Holding locks over device_del -> kobject_del -> sysfs_deactivate can cause deadlocks if those same locks are grabbed in sysfs show or store methods. The I model s_active count + completion as a sleeping read/write lock. I describe to lockdep sysfs_get_active as a read_trylock, sysfs_put_active as a read_unlock, and sysfs_deactivate as a write_lock and write_unlock pair. This seems to capture the essence for purposes of finding deadlocks, and in my testing gives finds real issues and ignores non-issues. This brings us back to holding locks over kobject_del is a problem that ideally we should find a way of addressing, but at least lockdep can tell us about the problems instead of requiring developers to debug rare strange system deadlocks, that happen when sysfs files are removed while being written to. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory_hotplug.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud