Re: [PATCH 1/2] mm/page_alloc: free order-0 pages through PCP in page_frag_free()
From: Dave Hansen
Date: Mon Nov 05 2018 - 11:37:59 EST
On 11/5/18 12:58 AM, Aaron Lu wrote:
> - 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)
> + free_unref_page(page);
> + else
> + __free_pages_ok(page, order);
> + }
> }
This little hunk seems repeated in __free_pages() and
__page_frag_cache_drain(). Do we need a common helper?