linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mm, pageblock: make sure pageblock won't exceed mem_sectioin
@ 2018-12-05  9:19 Wei Yang
  2018-12-05  9:19 ` [PATCH 2/2] mm, page_alloc: cleanup usemap_size() when SPARSEMEM is not set Wei Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Wei Yang @ 2018-12-05  9:19 UTC (permalink / raw)
  To: linux-mm; +Cc: mgorman, akpm, Wei Yang

When SPARSEMEM is used, there is an indication that pageblock is not
allowed to exceed one mem_section. Current code doesn't have this
constrain explicitly.

This patch adds this to make sure it won't.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 include/linux/mmzone.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index be126113b499..8f3ce3a0c7d6 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1084,6 +1084,10 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn)
 #error Allocator MAX_ORDER exceeds SECTION_SIZE
 #endif
 
+#if (pageblock_order + PAGE_SHIFT) > SECTION_SIZE_BITS
+#error Allocator pageblock_order exceeds SECTION_SIZE
+#endif
+
 static inline unsigned long pfn_to_section_nr(unsigned long pfn)
 {
 	return pfn >> PFN_SECTION_SHIFT;
-- 
2.15.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-12-13  7:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05  9:19 [PATCH 1/2] mm, pageblock: make sure pageblock won't exceed mem_sectioin Wei Yang
2018-12-05  9:19 ` [PATCH 2/2] mm, page_alloc: cleanup usemap_size() when SPARSEMEM is not set Wei Yang
2018-12-07  9:58   ` Wei Yang
2018-12-05 11:15 ` [PATCH 1/2] mm, pageblock: make sure pageblock won't exceed mem_sectioin Mel Gorman
2018-12-05 12:08   ` Wei Yang
2018-12-05 15:37     ` Mel Gorman
2018-12-05 22:31       ` Wei Yang
2018-12-06  9:00         ` David Hildenbrand
2018-12-06  9:21           ` Wei Yang
2018-12-06  9:26             ` David Hildenbrand
2018-12-06  9:42               ` Wei Yang
2018-12-08  1:42 ` kbuild test robot
2018-12-09 12:03   ` Wei Yang
2018-12-13  2:26     ` Rong Chen
2018-12-13  3:08       ` Wei Yang
2018-12-13  5:02         ` Rong Chen
2018-12-13  7:28           ` Wei Yang
2018-12-09 13:58 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox