[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <29246b53-11c6-13ab-b364-272e564da458@gmail.com>
Date: Thu, 15 Mar 2018 14:03:32 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Matthew Wilcox <willy@...radead.org>,
Alexander Duyck <alexander.h.duyck@...el.com>
Cc: linux-mm@...r.kernel.org, netdev@...r.kernel.org,
Matthew Wilcox <mawilcox@...rosoft.com>
Subject: Re: [RFC 2/2] page_frag_cache: Store metadata in struct page
On 03/15/2018 12:53 PM, Matthew Wilcox wrote:
> From: Matthew Wilcox <mawilcox@...rosoft.com>
>
> Shrink page_frag_cache from 24 to 8 bytes (a single pointer to the
> currently-in-use struct page) by using the page's refcount directly
> (instead of maintaining a bias) and storing our current progress through
> the page in the same bits currently used for page->index. We no longer
> need to reflect the page pfmemalloc state if we're storing the page
> directly.
>
> On the downside, we now call page_address() on every allocation, and we
> do an atomic_inc() rather than a non-atomic decrement, but we should
> touch the same number of cachelines and there is far less code (and
> the code is less complex).
>
> Signed-off-by: Matthew Wilcox <mawilcox@...rosoft.com>
> ---
One point about storing metadata not in struct page was to avoid false sharing.
consumers of page frags call put_page() thus touching page refcount.
With the pagecnt_bias (and other fields) we store in another cache line
(private to the producer) we amortize the access to the shared cache line only when needed.
Powered by blists - more mailing lists