Revert "mm/hugetlb: add folio_hstate()"

This reverts commit 6b27a1f253 which is
commit e51da3a9b6 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: I431cd23e83455c445568dc8dd589915bdb6594c4
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-07-20 12:50:01 +00:00
parent 6d38b404ee
commit 366b3a6494
2 changed files with 3 additions and 13 deletions

View File

@@ -863,15 +863,10 @@ static inline pte_t arch_make_huge_pte(pte_t entry, unsigned int shift,
}
#endif
static inline struct hstate *folio_hstate(struct folio *folio)
{
VM_BUG_ON_FOLIO(!folio_test_hugetlb(folio), folio);
return size_to_hstate(folio_size(folio));
}
static inline struct hstate *page_hstate(struct page *page)
{
return folio_hstate(page_folio(page));
VM_BUG_ON_PAGE(!PageHuge(page), page);
return size_to_hstate(page_size(page));
}
static inline unsigned hstate_index_to_shift(unsigned index)
@@ -1082,11 +1077,6 @@ static inline struct hstate *hstate_vma(struct vm_area_struct *vma)
return NULL;
}
static inline struct hstate *folio_hstate(struct folio *folio)
{
return NULL;
}
static inline struct hstate *page_hstate(struct page *page)
{
return NULL;

View File

@@ -1640,7 +1640,7 @@ struct page *alloc_migration_target(struct page *page, unsigned long private)
nid = folio_nid(folio);
if (folio_test_hugetlb(folio)) {
struct hstate *h = folio_hstate(folio);
struct hstate *h = page_hstate(&folio->page);
gfp_mask = htlb_modify_alloc_mask(h, gfp_mask);
return alloc_huge_page_nodemask(h, nid, mtc->nmask, gfp_mask);