rename *MEMALLOC flags (was: Re: [RFC][PATCH 3/4] deadlockprevention core)

From: Peter Zijlstra
Date: Sat Aug 12 2006 - 11:05:03 EST


On Sat, 2006-08-12 at 10:41 -0400, Jeff Garzik wrote:
> Peter Zijlstra wrote:
> > Index: linux-2.6/include/linux/gfp.h
> > ===================================================================
> > --- linux-2.6.orig/include/linux/gfp.h 2006-08-12 12:56:06.000000000 +0200
> > +++ linux-2.6/include/linux/gfp.h 2006-08-12 12:56:09.000000000 +0200
> > @@ -46,6 +46,7 @@ struct vm_area_struct;
> > #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */
> > #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */
> > #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
> > +#define __GFP_MEMALLOC ((__force gfp_t)0x40000u) /* Use emergency reserves */
>
> This symbol name has nothing to do with its purpose. The entire area of
> code you are modifying could be described as having something to do with
> 'memalloc'.
>
> GFP_EMERGENCY or GFP_USE_RESERVES or somesuch would be a far better
> symbol name.
>
> I recognize that is matches with GFP_NOMEMALLOC, but that doesn't change
> the situation anyway. In fact, a cleanup patch to rename GFP_NOMEMALLOC
> would be nice.

I'm rather bad at picking names, but here goes:

PF_MEMALLOC -> PF_EMERGALLOC
__GFP_NOMEMALLOC -> __GFP_NOEMERGALLOC
__GFP_MEMALLOC -> __GFP_EMERGALLOC

Is that suitable and shall I prepare patches? Or do we want more ppl to
chime in and have a few more rounds?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/