linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [Patch v2] mm/vmstat: remove unused node and zone state helpers
@ 2025-12-25 21:02 Wei Yang
  2025-12-27  5:49 ` Joshua Hahn
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wei Yang @ 2025-12-25 21:02 UTC (permalink / raw)
  To: akpm, david, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko
  Cc: linux-mm, Wei Yang, Joshua Hahn

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.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
---
 include/linux/vmstat.h |  6 ------
 mm/vmstat.c            | 15 ---------------
 2 files changed, 21 deletions(-)

diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 3398a345bda8..cf559e2ce1d4 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -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) { }
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 090b5c5294b9..16b7cb24d411 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -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)
 {
-- 
2.34.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch v2] mm/vmstat: remove unused node and zone state helpers
  2025-12-25 21:02 [Patch v2] mm/vmstat: remove unused node and zone state helpers Wei Yang
@ 2025-12-27  5:49 ` Joshua Hahn
  2026-01-05 11:25 ` Vlastimil Babka
  2026-01-05 15:23 ` David Hildenbrand (Red Hat)
  2 siblings, 0 replies; 5+ messages in thread
From: Joshua Hahn @ 2025-12-27  5:49 UTC (permalink / raw)
  To: Wei Yang
  Cc: akpm, david, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
	mhocko, linux-mm

On Thu, 25 Dec 2025 21:02:13 +0000 Wei Yang <richard.weiyang@gmail.com> 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.
> 
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> Cc: Joshua Hahn <joshua.hahnjy@gmail.com>

LGTM, thanks!

Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch v2] mm/vmstat: remove unused node and zone state helpers
  2025-12-25 21:02 [Patch v2] mm/vmstat: remove unused node and zone state helpers Wei Yang
  2025-12-27  5:49 ` Joshua Hahn
@ 2026-01-05 11:25 ` Vlastimil Babka
  2026-01-05 15:23 ` David Hildenbrand (Red Hat)
  2 siblings, 0 replies; 5+ messages in thread
From: Vlastimil Babka @ 2026-01-05 11:25 UTC (permalink / raw)
  To: Wei Yang, akpm, david, lorenzo.stoakes, Liam.Howlett, rppt,
	surenb, mhocko
  Cc: linux-mm, Joshua Hahn

On 12/25/25 22:02, Wei Yang 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.
> 
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> Cc: Joshua Hahn <joshua.hahnjy@gmail.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  include/linux/vmstat.h |  6 ------
>  mm/vmstat.c            | 15 ---------------
>  2 files changed, 21 deletions(-)
> 
> diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
> index 3398a345bda8..cf559e2ce1d4 100644
> --- a/include/linux/vmstat.h
> +++ b/include/linux/vmstat.h
> @@ -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) { }
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index 090b5c5294b9..16b7cb24d411 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -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)
>  {



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch v2] mm/vmstat: remove unused node and zone state helpers
  2025-12-25 21:02 [Patch v2] mm/vmstat: remove unused node and zone state helpers Wei Yang
  2025-12-27  5:49 ` Joshua Hahn
  2026-01-05 11:25 ` Vlastimil Babka
@ 2026-01-05 15:23 ` David Hildenbrand (Red Hat)
  2026-01-06 11:40   ` Wei Yang
  2 siblings, 1 reply; 5+ messages in thread
From: David Hildenbrand (Red Hat) @ 2026-01-05 15:23 UTC (permalink / raw)
  To: Wei Yang, akpm, lorenzo.stoakes, Liam.Howlett, vbabka, rppt,
	surenb, mhocko
  Cc: linux-mm, Joshua Hahn

On 12/25/25 22:02, Wei Yang 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.
> 
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
> ---

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

Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>

-- 
Cheers

David


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch v2] mm/vmstat: remove unused node and zone state helpers
  2026-01-05 15:23 ` David Hildenbrand (Red Hat)
@ 2026-01-06 11:40   ` Wei Yang
  0 siblings, 0 replies; 5+ messages in thread
From: Wei Yang @ 2026-01-06 11:40 UTC (permalink / raw)
  To: David Hildenbrand (Red Hat)
  Cc: Wei Yang, akpm, lorenzo.stoakes, Liam.Howlett, vbabka, rppt,
	surenb, mhocko, linux-mm, Joshua Hahn

On Mon, Jan 05, 2026 at 04:23:23PM +0100, David Hildenbrand (Red Hat) wrote:
>On 12/25/25 22:02, Wei Yang 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.
>> 
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
>> ---
>
>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.

>Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
>
>-- 
>Cheers
>
>David

-- 
Wei Yang
Help you, Help me


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-06 11:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-25 21:02 [Patch v2] mm/vmstat: remove unused node and zone state helpers Wei Yang
2025-12-27  5:49 ` Joshua Hahn
2026-01-05 11:25 ` Vlastimil Babka
2026-01-05 15:23 ` David Hildenbrand (Red Hat)
2026-01-06 11:40   ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox