Re: [PATCH v9 00/15] Use generic_file_read_iter() in hugetlbfs

"Lorenzo Stoakes (ARM)" <[email protected]>
Newsgroups org.kernel.vger.linux-fsdevel,org.kvack.linux-mm
Message-ID <an2B3q2apR0qrS_N@lucifer>
On Wed, Aug 05, 2026 at 10:05:40PM +0100, Matthew Wilcox (Oracle) wrote:
> 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 +++++---

Much as I'd like to not look at this, nor think about it, nor even admit that
any of this actually exists, I do co-maintain the rmap with David so please do
cc- me on future revisions :)

>  mm/shmem.c                 |   2 +-
>  mm/vmscan.c                |   2 +-
>  virt/kvm/guest_memfd.c     |   2 +-
>  17 files changed, 368 insertions(+), 269 deletions(-)
>
> --
> 2.47.3
>
>

--
Cheers, Lorenzo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.