Re: [PATCH 2/2] mm: remove unused totalram_pages_inc() and totalram_pages_dec()
From: Tal Zussman
Date: Tue Sep 01 2026 - 10:34:42 EST
On 9/1/26 5:06 PM, Lorenzo Stoakes (ARM) wrote:
> On Tue, Sep 01, 2026 at 08:59:20AM -0400, 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.
>>
>> Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
>
> With additional change requested below addressed, LGTM and:
>
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
>
Thanks!
>> ---
>> include/linux/mm.h | 10 ----------
>> 1 file changed, 10 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);
>> -}
>
> I also see totalram_pages_inc() in tools/include/linux/mm.h - could you remove
> it too to keep things consistent? Thanks!
>
Yes, will do. For some reason I was under the impression that tools headers
are generally synced separately as needed, but that's clearly not the case...
Maybe I was thinking of the tools uapi headers.
>> -
>> -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);
>>
>> --
>> 2.39.5
>>
>
> --
> Cheers, Lorenzo
>