Skip to content
  1. Jun 24, 2023
    • Baolin Wang's avatar
      mm: compaction: skip memory hole rapidly when isolating migratable pages · 9721fd82
      Baolin Wang authored
      
      
      On some machines, the normal zone can have a large memory hole like below
      memory layout, and we can see the range from 0x100000000 to 0x1800000000
      is a hole.  So when isolating some migratable pages, the scanner can meet
      the hole and it will take more time to skip the large hole.  From my
      measurement, I can see the isolation scanner will take 80us ~ 100us to
      skip the large hole [0x100000000 - 0x1800000000].
      
      So adding a new helper to fast search next online memory section to skip
      the large hole can help to find next suitable pageblock efficiently.  With
      this patch, I can see the large hole scanning only takes < 1us.
      
      [    0.000000] Zone ranges:
      [    0.000000]   DMA      [mem 0x0000000040000000-0x00000000ffffffff]
      [    0.000000]   DMA32    empty
      [    0.000000]   Normal   [mem 0x0000000100000000-0x0000001fa7ffffff]
      [    0.000000] Movable zone start for each node
      [    0.000000] Early memory node ranges
      [    0.000000]   node   0: [mem 0x0000000040000000-0x0000000fffffffff]
      [    0.000000]   node   0: [mem 0x0000001800000000-0x0000001fa3c7ffff]
      [    0.000000]   node   0: [mem 0x0000001fa3c80000-0x0000001fa3ffffff]
      [    0.000000]   node   0: [mem 0x0000001fa4000000-0x0000001fa402ffff]
      [    0.000000]   node   0: [mem 0x0000001fa4030000-0x0000001fa40effff]
      [    0.000000]   node   0: [mem 0x0000001fa40f0000-0x0000001fa73cffff]
      [    0.000000]   node   0: [mem 0x0000001fa73d0000-0x0000001fa745ffff]
      [    0.000000]   node   0: [mem 0x0000001fa7460000-0x0000001fa746ffff]
      [    0.000000]   node   0: [mem 0x0000001fa7470000-0x0000001fa758ffff]
      [    0.000000]   node   0: [mem 0x0000001fa7590000-0x0000001fa7ffffff]
      
      [baolin.wang@linux.alibaba.com: limit next_ptn to not exceed cc->free_pfn]
        Link: https://lkml.kernel.org/r/a1d859c28af0c7e85e91795e7473f553eb180a9d.1686813379.git.baolin.wang@linux.alibaba.com
      Link: https://lkml.kernel.org/r/75b4c8ca36bf44ad8c42bf0685ac19d272e426ec.1686705221.git.baolin.wang@linux.alibaba.com
      Signed-off-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
      Suggested-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatar"Huang, Ying" <ying.huang@intel.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      9721fd82
    • Marco Elver's avatar
      kasan, doc: note kasan.fault=panic_on_write behaviour for async modes · 8c293a63
      Marco Elver authored
      Note the behaviour of kasan.fault=panic_on_write for async modes, since
      all asynchronous faults will result in panic (even if they are reads).
      
      Link: https://lkml.kernel.org/r/ZJHfL6vavKUZ3Yd8@elver.google.com
      Fixes: 452c03fd
      
       ("kasan: add support for kasan.fault=panic_on_write")
      Signed-off-by: default avatarMarco Elver <elver@google.com>
      Reviewed-by: default avatarAndrey Konovalov <andreyknvl@gmail.com>
      Cc: Aleksandr Nogikh <nogikh@google.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Taras Madan <tarasmadan@google.com>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      8c293a63
    • Andrew Morton's avatar
    • Yu Zhao's avatar
      mm/mglru: make memcg_lru->lock irq safe · 814bc1de
      Yu Zhao authored
      lru_gen_rotate_memcg() can happen in softirq if memory.soft_limit_in_bytes
      is set.  This requires memcg_lru->lock to be irq safe.  Lockdep warns on
      this.
      
      This problem only affects memcg v1.
      
      Link: https://lkml.kernel.org/r/20230619193821.2710944-1-yuzhao@google.com
      Fixes: e4dde56c
      
       ("mm: multi-gen LRU: per-node lru_gen_folio lists")
      Signed-off-by: default avatarYu Zhao <yuzhao@google.com>
      Reported-by: default avatar <syzbot+87c490fd2be656269b6a@syzkaller.appspotmail.com>
      Closes: https://syzkaller.appspot.com/bug?extid=87c490fd2be656269b6a
      Reviewed-by: default avatarYosry Ahmed <yosryahmed@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      814bc1de
  2. Jun 20, 2023