Skip to contentSkip to conversation

mm/vmstat: remove unused node and zone state helpers

PATCH Applied Wei Yang 4 participants 5 messages Dec 25, 2025 – Jan 6

Subsystems (2)
lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH v2 1/1 mm/vmstat: remove unused node and zone state helpers

Several helper functions for managing node and zone states have become obsolete and no longer have any callers within the kernel.

inc_node_state()
inc_zone_state()
dec_zone_state()

This commit removes the dead code.

---
 include/linux/vmstat.h |  6 ------
 mm/vmstat.c            | 15 ---------------
 2 files changed, 21 deletions(-)
include/linux/vmstat.h +0 -6
index 3398a345bda8..cf559e2ce1d4 100644
@@ -286,10 +286,8 @@ void mod_node_page_state(struct pglist_data *, enum node_stat_item, long);
 void inc_node_page_state(struct page *, enum node_stat_item);
 void dec_node_page_state(struct page *, enum node_stat_item);
 
-extern void inc_node_state(struct pglist_data *, enum node_stat_item);
 extern void __inc_zone_state(struct zone *, enum zone_stat_item);
 extern void __inc_node_state(struct pglist_data *, enum node_stat_item);
-extern void dec_zone_state(struct zone *, enum zone_stat_item);
 extern void __dec_zone_state(struct zone *, enum zone_stat_item);
 extern void __dec_node_state(struct pglist_data *, enum node_stat_item);
 
@@ -394,10 +392,6 @@ static inline void __dec_node_page_state(struct page *page,
 #define dec_node_page_state __dec_node_page_state
 #define mod_node_page_state __mod_node_page_state
 
-#define inc_zone_state __inc_zone_state
-#define inc_node_state __inc_node_state
-#define dec_zone_state __dec_zone_state
-
 #define set_pgdat_percpu_threshold(pgdat, callback) { }
 
 static inline void refresh_zone_stat_thresholds(void) { }
mm/vmstat.c +0 -15
index 090b5c5294b9..16b7cb24d411 100644
@@ -671,11 +671,6 @@ void mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item,
 }
 EXPORT_SYMBOL(mod_node_page_state);
 
-void inc_node_state(struct pglist_data *pgdat, enum node_stat_item item)
-{
-	mod_node_state(pgdat, item, 1, 1);
-}
-
 void inc_node_page_state(struct page *page, enum node_stat_item item)
 {
 	mod_node_state(page_pgdat(page), item, 1, 1);
@@ -724,16 +719,6 @@ void dec_zone_page_state(struct page *page, enum zone_stat_item item)
 }
 EXPORT_SYMBOL(dec_zone_page_state);
 
-void inc_node_state(struct pglist_data *pgdat, enum node_stat_item item)
-{
-	unsigned long flags;
-
-	local_irq_save(flags);
-	__inc_node_state(pgdat, item);
-	local_irq_restore(flags);
-}
-EXPORT_SYMBOL(inc_node_state);
-
 void mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item,
 					long delta)
 {
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · On Thu, 25 Dec 2025 21:02:13 +0000 Wei Yang <[email protected]> wrote:

Several helper functions for managing node and zone states have become obsolete and no longer have any callers within the kernel.

inc_node_state()
inc_zone_state()
dec_zone_state()

This commit removes the dead code.

LGTM, thanks!

Acked-by on v2 1/1
#2 lore raw
In reply to Wei Yang
Quoted 11 lines · Wei Yang

Several helper functions for managing node and zone states have become obsolete and no longer have any callers within the kernel.

inc_node_state()
inc_zone_state()
dec_zone_state()

This commit removes the dead code.

Quoted 64 lines
---
 include/linux/vmstat.h |  6 ------
 mm/vmstat.c            | 15 ---------------
 2 files changed, 21 deletions(-)
include/linux/vmstat.h +0 -6
index 3398a345bda8..cf559e2ce1d4 100644
@@ -286,10 +286,8 @@ void mod_node_page_state(struct pglist_data *, enum node_stat_item, long);
 void inc_node_page_state(struct page *, enum node_stat_item);
 void dec_node_page_state(struct page *, enum node_stat_item);
 
-extern void inc_node_state(struct pglist_data *, enum node_stat_item);
 extern void __inc_zone_state(struct zone *, enum zone_stat_item);
 extern void __inc_node_state(struct pglist_data *, enum node_stat_item);
-extern void dec_zone_state(struct zone *, enum zone_stat_item);
 extern void __dec_zone_state(struct zone *, enum zone_stat_item);
 extern void __dec_node_state(struct pglist_data *, enum node_stat_item);
 
@@ -394,10 +392,6 @@ static inline void __dec_node_page_state(struct page *page,
 #define dec_node_page_state __dec_node_page_state
 #define mod_node_page_state __mod_node_page_state
 
-#define inc_zone_state __inc_zone_state
-#define inc_node_state __inc_node_state
-#define dec_zone_state __dec_zone_state
-
 #define set_pgdat_percpu_threshold(pgdat, callback) { }
 
 static inline void refresh_zone_stat_thresholds(void) { }
mm/vmstat.c +0 -15
index 090b5c5294b9..16b7cb24d411 100644
@@ -671,11 +671,6 @@ void mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item,
 }
 EXPORT_SYMBOL(mod_node_page_state);
 
-void inc_node_state(struct pglist_data *pgdat, enum node_stat_item item)
-{
-	mod_node_state(pgdat, item, 1, 1);
-}
-
 void inc_node_page_state(struct page *page, enum node_stat_item item)
 {
 	mod_node_state(page_pgdat(page), item, 1, 1);
@@ -724,16 +719,6 @@ void dec_zone_page_state(struct page *page, enum zone_stat_item item)
 }
 EXPORT_SYMBOL(dec_zone_page_state);
 
-void inc_node_state(struct pglist_data *pgdat, enum node_stat_item item)
-{
-	unsigned long flags;
-
-	local_irq_save(flags);
-	__inc_node_state(pgdat, item);
-	local_irq_restore(flags);
-}
-EXPORT_SYMBOL(inc_node_state);
-
 void mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item,
 					long delta)
 {
maintainer Acked-by on v2 1/1
#3 lore raw
In reply to Wei Yang
Quoted 7 lines · Wei Yang

Several helper functions for managing node and zone states have become obsolete and no longer have any callers within the kernel.

inc_node_state()
inc_zone_state()
dec_zone_state()

Quoted 5 lines

This commit removes the dead code.

---

Note: It's good practice to describe below the "--" what changed between v1 and v2, and to not drop RBs/Acks for minor stuff.

Signature · 3 lines
Cheers

David
author
#4 lore raw
Quoted 8 lines · David Hildenbrand (Red Hat)
Quoted 7 lines · Wei Yang

Several helper functions for managing node and zone states have become obsolete and no longer have any callers within the kernel.

inc_node_state()
inc_zone_state()
dec_zone_state()

Quoted 9 lines
Quoted 5 lines

This commit removes the dead code.

---

Note: It's good practice to describe below the "--" what changed between v1 and v2, and to not drop RBs/Acks for minor stuff.

Got it, thanks.

Quoted 6 lines
Signature · 3 lines
Cheers

David
Signature · 2 lines
Wei Yang
Help you, Help me