Revert "mm/hugetlb: add hugetlb_folio_subpool() helpers"

This reverts commit 6a8af731a1 which is
commit 149562f750 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: I2987d07bc7063ecb38b8565a2dbd943fdf251aa2
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-07-20 12:50:20 +00:00
parent 366b3a6494
commit edd74f93c0
2 changed files with 6 additions and 17 deletions

View File

@@ -1108,10 +1108,10 @@ static int hugetlbfs_migrate_folio(struct address_space *mapping,
if (rc != MIGRATEPAGE_SUCCESS) if (rc != MIGRATEPAGE_SUCCESS)
return rc; return rc;
if (hugetlb_folio_subpool(src)) { if (hugetlb_page_subpool(&src->page)) {
hugetlb_set_folio_subpool(dst, hugetlb_set_page_subpool(&dst->page,
hugetlb_folio_subpool(src)); hugetlb_page_subpool(&src->page));
hugetlb_set_folio_subpool(src, NULL); hugetlb_set_page_subpool(&src->page, NULL);
} }
if (mode != MIGRATE_SYNC_NO_COPY) if (mode != MIGRATE_SYNC_NO_COPY)

View File

@@ -754,29 +754,18 @@ extern unsigned int default_hstate_idx;
#define default_hstate (hstates[default_hstate_idx]) #define default_hstate (hstates[default_hstate_idx])
static inline struct hugepage_subpool *hugetlb_folio_subpool(struct folio *folio)
{
return (void *)folio_get_private_1(folio);
}
/* /*
* hugetlb page subpool pointer located in hpage[1].private * hugetlb page subpool pointer located in hpage[1].private
*/ */
static inline struct hugepage_subpool *hugetlb_page_subpool(struct page *hpage) static inline struct hugepage_subpool *hugetlb_page_subpool(struct page *hpage)
{ {
return hugetlb_folio_subpool(page_folio(hpage)); return (void *)page_private(hpage + SUBPAGE_INDEX_SUBPOOL);
}
static inline void hugetlb_set_folio_subpool(struct folio *folio,
struct hugepage_subpool *subpool)
{
folio_set_private_1(folio, (unsigned long)subpool);
} }
static inline void hugetlb_set_page_subpool(struct page *hpage, static inline void hugetlb_set_page_subpool(struct page *hpage,
struct hugepage_subpool *subpool) struct hugepage_subpool *subpool)
{ {
hugetlb_set_folio_subpool(page_folio(hpage), subpool); set_page_private(hpage + SUBPAGE_INDEX_SUBPOOL, (unsigned long)subpool);
} }
static inline struct hstate *hstate_file(struct file *f) static inline struct hstate *hstate_file(struct file *f)