Merge branch 'akpm' (patches from Andrew)
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Jun 2021 00:29:11 +0000 (17:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Jun 2021 00:29:11 +0000 (17:29 -0700)
Merge misc updates from Andrew Morton:
 "191 patches.

  Subsystems affected by this patch series: kthread, ia64, scripts,
  ntfs, squashfs, ocfs2, kernel/watchdog, and mm (gup, pagealloc, slab,
  slub, kmemleak, dax, debug, pagecache, gup, swap, memcg, pagemap,
  mprotect, bootmem, dma, tracing, vmalloc, kasan, initialization,
  pagealloc, and memory-failure)"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (191 commits)
  mm,hwpoison: make get_hwpoison_page() call get_any_page()
  mm,hwpoison: send SIGBUS with error virutal address
  mm/page_alloc: split pcp->high across all online CPUs for cpuless nodes
  mm/page_alloc: allow high-order pages to be stored on the per-cpu lists
  mm: replace CONFIG_FLAT_NODE_MEM_MAP with CONFIG_FLATMEM
  mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA
  docs: remove description of DISCONTIGMEM
  arch, mm: remove stale mentions of DISCONIGMEM
  mm: remove CONFIG_DISCONTIGMEM
  m68k: remove support for DISCONTIGMEM
  arc: remove support for DISCONTIGMEM
  arc: update comment about HIGHMEM implementation
  alpha: remove DISCONTIGMEM and NUMA
  mm/page_alloc: move free_the_page
  mm/page_alloc: fix counting of managed_pages
  mm/page_alloc: improve memmap_pages dbg msg
  mm: drop SECTION_SHIFT in code comments
  mm/page_alloc: introduce vm.percpu_pagelist_high_fraction
  mm/page_alloc: limit the number of pages on PCP lists when reclaim is active
  mm/page_alloc: scale the number of pages that are batch freed
  ...

34 files changed:
1  2 
Documentation/admin-guide/kernel-parameters.txt
Documentation/admin-guide/sysctl/kernel.rst
arch/arm64/Kconfig
arch/arm64/kvm/mmu.c
arch/powerpc/kernel/smp.c
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_uvmem.c
arch/sparc/kernel/smp_64.c
arch/x86/Kconfig
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
include/linux/gfp.h
include/linux/kasan.h
include/linux/kthread.h
include/linux/mm.h
include/linux/page-flags.h
include/linux/printk.h
kernel/events/core.c
kernel/events/uprobes.c
kernel/fork.c
kernel/kthread.c
kernel/sysctl.c
lib/Kconfig.debug
lib/Makefile
lib/dump_stack.c
lib/vsprintf.c
mm/compaction.c
mm/kasan/common.c
mm/kasan/hw_tags.c
mm/kasan/sw_tags.c
mm/mmap.c
mm/page_alloc.c
mm/shmem.c
virt/kvm/kvm_main.c

Simple merge
@@@ -924,12 -853,9 +924,12 @@@ static int user_mem_abort(struct kvm_vc
                return -EFAULT;
        }
  
 -      /* Let's check if we will get back a huge page backed by hugetlbfs */
 +      /*
 +       * Let's check if we will get back a huge page backed by hugetlbfs, or
 +       * get block mapping for device MMIO region.
 +       */
        mmap_read_lock(current->mm);
-       vma = find_vma_intersection(current->mm, hva, hva + 1);
+       vma = vma_lookup(current->mm, hva);
        if (unlikely(!vma)) {
                kvm_err("Failed to find VMA for hva 0x%lx\n", hva);
                mmap_read_unlock(current->mm);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/binfmt_elf.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/fork.c
Simple merge
Simple merge
diff --cc kernel/sysctl.c
Simple merge
Simple merge
diff --cc lib/Makefile
Simple merge
@@@ -84,16 -84,56 +84,22 @@@ static void __dump_stack(const char *lo
   *
   * Architectures can override this implementation by implementing its own.
   */
- asmlinkage __visible void dump_stack(void)
 -#ifdef CONFIG_SMP
 -static atomic_t dump_lock = ATOMIC_INIT(-1);
 -
+ asmlinkage __visible void dump_stack_lvl(const char *log_lvl)
  {
        unsigned long flags;
 -      int was_locked;
 -      int old;
 -      int cpu;
  
        /*
         * Permit this cpu to perform nested stack dumps while serialising
         * against other CPUs
         */
 -retry:
 -      local_irq_save(flags);
 -      cpu = smp_processor_id();
 -      old = atomic_cmpxchg(&dump_lock, -1, cpu);
 -      if (old == -1) {
 -              was_locked = 0;
 -      } else if (old == cpu) {
 -              was_locked = 1;
 -      } else {
 -              local_irq_restore(flags);
 -              /*
 -               * Wait for the lock to release before jumping to
 -               * atomic_cmpxchg() in order to mitigate the thundering herd
 -               * problem.
 -               */
 -              do { cpu_relax(); } while (atomic_read(&dump_lock) != -1);
 -              goto retry;
 -      }
 -
 -      __dump_stack(log_lvl);
 -
 -      if (!was_locked)
 -              atomic_set(&dump_lock, -1);
 -
 -      local_irq_restore(flags);
 -}
 -#else
 -asmlinkage __visible void dump_stack_lvl(const char *log_lvl)
 -{
 +      printk_cpu_lock_irqsave(flags);
-       __dump_stack();
+       __dump_stack(log_lvl);
 +      printk_cpu_unlock_irqrestore(flags);
  }
 -#endif
+ EXPORT_SYMBOL(dump_stack_lvl);
+ asmlinkage __visible void dump_stack(void)
+ {
+       dump_stack_lvl(KERN_DEFAULT);
+ }
  EXPORT_SYMBOL(dump_stack);
diff --cc lib/vsprintf.c
Simple merge
diff --cc mm/compaction.c
Simple merge
Simple merge
@@@ -216,60 -216,6 +216,38 @@@ void __init kasan_init_hw_tags(void
        pr_info("KernelAddressSanitizer initialized\n");
  }
  
- void kasan_set_free_info(struct kmem_cache *cache,
-                               void *object, u8 tag)
- {
-       struct kasan_alloc_meta *alloc_meta;
-       alloc_meta = kasan_get_alloc_meta(cache, object);
-       if (alloc_meta)
-               kasan_set_track(&alloc_meta->free_track[0], GFP_NOWAIT);
- }
- struct kasan_track *kasan_get_free_track(struct kmem_cache *cache,
-                               void *object, u8 tag)
- {
-       struct kasan_alloc_meta *alloc_meta;
-       alloc_meta = kasan_get_alloc_meta(cache, object);
-       if (!alloc_meta)
-               return NULL;
-       return &alloc_meta->free_track[0];
- }
 +void kasan_alloc_pages(struct page *page, unsigned int order, gfp_t flags)
 +{
 +      /*
 +       * This condition should match the one in post_alloc_hook() in
 +       * page_alloc.c.
 +       */
 +      bool init = !want_init_on_free() && want_init_on_alloc(flags);
 +
 +      if (flags & __GFP_SKIP_KASAN_POISON)
 +              SetPageSkipKASanPoison(page);
 +
 +      if (flags & __GFP_ZEROTAGS) {
 +              int i;
 +
 +              for (i = 0; i != 1 << order; ++i)
 +                      tag_clear_highpage(page + i);
 +      } else {
 +              kasan_unpoison_pages(page, order, init);
 +      }
 +}
 +
 +void kasan_free_pages(struct page *page, unsigned int order)
 +{
 +      /*
 +       * This condition should match the one in free_pages_prepare() in
 +       * page_alloc.c.
 +       */
 +      bool init = want_init_on_free();
 +
 +      kasan_poison_pages(page, order, init);
 +}
 +
  #if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
  
  void kasan_set_tagging_report_once(bool state)
@@@ -166,51 -166,3 +166,10 @@@ void __hwasan_tag_memory(unsigned long 
        kasan_poison((void *)addr, size, tag, false);
  }
  EXPORT_SYMBOL(__hwasan_tag_memory);
- void kasan_set_free_info(struct kmem_cache *cache,
-                               void *object, u8 tag)
- {
-       struct kasan_alloc_meta *alloc_meta;
-       u8 idx = 0;
-       alloc_meta = kasan_get_alloc_meta(cache, object);
-       if (!alloc_meta)
-               return;
- #ifdef CONFIG_KASAN_SW_TAGS_IDENTIFY
-       idx = alloc_meta->free_track_idx;
-       alloc_meta->free_pointer_tag[idx] = tag;
-       alloc_meta->free_track_idx = (idx + 1) % KASAN_NR_FREE_STACKS;
- #endif
-       kasan_set_track(&alloc_meta->free_track[idx], GFP_NOWAIT);
- }
- struct kasan_track *kasan_get_free_track(struct kmem_cache *cache,
-                               void *object, u8 tag)
- {
-       struct kasan_alloc_meta *alloc_meta;
-       int i = 0;
-       alloc_meta = kasan_get_alloc_meta(cache, object);
-       if (!alloc_meta)
-               return NULL;
- #ifdef CONFIG_KASAN_SW_TAGS_IDENTIFY
-       for (i = 0; i < KASAN_NR_FREE_STACKS; i++) {
-               if (alloc_meta->free_pointer_tag[i] == tag)
-                       break;
-       }
-       if (i == KASAN_NR_FREE_STACKS)
-               i = alloc_meta->free_track_idx;
- #endif
-       return &alloc_meta->free_track[i];
- }
 +
 +void kasan_tag_mismatch(unsigned long addr, unsigned long access_info,
 +                      unsigned long ret_ip)
 +{
 +      kasan_report(addr, 1 << (access_info & 0xf), access_info & 0x10,
 +                   ret_ip);
 +}
diff --cc mm/mmap.c
Simple merge
diff --cc mm/page_alloc.c
Simple merge
diff --cc mm/shmem.c
Simple merge
Simple merge