Skip to contentSkip to conversation

about commit "[PATCH] Align the node_mem_map endpoints to a MAX_ORDER boundary"

RFC Wang YanQing 1 participant 1 message Mar 20, 2013 Memory management

lore
Share & tools
lore
#0 lore raw

Hi Mel Gorman and all, could you explain the code snippet below in commit e984bb43f7450312ba66fe0e67a99efa6be3b246 "[PATCH] Align the node_mem_map endpoints to a MAX_ORDER boundary" this commit had getted your ack-by.

"
start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); end = pgdat->node_start_pfn + pgdat->node_spanned_pages; end = ALIGN(end, MAX_ORDER_NR_PAGES);
size = (end - start) * sizeof(struct page);
map = alloc_remap(pgdat->node_id, size);
if (!map)

        map = alloc_bootmem_node(pgdat, size);

pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); "

MY QUESTION IS WHY WE NEED THIS TWO LINES BELOW:

"
start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); "
and
"
pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); "

Maybe we don't need this trick and can save some hundred bytes.

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>