diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-16 16:41:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-16 16:41:02 -0400 |
commit | 3469d261eac65912927dca13ee8f77c744ad7aa2 (patch) | |
tree | 09b25f80c065d52ee6e158c189ba44bb28bb76fc /include/linux/lockdep.h | |
parent | 1c19b68a279c58d6da4379bf8b6d679a300a1daf (diff) | |
parent | 4544ba8c6b1743499cabb682897a469911845f15 (diff) |
Merge branch 'locking-rwsem-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull support for killable rwsems from Ingo Molnar:
"This, by Michal Hocko, implements down_write_killable().
The main usecase will be to update mm_sem usage sites to use this new
API, to allow the mm-reaper introduced in commit aac453635549 ("mm,
oom: introduce oom reaper") to tear down oom victim address spaces
asynchronously with minimum latencies and without deadlock worries"
[ The vfs will want it too as the inode lock is changed from a mutex to
a rwsem due to the parallel lookup and readdir updates ]
* 'locking-rwsem-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
locking/rwsem: Fix comment on register clobbering
locking/rwsem: Fix down_write_killable()
locking/rwsem, x86: Add frame annotation for call_rwsem_down_write_failed_killable()
locking/rwsem: Provide down_write_killable()
locking/rwsem, x86: Provide __down_write_killable()
locking/rwsem, s390: Provide __down_write_killable()
locking/rwsem, ia64: Provide __down_write_killable()
locking/rwsem, alpha: Provide __down_write_killable()
locking/rwsem: Introduce basis for down_write_killable()
locking/rwsem, sparc: Drop superfluous arch specific implementation
locking/rwsem, sh: Drop superfluous arch specific implementation
locking/rwsem, xtensa: Drop superfluous arch specific implementation
locking/rwsem: Drop explicit memory barriers
locking/rwsem: Get rid of __down_write_nested()
Diffstat (limited to 'include/linux/lockdep.h')
-rw-r--r-- | include/linux/lockdep.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index d10ef06971b5..f75222ea7f16 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -446,6 +446,18 @@ do { \ | |||
446 | lock_acquired(&(_lock)->dep_map, _RET_IP_); \ | 446 | lock_acquired(&(_lock)->dep_map, _RET_IP_); \ |
447 | } while (0) | 447 | } while (0) |
448 | 448 | ||
449 | #define LOCK_CONTENDED_RETURN(_lock, try, lock) \ | ||
450 | ({ \ | ||
451 | int ____err = 0; \ | ||
452 | if (!try(_lock)) { \ | ||
453 | lock_contended(&(_lock)->dep_map, _RET_IP_); \ | ||
454 | ____err = lock(_lock); \ | ||
455 | } \ | ||
456 | if (!____err) \ | ||
457 | lock_acquired(&(_lock)->dep_map, _RET_IP_); \ | ||
458 | ____err; \ | ||
459 | }) | ||
460 | |||
449 | #else /* CONFIG_LOCK_STAT */ | 461 | #else /* CONFIG_LOCK_STAT */ |
450 | 462 | ||
451 | #define lock_contended(lockdep_map, ip) do {} while (0) | 463 | #define lock_contended(lockdep_map, ip) do {} while (0) |
@@ -454,6 +466,9 @@ do { \ | |||
454 | #define LOCK_CONTENDED(_lock, try, lock) \ | 466 | #define LOCK_CONTENDED(_lock, try, lock) \ |
455 | lock(_lock) | 467 | lock(_lock) |
456 | 468 | ||
469 | #define LOCK_CONTENDED_RETURN(_lock, try, lock) \ | ||
470 | lock(_lock) | ||
471 | |||
457 | #endif /* CONFIG_LOCK_STAT */ | 472 | #endif /* CONFIG_LOCK_STAT */ |
458 | 473 | ||
459 | #ifdef CONFIG_LOCKDEP | 474 | #ifdef CONFIG_LOCKDEP |