Re: [PATCH 01 of 31] define MADV_HUGEPAGE

Andrea Arcangeli
2010-01-26T12:31:27Z

On Tue, Jan 26, 2010 at 11:41:01AM +0000, Mel Gorman wrote:
> On Mon, Jan 25, 2010 at 06:18:52PM +0100, Andrea Arcangeli wrote:
> > From: Andrea Arcangeli <aarcange@redhat.com>
> >
> > Define MADV_HUGEPAGE.
> >
> > Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
> > ---
> >
> > diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h
> > --- a/include/asm-generic/mman-common.h
> > +++ b/include/asm-generic/mman-common.h
> > @@ -45,6 +45,8 @@
> > #define MADV_MERGEABLE 12 /* KSM may merge identical pages */
> > #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
> >
> > +#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
> > +
>
> The use of 14 collides with parisc
>
> $ git grep MADV_ | grep define | grep 14
> arch/parisc/include/asm/mman.h:#define MADV_16K_PAGES 14 /* Use 16K pages */

Very error prone that you can register in arch file, there are 4
billions MADV_ available, the arch files shall be removed and it
should all be defined in mman-common.h.