[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160205170317.4906cba3@thinkpad>
Date: Fri, 5 Feb 2016 17:03:17 +0100
From: Gerald Schaefer <gerald.schaefer@...ibm.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Konstantin Khlebnikov <koct9i@...il.com>,
Michal Hocko <mhocko@...e.com>,
Vlastimil Babka <vbabka@...e.cz>,
Jerome Marchand <jmarchan@...hat.com>,
Johannes Weiner <hannes@...xchg.org>,
Mel Gorman <mgorman@...e.de>,
Dan Williams <dan.j.williams@...el.com>,
Ross Zwisler <ross.zwisler@...ux.intel.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Michael Holzheu <holzheu@...ux.vnet.ibm.com>
Subject: Re: [PATCH RFC 1/1] numa: fix /proc/<pid>/numa_maps for THP
On Fri, 5 Feb 2016 07:38:09 -0800
Dave Hansen <dave.hansen@...el.com> wrote:
> On 02/05/2016 07:34 AM, Gerald Schaefer wrote:
> > +static struct page *can_gather_numa_stats_pmd(pmd_t pmd,
> > + struct vm_area_struct *vma,
> > + unsigned long addr)
> > +{
>
> Is there a way to do this without making a copy of most of
> can_gather_numa_stats()? Seems like the kind of thing where the pmd
> version will bitrot.
>
Yes, that also gave me a little headache, even more with the vm_normal_page()
code duplication, but I didn't see a much better way. Separate _pte/_pmd
functions that largely do the same thing seem not so uncommon to me.
The best I could think of would be splitting the !HAVE_PTE_SPECIAL path
in vm_normal_page() into a separate function, but I see not much room for
improvement for can_gather_numa_stats(), other than maybe not having
a _pmd version at all and doing all the work inside gather_pte_stats(),
but that would probably just relocate the code duplication.
Powered by blists - more mailing lists