Qian Cai
b1399497b7
mm/slab.c: kmemleak no scan alien caches
...
[ Upstream commit 92d1d07daad65c300c7d0b68bbef8867e9895d54 ]
Kmemleak throws endless warnings during boot due to in
__alloc_alien_cache(),
alc = kmalloc_node(memsize, gfp, node);
init_arraycache(&alc->ac, entries, batch);
kmemleak_no_scan(ac);
Kmemleak does not track the array cache (alc->ac) but the alien cache
(alc) instead, so let it track the latter by lifting kmemleak_no_scan()
out of init_arraycache().
There is another place that calls init_arraycache(), but
alloc_kmem_cache_cpus() uses the percpu allocation where will never be
considered as a leak.
kmemleak: Found object by alias at 0xffff8007b9aa7e38
CPU: 190 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2+ #2
Call trace:
dump_backtrace+0x0/0x168
show_stack+0x24/0x30
dump_stack+0x88/0xb0
lookup_object+0x84/0xac
find_and_get_object+0x84/0xe4
kmemleak_no_scan+0x74/0xf4
setup_kmem_cache_node+0x2b4/0x35c
__do_tune_cpucache+0x250/0x2d4
do_tune_cpucache+0x4c/0xe4
enable_cpucache+0xc8/0x110
setup_cpu_cache+0x40/0x1b8
__kmem_cache_create+0x240/0x358
create_cache+0xc0/0x198
kmem_cache_create_usercopy+0x158/0x20c
kmem_cache_create+0x50/0x64
fsnotify_init+0x58/0x6c
do_one_initcall+0x194/0x388
kernel_init_freeable+0x668/0x688
kernel_init+0x18/0x124
ret_from_fork+0x10/0x18
kmemleak: Object 0xffff8007b9aa7e00 (size 256):
kmemleak: comm "swapper/0", pid 1, jiffies 4294697137
kmemleak: min_count = 1
kmemleak: count = 0
kmemleak: flags = 0x1
kmemleak: checksum = 0
kmemleak: backtrace:
kmemleak_alloc+0x84/0xb8
kmem_cache_alloc_node_trace+0x31c/0x3a0
__kmalloc_node+0x58/0x78
setup_kmem_cache_node+0x26c/0x35c
__do_tune_cpucache+0x250/0x2d4
do_tune_cpucache+0x4c/0xe4
enable_cpucache+0xc8/0x110
setup_cpu_cache+0x40/0x1b8
__kmem_cache_create+0x240/0x358
create_cache+0xc0/0x198
kmem_cache_create_usercopy+0x158/0x20c
kmem_cache_create+0x50/0x64
fsnotify_init+0x58/0x6c
do_one_initcall+0x194/0x388
kernel_init_freeable+0x668/0x688
kernel_init+0x18/0x124
kmemleak: Not scanning unknown object at 0xffff8007b9aa7e38
CPU: 190 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2+ #2
Call trace:
dump_backtrace+0x0/0x168
show_stack+0x24/0x30
dump_stack+0x88/0xb0
kmemleak_no_scan+0x90/0xf4
setup_kmem_cache_node+0x2b4/0x35c
__do_tune_cpucache+0x250/0x2d4
do_tune_cpucache+0x4c/0xe4
enable_cpucache+0xc8/0x110
setup_cpu_cache+0x40/0x1b8
__kmem_cache_create+0x240/0x358
create_cache+0xc0/0x198
kmem_cache_create_usercopy+0x158/0x20c
kmem_cache_create+0x50/0x64
fsnotify_init+0x58/0x6c
do_one_initcall+0x194/0x388
kernel_init_freeable+0x668/0x688
kernel_init+0x18/0x124
ret_from_fork+0x10/0x18
Link: http://lkml.kernel.org/r/20190129184518.39808-1-cai@lca.pw
Fixes: 1fe00d50a9e8 ("slab: factor out initialization of array cache")
Signed-off-by: Qian Cai <cai@lca.pw>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-27 09:33:48 +02:00
..
2018-08-24 13:26:58 +02:00
2018-04-08 11:51:56 +02:00
2016-03-03 15:07:18 -08:00
2015-09-08 15:35:28 -07:00
2015-04-14 16:49:03 -07:00
2015-07-17 16:39:54 -07:00
2019-04-27 09:33:48 +02:00
2015-08-14 15:56:32 -07:00
2018-01-17 09:35:26 +01:00
2017-11-24 11:26:29 +01:00
2018-09-19 22:49:00 +02:00
2015-11-06 17:50:42 -08:00
2018-02-25 11:03:41 +01:00
2018-09-15 09:40:38 +02:00
2015-11-06 17:50:42 -08:00
2018-05-26 08:48:54 +02:00
2018-12-17 21:55:16 +01:00
2015-06-24 17:49:45 -07:00
2018-12-17 21:55:17 +01:00
2014-08-06 18:01:22 -07:00
2018-11-10 07:41:42 -08:00
2015-11-06 17:50:42 -08:00
2019-03-23 08:44:23 +01:00
2015-09-10 13:29:01 -07:00
2017-01-06 11:16:11 +01:00
2017-08-11 09:08:50 -07:00
2015-02-10 14:30:31 -08:00
2018-05-26 08:48:55 +02:00
2015-01-08 15:10:52 -08:00
2014-10-09 22:25:50 -04:00
2014-06-06 16:08:18 -07:00
2018-05-30 07:49:06 +02:00
2018-05-30 07:49:08 +02:00
2017-07-21 07:44:56 +02:00
2015-11-05 19:34:48 -08:00
2018-10-10 08:52:11 +02:00
2015-09-11 16:42:39 -07:00
2017-06-14 13:16:26 +02:00
2018-07-25 10:18:16 +02:00
2019-03-23 08:44:26 +01:00
2018-01-31 12:06:09 +01:00
2018-12-17 21:55:17 +01:00
2019-04-27 09:33:47 +02:00
2017-08-12 19:29:09 -07:00
2015-09-08 15:35:28 -07:00
2019-03-23 08:44:23 +01:00
2015-11-05 19:34:48 -08:00
2018-12-13 09:21:33 +01:00
2015-06-30 19:44:56 -07:00
2019-03-23 08:44:21 +01:00
2017-12-25 14:22:09 +01:00
2015-09-10 13:29:01 -07:00
2015-02-11 17:06:02 -08:00
2018-08-15 17:42:10 +02:00
2018-11-10 07:41:42 -08:00
2015-11-05 19:34:48 -08:00
2015-06-30 19:44:55 -07:00
2018-12-17 21:55:17 +01:00
2019-02-06 19:43:07 +01:00
2018-07-11 16:03:51 +02:00
2015-11-05 19:34:48 -08:00
2019-04-27 09:33:48 +02:00
2015-09-10 13:29:01 -07:00
2015-08-13 12:32:00 -06:00
2016-04-20 15:41:53 +09:00
2017-11-24 08:32:25 +01:00
2019-01-26 09:42:55 +01:00
2017-11-24 08:32:25 +01:00
2014-09-02 14:46:05 -04:00
2014-09-02 14:46:02 -04:00
2018-05-16 10:06:46 +02:00
2016-02-25 12:01:23 -08:00
2018-12-17 21:55:16 +01:00
2015-11-06 17:50:42 -08:00
2019-04-03 06:23:18 +02:00
2019-03-23 08:44:34 +01:00
2017-10-21 17:09:05 +02:00
2019-04-27 09:33:48 +02:00
2015-11-22 11:58:44 -08:00
2015-11-22 11:58:44 -08:00
2018-10-10 08:52:08 +02:00
2017-07-05 14:37:15 +02:00
2015-09-08 15:35:28 -07:00
2015-11-06 17:50:42 -08:00
2018-08-15 17:42:10 +02:00
2018-12-13 09:21:33 +01:00
2015-09-04 16:54:41 -07:00
2018-12-17 21:55:16 +01:00
2018-09-19 22:49:00 +02:00
2019-04-27 09:33:48 +02:00
2017-03-12 06:37:25 +01:00
2018-06-06 16:46:23 +02:00
2019-04-03 06:23:21 +02:00
2016-10-28 03:01:34 -04:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2016-05-18 17:06:44 -07:00
2018-09-05 09:18:36 +02:00