Skip to content

Use generic_file_read_iter() in hugetlbfs

Matthew Wilcox (Oracle) linux-fsdevel linux-mm stable 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest15 patches 38 repliesIn review
  2. v815 patches 30 repliesSuperseded
  3. v713 patches 17 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v612 patches8 repliesSuperseded
v512 patches6 repliesSuperseded
v414 patches23 repliesSuperseded
v39 patches2 repliesSuperseded
v210 patches15 repliesSuperseded
v14 patches3 repliesSuperseded

Changes from v7 from the cover letter

- Fix the KPF_HWPOISON blooper
- Expand HVO in a comment
- Collect R-b tags from Gregory & Jane

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15memory-failure: Fix hardware poison check in unpoison_memory() againmm/memory-failure.c+3 -20 replies
2/15memory-failure: Prevent hugetlb freeing during unpoisoninginclude/linux/hugetlb.h mm/memory-failure.c+24 -11 reply
3/15mm: Rename folio_contain_hwpoison_page() to folio_has_hwpoison_page()include/linux/page-flags.h mm/huge_memory.c mm/memory_hotplug.c +2 more+6 -61 reply
4/15hugetlb: Mark some function arguments as constinclude/linux/hugetlb.h mm/hugetlb.c+10 -110 replies
5/15guest_memfd: Use folio_has_hwpoisoned_page()virt/kvm/guest_memfd.c+1 -13 replies
6/15kpageflags: Use is_page_hwpoison() to set KPF_HWPOISONfs/proc/page.c+2 -63 replies
7/15hugetlb: Move poison to pages before clearing hugetlb page typemm/hugetlb.c+18 -130 replies
8/15hugetlb: Use the has_hwpoisoned flagfs/Kconfig fs/hugetlbfs/inode.c include/linux/page-flags.h +4 more+120 -4813 replies
9/15mm: Remove locking mf_mutex in is_raw_hwpoison_page_in_hugepage()fs/hugetlbfs/inode.c include/linux/hugetlb.h include/linux/mm_types.h +1 more+61 -532 replies
10/15mm: Check individual hugetlb pages for poisoninclude/linux/page-flags.h mm/memory-failure.c+39 -81 reply
11/15filemap: Add hwpoison handling to filemap_read()include/linux/hugetlb.h include/linux/page-flags.h mm/filemap.c+42 -44 replies
12/15filemap: Remove checks in mapping_set_folio_order_range()include/linux/pagemap.h+14 -201 reply
13/15hugetlb: Set mapping folio orderfs/hugetlbfs/inode.c+11 -22 replies
14/15filemap: Add support for authoritative mappingsinclude/linux/pagemap.h mm/filemap.c+29 -04 replies
15/15hugetlb: replace hugetlbfs_read_iter() with generic_file_read_iter()fs/hugetlbfs/inode.c+2 -1081 reply

Reviews trailers per patch

14 of 15 patches have a Reviewed-by or Acked-by.

PatchJane ChuGregory Price (Meta)Miaohe LinUsama ArifSean ChristophersonAckerley TngDavid Hildenbrand (Arm)Pedro Falcato
1/15R-b R-b R-b
2/15R-b R-b R-b
3/15R-b R-b R-b A-b A-b
4/15R-b R-b R-b A-b
5/15R-b R-b A-b R-b A-b
6/15R-b R-b
7/15R-b R-b R-b
8/15R-b R-b R-b
9/15R-b R-b R-b
10/15R-b R-b R-b
11/15
12/15R-b R-b R-b
13/15R-b R-b R-b R-b
14/15R-b R-b
15/15R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.

Read the v9 thread

Cover letter [PATCH v9 00/15] Use generic_file_read_iter() in hugetlbfs

This set of patches are separated out from Jane's earlier series.
https://lore.kernel.org/linux-mm/[email protected]/

We need three things to use filemap_read_iter() instead of a hugetlbfs specific read_iter: hwpoison handling, treating gaps in the pagecache as holes, and having hugetlb set the folio size in the mapping. hwopison handling turned out to need a lot of prep work; the other two things are fairly straightforward.

Sashiko complains that the implementation of AS_AUTHORITATIVE is incomplete, but hugetlbfs doesn't use any of that functionality. We'll add it when we need it, either when hugetlbfs uses it, or when we convert shmem to use filemap.

v8 here:
https://lore.kernel.org/linux-mm/[email protected]/

Changes from v7:
- Fix the KPF_HWPOISON blooper
- Expand HVO in a comment
- Collect R-b tags from Gregory & Jane

Jane Chu (2):
filemap: Add hwpoison handling to filemap_read()
hugetlb: replace hugetlbfs_read_iter() with generic_file_read_iter()

Matthew Wilcox (Oracle) (13):
memory-failure: Fix hardware poison check in unpoison_memory() again
memory-failure: Prevent hugetlb freeing during unpoisoning
mm: Rename folio_contain_hwpoison_page() to folio_has_hwpoison_page()
hugetlb: Mark some function arguments as const
guest_memfd: Use folio_has_hwpoisoned_page()
kpageflags: Use is_page_hwpoison() to set KPF_HWPOISON
hugetlb: Move poison to pages before clearing hugetlb page type
hugetlb: Use the has_hwpoisoned flag
mm: Remove locking mf_mutex in is_raw_hwpoison_page_in_hugepage()
mm: Check individual hugetlb pages for poison
filemap: Remove checks in mapping_set_folio_order_range()
hugetlb: Set mapping folio order
filemap: Add support for authoritative mappings

 fs/Kconfig                 |   2 +-
 fs/hugetlbfs/inode.c       | 123 +++--------------------
 fs/proc/page.c             |   8 +-
 include/linux/hugetlb.h    |  43 +++++---
 include/linux/mm_types.h   |   4 +-
 include/linux/page-flags.h |  64 ++++++++++--
 include/linux/pagemap.h    |  45 +++++----
 mm/Kconfig                 |   6 +-
 mm/filemap.c               |  51 +++++++++-
 mm/huge_memory.c           |   2 +-
 mm/hugetlb.c               |  41 ++++----
 mm/memory-failure.c        | 197 +++++++++++++++++++++++++------------
 mm/memory_hotplug.c        |   2 +-
 mm/rmap.c                  |  43 +++++---
 mm/shmem.c                 |   2 +-
 mm/vmscan.c                |   2 +-
 virt/kvm/guest_memfd.c     |   2 +-
 17 files changed, 368 insertions(+), 269 deletions(-)
Signature · 1 line
2.47.3