diff options
-rw-r--r-- | mm/page_alloc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 8404b36794ce..f0617cf88706 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4557,8 +4557,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); |