All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/75] MM folio patches for 5.18
@ 2022-02-04 19:57 Matthew Wilcox (Oracle)
  2022-02-04 19:57 ` [PATCH 01/75] mm/gup: Increment the page refcount before the pincount Matthew Wilcox (Oracle)
                   ` (76 more replies)
  0 siblings, 77 replies; 115+ messages in thread
From: Matthew Wilcox (Oracle) @ 2022-02-04 19:57 UTC (permalink / raw)
  To: linux-mm; +Cc: Matthew Wilcox (Oracle), linux-kernel

Whole series availabke through git, and shortly in linux-next:
https://git.infradead.org/users/willy/pagecache.git/shortlog/refs/heads/for-next
or git://git.infradead.org/users/willy/pagecache.git for-next

The first few patches should look familiar to most; these are converting
the GUP code to folios (and a few other things).  Most are well-reviewed,
but I did have to make significant changes to a few patches to accommodate
John's recent bugfix, so I dropped the R-b from them.

After the GUP changes, I started working on vmscan, trying to convert
all of shrink_page_list() to use a folio.  The pages it works on are
folios by definition (since they're chained through ->lru and ->lru
occupies the same bytes of memory as ->compound_head, so they can't be
tail pages).  This is a ridiculously large function, and I'm only part
of the way through it.  I have, however, finished converting rmap_walk()
and friends to take a folio instead of a page.

Midway through, there's a short detour to fix up page_vma_mapped_walk to
work on an explicit PFN range instead of a page.  I had been intending to
convert that to use a folio, but with page_mapped_in_vma() really just
wanting to know about one page (even if it's a head page) and Muchun
wanting to walk pageless memory, making all the users use PFNs just
seemed like the right thing to do.

The last 9 patches actually start adding large folios to the page cache.
This is where I expect the most trouble, but they've been stable in my
testing for a while.

Matthew Wilcox (Oracle) (74):
  mm/gup: Increment the page refcount before the pincount
  mm/gup: Remove for_each_compound_range()
  mm/gup: Remove for_each_compound_head()
  mm/gup: Change the calling convention for compound_range_next()
  mm/gup: Optimise compound_range_next()
  mm/gup: Change the calling convention for compound_next()
  mm/gup: Fix some contiguous memmap assumptions
  mm/gup: Remove an assumption of a contiguous memmap
  mm/gup: Handle page split race more efficiently
  mm/gup: Remove hpage_pincount_add()
  mm/gup: Remove hpage_pincount_sub()
  mm: Make compound_pincount always available
  mm: Add folio_pincount_ptr()
  mm: Turn page_maybe_dma_pinned() into folio_maybe_dma_pinned()
  mm/gup: Add try_get_folio() and try_grab_folio()
  mm/gup: Convert try_grab_page() to use a folio
  mm: Remove page_cache_add_speculative() and
    page_cache_get_speculative()
  mm/gup: Add gup_put_folio()
  mm/hugetlb: Use try_grab_folio() instead of try_grab_compound_head()
  mm/gup: Convert gup_pte_range() to use a folio
  mm/gup: Convert gup_hugepte() to use a folio
  mm/gup: Convert gup_huge_pmd() to use a folio
  mm/gup: Convert gup_huge_pud() to use a folio
  mm/gup: Convert gup_huge_pgd() to use a folio
  mm/gup: Turn compound_next() into gup_folio_next()
  mm/gup: Turn compound_range_next() into gup_folio_range_next()
  mm: Turn isolate_lru_page() into folio_isolate_lru()
  mm/gup: Convert check_and_migrate_movable_pages() to use a folio
  mm/workingset: Convert workingset_eviction() to take a folio
  mm/memcg: Convert mem_cgroup_swapout() to take a folio
  mm: Add lru_to_folio()
  mm: Turn putback_lru_page() into folio_putback_lru()
  mm/vmscan: Convert __remove_mapping() to take a folio
  mm/vmscan: Turn page_check_dirty_writeback() into
    folio_check_dirty_writeback()
  mm: Turn head_compound_mapcount() into folio_entire_mapcount()
  mm: Add folio_mapcount()
  mm: Add split_folio_to_list()
  mm: Add folio_is_zone_device() and folio_is_device_private()
  mm: Add folio_pgoff()
  mm: Add pvmw_set_page() and pvmw_set_folio()
  hexagon: Add pmd_pfn()
  mm: Convert page_vma_mapped_walk to work on PFNs
  mm/page_idle: Convert page_idle_clear_pte_refs() to use a folio
  mm/rmap: Use a folio in page_mkclean_one()
  mm/rmap: Turn page_referenced() into folio_referenced()
  mm/mlock: Turn clear_page_mlock() into folio_end_mlock()
  mm/mlock: Turn mlock_vma_page() into mlock_vma_folio()
  mm/rmap: Turn page_mlock() into folio_mlock()
  mm/mlock: Turn munlock_vma_page() into munlock_vma_folio()
  mm/huge_memory: Convert __split_huge_pmd() to take a folio
  mm/rmap: Convert try_to_unmap() to take a folio
  mm/rmap: Convert try_to_migrate() to folios
  mm/rmap: Convert make_device_exclusive_range() to use folios
  mm/migrate: Convert remove_migration_ptes() to folios
  mm/damon: Convert damon_pa_mkold() to use a folio
  mm/damon: Convert damon_pa_young() to use a folio
  mm/rmap: Turn page_lock_anon_vma_read() into
    folio_lock_anon_vma_read()
  mm: Turn page_anon_vma() into folio_anon_vma()
  mm/rmap: Convert rmap_walk() to take a folio
  mm/rmap: Constify the rmap_walk_control argument
  mm/vmscan: Free non-shmem folios without splitting them
  mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios
  mm/vmscan: Account large folios correctly
  mm/vmscan: Turn page_check_references() into folio_check_references()
  mm/vmscan: Convert pageout() to take a folio
  mm: Turn can_split_huge_page() into can_split_folio()
  mm/filemap: Allow large folios to be added to the page cache
  mm: Fix READ_ONLY_THP warning
  mm: Make large folios depend on THP
  mm: Support arbitrary THP sizes
  mm/readahead: Add large folio readahead
  mm/readahead: Switch to page_cache_ra_order
  mm/filemap: Support VM_HUGEPAGE for file mappings
  selftests/vm/transhuge-stress: Support file-backed PMD folios

William Kucharski (1):
  mm/readahead: Align file mappings for non-DAX

 Documentation/core-api/pin_user_pages.rst     |  18 +-
 arch/hexagon/include/asm/pgtable.h            |   3 +-
 arch/powerpc/include/asm/mmu_context.h        |   1 -
 include/linux/huge_mm.h                       |  59 +--
 include/linux/hugetlb.h                       |   5 +
 include/linux/ksm.h                           |   6 +-
 include/linux/mm.h                            | 145 +++---
 include/linux/mm_types.h                      |   7 +-
 include/linux/pagemap.h                       |  32 +-
 include/linux/rmap.h                          |  50 ++-
 include/linux/swap.h                          |   6 +-
 include/trace/events/vmscan.h                 |  10 +-
 kernel/events/uprobes.c                       |   2 +-
 mm/damon/paddr.c                              |  52 ++-
 mm/debug.c                                    |  18 +-
 mm/filemap.c                                  |  59 ++-
 mm/folio-compat.c                             |  34 ++
 mm/gup.c                                      | 383 +++++++---------
 mm/huge_memory.c                              | 127 +++---
 mm/hugetlb.c                                  |   7 +-
 mm/internal.h                                 |  52 ++-
 mm/ksm.c                                      |  17 +-
 mm/memcontrol.c                               |  22 +-
 mm/memory-failure.c                           |  10 +-
 mm/memory_hotplug.c                           |  13 +-
 mm/migrate.c                                  |  90 ++--
 mm/mlock.c                                    | 136 +++---
 mm/page_alloc.c                               |   3 +-
 mm/page_idle.c                                |  26 +-
 mm/page_vma_mapped.c                          |  58 ++-
 mm/readahead.c                                | 108 ++++-
 mm/rmap.c                                     | 416 +++++++++---------
 mm/util.c                                     |  36 +-
 mm/vmscan.c                                   | 280 ++++++------
 mm/workingset.c                               |  25 +-
 tools/testing/selftests/vm/transhuge-stress.c |  35 +-
 36 files changed, 1270 insertions(+), 1081 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 115+ messages in thread

end of thread, other threads:[~2022-02-14  4:33 UTC | newest]

Thread overview: 115+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 19:57 [PATCH 00/75] MM folio patches for 5.18 Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 01/75] mm/gup: Increment the page refcount before the pincount Matthew Wilcox (Oracle)
2022-02-04 21:13   ` John Hubbard
2022-02-04 21:28     ` Matthew Wilcox
2022-02-07  7:45   ` Christoph Hellwig
2022-02-04 19:57 ` [PATCH 02/75] mm/gup: Remove for_each_compound_range() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 03/75] mm/gup: Remove for_each_compound_head() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 04/75] mm/gup: Change the calling convention for compound_range_next() Matthew Wilcox (Oracle)
2022-02-07  7:45   ` Christoph Hellwig
2022-02-04 19:57 ` [PATCH 05/75] mm/gup: Optimise compound_range_next() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 06/75] mm/gup: Change the calling convention for compound_next() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 07/75] mm/gup: Fix some contiguous memmap assumptions Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 08/75] mm/gup: Remove an assumption of a contiguous memmap Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 09/75] mm/gup: Handle page split race more efficiently Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 10/75] mm/gup: Remove hpage_pincount_add() Matthew Wilcox (Oracle)
2022-02-04 21:29   ` John Hubbard
2022-02-07  7:46   ` Christoph Hellwig
2022-02-04 19:57 ` [PATCH 11/75] mm/gup: Remove hpage_pincount_sub() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 12/75] mm: Make compound_pincount always available Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 13/75] mm: Add folio_pincount_ptr() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 14/75] mm: Turn page_maybe_dma_pinned() into folio_maybe_dma_pinned() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 15/75] mm/gup: Add try_get_folio() and try_grab_folio() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 16/75] mm/gup: Convert try_grab_page() to use a folio Matthew Wilcox (Oracle)
2022-02-06  2:12   ` John Hubbard
2022-02-07  7:47   ` Christoph Hellwig
2022-02-04 19:57 ` [PATCH 17/75] mm: Remove page_cache_add_speculative() and page_cache_get_speculative() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 18/75] mm/gup: Add gup_put_folio() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 19/75] mm/hugetlb: Use try_grab_folio() instead of try_grab_compound_head() Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 20/75] mm/gup: Convert gup_pte_range() to use a folio Matthew Wilcox (Oracle)
2022-02-06 14:52   ` Mark Hemment
2022-02-11 20:20     ` Matthew Wilcox
2022-02-04 19:57 ` [PATCH 21/75] mm/gup: Convert gup_hugepte() " Matthew Wilcox (Oracle)
2022-02-04 19:57 ` [PATCH 22/75] mm/gup: Convert gup_huge_pmd() " Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 23/75] mm/gup: Convert gup_huge_pud() " Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 24/75] mm/gup: Convert gup_huge_pgd() " Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 25/75] mm/gup: Turn compound_next() into gup_folio_next() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 26/75] mm/gup: Turn compound_range_next() into gup_folio_range_next() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 27/75] mm: Turn isolate_lru_page() into folio_isolate_lru() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 28/75] mm/gup: Convert check_and_migrate_movable_pages() to use a folio Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 29/75] mm/workingset: Convert workingset_eviction() to take " Matthew Wilcox (Oracle)
2022-02-07  7:49   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 30/75] mm/memcg: Convert mem_cgroup_swapout() " Matthew Wilcox (Oracle)
2022-02-07  7:49   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 31/75] mm: Add lru_to_folio() Matthew Wilcox (Oracle)
2022-02-07  7:50   ` Christoph Hellwig
2022-02-11 20:24     ` Matthew Wilcox
2022-02-04 19:58 ` [PATCH 32/75] mm: Turn putback_lru_page() into folio_putback_lru() Matthew Wilcox (Oracle)
2022-02-07  7:50   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 33/75] mm/vmscan: Convert __remove_mapping() to take a folio Matthew Wilcox (Oracle)
2022-02-07  7:51   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 34/75] mm/vmscan: Turn page_check_dirty_writeback() into folio_check_dirty_writeback() Matthew Wilcox (Oracle)
2022-02-07  7:51   ` Christoph Hellwig
2022-02-12  1:49     ` Matthew Wilcox
2022-02-04 19:58 ` [PATCH 35/75] mm: Turn head_compound_mapcount() into folio_entire_mapcount() Matthew Wilcox (Oracle)
2022-02-07  7:52   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 36/75] mm: Add folio_mapcount() Matthew Wilcox (Oracle)
2022-02-07  7:53   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 37/75] mm: Add split_folio_to_list() Matthew Wilcox (Oracle)
2022-02-07  7:54   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 38/75] mm: Add folio_is_zone_device() and folio_is_device_private() Matthew Wilcox (Oracle)
2022-02-07  7:54   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 39/75] mm: Add folio_pgoff() Matthew Wilcox (Oracle)
2022-02-07  7:55   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 40/75] mm: Add pvmw_set_page() and pvmw_set_folio() Matthew Wilcox (Oracle)
2022-02-07  7:55   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 41/75] hexagon: Add pmd_pfn() Matthew Wilcox (Oracle)
2022-02-06 18:13   ` Mike Rapoport
2022-02-06 20:46     ` Matthew Wilcox
2022-02-06 21:33       ` Mike Rapoport
2022-02-06 22:05         ` Matthew Wilcox
2022-02-07 14:24           ` Mike Rapoport
2022-02-04 19:58 ` [PATCH 42/75] mm: Convert page_vma_mapped_walk to work on PFNs Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 43/75] mm/page_idle: Convert page_idle_clear_pte_refs() to use a folio Matthew Wilcox (Oracle)
2022-02-07  7:57   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 44/75] mm/rmap: Use a folio in page_mkclean_one() Matthew Wilcox (Oracle)
2022-02-07  7:57   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 45/75] mm/rmap: Turn page_referenced() into folio_referenced() Matthew Wilcox (Oracle)
2022-02-07  7:58   ` Christoph Hellwig
2022-02-04 19:58 ` [PATCH 46/75] mm/mlock: Turn clear_page_mlock() into folio_end_mlock() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 47/75] mm/mlock: Turn mlock_vma_page() into mlock_vma_folio() Matthew Wilcox (Oracle)
2022-02-07 10:46   ` Mike Rapoport
2022-02-04 19:58 ` [PATCH 48/75] mm/rmap: Turn page_mlock() into folio_mlock() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 49/75] mm/mlock: Turn munlock_vma_page() into munlock_vma_folio() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 50/75] mm/huge_memory: Convert __split_huge_pmd() to take a folio Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 51/75] mm/rmap: Convert try_to_unmap() " Matthew Wilcox (Oracle)
2022-02-09 14:24   ` Mauricio Faria de Oliveira
2022-02-09 14:29     ` Matthew Wilcox
2022-02-04 19:58 ` [PATCH 52/75] mm/rmap: Convert try_to_migrate() to folios Matthew Wilcox (Oracle)
2022-02-09 15:27   ` Zi Yan
2022-02-04 19:58 ` [PATCH 53/75] mm/rmap: Convert make_device_exclusive_range() to use folios Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 54/75] mm/migrate: Convert remove_migration_ptes() to folios Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 55/75] mm/damon: Convert damon_pa_mkold() to use a folio Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 56/75] mm/damon: Convert damon_pa_young() " Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 57/75] mm/rmap: Turn page_lock_anon_vma_read() into folio_lock_anon_vma_read() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 58/75] mm: Turn page_anon_vma() into folio_anon_vma() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 59/75] mm/rmap: Convert rmap_walk() to take a folio Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 60/75] mm/rmap: Constify the rmap_walk_control argument Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 61/75] mm/vmscan: Free non-shmem folios without splitting them Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 62/75] mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 63/75] mm/vmscan: Account large folios correctly Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 64/75] mm/vmscan: Turn page_check_references() into folio_check_references() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 65/75] mm/vmscan: Convert pageout() to take a folio Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 66/75] mm: Turn can_split_huge_page() into can_split_folio() Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 67/75] mm/filemap: Allow large folios to be added to the page cache Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 68/75] mm: Fix READ_ONLY_THP warning Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 69/75] mm: Make large folios depend on THP Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 70/75] mm: Support arbitrary THP sizes Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 71/75] mm/readahead: Add large folio readahead Matthew Wilcox (Oracle)
2022-02-06 13:10   ` Mark Hemment
2022-02-04 19:58 ` [PATCH 72/75] mm/readahead: Align file mappings for non-DAX Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 73/75] mm/readahead: Switch to page_cache_ra_order Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 74/75] mm/filemap: Support VM_HUGEPAGE for file mappings Matthew Wilcox (Oracle)
2022-02-04 19:58 ` [PATCH 75/75] selftests/vm/transhuge-stress: Support file-backed PMD folios Matthew Wilcox (Oracle)
2022-02-13 22:31 ` [PATCH 00/75] MM folio patches for 5.18 John Hubbard
2022-02-14  4:33 ` Matthew Wilcox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.