Skip to contentSkip to conversation

mm: remove dead code totalram_pages_set()

PATCH Superseded Wei Yang 3 participants 6 messages Dec 17, 2019 – Dec 18, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 mm: remove dead code totalram_pages_set()

No one use totalram_pages_set(), just remote it.

---
 include/linux/mm.h | 5 -----
 1 file changed, 5 deletions(-)
include/linux/mm.h +0 -5
index 74232b28949b..4cf023c4c6b3 100644
@@ -70,11 +70,6 @@ static inline void totalram_pages_add(long count)
 	atomic_long_add(count, &_totalram_pages);
 }
 
-static inline void totalram_pages_set(long val)
-{
-	atomic_long_set(&_totalram_pages, val);
-}
-
 extern void * high_memory;
 extern int page_cluster;
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Wei Yang

No one use totalram_pages_set(), just remote it.

s/use/uses/
s/remote/remove/

Quoted 13 lines
---
 include/linux/mm.h | 5 -----
 1 file changed, 5 deletions(-)
include/linux/mm.h +0 -0
index 74232b28949b..4cf023c4c6b3 100644
@@ -70,11 +70,6 @@ static inline void totalram_pages_add(long count)
 	atomic_long_add(count, &_totalram_pages);

include/linux/mm.h static inline void totalram_pages_add(long count) · line 75

Quoted 10 lines
include/linux/mm.h +0 -5
 }
 
-static inline void totalram_pages_set(long val)
-{
-	atomic_long_set(&_totalram_pages, val);
-}
-
 extern void * high_memory;
 extern int page_cluster;
 
Signature · 3 lines
Thanks,

David / dhildenb
author
#2 lore raw
Quoted 6 lines · David Hildenbrand
Quoted 1 line · Wei Yang

No one use totalram_pages_set(), just remote it.

s/use/uses/
s/remote/remove/

Thanks, my bad.

Quoted 30 lines
Quoted 13 lines
---
 include/linux/mm.h | 5 -----
 1 file changed, 5 deletions(-)
include/linux/mm.h +0 -0
index 74232b28949b..4cf023c4c6b3 100644
@@ -70,11 +70,6 @@ static inline void totalram_pages_add(long count)
 	atomic_long_add(count, &_totalram_pages);

include/linux/mm.h static inline void totalram_pages_add(long count) · line 75

Quoted 10 lines
include/linux/mm.h +0 -5
 }
 
-static inline void totalram_pages_set(long val)
-{
-	atomic_long_set(&_totalram_pages, val);
-}
-
 extern void * high_memory;
 extern int page_cluster;
 
Signature · 3 lines
Thanks,

David / dhildenb
Signature · 2 lines
Wei Yang
Help you, Help me
#3 lore raw
In reply to Wei Yang
Quoted 5 lines · Wei Yang

No one use totalram_pages_set(), just remote it.

It is unlikely that this is unintentional, but can you figure out which commit removed the last caller just in case?

author
#4 lore raw
Quoted 7 lines · Qian Cai
Quoted 5 lines · Wei Yang

No one use totalram_pages_set(), just remote it.

It is unlikely that this is unintentional, but can you figure out which commit removed the last caller just in case?

Took a look into the history. This function is introduced in

commit 'ca79b0c211af' (mm: convert totalram_pages and totalhigh_pages variables to atomic)

Even in this commit, no one use this function.

Will include this in next version.

Signature · 2 lines
Wei Yang
Help you, Help me
#5 lore raw
Quoted 10 lines · Wei Yang

Took a look into the history. This function is introduced in

commit 'ca79b0c211af' (mm: convert totalram_pages and totalhigh_pages variables to atomic)

Even in this commit, no one use this function.

It occurs to me that function was a part of API design as a placeholder which might be used in the future.