Qian Cai
a9c7024380
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-05 22:31:27 +02:00
..
2018-08-24 13:09:12 +02:00
2019-03-05 17:58:01 +01:00
2018-10-13 09:27:30 +02:00
2017-11-02 11:10:55 +01:00
2017-06-05 16:59:12 +02:00
2017-11-02 11:10:55 +01:00
2019-04-05 22:31:27 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-09-19 22:43:48 +02:00
2017-02-27 18:43:47 -08:00
2018-02-25 11:08:03 +01:00
2018-09-15 09:45:28 +02:00
2017-11-02 11:10:55 +01:00
2018-04-24 09:36:39 +02:00
2018-03-03 10:24:21 +01:00
2016-07-26 16:19:19 -07:00
2019-03-23 14:35:12 +01:00
2017-11-02 11:10:55 +01:00
2019-01-13 10:01:02 +01:00
2018-12-05 19:41:08 +01:00
2016-05-20 17:58:30 -07:00
2019-03-13 14:03:10 -07:00
2017-05-03 15:52:12 -07:00
2017-11-02 11:10:55 +01:00
2017-09-06 17:27:30 -07:00
2017-09-08 18:26:49 -07:00
2018-05-22 18:53:58 +02:00
2018-02-22 15:42:24 +01:00
2018-12-05 19:41:09 +01:00
2016-03-17 15:09:34 -07:00
2018-05-30 07:52:21 +02:00
2018-07-03 11:25:03 +02:00
2017-10-03 17:54:25 -07:00
2016-05-22 17:21:27 -07:00
2018-10-10 08:54:22 +02:00
2018-02-22 15:42:24 +01:00
2018-03-28 18:24:39 +02:00
2018-09-05 09:26:32 +02:00
2019-03-13 14:03:18 -07:00
2019-03-23 14:35:24 +01:00
2019-01-16 22:07:11 +01:00
2019-04-05 22:31:27 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-04-03 06:25:20 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-03-17 15:09:34 -07:00
2019-03-05 17:58:02 +01:00
2017-03-02 08:42:38 +01:00
2017-08-31 16:13:00 -07:00
2017-11-02 11:10:55 +01:00
2018-08-15 18:12:51 +02:00
2018-10-20 09:48:53 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-14 18:13:32 -07:00
2019-02-06 17:31:36 +01:00
2019-03-23 14:35:13 +01:00
2017-11-02 11:10:55 +01:00
2019-04-05 22:31:27 +02:00
2018-05-30 07:52:24 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:52:21 +02:00
2017-11-02 11:10:55 +01:00
2018-11-13 11:15:08 -08:00
2019-01-26 09:37:06 +01:00
2017-11-24 08:37:04 +01:00
2017-11-02 11:10:55 +01:00
2019-02-12 19:46:05 +01:00
2017-09-27 14:45:57 -07:00
2018-04-08 14:26:29 +02:00
2018-10-18 09:16:23 +02:00
2017-11-02 11:10:55 +01:00
2017-03-02 08:42:28 +01:00
2017-11-02 11:10:55 +01:00
2018-09-09 19:55:53 +02:00
2018-10-13 09:27:22 +02:00
2017-10-03 17:54:24 -07:00
2019-03-23 14:35:17 +01:00
2018-12-01 09:42:51 +01:00
2019-04-05 22:31:27 +02:00
2018-02-22 15:42:23 +01:00
2017-11-02 11:10:55 +01:00
2018-10-03 17:00:55 -07:00
2017-11-02 11:10:55 +01:00
2018-05-16 10:10:27 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-03 17:54:24 -07:00
2019-01-26 09:37:06 +01:00
2018-12-08 13:03:40 +01:00
2017-04-05 12:30:18 -07:00
2018-12-08 13:03:38 +01:00
2019-01-16 22:07:11 +01:00
2018-09-19 22:43:48 +02:00
2019-04-05 22:31:27 +02:00
2017-07-10 16:32:31 -07:00
2018-12-29 13:39:11 +01:00
2018-12-08 13:03:40 +01:00
2017-11-02 11:10:55 +01:00
2018-12-01 09:42:54 +01:00
2016-01-15 11:40:52 -08:00
2015-11-06 17:50:42 -08:00
2017-12-14 09:53:10 +01:00
2018-09-05 09:26:30 +02:00