aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index fc241fe295ab..36d713e216e8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -235,12 +235,11 @@ static void prep_compound_page(struct page *page, unsigned long order)
235 235
236 set_compound_page_dtor(page, free_compound_page); 236 set_compound_page_dtor(page, free_compound_page);
237 set_compound_order(page, order); 237 set_compound_order(page, order);
238 __SetPageCompound(page); 238 __SetPageHead(page);
239 for (i = 1; i < nr_pages; i++) { 239 for (i = 1; i < nr_pages; i++) {
240 struct page *p = page + i; 240 struct page *p = page + i;
241 241
242 __SetPageTail(p); 242 __SetPageTail(p);
243 __SetPageCompound(p);
244 p->first_page = page; 243 p->first_page = page;
245 } 244 }
246} 245}
@@ -253,17 +252,16 @@ static void destroy_compound_page(struct page *page, unsigned long order)
253 if (unlikely(compound_order(page) != order)) 252 if (unlikely(compound_order(page) != order))
254 bad_page(page); 253 bad_page(page);
255 254
256 if (unlikely(!PageCompound(page))) 255 if (unlikely(!PageHead(page)))
257 bad_page(page); 256 bad_page(page);
258 __ClearPageCompound(page); 257 __ClearPageHead(page);
259 for (i = 1; i < nr_pages; i++) { 258 for (i = 1; i < nr_pages; i++) {
260 struct page *p = page + i; 259 struct page *p = page + i;
261 260
262 if (unlikely(!PageCompound(p) | !PageTail(p) | 261 if (unlikely(!PageTail(p) |
263 (p->first_page != page))) 262 (p->first_page != page)))
264 bad_page(page); 263 bad_page(page);
265 __ClearPageTail(p); 264 __ClearPageTail(p);
266 __ClearPageCompound(p);
267 } 265 }
268} 266}
269 267