Skip to contentSkip to conversation

memblock tests: add new pageblock related macro

PATCH Kefeng Wang 2 participants 2 messages Sep 7, 2022 – Sep 8, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Add new pageblock_start_pfn() and pageblock_align() macro which are needed by memblock tests.

---
 tools/testing/memblock/linux/mmzone.h | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/memblock/linux/mmzone.h +2 -0
index 7c2eb5c9bb54..e65f89b12f1c 100644
@@ -22,6 +22,8 @@ enum zone_type {
 
 #define pageblock_order		(MAX_ORDER - 1)
 #define pageblock_nr_pages	BIT(pageblock_order)
+#define pageblock_align(pfn)	ALIGN((pfn), pageblock_nr_pages)
+#define pageblock_start_pfn(pfn)	ALIGN_DOWN((pfn), pageblock_nr_pages)
 
 struct zone {
 	atomic_long_t		managed_pages;
Signature · 1 line
2.35.3
maintainer
#1 lore raw

Andrew,

Do you mind taking this along with the pageblock macros series?

Quoted 24 lines · Kefeng Wang

Add new pageblock_start_pfn() and pageblock_align() macro which are needed by memblock tests.

---
 tools/testing/memblock/linux/mmzone.h | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/memblock/linux/mmzone.h +2 -0
index 7c2eb5c9bb54..e65f89b12f1c 100644
@@ -22,6 +22,8 @@ enum zone_type {
 
 #define pageblock_order		(MAX_ORDER - 1)
 #define pageblock_nr_pages	BIT(pageblock_order)
+#define pageblock_align(pfn)	ALIGN((pfn), pageblock_nr_pages)
+#define pageblock_start_pfn(pfn)	ALIGN_DOWN((pfn), pageblock_nr_pages)
 
 struct zone {
 	atomic_long_t		managed_pages;
Signature · 1 line
2.35.3
Signature · 2 lines
Sincerely yours,
Mike.