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.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -16,7 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | /* Policies */ |
| 19 | −enum { | |
| 19 | +enum mempolicy_mode { | |
| 20 | 20 | MPOL_DEFAULT, |
| 21 | 21 | MPOL_PREFERRED, |
| 22 | 22 | MPOL_BIND, |