[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150320213449.GA19774@node.dhcp.inet.fi>
Date: Fri, 20 Mar 2015 23:34:49 +0200
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hughd@...gle.com>,
Dave Hansen <dave.hansen@...el.com>,
Mel Gorman <mgorman@...e.de>, Rik van Riel <riel@...hat.com>,
Vlastimil Babka <vbabka@...e.cz>,
Christoph Lameter <cl@...two.org>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
Steve Capper <steve.capper@...aro.org>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.cz>,
Jerome Marchand <jmarchan@...hat.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 03/16] page-flags: introduce page flags policies wrt
compound pages
On Fri, Mar 20, 2015 at 01:35:53PM -0700, Andrew Morton wrote:
> On Thu, 19 Mar 2015 19:08:09 +0200 "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com> wrote:
>
> > This patch third argument to macros which create function definitions
> > for page flags. This arguments defines how page-flags helpers behave
> > on compound functions.
> >
> > For now we define four policies:
> >
> > - ANY: the helper function operates on the page it gets, regardless if
> > it's non-compound, head or tail.
> >
> > - HEAD: the helper function operates on the head page of the compound
> > page if it gets tail page.
> >
> > - NO_TAIL: only head and non-compond pages are acceptable for this
> > helper function.
> >
> > - NO_COMPOUND: only non-compound pages are acceptable for this helper
> > function.
> >
> > For now we use policy ANY for all helpers, which match current
> > behaviour.
> >
> > We do not enforce the policy for TESTPAGEFLAG, because we have flags
> > checked for random pages all over the kernel. Noticeable exception to
> > this is PageTransHuge() which triggers VM_BUG_ON() for tail page.
> >
> > +/* Page flags policies wrt compound pages */
> > +#define ANY(page, enforce) page
> > +#define HEAD(page, enforce) compound_head(page)
> > +#define NO_TAIL(page, enforce) ({ \
> > +#define NO_COMPOUND(page, enforce) ({ \
> > ...
> >
> > +#undef ANY
> > +#undef HEAD
> > +#undef NO_TAIL
> > +#undef NO_COMPOUND
> > #endif /* !__GENERATING_BOUNDS_H */
>
> This is risky - there are existing definitions of ANY and HEAD, and
> this code may go and undefine them. This is improbable at present, as
> those definitions are in .c, after all includes. But still, it's not
> good to chew off great hunks of the namespace like this.
>
> So I think I'll prefix all these with "PF_", OK?
Yeah. That's fine.
--
Kirill A. Shutemov
--
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