> Looks like he made the same mistake in the actual code comments: > > +/* Allocation type modifiers, group together if possible > + * __GPF_USER: Allocation for user page or a buffer page > + * __GFP_KERNRCLM: Short-lived or reclaimable kernel allocation > + */ > +#define __GFP_USER 0x40000u /* Kernel page that is easily reclaimable */ > +#define __GFP_KERNRCLM 0x80000u /* User is a userspace user */ > > I'd guess you meant to write more like the following: > > #define __GFP_USER 0x40000u /* Page for user address space */ > #define __GFP_KERNRCLM 0x80000u /* Kernel page that is easily reclaimable */ Yep. > > And the block comment seems to needlessly repeat the inline comments, > add a dubious claim, and omit the interesting stuff ... In other words: > > Does it actually matter if these two bits are grouped, or not? I > suspect that some of your other code, such as shifting the gfpmask by > RCLM_SHIFT bits, _requires_ that these two bits be adjacent. So the > "if possible" in the comment above is misleading. > > And I suspect that gfp.h should contain the RCLM_SHIFT define, or > at least mention in comment that RCLM_SHIFT depends on the position > of the above two __GFP_* bits. I'll add a comment here. > > And I don't see any mention in the comments in gfp.h that these > two bits, in tandem, have an additional meaning - both bits off > means, I guess, not reclaimable, well at least not easily. Yep, adding comment now. > > My HARDWALL patch appears to already be in Linus's kernel, so you > probably also need to do a global substitute of all instances in > the kernel of __GFP_HARDWALL, replacing it with __GFP_USER. Here > is the list of files I see affected, with a count of the number of > __GFP_HARDWALL strings in each: > > include/linux/gfp.h:4 > kernel/cpuset.c:6 > mm/page_alloc.c:2 > mm/vmscan.c:4 We may not be able to use the same flag after all due to our need to mark buffer pages as user. > > The comment in the next line looks like it needs to be changed to match > the code change: > > +#define __GFP_BITS_SHIFT 21 /* Room for 20 __GFP_FOO bits */ Yep. > > On the other hand, why did you change __GFP_BITS_SHIFT? Isn't 20 > enough - just enough? Yep. Fixed patch attached. Signed-off-by: Mel Gorman Signed-off-by: Joel Schopp