mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
Merge 5b24eeef06 ("mm/page_alloc: split prep_compound_page into head and tail subparts") into android-mainline
Steps on the way to 5.17-rc1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ib542956cd675d577b7e7fdf1df45cdea2052bacf
This commit is contained in:
@@ -726,23 +726,33 @@ void free_compound_page(struct page *page)
|
||||
free_the_page(page, compound_order(page));
|
||||
}
|
||||
|
||||
static void prep_compound_head(struct page *page, unsigned int order)
|
||||
{
|
||||
set_compound_page_dtor(page, COMPOUND_PAGE_DTOR);
|
||||
set_compound_order(page, order);
|
||||
atomic_set(compound_mapcount_ptr(page), -1);
|
||||
if (hpage_pincount_available(page))
|
||||
atomic_set(compound_pincount_ptr(page), 0);
|
||||
}
|
||||
|
||||
static void prep_compound_tail(struct page *head, int tail_idx)
|
||||
{
|
||||
struct page *p = head + tail_idx;
|
||||
|
||||
p->mapping = TAIL_MAPPING;
|
||||
set_compound_head(p, head);
|
||||
}
|
||||
|
||||
void prep_compound_page(struct page *page, unsigned int order)
|
||||
{
|
||||
int i;
|
||||
int nr_pages = 1 << order;
|
||||
|
||||
__SetPageHead(page);
|
||||
for (i = 1; i < nr_pages; i++) {
|
||||
struct page *p = page + i;
|
||||
p->mapping = TAIL_MAPPING;
|
||||
set_compound_head(p, page);
|
||||
}
|
||||
for (i = 1; i < nr_pages; i++)
|
||||
prep_compound_tail(page, i);
|
||||
|
||||
set_compound_page_dtor(page, COMPOUND_PAGE_DTOR);
|
||||
set_compound_order(page, order);
|
||||
atomic_set(compound_mapcount_ptr(page), -1);
|
||||
if (hpage_pincount_available(page))
|
||||
atomic_set(compound_pincount_ptr(page), 0);
|
||||
prep_compound_head(page, order);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_PAGEALLOC
|
||||
|
||||
Reference in New Issue
Block a user