[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20181121191511.658e0d41504e146edd88af53@linux-foundation.org>
Date: Wed, 21 Nov 2018 19:15:11 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Aaron Lu <aaron.lu@...el.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org,
Paweł Staszewski <pstaszewski@...are.pl>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Eric Dumazet <eric.dumazet@...il.com>,
Tariq Toukan <tariqt@...lanox.com>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Yoel Caspersen <yoel@...knet.dk>,
Mel Gorman <mgorman@...hsingularity.net>,
Saeed Mahameed <saeedm@...lanox.com>,
Michal Hocko <mhocko@...e.com>,
Vlastimil Babka <vbabka@...e.cz>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
Ian Kumlien <ian.kumlien@...il.com>
Subject: Re: [PATCH v2 RESEND update 1/2] mm/page_alloc: free order-0 pages
through PCP in page_frag_free()
On Tue, 20 Nov 2018 09:45:44 +0800 Aaron Lu <aaron.lu@...el.com> wrote:
> page_frag_free() calls __free_pages_ok() to free the page back to
> Buddy. This is OK for high order page, but for order-0 pages, it
> misses the optimization opportunity of using Per-Cpu-Pages and can
> cause zone lock contention when called frequently.
>
Looks nice to me. Let's tell our readers why we're doing this.
--- a/mm/page_alloc.c~mm-page_alloc-free-order-0-pages-through-pcp-in-page_frag_free-fix
+++ a/mm/page_alloc.c
@@ -4684,7 +4684,7 @@ void page_frag_free(void *addr)
if (unlikely(put_page_testzero(page))) {
unsigned int order = compound_order(page);
- if (order == 0)
+ if (order == 0) /* Via pcp? */
free_unref_page(page);
else
__free_pages_ok(page, order);
_
Powered by blists - more mailing lists