aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/mmzone.h4
-rw-r--r--mm/sparse.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 09d381b71fd8..ae19af5ec02c 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1137,6 +1137,10 @@ struct mem_section {
1137 struct page_cgroup *page_cgroup; 1137 struct page_cgroup *page_cgroup;
1138 unsigned long pad; 1138 unsigned long pad;
1139#endif 1139#endif
1140 /*
1141 * WARNING: mem_section must be a power-of-2 in size for the
1142 * calculation and use of SECTION_ROOT_MASK to make sense.
1143 */
1140}; 1144};
1141 1145
1142#ifdef CONFIG_SPARSEMEM_EXTREME 1146#ifdef CONFIG_SPARSEMEM_EXTREME
diff --git a/mm/sparse.c b/mm/sparse.c
index 1c91f0d3f6ab..3194ec414728 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -481,6 +481,9 @@ void __init sparse_init(void)
481 struct page **map_map; 481 struct page **map_map;
482#endif 482#endif
483 483
484 /* see include/linux/mmzone.h 'struct mem_section' definition */
485 BUILD_BUG_ON(!is_power_of_2(sizeof(struct mem_section)));
486
484 /* Setup pageblock_order for HUGETLB_PAGE_SIZE_VARIABLE */ 487 /* Setup pageblock_order for HUGETLB_PAGE_SIZE_VARIABLE */
485 set_pageblock_order(); 488 set_pageblock_order();
486 489