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