[PATCH v2 3/3] mm: page_counter: drop protection fields from struct page_counter

From: linuszeng via B4 Relay

Date: Wed Sep 09 2026 - 06:03:00 EST


From: linuszeng <linuszeng@xxxxxxxxxxx>

The protection state now lives in struct page_counter_protection, so
remove the emin/min_usage/children_min_usage, elow/low_usage/
children_low_usage, min, low and protection_support fields from struct
page_counter.

Also drop the now-orphaned _pad2_ padding and its comment: with the
protection fields gone it no longer separates the read-mostly fields
from anything, and the structure's cacheline alignment already pads the
tail out.

swap/memsw, kmem, tcpmem and hugetlb counters no longer carry this
unused state: on 64-bit the structure shrinks from three cache lines to
two, saving one cache line.
---
include/linux/page_counter.h | 16 ----------------
1 file changed, 16 deletions(-)

diff --git a/include/linux/page_counter.h b/include/linux/page_counter.h
index b81f16702764..0007960ba5a4 100644
--- a/include/linux/page_counter.h
+++ b/include/linux/page_counter.h
@@ -43,27 +43,11 @@ struct page_counter {

CACHELINE_PADDING(_pad1_);

- /* effective memory.min and memory.min usage tracking */
- unsigned long emin;
- atomic_long_t min_usage;
- atomic_long_t children_min_usage;
-
- /* effective memory.low and memory.low usage tracking */
- unsigned long elow;
- atomic_long_t low_usage;
- atomic_long_t children_low_usage;
-
unsigned long watermark;
/* Latest cg2 reset watermark */
unsigned long local_watermark;

- /* Keep all the read most fields in a separete cacheline. */
- CACHELINE_PADDING(_pad2_);
-
- bool protection_support;
bool track_failcnt;
- unsigned long min;
- unsigned long low;
unsigned long high;
unsigned long max;
struct page_counter *parent;

--
2.43.7