aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/locking
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-05-03 20:55:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-03 20:55:59 -0400
commitdd23f273d9a765d7f092c1bb0d1cd7aaf668077e (patch)
tree9bf826a9f553c9b0a5e852deaaf58bee56b601ac /kernel/locking
parent1684096b1ed813f621fb6cbd06e72235c1c2a0ca (diff)
parentb19385993623c1a18a686b6b271cd24d5aa96f52 (diff)
Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: - a few misc things - most of MM - KASAN updates * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (102 commits) kasan: separate report parts by empty lines kasan: improve double-free report format kasan: print page description after stacks kasan: improve slab object description kasan: change report header kasan: simplify address description logic kasan: change allocation and freeing stack traces headers kasan: unify report headers kasan: introduce helper functions for determining bug type mm: hwpoison: call shake_page() after try_to_unmap() for mlocked page mm: hwpoison: call shake_page() unconditionally mm/swapfile.c: fix swap space leak in error path of swap_free_entries() mm/gup.c: fix access_ok() argument type mm/truncate: avoid pointless cleancache_invalidate_inode() calls. mm/truncate: bail out early from invalidate_inode_pages2_range() if mapping is empty fs/block_dev: always invalidate cleancache in invalidate_bdev() fs: fix data invalidation in the cleancache during direct IO zram: reduce load operation in page_same_filled zram: use zram_free_page instead of open-coded zram: introduce zram data accessor ...
Diffstat (limited to 'kernel/locking')
-rw-r--r--kernel/locking/lockdep.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index dc3297895ce3..0a1b3c748478 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -30,6 +30,7 @@
30#include <linux/sched.h> 30#include <linux/sched.h>
31#include <linux/sched/clock.h> 31#include <linux/sched/clock.h>
32#include <linux/sched/task.h> 32#include <linux/sched/task.h>
33#include <linux/sched/mm.h>
33#include <linux/delay.h> 34#include <linux/delay.h>
34#include <linux/module.h> 35#include <linux/module.h>
35#include <linux/proc_fs.h> 36#include <linux/proc_fs.h>
@@ -2876,6 +2877,8 @@ static void __lockdep_trace_alloc(gfp_t gfp_mask, unsigned long flags)
2876 if (unlikely(!debug_locks)) 2877 if (unlikely(!debug_locks))
2877 return; 2878 return;
2878 2879
2880 gfp_mask = current_gfp_context(gfp_mask);
2881
2879 /* no reclaim without waiting on it */ 2882 /* no reclaim without waiting on it */
2880 if (!(gfp_mask & __GFP_DIRECT_RECLAIM)) 2883 if (!(gfp_mask & __GFP_DIRECT_RECLAIM))
2881 return; 2884 return;
@@ -2885,7 +2888,7 @@ static void __lockdep_trace_alloc(gfp_t gfp_mask, unsigned long flags)
2885 return; 2888 return;
2886 2889
2887 /* We're only interested __GFP_FS allocations for now */ 2890 /* We're only interested __GFP_FS allocations for now */
2888 if (!(gfp_mask & __GFP_FS)) 2891 if (!(gfp_mask & __GFP_FS) || (curr->flags & PF_MEMALLOC_NOFS))
2889 return; 2892 return;
2890 2893
2891 /* 2894 /*
@@ -2894,6 +2897,10 @@ static void __lockdep_trace_alloc(gfp_t gfp_mask, unsigned long flags)
2894 if (DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))) 2897 if (DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)))
2895 return; 2898 return;
2896 2899
2900 /* Disable lockdep if explicitly requested */
2901 if (gfp_mask & __GFP_NOLOCKDEP)
2902 return;
2903
2897 mark_held_locks(curr, RECLAIM_FS); 2904 mark_held_locks(curr, RECLAIM_FS);
2898} 2905}
2899 2906
@@ -3947,7 +3954,7 @@ EXPORT_SYMBOL_GPL(lock_unpin_lock);
3947 3954
3948void lockdep_set_current_reclaim_state(gfp_t gfp_mask) 3955void lockdep_set_current_reclaim_state(gfp_t gfp_mask)
3949{ 3956{
3950 current->lockdep_reclaim_gfp = gfp_mask; 3957 current->lockdep_reclaim_gfp = current_gfp_context(gfp_mask);
3951} 3958}
3952EXPORT_SYMBOL_GPL(lockdep_set_current_reclaim_state); 3959EXPORT_SYMBOL_GPL(lockdep_set_current_reclaim_state);
3953 3960