mbox series

[RFC,v2,0/2] change ->index to PAGE_SIZE for hugetlb pages

Message ID 20230519220142.212051-1-sidhartha.kumar@oracle.com (mailing list archive)
Headers show
Series change ->index to PAGE_SIZE for hugetlb pages | expand

Message

Sidhartha Kumar May 19, 2023, 10:01 p.m. UTC
This RFC patchset attempts to implement a listed filemap TODO which is
changing hugetlb folios to have ->index in PAGE_SIZE. This simplifies many
functions within filemap.c as they have to special case hugetlb pages.
From the last RFC[1], Mike pointed out that hugetlb will have to maintain
a huge page sized index as well because it is used for the reservation
map as well as the hash function for the hugetlb mutex table.

This patchset adds new wrappers for hugetlb code to to interact with the
page cache. These wrappers calculate a linear page index as this is now
what the page cache expects for hugetlb pages as well.

This series passes the LTP hugetlb test cases. I will do more testing
and performance analysis but wanted to get some early feedback if this
approach is acceptable.

[1]:https://lore.kernel.org/lkml/20230425012721.GA6696@monkey/T/

Sidhartha Kumar (2):
  mm/filemap: remove hugetlb special casing in filemap.c
  mm/hugetlb: add wrapper functions for interactions with page cache

 fs/hugetlbfs/inode.c    | 14 +++++++-------
 include/linux/hugetlb.h | 21 +++++++++++++++++++--
 include/linux/pagemap.h |  8 --------
 mm/filemap.c            | 36 +++++++++++-------------------------
 mm/hugetlb.c            | 22 +++++++++++++---------
 5 files changed, 50 insertions(+), 51 deletions(-)