diff options
author | Joel Stanley <joel@jms.id.au> | 2019-05-08 16:48:45 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2019-05-08 16:48:48 +0300 |
commit | d09fc0c4bdfbcbe251df247b5a94e2a07dec9c2f (patch) | |
tree | 893d98100d3ede2ff76905a67e1b9798c8c88868 /mm/kmemleak.c | |
parent | 76cc3bd0c342199b0bc0fd6afc7035274bf7a718 (diff) | |
parent | 274ede3e1a5fb3d0fd33acafb08993e95972c51f (diff) | |
download | linux-dev-5.0.tar.xz |
Merge tag 'v5.0.14' into dev-5.0dev-5.0
This is the 5.0.14 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'mm/kmemleak.c')
-rw-r--r-- | mm/kmemleak.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 707fa5579f66..2e435b8142e5 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1401,6 +1401,7 @@ static void scan_block(void *_start, void *_end, /* * Scan a large memory block in MAX_SCAN_SIZE chunks to reduce the latency. */ +#ifdef CONFIG_SMP static void scan_large_block(void *start, void *end) { void *next; @@ -1412,6 +1413,7 @@ static void scan_large_block(void *start, void *end) cond_resched(); } } +#endif /* * Scan a memory block corresponding to a kmemleak_object. A condition is @@ -1529,11 +1531,6 @@ static void kmemleak_scan(void) } rcu_read_unlock(); - /* data/bss scanning */ - scan_large_block(_sdata, _edata); - scan_large_block(__bss_start, __bss_stop); - scan_large_block(__start_ro_after_init, __end_ro_after_init); - #ifdef CONFIG_SMP /* per-cpu sections scanning */ for_each_possible_cpu(i) @@ -2071,6 +2068,17 @@ void __init kmemleak_init(void) } local_irq_restore(flags); + /* register the data/bss sections */ + create_object((unsigned long)_sdata, _edata - _sdata, + KMEMLEAK_GREY, GFP_ATOMIC); + create_object((unsigned long)__bss_start, __bss_stop - __bss_start, + KMEMLEAK_GREY, GFP_ATOMIC); + /* only register .data..ro_after_init if not within .data */ + if (__start_ro_after_init < _sdata || __end_ro_after_init > _edata) + create_object((unsigned long)__start_ro_after_init, + __end_ro_after_init - __start_ro_after_init, + KMEMLEAK_GREY, GFP_ATOMIC); + /* * This is the point where tracking allocations is safe. Automatic * scanning is started during the late initcall. Add the early logged |