[PATCH 3/3] mm: page_counter: drop protection fields from struct page_counter
From: linuszeng via B4 Relay
Date: Wed Sep 09 2026 - 04:27:22 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.
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 | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/include/linux/page_counter.h b/include/linux/page_counter.h
index b81f16702764..a4dd461523af 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;
@@ -73,6 +57,9 @@ struct page_counter {
* support memory.min/memory.low (swap, memsw, kmem, tcpmem, ...).
*/
struct page_counter_protection *prot;
+
+ /* Keep all the read most fields in a separete cacheline. */
+ CACHELINE_PADDING(_pad2_);
} ____cacheline_internodealigned_in_smp;
#if BITS_PER_LONG == 32
--
2.43.7