Skip to contentSkip to conversation

mm: clean up obsolete check on space in page->flags

PATCH Applied Yu Zhao 2 participants 2 messages Dec 8, 2019 – Dec 9, 2019

Subsystems (2)
lore
Share & tools
lore

Yu Zhao

author
#0 lore raw

PATCH 1/1 mm: clean up obsolete check on space in page->flags

The check in linux/mm.h was intended to make sure we don't overrun page flags. But it's obsolete because it doesn't include LAST_CPUPID_WIDTH nor KASAN_TAG_WIDTH.

Just remove check since we already have it covered in linux/page-flags-layout.h (near the end of the file).

---
 include/linux/mm.h | 4 ----
 1 file changed, 4 deletions(-)
include/linux/mm.h +0 -4
index c97ea3b694e6..2e7596cce9d8 100644
@@ -921,10 +921,6 @@ vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf);
 
 #define ZONEID_PGSHIFT		(ZONEID_PGOFF * (ZONEID_SHIFT != 0))
 
-#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
-#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
-#endif
-
 #define ZONES_MASK		((1UL << ZONES_WIDTH) - 1)
 #define NODES_MASK		((1UL << NODES_WIDTH) - 1)
 #define SECTIONS_MASK		((1UL << SECTIONS_WIDTH) - 1)
Signature · 1 line
2.24.0.393.g34dc348eaf-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Yu Zhao

The check in linux/mm.h was intended to make sure we don't overrun page flags. But it's obsolete because it doesn't include LAST_CPUPID_WIDTH nor KASAN_TAG_WIDTH.

Just remove check since we already have it covered in linux/page-flags-layout.h (near the end of the file).

---
 include/linux/mm.h | 4 ----
 1 file changed, 4 deletions(-)
include/linux/mm.h +0 -0
index c97ea3b694e6..2e7596cce9d8 100644

include/linux/mm.h vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf); · line 926

Quoted 10 lines
include/linux/mm.h +0 -4
@@ -921,10 +921,6 @@ vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf);
 
 #define ZONEID_PGSHIFT		(ZONEID_PGOFF * (ZONEID_SHIFT != 0))
 
-#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
-#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
-#endif
-
 #define ZONES_MASK		((1UL << ZONES_WIDTH) - 1)
 #define NODES_MASK		((1UL << NODES_WIDTH) - 1)
 #define SECTIONS_MASK		((1UL << SECTIONS_WIDTH) - 1)
Signature · 3 lines
Thanks,

David / dhildenb