Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mm: remove three unused helpers from mm.h
@ 2026-09-01 19:38 Tal Zussman
  2026-09-01 19:38 ` [PATCH v2 1/2] mm: remove unused mark_page_reserved() Tal Zussman
  2026-09-01 19:38 ` [PATCH v2 2/2] mm: remove unused totalram_pages_inc() and totalram_pages_dec() Tal Zussman
  0 siblings, 2 replies; 5+ messages in thread
From: Tal Zussman @ 2026-09-01 19:38 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko
  Cc: linux-mm, linux-kernel, Tal Zussman

I happened to notice these were unused. Two of them are relatively
recently unused, and one has been unused for a few years. Remove them.

---
Changes in v2:
- Apply tags (thanks Lorenzo & Mike!)
- Drop totalram_pages_inc() tools/include/linux/mm.h too, per Lorenzo.
- Link to v1: https://patch.msgid.link/20260901-mm-remove-unused-helpers-v1-0-f092d086f7dc@columbia.edu

---
Tal Zussman (2):
      mm: remove unused mark_page_reserved()
      mm: remove unused totalram_pages_inc() and totalram_pages_dec()

 include/linux/mm.h       | 16 ----------------
 tools/include/linux/mm.h |  4 ----
 2 files changed, 20 deletions(-)
---
base-commit: ead700ca770c82167af32622cf8b68c9f87c3c7c
change-id: 20260901-mm-remove-unused-helpers-33056049864c

Best regards,
--  
Tal Zussman <tz2294@columbia.edu>



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

* [PATCH v2 1/2] mm: remove unused mark_page_reserved()
  2026-09-01 19:38 [PATCH v2 0/2] mm: remove three unused helpers from mm.h Tal Zussman
@ 2026-09-01 19:38 ` Tal Zussman
  2026-09-07 14:08   ` David Hildenbrand (Arm)
  2026-09-01 19:38 ` [PATCH v2 2/2] mm: remove unused totalram_pages_inc() and totalram_pages_dec() Tal Zussman
  1 sibling, 1 reply; 5+ messages in thread
From: Tal Zussman @ 2026-09-01 19:38 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko
  Cc: linux-mm, linux-kernel, Tal Zussman

mark_page_reserved() lost its last caller in commit 6215d9f4470f ("arch,
mm: consolidate empty_zero_page"). Remove it.

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
---
 include/linux/mm.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1b28e6fc8d5d..e3736c42c4db 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -4080,12 +4080,6 @@ static inline void free_reserved_page(struct page *page)
 	free_reserved_pages(page, 0);
 }
 
-static inline void mark_page_reserved(struct page *page)
-{
-	SetPageReserved(page);
-	adjust_managed_page_count(page, -1);
-}
-
 static inline void free_reserved_ptdesc(struct ptdesc *pt)
 {
 	free_reserved_page(ptdesc_page(pt));

-- 
2.39.5



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

* [PATCH v2 2/2] mm: remove unused totalram_pages_inc() and totalram_pages_dec()
  2026-09-01 19:38 [PATCH v2 0/2] mm: remove three unused helpers from mm.h Tal Zussman
  2026-09-01 19:38 ` [PATCH v2 1/2] mm: remove unused mark_page_reserved() Tal Zussman
@ 2026-09-01 19:38 ` Tal Zussman
  2026-09-07 14:09   ` David Hildenbrand (Arm)
  1 sibling, 1 reply; 5+ messages in thread
From: Tal Zussman @ 2026-09-01 19:38 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko
  Cc: linux-mm, linux-kernel, Tal Zussman

totalram_pages_inc() and totalram_pages_dec() have had no callers since
commit 7fbc5e26123e ("memblock: extract page freeing from
free_reserved_area() into a helper") and commit 287b89773d81
("powerpc/pseries/cmm: Use adjust_managed_page_count() insted of
totalram_pages_*"), respectively. Remove them.

Drop the totalram_pages_inc() stub from tools mm.h too.

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
---
 include/linux/mm.h       | 10 ----------
 tools/include/linux/mm.h |  4 ----
 2 files changed, 14 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index e3736c42c4db..c105a3758915 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -57,16 +57,6 @@ static inline unsigned long totalram_pages(void)
 	return (unsigned long)atomic_long_read(&_totalram_pages);
 }
 
-static inline void totalram_pages_inc(void)
-{
-	atomic_long_inc(&_totalram_pages);
-}
-
-static inline void totalram_pages_dec(void)
-{
-	atomic_long_dec(&_totalram_pages);
-}
-
 static inline void totalram_pages_add(long count)
 {
 	atomic_long_add(count, &_totalram_pages);
diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h
index 84b5954f66c3..d586a510e6e1 100644
--- a/tools/include/linux/mm.h
+++ b/tools/include/linux/mm.h
@@ -33,10 +33,6 @@ static inline phys_addr_t virt_to_phys(volatile void *address)
 	return (phys_addr_t)address;
 }
 
-static inline void totalram_pages_inc(void)
-{
-}
-
 static inline void totalram_pages_add(long count)
 {
 }

-- 
2.39.5



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

* Re: [PATCH v2 1/2] mm: remove unused mark_page_reserved()
  2026-09-01 19:38 ` [PATCH v2 1/2] mm: remove unused mark_page_reserved() Tal Zussman
@ 2026-09-07 14:08   ` David Hildenbrand (Arm)
  0 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-07 14:08 UTC (permalink / raw)
  To: Tal Zussman, Andrew Morton, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko
  Cc: linux-mm, linux-kernel

On 9/1/26 21:38, Tal Zussman wrote:
> mark_page_reserved() lost its last caller in commit 6215d9f4470f ("arch,
> mm: consolidate empty_zero_page"). Remove it.
> 
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> Signed-off-by: Tal Zussman <tz2294@columbia.edu>
> ---
>  include/linux/mm.h | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 1b28e6fc8d5d..e3736c42c4db 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -4080,12 +4080,6 @@ static inline void free_reserved_page(struct page *page)
>  	free_reserved_pages(page, 0);
>  }
>  
> -static inline void mark_page_reserved(struct page *page)
> -{
> -	SetPageReserved(page);
> -	adjust_managed_page_count(page, -1);
> -}
> -

Good! The less PageReserved magic, the better.

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

-- 
Cheers,

David


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

* Re: [PATCH v2 2/2] mm: remove unused totalram_pages_inc() and totalram_pages_dec()
  2026-09-01 19:38 ` [PATCH v2 2/2] mm: remove unused totalram_pages_inc() and totalram_pages_dec() Tal Zussman
@ 2026-09-07 14:09   ` David Hildenbrand (Arm)
  0 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand (Arm) @ 2026-09-07 14:09 UTC (permalink / raw)
  To: Tal Zussman, Andrew Morton, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko
  Cc: linux-mm, linux-kernel

On 9/1/26 21:38, Tal Zussman wrote:
> totalram_pages_inc() and totalram_pages_dec() have had no callers since
> commit 7fbc5e26123e ("memblock: extract page freeing from
> free_reserved_area() into a helper") and commit 287b89773d81
> ("powerpc/pseries/cmm: Use adjust_managed_page_count() insted of
> totalram_pages_*"), respectively. Remove them.
> 
> Drop the totalram_pages_inc() stub from tools mm.h too.
> 
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> Signed-off-by: Tal Zussman <tz2294@columbia.edu>
> ---
>  include/linux/mm.h       | 10 ----------
>  tools/include/linux/mm.h |  4 ----
>  2 files changed, 14 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index e3736c42c4db..c105a3758915 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -57,16 +57,6 @@ static inline unsigned long totalram_pages(void)
>  	return (unsigned long)atomic_long_read(&_totalram_pages);
>  }
>  
> -static inline void totalram_pages_inc(void)
> -{
> -	atomic_long_inc(&_totalram_pages);
> -}
> -
> -static inline void totalram_pages_dec(void)
> -{
> -	atomic_long_dec(&_totalram_pages);
> -}
> -
>  static inline void totalram_pages_add(long count)
>  {
>  	atomic_long_add(count, &_totalram_pages);
> diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h
> index 84b5954f66c3..d586a510e6e1 100644
> --- a/tools/include/linux/mm.h
> +++ b/tools/include/linux/mm.h
> @@ -33,10 +33,6 @@ static inline phys_addr_t virt_to_phys(volatile void *address)
>  	return (phys_addr_t)address;
>  }
>  
> -static inline void totalram_pages_inc(void)
> -{
> -}
> -
>  static inline void totalram_pages_add(long count)
>  {
>  }
> 

Also very nice!

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

-- 
Cheers,

David


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

end of thread, other threads:[~2026-09-07 14:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 19:38 [PATCH v2 0/2] mm: remove three unused helpers from mm.h Tal Zussman
2026-09-01 19:38 ` [PATCH v2 1/2] mm: remove unused mark_page_reserved() Tal Zussman
2026-09-07 14:08   ` David Hildenbrand (Arm)
2026-09-01 19:38 ` [PATCH v2 2/2] mm: remove unused totalram_pages_inc() and totalram_pages_dec() Tal Zussman
2026-09-07 14:09   ` David Hildenbrand (Arm)

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