Merge branch 'akpm' (patches from Andrew)
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Jan 2022 18:37:06 +0000 (20:37 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Jan 2022 18:37:06 +0000 (20:37 +0200)
Merge misc updates from Andrew Morton:
 "146 patches.

  Subsystems affected by this patch series: kthread, ia64, scripts,
  ntfs, squashfs, ocfs2, vfs, and mm (slab-generic, slab, kmemleak,
  dax, kasan, debug, pagecache, gup, shmem, frontswap, memremap,
  memcg, selftests, pagemap, dma, vmalloc, memory-failure, hugetlb,
  userfaultfd, vmscan, mempolicy, oom-kill, hugetlbfs, migration, thp,
  ksm, page-poison, percpu, rmap, zswap, zram, cleanups, hmm, and
  damon)"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (146 commits)
  mm/damon: hide kernel pointer from tracepoint event
  mm/damon/vaddr: hide kernel pointer from damon_va_three_regions() failure log
  mm/damon/vaddr: use pr_debug() for damon_va_three_regions() failure logging
  mm/damon/dbgfs: remove an unnecessary variable
  mm/damon: move the implementation of damon_insert_region to damon.h
  mm/damon: add access checking for hugetlb pages
  Docs/admin-guide/mm/damon/usage: update for schemes statistics
  mm/damon/dbgfs: support all DAMOS stats
  Docs/admin-guide/mm/damon/reclaim: document statistics parameters
  mm/damon/reclaim: provide reclamation statistics
  mm/damon/schemes: account how many times quota limit has exceeded
  mm/damon/schemes: account scheme actions that successfully applied
  mm/damon: remove a mistakenly added comment for a future feature
  Docs/admin-guide/mm/damon/usage: update for kdamond_pid and (mk|rm)_contexts
  Docs/admin-guide/mm/damon/usage: mention tracepoint at the beginning
  Docs/admin-guide/mm/damon/usage: remove redundant information
  Docs/admin-guide/mm/damon/usage: update for scheme quotas and watermarks
  mm/damon: convert macro functions to static inline functions
  mm/damon: modify damon_rand() macro to static inline function
  mm/damon: move damon_rand() definition into damon.h
  ...

42 files changed:
1  2 
MAINTAINERS
arch/Kconfig
arch/arm/mm/fault.c
arch/arm64/mm/fault.c
arch/parisc/mm/fault.c
arch/powerpc/mm/fault.c
arch/s390/mm/fault.c
arch/um/kernel/trap.c
arch/x86/Kconfig
arch/x86/include/asm/pgtable.h
drivers/block/zram/zram_drv.c
drivers/dax/bus.c
drivers/dax/bus.h
drivers/dax/device.c
drivers/of/fdt.c
fs/ext4/extents.c
fs/xfs/xfs_buf.c
include/linux/fs.h
include/linux/kasan.h
include/linux/memcontrol.h
include/linux/memremap.h
include/linux/mm.h
include/linux/mm_types.h
include/linux/page-flags.h
kernel/fork.c
kernel/rcu/rcutorture.c
kernel/sysctl.c
mm/Makefile
mm/huge_memory.c
mm/internal.h
mm/kasan/quarantine.c
mm/khugepaged.c
mm/memcontrol.c
mm/memory-failure.c
mm/memory.c
mm/memremap.c
mm/migrate.c
mm/shmem.c
mm/slab.h
mm/slab_common.c
mm/swap.c
mm/truncate.c

diff --cc MAINTAINERS
Simple merge
diff --cc arch/Kconfig
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -39,7 -48,12 +39,8 @@@ int __dax_driver_register(struct dax_de
        __dax_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)
  void dax_driver_unregister(struct dax_device_driver *dax_drv);
  void kill_dev_dax(struct dev_dax *dev_dax);
+ bool static_dev_dax(struct dev_dax *dev_dax);
  
 -#if IS_ENABLED(CONFIG_DEV_DAX_PMEM_COMPAT)
 -int dev_dax_probe(struct dev_dax *dev_dax);
 -#endif
 -
  /*
   * While run_dax() is potentially a generic operation that could be
   * defined in include/linux/dax.h we don't want to grow any users
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -85,9 -95,15 +85,14 @@@ struct dev_pagemap_ops 
   * struct dev_pagemap - metadata for ZONE_DEVICE mappings
   * @altmap: pre-allocated/reserved memory for vmemmap allocations
   * @ref: reference count that pins the devm_memremap_pages() mapping
 - * @internal_ref: internal reference if @ref is not provided by the caller
 - * @done: completion for @internal_ref
 + * @done: completion for @ref
   * @type: memory type: see MEMORY_* in memory_hotplug.h
   * @flags: PGMAP_* flags to specify defailed behavior
+  * @vmemmap_shift: structural definition of how the vmemmap page metadata
+  *      is populated, specifically the metadata page order.
+  *    A zero value (default) uses base pages as the vmemmap metadata
+  *    representation. A bigger value will set up compound struct pages
+  *    of the requested order value.
   * @ops: method table
   * @owner: an opaque pointer identifying the entity that manages this
   *    instance.  Used by various helpers to make sure that no
Simple merge
Simple merge
Simple merge
diff --cc kernel/fork.c
Simple merge
Simple merge
diff --cc kernel/sysctl.c
Simple merge
diff --cc mm/Makefile
Simple merge
Simple merge
diff --cc mm/internal.h
Simple merge
Simple merge
diff --cc mm/khugepaged.c
Simple merge
diff --cc mm/memcontrol.c
Simple merge
Simple merge
diff --cc mm/memory.c
Simple merge
diff --cc mm/memremap.c
@@@ -110,8 -116,33 +116,9 @@@ static unsigned long pfn_len(struct dev
  }
  
  #define for_each_device_pfn(pfn, map, i) \
-       for (pfn = pfn_first(map, i); pfn < pfn_end(map, i); pfn = pfn_next(pfn))
+       for (pfn = pfn_first(map, i); pfn < pfn_end(map, i); \
+            pfn = pfn_next(map, pfn))
  
 -static void dev_pagemap_kill(struct dev_pagemap *pgmap)
 -{
 -      if (pgmap->ops && pgmap->ops->kill)
 -              pgmap->ops->kill(pgmap);
 -      else
 -              percpu_ref_kill(pgmap->ref);
 -}
 -
 -static void dev_pagemap_cleanup(struct dev_pagemap *pgmap)
 -{
 -      if (pgmap->ops && pgmap->ops->cleanup) {
 -              pgmap->ops->cleanup(pgmap);
 -      } else {
 -              wait_for_completion(&pgmap->done);
 -              percpu_ref_exit(pgmap->ref);
 -      }
 -      /*
 -       * Undo the pgmap ref assignment for the internal case as the
 -       * caller may re-enable the same pgmap.
 -       */
 -      if (pgmap->ref == &pgmap->internal_ref)
 -              pgmap->ref = NULL;
 -}
 -
  static void pageunmap_range(struct dev_pagemap *pgmap, int range_id)
  {
        struct range *range = &pgmap->ranges[range_id];
@@@ -271,8 -302,7 +278,7 @@@ static int pagemap_range(struct dev_pag
        memmap_init_zone_device(&NODE_DATA(nid)->node_zones[ZONE_DEVICE],
                                PHYS_PFN(range->start),
                                PHYS_PFN(range_len(range)), pgmap);
-       percpu_ref_get_many(&pgmap->ref,
-               pfn_end(pgmap, range_id) - pfn_first(pgmap, range_id));
 -      percpu_ref_get_many(pgmap->ref, pfn_len(pgmap, range_id));
++      percpu_ref_get_many(&pgmap->ref, pfn_len(pgmap, range_id));
        return 0;
  
  err_add_memory:
diff --cc mm/migrate.c
Simple merge
diff --cc mm/shmem.c
Simple merge
diff --cc mm/slab.h
Simple merge
Simple merge
diff --cc mm/swap.c
Simple merge
diff --cc mm/truncate.c
@@@ -213,18 -212,18 +212,16 @@@ invalidate_complete_page(struct address
        if (page_has_private(page) && !try_to_release_page(page, 0))
                return 0;
  
-       ret = remove_mapping(mapping, page);
-       return ret;
+       return remove_mapping(mapping, page);
  }
  
 -int truncate_inode_page(struct address_space *mapping, struct page *page)
 +int truncate_inode_folio(struct address_space *mapping, struct folio *folio)
  {
 -      VM_BUG_ON_PAGE(PageTail(page), page);
 -
 -      if (page->mapping != mapping)
 +      if (folio->mapping != mapping)
                return -EIO;
  
 -      truncate_cleanup_page(page);
 -      delete_from_page_cache(page);
 +      truncate_cleanup_folio(folio);
 +      filemap_remove_folio(folio);
        return 0;
  }