aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index eec89ab39bb6..62c122528587 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -56,6 +56,7 @@ long nr_swap_pages;
56int percpu_pagelist_fraction; 56int percpu_pagelist_fraction;
57 57
58static void fastcall free_hot_cold_page(struct page *page, int cold); 58static void fastcall free_hot_cold_page(struct page *page, int cold);
59static void __free_pages_ok(struct page *page, unsigned int order);
59 60
60/* 61/*
61 * results with 256, 32 in the lowmem_reserve sysctl: 62 * results with 256, 32 in the lowmem_reserve sysctl:
@@ -173,12 +174,18 @@ static void bad_page(struct page *page)
173 * put_page() function. Its ->lru.prev holds the order of allocation. 174 * put_page() function. Its ->lru.prev holds the order of allocation.
174 * This usage means that zero-order pages may not be compound. 175 * This usage means that zero-order pages may not be compound.
175 */ 176 */
177
178static void free_compound_page(struct page *page)
179{
180 __free_pages_ok(page, (unsigned long)page[1].lru.prev);
181}
182
176static void prep_compound_page(struct page *page, unsigned long order) 183static void prep_compound_page(struct page *page, unsigned long order)
177{ 184{
178 int i; 185 int i;
179 int nr_pages = 1 << order; 186 int nr_pages = 1 << order;
180 187
181 page[1].lru.next = NULL; /* set dtor */ 188 page[1].lru.next = (void *)free_compound_page; /* set dtor */
182 page[1].lru.prev = (void *)order; 189 page[1].lru.prev = (void *)order;
183 for (i = 0; i < nr_pages; i++) { 190 for (i = 0; i < nr_pages; i++) {
184 struct page *p = page + i; 191 struct page *p = page + i;