diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -550,14 +550,6 @@ static void start_cpu_timer(int cpu) | |||
550 | 550 | ||
551 | static void init_arraycache(struct array_cache *ac, int limit, int batch) | 551 | static void init_arraycache(struct array_cache *ac, int limit, int batch) |
552 | { | 552 | { |
553 | /* | ||
554 | * The array_cache structures contain pointers to free object. | ||
555 | * However, when such objects are allocated or transferred to another | ||
556 | * cache the pointers are not cleared and they could be counted as | ||
557 | * valid references during a kmemleak scan. Therefore, kmemleak must | ||
558 | * not scan such objects. | ||
559 | */ | ||
560 | kmemleak_no_scan(ac); | ||
561 | if (ac) { | 553 | if (ac) { |
562 | ac->avail = 0; | 554 | ac->avail = 0; |
563 | ac->limit = limit; | 555 | ac->limit = limit; |
@@ -573,6 +565,14 @@ static struct array_cache *alloc_arraycache(int node, int entries, | |||
573 | struct array_cache *ac = NULL; | 565 | struct array_cache *ac = NULL; |
574 | 566 | ||
575 | ac = kmalloc_node(memsize, gfp, node); | 567 | ac = kmalloc_node(memsize, gfp, node); |
568 | /* | ||
569 | * The array_cache structures contain pointers to free object. | ||
570 | * However, when such objects are allocated or transferred to another | ||
571 | * cache the pointers are not cleared and they could be counted as | ||
572 | * valid references during a kmemleak scan. Therefore, kmemleak must | ||
573 | * not scan such objects. | ||
574 | */ | ||
575 | kmemleak_no_scan(ac); | ||
576 | init_arraycache(ac, entries, batchcount); | 576 | init_arraycache(ac, entries, batchcount); |
577 | return ac; | 577 | return ac; |
578 | } | 578 | } |
@@ -667,6 +667,7 @@ static struct alien_cache *__alloc_alien_cache(int node, int entries, | |||
667 | 667 | ||
668 | alc = kmalloc_node(memsize, gfp, node); | 668 | alc = kmalloc_node(memsize, gfp, node); |
669 | if (alc) { | 669 | if (alc) { |
670 | kmemleak_no_scan(alc); | ||
670 | init_arraycache(&alc->ac, entries, batch); | 671 | init_arraycache(&alc->ac, entries, batch); |
671 | spin_lock_init(&alc->lock); | 672 | spin_lock_init(&alc->lock); |
672 | } | 673 | } |