[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YrSPsqJHJTRcCmph@casper.infradead.org>
Date: Thu, 23 Jun 2022 17:07:14 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc: akpm@...ux-foundation.org, rppt@...ux.ibm.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v2 1/3] mm: Factor out the pagetable pages account
into new helper function
On Wed, Jun 22, 2022 at 04:58:52PM +0800, Baolin Wang wrote:
> +static inline void pgtable_set_and_inc(struct page *page)
> +{
> + __SetPageTable(page);
> + inc_lruvec_page_state(page, NR_PAGETABLE);
> +}
I don't like the names. The accounting is also wrong for non-order-0
allocations. It should be
mod_lruvec_page_state(page, NR_PAGETABLE, compound_nr(page))
but it's probably better to change the API to pass in the number of
pages instead of recalculating it.
I can't think of a good name. What's wrong with just adding
static inline bool pgtable_pud_page_ctor(struct page *page)
to go along with the pte and pmd variants?
Powered by blists - more mailing lists