On Mon, Apr 01, 2013 at 02:13:24PM +0300, Dan Carpenter wrote: > I still don't understand the code in gfp_to_alloc_flags(). > > int alloc_flags = ALLOC_WMARK_MIN | ALLOC_CPUSET; > > ORing with zero is odd. > Thanks Dan for the report and thanks Michal for fixing it. I was offline for last week which lead to my tardy response. The odditiy is that ALLOC_WMARK_MIN is not treated as a flag but as an offset within the zone->wmark so it starts as 0. It could have been written as int alloc_flags = ALLOC_CPUSET; but then it would be easy to forget that in this path we are using the MIN watermark. The "flag" is used as an offset because it eliminated a number of branches in the page allocator and was a micro-optimisation at the time. -- Mel Gorman SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>