mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] memcg: remove unused page-based helpers
@ 2026-09-18 16:55 Sang-Heon Jeon
  2026-09-18 16:55 ` [PATCH 1/2] memcg: remove unused page_memcg_check() Sang-Heon Jeon
  2026-09-18 16:55 ` [PATCH 2/2] memcg: remove unused mod_memcg_page_state() Sang-Heon Jeon
  0 siblings, 2 replies; 5+ messages in thread
From: Sang-Heon Jeon @ 2026-09-18 16:55 UTC (permalink / raw)
  To: Johannes Weiner, Michal Hocko, Roman Gushchin, Shakeel Butt
  Cc: cgroups, linux-kernel, linux-mm, Muchun Song

Hello,

While reading memcontrol.h, I found two page-based helpers that have
no callers.

No functional change.

Sang-Heon Jeon (2):
  memcg: remove unused page_memcg_check()
  memcg: remove unused mod_memcg_page_state()

 include/linux/memcontrol.h | 32 --------------------------------
 1 file changed, 32 deletions(-)

-- 
2.43.0


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

* [PATCH 1/2] memcg: remove unused page_memcg_check()
  2026-09-18 16:55 [PATCH 0/2] memcg: remove unused page-based helpers Sang-Heon Jeon
@ 2026-09-18 16:55 ` Sang-Heon Jeon
  2026-09-18 17:13   ` Shakeel Butt
  2026-09-18 16:55 ` [PATCH 2/2] memcg: remove unused mod_memcg_page_state() Sang-Heon Jeon
  1 sibling, 1 reply; 5+ messages in thread
From: Sang-Heon Jeon @ 2026-09-18 16:55 UTC (permalink / raw)
  To: Johannes Weiner, Michal Hocko, Roman Gushchin, Shakeel Butt
  Cc: cgroups, linux-kernel, linux-mm, Muchun Song

Since commit 90f095b816e2 ("mm/page_owner: use memcg_data snapshot to
avoid TOCTOU in print_page_owner_memcg()"), page_memcg_check() has no
callers.

So remove it.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 include/linux/memcontrol.h | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 64c183be8cbf..b57a74617b0b 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -498,13 +498,6 @@ static inline struct mem_cgroup *folio_memcg_check(const struct folio *folio)
 	return obj_cgroup_memcg(objcg);
 }
 
-static inline struct mem_cgroup *page_memcg_check(const struct page *page)
-{
-	if (PageTail(page))
-		return NULL;
-	return folio_memcg_check((const struct folio *)page);
-}
-
 static inline struct mem_cgroup *get_mem_cgroup_from_objcg(const struct obj_cgroup *objcg)
 {
 	struct mem_cgroup *memcg;
@@ -1100,11 +1093,6 @@ static inline struct mem_cgroup *folio_memcg_check(const struct folio *folio)
 	return NULL;
 }
 
-static inline struct mem_cgroup *page_memcg_check(const struct page *page)
-{
-	return NULL;
-}
-
 static inline struct mem_cgroup *get_mem_cgroup_from_objcg(const struct obj_cgroup *objcg)
 {
 	return NULL;
-- 
2.43.0


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

* [PATCH 2/2] memcg: remove unused mod_memcg_page_state()
  2026-09-18 16:55 [PATCH 0/2] memcg: remove unused page-based helpers Sang-Heon Jeon
  2026-09-18 16:55 ` [PATCH 1/2] memcg: remove unused page_memcg_check() Sang-Heon Jeon
@ 2026-09-18 16:55 ` Sang-Heon Jeon
  2026-09-18 17:14   ` Shakeel Butt
  1 sibling, 1 reply; 5+ messages in thread
From: Sang-Heon Jeon @ 2026-09-18 16:55 UTC (permalink / raw)
  To: Johannes Weiner, Michal Hocko, Roman Gushchin, Shakeel Butt
  Cc: cgroups, linux-kernel, linux-mm, Muchun Song

Since commit c466412c73c3 ("mm: memcontrol: switch to native NR_VMALLOC
vmstat counter"), mod_memcg_page_state() has no callers.

So remove it.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 include/linux/memcontrol.h | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index b57a74617b0b..c0557e1e3d21 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -949,21 +949,6 @@ void mem_cgroup_print_oom_group(struct mem_cgroup *memcg);
 void mod_memcg_state(struct mem_cgroup *memcg,
 		     enum memcg_stat_item idx, int val);
 
-static inline void mod_memcg_page_state(const struct page *page,
-					enum memcg_stat_item idx, int val)
-{
-	struct mem_cgroup *memcg;
-
-	if (mem_cgroup_disabled())
-		return;
-
-	rcu_read_lock();
-	memcg = folio_memcg(page_folio(page));
-	if (memcg)
-		mod_memcg_state(memcg, idx, val);
-	rcu_read_unlock();
-}
-
 unsigned long memcg_events(const struct mem_cgroup *memcg, int event);
 unsigned long memcg_page_state(const struct mem_cgroup *memcg, int idx);
 unsigned long memcg_page_state_output(const struct mem_cgroup *memcg, int item);
@@ -1396,11 +1381,6 @@ static inline void mod_memcg_state(struct mem_cgroup *memcg,
 {
 }
 
-static inline void mod_memcg_page_state(const struct page *page,
-					enum memcg_stat_item idx, int val)
-{
-}
-
 static inline unsigned long memcg_page_state(const struct mem_cgroup *memcg, int idx)
 {
 	return 0;
-- 
2.43.0


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

* Re: [PATCH 1/2] memcg: remove unused page_memcg_check()
  2026-09-18 16:55 ` [PATCH 1/2] memcg: remove unused page_memcg_check() Sang-Heon Jeon
@ 2026-09-18 17:13   ` Shakeel Butt
  0 siblings, 0 replies; 5+ messages in thread
From: Shakeel Butt @ 2026-09-18 17:13 UTC (permalink / raw)
  To: Sang-Heon Jeon
  Cc: Johannes Weiner, Michal Hocko, Roman Gushchin, cgroups,
	linux-kernel, linux-mm, Muchun Song

On Sat, Sep 19, 2026 at 01:55:57AM +0900, Sang-Heon Jeon wrote:
> Since commit 90f095b816e2 ("mm/page_owner: use memcg_data snapshot to
> avoid TOCTOU in print_page_owner_memcg()"), page_memcg_check() has no
> callers.
> 
> So remove it.
> 
> No functional change.
> 
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>

Acked-by: Shakeel Butt <shakeel.butt@linux.dev>

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

* Re: [PATCH 2/2] memcg: remove unused mod_memcg_page_state()
  2026-09-18 16:55 ` [PATCH 2/2] memcg: remove unused mod_memcg_page_state() Sang-Heon Jeon
@ 2026-09-18 17:14   ` Shakeel Butt
  0 siblings, 0 replies; 5+ messages in thread
From: Shakeel Butt @ 2026-09-18 17:14 UTC (permalink / raw)
  To: Sang-Heon Jeon
  Cc: Johannes Weiner, Michal Hocko, Roman Gushchin, cgroups,
	linux-kernel, linux-mm, Muchun Song

On Sat, Sep 19, 2026 at 01:55:58AM +0900, Sang-Heon Jeon wrote:
> Since commit c466412c73c3 ("mm: memcontrol: switch to native NR_VMALLOC
> vmstat counter"), mod_memcg_page_state() has no callers.
> 
> So remove it.
> 
> No functional change.
> 
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>

Acked-by: Shakeel Butt <shakeel.butt@linux.dev>

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-18 16:55 [PATCH 0/2] memcg: remove unused page-based helpers Sang-Heon Jeon
2026-09-18 16:55 ` [PATCH 1/2] memcg: remove unused page_memcg_check() Sang-Heon Jeon
2026-09-18 17:13   ` Shakeel Butt
2026-09-18 16:55 ` [PATCH 2/2] memcg: remove unused mod_memcg_page_state() Sang-Heon Jeon
2026-09-18 17:14   ` Shakeel Butt

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

all inboxes | Powered by JetHome®