Skip to content

Commit

Permalink
x86-32, numa: Align pgdat size while initializing alloc_remap
Browse files Browse the repository at this point in the history
When pgdat is reserved in init_remap_allocator(), PAGE_SIZE aligned
size will be used.  Match the size alignment in initialization to
avoid allocation failure down the road.

Signed-off-by: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/1301955840-7246-3-git-send-email-tj@kernel.org
Acked-by: Yinghai Lu <yinghai@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
Tejun Heo authored and H. Peter Anvin committed Apr 7, 2011
1 parent 3fe14ab commit a6c24f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/mm/numa_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ static __init unsigned long calculate_numa_remap_pages(void)
node_end_pfn[nid] = max_pfn;

/* ensure the remap includes space for the pgdat. */
size = node_remap_size[nid] + sizeof(pg_data_t);
size = node_remap_size[nid];
size += ALIGN(sizeof(pg_data_t), PAGE_SIZE);

/* convert size to large (pmd size) pages, rounding up */
size = (size + LARGE_PAGE_BYTES - 1) / LARGE_PAGE_BYTES;
Expand Down

0 comments on commit a6c24f7

Please sign in to comment.