lkml.org 
[lkml]   [2009]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 21/25] Use allocation flags as an index to the zone watermark
On Wed, 22 Apr 2009, KOSAKI Motohiro wrote:

> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index 376d848..e61867e 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -1157,10 +1157,13 @@ failed:
> > return NULL;
> > }
> >
> > -#define ALLOC_NO_WATERMARKS 0x01 /* don't check watermarks at all */
> > -#define ALLOC_WMARK_MIN 0x02 /* use pages_min watermark */
> > -#define ALLOC_WMARK_LOW 0x04 /* use pages_low watermark */
> > -#define ALLOC_WMARK_HIGH 0x08 /* use pages_high watermark */
> > +/* The WMARK bits are used as an index zone->pages_mark */
> > +#define ALLOC_WMARK_MIN 0x00 /* use pages_min watermark */
> > +#define ALLOC_WMARK_LOW 0x01 /* use pages_low watermark */
> > +#define ALLOC_WMARK_HIGH 0x02 /* use pages_high watermark */
> > +#define ALLOC_NO_WATERMARKS 0x08 /* don't check watermarks at all */
> > +#define ALLOC_WMARK_MASK 0x07 /* Mask to get the watermark bits */
>
> the mask only use two bit. but mask definition is three bit (0x07), why?
>

I think it would probably be better to simply use

#define ALLOC_WMARK_MASK (ALLOC_NO_WATERMARKS - 1)

here and define ALLOC_NO_WATERMARKS to be 0x04.


\
 
 \ /
  Last update: 2009-04-22 02:45    [W:0.155 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site