From: Christoph Lameter There is still a problem after Andy's patch in connection with Optional ZONE DMA that I pointed out earlier. If we only have a single zone then ZONEID_PGSHIFT == 0. This is fine for the non NUMA case in which we have only a single zone and ZONEID_MASK == 0 too. page_zone_id() will always be 0. In the NUMA case we still have one zone per node. Thus we need to have a correct ZONEID_PGSHIFT in order to isolate the node number from page flags. Right now we take NODES_SHIFT bits starting from 0! I am not exactly sure how to fix that the right way given the complex nested macros. Andy may know. The following patch checks for that condition. We can only allow ZONEID_PGSHIFT to be zero if the ZONEID_MASK is also zero. (We cannot check that with an #if because ZONEID_SHIFT contains a "sizeof(...)" element) Signed-off-by: Christoph Lameter Cc: Andy Whitcroft Cc: Dave Hansen Signed-off-by: Andrew Morton --- include/linux/mm.h | 1 + 1 file changed, 1 insertion(+) diff -puN include/linux/mm.h~get-rid-of-zone_table-fix-2 include/linux/mm.h --- a/include/linux/mm.h~get-rid-of-zone_table-fix-2 +++ a/include/linux/mm.h @@ -445,6 +445,7 @@ static inline enum zone_type page_zonenu */ static inline int page_zone_id(struct page *page) { + BUG_ON(ZONEID_PGSHIFT == 0 && ZONEID_MASK); return (page->flags >> ZONEID_PGSHIFT) & ZONEID_MASK; } _