History

mm: hugetlb: move mpol interpretation out of alloc_buddy_hugetlb_folio_with_mpol()

Move memory policy interpretation out of alloc_buddy_hugetlb_folio_with_mpol() and into alloc_hugetlb_folio() to separate reading and interpretation of memory policy from actual allocation. This will later allow memory policy to be interpreted outside of the process of allocating a hugetlb folio entirely. This opens doors for other callers of the HugeTLB folio allocation function, such as guest_memfd, where memory may not always be mapped and hence may not have an associated vma. Introduce struct mempolicy_interpreted to hold all the components of an interpreted memory policy. Rename alloc_buddy_hugetlb_folio_with_mpol() to alloc_buddy_hugetlb_folio() since the function no longer interprets memory policy. No functional change intended.

Ackerley Tng committed 4 months ago

Commit 66a4e9e1 parent 88819612 files · +37 −19Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/mempolicy.h+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
16 */16 */
17 17
18/* Policies */18/* Policies */
19enum {19enum mempolicy_mode {
20 MPOL_DEFAULT,20 MPOL_DEFAULT,
21 MPOL_PREFERRED,21 MPOL_PREFERRED,
22 MPOL_BIND,22 MPOL_BIND,