[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120704230350.GN25743@redhat.com>
Date: Thu, 5 Jul 2012 01:03:50 +0200
From: Andrea Arcangeli <aarcange@...hat.com>
To: Rik van Riel <riel@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Hillf Danton <dhillf@...il.com>, Dan Smith <danms@...ibm.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...e.hu>, Paul Turner <pjt@...gle.com>,
Suresh Siddha <suresh.b.siddha@...el.com>,
Mike Galbraith <efault@....de>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Lai Jiangshan <laijs@...fujitsu.com>,
Bharata B Rao <bharata.rao@...il.com>,
Lee Schermerhorn <Lee.Schermerhorn@...com>,
Johannes Weiner <hannes@...xchg.org>,
Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>,
Christoph Lameter <cl@...ux.com>,
Alex Shi <alex.shi@...el.com>,
Mauricio Faria de Oliveira <mauricfo@...ux.vnet.ibm.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Don Morris <don.morris@...com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: Re: [PATCH 06/40] autonuma: x86 pte_numa() and pmd_numa()
On Fri, Jun 29, 2012 at 11:02:41AM -0400, Rik van Riel wrote:
> On 06/28/2012 08:55 AM, Andrea Arcangeli wrote:
>
> > static inline int pte_file(pte_t pte)
> > {
> > - return pte_flags(pte)& _PAGE_FILE;
> > + return (pte_flags(pte)& _PAGE_FILE) == _PAGE_FILE;
> > }
>
> Wait, why is this change made? Surely _PAGE_FILE is just
> one single bit and this change is not useful?
>
> If there is a reason for this change, please document it.
I splitted it off to a separated patch with proper commit log here.
http://git.kernel.org/?p=linux/kernel/git/andrea/aa.git;a=commitdiff;h=7b2292c7ab86205f3d630533dc9987449fea6347
I haven't checked if it spawns the same warning without the patchset
applied, but I need the build not to show warnings, so while it may be
irrelevant warning for upstream, I don't like to have warnings.
> > static inline int pte_hidden(pte_t pte)
> > @@ -415,7 +417,46 @@ static inline int pte_hidden(pte_t pte)
> >
> > static inline int pmd_present(pmd_t pmd)
> > {
> > - return pmd_flags(pmd)& _PAGE_PRESENT;
> > + return pmd_flags(pmd)& (_PAGE_PRESENT | _PAGE_PROTNONE |
> > + _PAGE_NUMA_PMD);
> > +}
>
> Somewhat subtle. Better documentation in patch 5 will
> help explain this.
It's as subtle as PROTNONE but I added more explanation below as well
as in patch 5.
> > +#ifdef CONFIG_AUTONUMA
> > +static inline int pte_numa(pte_t pte)
> > +{
> > + return (pte_flags(pte)&
> > + (_PAGE_NUMA_PTE|_PAGE_PRESENT)) == _PAGE_NUMA_PTE;
> > +}
> > +
> > +static inline int pmd_numa(pmd_t pmd)
> > +{
> > + return (pmd_flags(pmd)&
> > + (_PAGE_NUMA_PMD|_PAGE_PRESENT)) == _PAGE_NUMA_PMD;
> > +}
> > +#endif
>
> These could use a little explanation of how _PAGE_NUMA_* is
> used and what the flags mean.
Added:
http://git.kernel.org/?p=linux/kernel/git/andrea/aa.git;a=commitdiff;h=0e6537227de32c40bbf0a5bc6b11d27ba5779e68
> > +static inline pte_t pte_mknotnuma(pte_t pte)
> > +{
> > + pte = pte_clear_flags(pte, _PAGE_NUMA_PTE);
> > + return pte_set_flags(pte, _PAGE_PRESENT|_PAGE_ACCESSED);
> > +}
> > +
> > +static inline pmd_t pmd_mknotnuma(pmd_t pmd)
> > +{
> > + pmd = pmd_clear_flags(pmd, _PAGE_NUMA_PMD);
> > + return pmd_set_flags(pmd, _PAGE_PRESENT|_PAGE_ACCESSED);
> > +}
> > +
> > +static inline pte_t pte_mknuma(pte_t pte)
> > +{
> > + pte = pte_set_flags(pte, _PAGE_NUMA_PTE);
> > + return pte_clear_flags(pte, _PAGE_PRESENT);
> > +}
> > +
> > +static inline pmd_t pmd_mknuma(pmd_t pmd)
> > +{
> > + pmd = pmd_set_flags(pmd, _PAGE_NUMA_PMD);
> > + return pmd_clear_flags(pmd, _PAGE_PRESENT);
> > }
>
> These functions could use some explanation, too.
>
> Why do the top ones set _PAGE_ACCESSED, while the bottom ones
> leave _PAGE_ACCESSED alone?
>
> I can guess the answer, but it should be documented so it is
> also clear to people with less experience in the VM.
Added too in prev link.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists