Files
linux/include/linux
Qian Cai fed84c7852 mm/memblock.c: skip kmemleak for kasan_init()
Kmemleak does not play well with KASAN (tested on both HPE Apollo 70 and
Huawei TaiShan 2280 aarch64 servers).

After calling start_kernel()->setup_arch()->kasan_init(), kmemleak early
log buffer went from something like 280 to 260000 which caused kmemleak
disabled and crash dump memory reservation failed.  The multitude of
kmemleak_alloc() calls is from nested loops while KASAN is setting up full
memory mappings, so let early kmemleak allocations skip those
memblock_alloc_internal() calls came from kasan_init() given that those
early KASAN memory mappings should not reference to other memory.  Hence,
no kmemleak false positives.

kasan_init
  kasan_map_populate [1]
    kasan_pgd_populate [2]
      kasan_pud_populate [3]
        kasan_pmd_populate [4]
          kasan_pte_populate [5]
            kasan_alloc_zeroed_page
              memblock_alloc_try_nid
                memblock_alloc_internal
                  kmemleak_alloc

[1] for_each_memblock(memory, reg)
[2] while (pgdp++, addr = next, addr != end)
[3] while (pudp++, addr = next, addr != end && pud_none(READ_ONCE(*pudp)))
[4] while (pmdp++, addr = next, addr != end && pmd_none(READ_ONCE(*pmdp)))
[5] while (ptep++, addr = next, addr != end && pte_none(READ_ONCE(*ptep)))

Link: http://lkml.kernel.org/r/1543442925-17794-1-git-send-email-cai@gmx.us
Signed-off-by: Qian Cai <cai@gmx.us>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-12-28 12:11:49 -08:00
..
2018-11-14 10:56:33 -08:00
2018-12-11 09:57:47 -08:00
2018-10-16 11:13:50 +02:00
2018-12-11 01:04:23 +00:00
2018-11-12 10:33:49 +01:00
2018-11-26 18:41:21 -05:00
2018-11-01 19:59:53 -06:00
2018-10-19 13:24:31 -07:00
2018-10-26 16:26:32 -07:00
2018-12-03 17:40:18 +01:00
2018-11-13 21:55:24 +01:00
2018-10-21 10:46:33 -04:00
2018-12-07 12:59:08 -08:00
2018-11-30 13:29:04 +00:00
2018-10-17 13:56:58 -07:00
2018-10-21 10:46:39 -04:00
2018-10-26 16:26:35 -07:00
2018-12-18 15:11:07 -08:00
2018-10-08 22:53:10 +11:00
2018-12-03 17:11:02 -08:00
2018-10-11 09:16:44 -07:00
2018-10-24 00:41:07 +01:00