Merge tag 'mm-stable-2023-08-28-18-26' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Aug 2023 21:25:26 +0000 (14:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Aug 2023 21:25:26 +0000 (14:25 -0700)
Pull MM updates from Andrew Morton:

 - Some swap cleanups from Ma Wupeng ("fix WARN_ON in
   add_to_avail_list")

 - Peter Xu has a series (mm/gup: Unify hugetlb, speed up thp") which
   reduces the special-case code for handling hugetlb pages in GUP. It
   also speeds up GUP handling of transparent hugepages.

 - Peng Zhang provides some maple tree speedups ("Optimize the fast path
   of mas_store()").

 - Sergey Senozhatsky has improved te performance of zsmalloc during
   compaction (zsmalloc: small compaction improvements").

 - Domenico Cerasuolo has developed additional selftest code for zswap
   ("selftests: cgroup: add zswap test program").

 - xu xin has doe some work on KSM's handling of zero pages. These
   changes are mainly to enable the user to better understand the
   effectiveness of KSM's treatment of zero pages ("ksm: support
   tracking KSM-placed zero-pages").

 - Jeff Xu has fixes the behaviour of memfd's
   MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED sysctl ("mm/memfd: fix sysctl
   MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED").

 - David Howells has fixed an fscache optimization ("mm, netfs, fscache:
   Stop read optimisation when folio removed from pagecache").

 - Axel Rasmussen has given userfaultfd the ability to simulate memory
   poisoning ("add UFFDIO_POISON to simulate memory poisoning with
   UFFD").

 - Miaohe Lin has contributed some routine maintenance work on the
   memory-failure code ("mm: memory-failure: remove unneeded PageHuge()
   check").

 - Peng Zhang has contributed some maintenance work on the maple tree
   code ("Improve the validation for maple tree and some cleanup").

 - Hugh Dickins has optimized the collapsing of shmem or file pages into
   THPs ("mm: free retracted page table by RCU").

 - Jiaqi Yan has a patch series which permits us to use the healthy
   subpages within a hardware poisoned huge page for general purposes
   ("Improve hugetlbfs read on HWPOISON hugepages").

 - Kemeng Shi has done some maintenance work on the pagetable-check code
   ("Remove unused parameters in page_table_check").

 - More folioification work from Matthew Wilcox ("More filesystem folio
   conversions for 6.6"), ("Followup folio conversions for zswap"). And
   from ZhangPeng ("Convert several functions in page_io.c to use a
   folio").

 - page_ext cleanups from Kemeng Shi ("minor cleanups for page_ext").

 - Baoquan He has converted some architectures to use the
   GENERIC_IOREMAP ioremap()/iounmap() code ("mm: ioremap: Convert
   architectures to take GENERIC_IOREMAP way").

 - Anshuman Khandual has optimized arm64 tlb shootdown ("arm64: support
   batched/deferred tlb shootdown during page reclamation/migration").

 - Better maple tree lockdep checking from Liam Howlett ("More strict
   maple tree lockdep"). Liam also developed some efficiency
   improvements ("Reduce preallocations for maple tree").

 - Cleanup and optimization to the secondary IOMMU TLB invalidation,
   from Alistair Popple ("Invalidate secondary IOMMU TLB on permission
   upgrade").

 - Ryan Roberts fixes some arm64 MM selftest issues ("selftests/mm fixes
   for arm64").

 - Kemeng Shi provides some maintenance work on the compaction code
   ("Two minor cleanups for compaction").

 - Some reduction in mmap_lock pressure from Matthew Wilcox ("Handle
   most file-backed faults under the VMA lock").

 - Aneesh Kumar contributes code to use the vmemmap optimization for DAX
   on ppc64, under some circumstances ("Add support for DAX vmemmap
   optimization for ppc64").

 - page-ext cleanups from Kemeng Shi ("add page_ext_data to get client
   data in page_ext"), ("minor cleanups to page_ext header").

 - Some zswap cleanups from Johannes Weiner ("mm: zswap: three
   cleanups").

 - kmsan cleanups from ZhangPeng ("minor cleanups for kmsan").

 - VMA handling cleanups from Kefeng Wang ("mm: convert to
   vma_is_initial_heap/stack()").

 - DAMON feature work from SeongJae Park ("mm/damon/sysfs-schemes:
   implement DAMOS tried total bytes file"), ("Extend DAMOS filters for
   address ranges and DAMON monitoring targets").

 - Compaction work from Kemeng Shi ("Fixes and cleanups to compaction").

 - Liam Howlett has improved the maple tree node replacement code
   ("maple_tree: Change replacement strategy").

 - ZhangPeng has a general code cleanup - use the K() macro more widely
   ("cleanup with helper macro K()").

 - Aneesh Kumar brings memmap-on-memory to ppc64 ("Add support for
   memmap on memory feature on ppc64").

 - pagealloc cleanups from Kemeng Shi ("Two minor cleanups for pcp list
   in page_alloc"), ("Two minor cleanups for get pageblock
   migratetype").

 - Vishal Moola introduces a memory descriptor for page table tracking,
   "struct ptdesc" ("Split ptdesc from struct page").

 - memfd selftest maintenance work from Aleksa Sarai ("memfd: cleanups
   for vm.memfd_noexec").

 - MM include file rationalization from Hugh Dickins ("arch: include
   asm/cacheflush.h in asm/hugetlb.h").

 - THP debug output fixes from Hugh Dickins ("mm,thp: fix sloppy text
   output").

 - kmemleak improvements from Xiaolei Wang ("mm/kmemleak: use
   object_cache instead of kmemleak_initialized").

 - More folio-related cleanups from Matthew Wilcox ("Remove _folio_dtor
   and _folio_order").

 - A VMA locking scalability improvement from Suren Baghdasaryan
   ("Per-VMA lock support for swap and userfaults").

 - pagetable handling cleanups from Matthew Wilcox ("New page table
   range API").

 - A batch of swap/thp cleanups from David Hildenbrand ("mm/swap: stop
   using page->private on tail pages for THP_SWAP + cleanups").

 - Cleanups and speedups to the hugetlb fault handling from Matthew
   Wilcox ("Change calling convention for ->huge_fault").

 - Matthew Wilcox has also done some maintenance work on the MM
   subsystem documentation ("Improve mm documentation").

* tag 'mm-stable-2023-08-28-18-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (489 commits)
  maple_tree: shrink struct maple_tree
  maple_tree: clean up mas_wr_append()
  secretmem: convert page_is_secretmem() to folio_is_secretmem()
  nios2: fix flush_dcache_page() for usage from irq context
  hugetlb: add documentation for vma_kernel_pagesize()
  mm: add orphaned kernel-doc to the rst files.
  mm: fix clean_record_shared_mapping_range kernel-doc
  mm: fix get_mctgt_type() kernel-doc
  mm: fix kernel-doc warning from tlb_flush_rmaps()
  mm: remove enum page_entry_size
  mm: allow ->huge_fault() to be called without the mmap_lock held
  mm: move PMD_ORDER to pgtable.h
  mm: remove checks for pte_index
  memcg: remove duplication detection for mem_cgroup_uncharge_swap
  mm/huge_memory: work on folio->swap instead of page->private when splitting folio
  mm/swap: inline folio_set_swap_entry() and folio_swap_entry()
  mm/swap: use dedicated entry for swap in folio
  mm/swap: stop using page->private on tail pages for THP_SWAP
  selftests/mm: fix WARNING comparing pointer to 0
  selftests: cgroup: fix test_kmem_memcg_deletion kernel mem check
  ...

48 files changed:
1  2 
Documentation/admin-guide/kdump/vmcoreinfo.rst
Documentation/filesystems/locking.rst
Documentation/filesystems/porting.rst
MAINTAINERS
arch/arm64/Kconfig
arch/arm64/include/asm/pgtable.h
arch/csky/abiv2/cacheflush.c
arch/loongarch/Kconfig
arch/parisc/Kconfig
arch/powerpc/mm/init_64.c
arch/riscv/Kconfig
arch/riscv/include/asm/cacheflush.h
arch/riscv/include/asm/pgtable.h
arch/riscv/mm/init.c
arch/s390/Kconfig
arch/s390/include/asm/pgtable.h
arch/s390/mm/fault.c
arch/x86/Kconfig
arch/x86/xen/mmu_pv.c
drivers/net/ethernet/sfc/io.h
fs/Kconfig
fs/affs/file.c
fs/buffer.c
fs/ext4/ext4.h
fs/ext4/inode.c
fs/hugetlbfs/inode.c
fs/ntfs3/inode.c
fs/ocfs2/file.c
fs/proc/base.c
fs/splice.c
include/linux/bio.h
include/linux/fs.h
include/linux/memcontrol.h
include/linux/pagemap.h
include/net/tcp.h
io_uring/io_uring.c
kernel/events/core.c
mm/Kconfig
mm/Makefile
mm/filemap.c
mm/huge_memory.c
mm/khugepaged.c
mm/memory.c
mm/shmem.c
mm/truncate.c
mm/util.c
net/ipv4/tcp.c
security/selinux/hooks.c

Simple merge
Simple merge
diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
index 500eb8f693971b559f4f888720feca11a066cb07,d05a551af5d532a7013d5a607e5b47b64303b3cf..876028b1083f93b0447bd6f8c8c3cf10546f569b
@@@ -15,22 -16,23 +16,24 @@@ void update_mmu_cache_range(struct vm_f
  
        flush_tlb_page(vma, address);
  
-       if (!pfn_valid(pte_pfn(*pte)))
+       if (!pfn_valid(pfn))
                return;
  
-       page = pfn_to_page(pte_pfn(*pte));
-       if (page == ZERO_PAGE(0))
-               return;
+       folio = page_folio(pfn_to_page(pfn));
  
-       if (test_and_set_bit(PG_dcache_clean, &page->flags))
+       if (test_and_set_bit(PG_dcache_clean, &folio->flags))
                return;
  
-       addr = (unsigned long) kmap_atomic(page);
-       icache_inv_range(address, address + PAGE_SIZE);
-       dcache_wb_range(addr, addr + PAGE_SIZE);
++      icache_inv_range(address, address + nr*PAGE_SIZE);
+       for (i = 0; i < folio_nr_pages(folio); i++) {
+               unsigned long addr = (unsigned long) kmap_local_folio(folio,
+                                                               i * PAGE_SIZE);
  
-       kunmap_atomic((void *) addr);
+               dcache_wb_range(addr, addr + PAGE_SIZE);
+               if (vma->vm_flags & VM_EXEC)
+                       icache_inv_range(addr, addr + PAGE_SIZE);
+               kunmap_local((void *) addr);
+       }
  }
  
  void flush_icache_deferred(struct mm_struct *mm)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/Kconfig
Simple merge
diff --cc fs/affs/file.c
Simple merge
diff --cc fs/buffer.c
Simple merge
diff --cc fs/ext4/ext4.h
Simple merge
diff --cc fs/ext4/inode.c
Simple merge
Simple merge
Simple merge
diff --cc fs/ocfs2/file.c
Simple merge
diff --cc fs/proc/base.c
Simple merge
diff --cc fs/splice.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc mm/Kconfig
Simple merge
diff --cc mm/Makefile
Simple merge
diff --cc mm/filemap.c
Simple merge
index e4f0266a22d4102b273cd552b25a6d35cf858293,c4635f750255b10f7e2d5581d73857f0143a710f..fcafd9b69665949d624f99f24475bcb0c1bbff59
@@@ -2582,15 -2561,10 +2561,12 @@@ static void __split_huge_page(struct pa
        }
        local_irq_enable();
  
 +      if (nr_dropped)
 +              shmem_uncharge(head->mapping->host, nr_dropped);
        remap_page(folio, nr);
  
-       if (PageSwapCache(head)) {
-               swp_entry_t entry = { .val = page_private(head) };
-               split_swap_cluster(entry);
-       }
+       if (folio_test_swapcache(folio))
+               split_swap_cluster(folio->swap);
  
        for (i = 0; i < nr; i++) {
                struct page *subpage = head + i;
diff --cc mm/khugepaged.c
Simple merge
diff --cc mm/memory.c
Simple merge
diff --cc mm/shmem.c
Simple merge
diff --cc mm/truncate.c
Simple merge
diff --cc mm/util.c
Simple merge
diff --cc net/ipv4/tcp.c
Simple merge
Simple merge