diff options
author | Peter Zijlstra <peterz@infradead.org> | 2017-03-03 04:13:38 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-08-10 06:29:03 -0400 |
commit | d92a8cfcb37ecd1315269dab741f073b63b3a8b6 (patch) | |
tree | bd081c6309a48d23ae074e2035105be13622b005 /include/linux/lockdep.h | |
parent | a9668cd6ee288c4838bc668880ac085be551cac2 (diff) |
locking/lockdep: Rework FS_RECLAIM annotation
A while ago someone, and I cannot find the email just now, asked if we
could not implement the RECLAIM_FS inversion stuff with a 'fake' lock
like we use for other things like workqueues etc. I think this should
be possible which allows reducing the 'irq' states and will reduce the
amount of __bfs() lookups we do.
Removing the 1 IRQ state results in 4 less __bfs() walks per
dependency, improving lockdep performance. And by moving this
annotation out of the lockdep code it becomes easier for the mm people
to extend.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Byungchul Park <byungchul.park@lge.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Nikolay Borisov <nborisov@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: akpm@linux-foundation.org
Cc: boqun.feng@gmail.com
Cc: iamjoonsoo.kim@lge.com
Cc: kernel-team@lge.com
Cc: kirill@shutemov.name
Cc: npiggin@gmail.com
Cc: walken@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/lockdep.h')
-rw-r--r-- | include/linux/lockdep.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index fffe49f188e6..0a4c02c2d7a2 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -29,7 +29,7 @@ extern int lock_stat; | |||
29 | * We'd rather not expose kernel/lockdep_states.h this wide, but we do need | 29 | * We'd rather not expose kernel/lockdep_states.h this wide, but we do need |
30 | * the total number of states... :-( | 30 | * the total number of states... :-( |
31 | */ | 31 | */ |
32 | #define XXX_LOCK_USAGE_STATES (1+3*4) | 32 | #define XXX_LOCK_USAGE_STATES (1+2*4) |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * NR_LOCKDEP_CACHING_CLASSES ... Number of classes | 35 | * NR_LOCKDEP_CACHING_CLASSES ... Number of classes |
@@ -363,10 +363,6 @@ static inline void lock_set_subclass(struct lockdep_map *lock, | |||
363 | 363 | ||
364 | extern void lock_downgrade(struct lockdep_map *lock, unsigned long ip); | 364 | extern void lock_downgrade(struct lockdep_map *lock, unsigned long ip); |
365 | 365 | ||
366 | extern void lockdep_set_current_reclaim_state(gfp_t gfp_mask); | ||
367 | extern void lockdep_clear_current_reclaim_state(void); | ||
368 | extern void lockdep_trace_alloc(gfp_t mask); | ||
369 | |||
370 | struct pin_cookie { unsigned int val; }; | 366 | struct pin_cookie { unsigned int val; }; |
371 | 367 | ||
372 | #define NIL_COOKIE (struct pin_cookie){ .val = 0U, } | 368 | #define NIL_COOKIE (struct pin_cookie){ .val = 0U, } |
@@ -375,7 +371,7 @@ extern struct pin_cookie lock_pin_lock(struct lockdep_map *lock); | |||
375 | extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie); | 371 | extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie); |
376 | extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie); | 372 | extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie); |
377 | 373 | ||
378 | # define INIT_LOCKDEP .lockdep_recursion = 0, .lockdep_reclaim_gfp = 0, | 374 | # define INIT_LOCKDEP .lockdep_recursion = 0, |
379 | 375 | ||
380 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) | 376 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) |
381 | 377 | ||
@@ -416,9 +412,6 @@ static inline void lockdep_on(void) | |||
416 | # define lock_downgrade(l, i) do { } while (0) | 412 | # define lock_downgrade(l, i) do { } while (0) |
417 | # define lock_set_class(l, n, k, s, i) do { } while (0) | 413 | # define lock_set_class(l, n, k, s, i) do { } while (0) |
418 | # define lock_set_subclass(l, s, i) do { } while (0) | 414 | # define lock_set_subclass(l, s, i) do { } while (0) |
419 | # define lockdep_set_current_reclaim_state(g) do { } while (0) | ||
420 | # define lockdep_clear_current_reclaim_state() do { } while (0) | ||
421 | # define lockdep_trace_alloc(g) do { } while (0) | ||
422 | # define lockdep_info() do { } while (0) | 415 | # define lockdep_info() do { } while (0) |
423 | # define lockdep_init_map(lock, name, key, sub) \ | 416 | # define lockdep_init_map(lock, name, key, sub) \ |
424 | do { (void)(name); (void)(key); } while (0) | 417 | do { (void)(name); (void)(key); } while (0) |