Re: [PATCH v2 2/2] mm: remove unused totalram_pages_inc() and totalram_pages_dec()
From: David Hildenbrand (Arm)
Date: Mon Sep 07 2026 - 10:17:15 EST
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@xxxxxxxxxx>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
> Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxx>
--
Cheers,
David