diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b34348a41bfed628117458553196c4d385ed2782..dcc46d955df2e7a39fc4bfc1624581a0041bc9e6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4581,8 +4581,14 @@ void page_frag_free(void *addr) { struct page *page = virt_to_head_page(addr); - if (unlikely(put_page_testzero(page))) - __free_pages_ok(page, compound_order(page)); + if (unlikely(put_page_testzero(page))) { + unsigned int order = compound_order(page); + + if (order == 0) /* Via pcp? */ + free_unref_page(page); + else + __free_pages_ok(page, order); + } } EXPORT_SYMBOL(page_frag_free);