Skip to content

hugetlb: Use PAGE granularity index in exported i/f and adopt the common read_iter

Jane Chu linux-doc linux-fsdevel linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest11 patches 8 repliesIn review

Changes in v2 from the cover letter

- new patches 1-4: add hwpoison handling to filemap_read(), thus replace hugetlbfs_read_iter() with generic_file_read_iter(), suggested by Matthew [2];
- new patch 5: convert hugetlb fault handler's vmf->pgoff to PAGE_SIZE granularity like the rest of mm fault handling convention, suggested by Matthew [2];
- patch 6: fixed a bug in v1 pointed out by Usama Arif, also by syzbot;
- patch 8: did not pick the Acked-by from Oscar (for 5/6 in v1) due to updates to the patch;
- patch 11: add VM_WARN_ON in hugetlb_unreserve_pages(), per Oscar;

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11mm/memory-failure: make is_raw_hwpoison_page_in_hugepage() general purposefs/hugetlbfs/inode.c include/linux/hugetlb.h mm/memory-failure.c+14 -61 reply
2/11mm: factor out adjust_range_hwpoison() from hugetlbfsfs/hugetlbfs/inode.c include/linux/fs.h include/linux/hugetlb.h +1 more+33 -301 reply
3/11mm/filemap: add hwpoison handling to filemap_read()mm/filemap.c+14 -20 replies
4/11hugetlbfs,filemap: replace hugetlbfs_read_iter() with generic_file_read_iter()fs/hugetlbfs/inode.c mm/filemap.c+14 -851 reply
5/11hugetlb: Convert the vmf->pgoff to PAGE_SIZE granularitymm/hugetlb.c+11 -92 replies
6/11hugetlb: make hugetlb_fault_mutex_hash() to take PAGE_SIZE indexfs/hugetlbfs/inode.c include/linux/hugetlb.h mm/hugetlb.c +2 more+25 -241 reply
7/11hugetlb: replace filemap_lock_hugetlb_folio with filemap_lock_foliofs/hugetlbfs/inode.c include/linux/hugetlb.h mm/hugetlb.c+3 -161 reply
8/11hugetlb: make hugetlb_add_to_page_cache() to take PAGE_SIZE granularity indexfs/hugetlbfs/inode.c mm/hugetlb.c mm/memfd.c+18 -150 replies
9/11hugetlb: remove the hugetlb_linear_page_index() helperinclude/linux/hugetlb.h+0 -170 replies
10/11hugetlb: drop vma_hugecache_offset() in favor of linear_page_index()mm/hugetlb.c+7 -140 replies
11/11hugetlb: make hugetlb_[un]reserve_pages() to take PAGE granularity indexDocumentation/mm/hugetlbfs_reserv.rst fs/hugetlbfs/inode.c mm/hugetlb.c +1 more+45 -420 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/11] hugetlb: Use PAGE granularity index in exported i/f and adopt the common read_iter

changes in v2:
- new patches 1-4: add hwpoison handling to filemap_read(), thus replace hugetlbfs_read_iter() with generic_file_read_iter(), suggested by Matthew [2];
- new patch 5: convert hugetlb fault handler's vmf->pgoff to PAGE_SIZE granularity like the rest of mm fault handling convention, suggested by Matthew [2];
- patch 6: fixed a bug in v1 pointed out by Usama Arif, also by syzbot;
- patch 8: did not pick the Acked-by from Oscar (for 5/6 in v1) due to updates to the patch;
- patch 11: add VM_WARN_ON in hugetlb_unreserve_pages(), per Oscar;

v1:
This series stems from a discussion with David. [1]
The series makes a small cleanup to a few hugetlb interfaces used outside the subsystem by standardizing them on base-page indices. Hopefully this makes the interface semantics a bit more coherent with the rest of mm, while the internal hugetlb code continue to use hugepage indices where that remains the more natural fit.

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://lore.kernel.org/linux-mm/[email protected]/

Jane Chu (11):
mm/memory-failure: make is_raw_hwpoison_page_in_hugepage() general
purpose
mm: factor out adjust_range_hwpoison() from hugetlbfs mm/filemap: add hwpoison handling to filemap_read() hugetlbfs,filemap: replace hugetlbfs_read_iter() with
generic_file_read_iter()
hugetlb: Convert the vmf->pgoff to PAGE_SIZE granularity
hugetlb: make hugetlb_fault_mutex_hash() to take PAGE_SIZE index
hugetlb: replace filemap_lock_hugetlb_folio with filemap_lock_folio
hugetlb: make hugetlb_add_to_page_cache() to take PAGE_SIZE
granularity index
hugetlb: remove the hugetlb_linear_page_index() helper
hugetlb: drop vma_hugecache_offset() in favor of linear_page_index()
hugetlb: make hugetlb_[un]reserve_pages() to take PAGE granularity
index

 Documentation/mm/hugetlbfs_reserv.rst |  19 ++--
 fs/hugetlbfs/inode.c                  | 155 ++++----------------------
 include/linux/fs.h                    |   2 +
 include/linux/hugetlb.h               |  36 +-----
 mm/filemap.c                          |  62 ++++++++++-
 mm/hugetlb.c                          |  87 ++++++++-------
 mm/memfd.c                            |  25 ++---
 mm/memory-failure.c                   |  12 +-
 mm/userfaultfd.c                      |   6 +-
 9 files changed, 164 insertions(+), 240 deletions(-)
Signature · 1 line
2.43.5