[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190510225456.GA13529@iweiny-DESK2.sc.intel.com>
Date: Fri, 10 May 2019 15:54:56 -0700
From: Ira Weiny <ira.weiny@...el.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: "Huang, Ying" <ying.huang@...el.com>,
Yang Shi <yang.shi@...ux.alibaba.com>, hannes@...xchg.org,
mhocko@...e.com, mgorman@...hsingularity.net,
kirill.shutemov@...ux.intel.com, hughd@...gle.com,
akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: vmscan: correct nr_reclaimed for THP
On Fri, May 10, 2019 at 09:36:12AM -0700, Matthew Wilcox wrote:
> On Fri, May 10, 2019 at 10:12:40AM +0800, Huang, Ying wrote:
> > > + nr_reclaimed += (1 << compound_order(page));
> >
> > How about to change this to
> >
> >
> > nr_reclaimed += hpage_nr_pages(page);
>
> Please don't. That embeds the knowledge that we can only swap out either
> normal pages or THP sized pages. I'm trying to make the VM capable of
> supporting arbitrary-order pages, and this would be just one more place
> to fix.
>
> I'm sympathetic to the "self documenting" argument. My current tree has
> a patch in it:
>
> mm: Introduce compound_nr
>
> Replace 1 << compound_order(page) with compound_nr(page). Minor
> improvements in readability.
>
> It goes along with this patch:
>
> mm: Introduce page_size()
>
> It's unnecessarily hard to find out the size of a potentially huge page.
> Replace 'PAGE_SIZE << compound_order(page)' with page_size(page).
>
> Better suggestions on naming gratefully received. I'm more happy with
> page_size() than I am with compound_nr(). page_nr() gives the wrong
> impression; page_count() isn't great either.
Stupid question : what does 'nr' stand for?
Ira
Powered by blists - more mailing lists