Skip to content

hugetlb: Remove is_file_hugepages() macro

Adam Litke linux-mm 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Define the shmem_inode_info flags directlyinclude/linux/shmem_fs.h mm/shmem.c+4 -40 replies
2/6hugetlb: share shmem_inode_infofs/hugetlbfs/inode.c include/linux/hugetlb.h include/linux/shmem_fs.h+10 -110 replies
3/6Use inode_info to annotate hugetlbfs shm segmentsfs/hugetlbfs/inode.c include/linux/shmem_fs.h ipc/shm.c+17 -60 replies
4/6hugetlb: hugetlbfs handles overcommit accounting privatelyfs/hugetlbfs/inode.c include/linux/backing-dev.h mm/mmap.c+9 -20 replies
5/6Abstract is_hugepage_only_rangefs/hugetlbfs/inode.c include/linux/fs.h mm/mmap.c+12 -130 replies
6/6hugetlb: Remove is_file_hugepages()include/linux/hugetlb.h+0 -120 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/6] hugetlb: Remove is_file_hugepages() macro

The kernel code is currently peppered with special casing for hugetlbfs mappings. In many places we check a struct file's f_op member to see if it points to the hugetlbfs file_operations in which case we'll employ some sort of workaround. The need to check file_operations in this manner suggests that we are either missing f_op operations, or have deficient abstraction elsewhere.

I am motivated to clean this up for two reasons: 1) The community has asked for huge pages to be kept "on the side" of the main VM. I believe these patches advance that goal. 2) Proper abstraction of hugetlbfs allows the underlying implementation to be changed without disturbing the main VM.

Removing the is_file_hugepages() macro involved finding all the call sites, determining the actual incompatibility that huge page mappings introduce, and applying a relatively trivial fix for the problem. The following patches perform this surgery.

When converting these, I have tried to use as general of a solution as possible. Review of some of the design decisions would be appreciated -- specifically the use of backing_dev_info for the note about special accounting, and hugetlbfs sharing the inode_info struct with shmem.

Thanks to Andy Whitcroft and others for review of the preliminary patches.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>