linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Remove redundant PageMemcgKmem(page) call
@ 2025-02-12  2:06 Shengken Lin
  2025-02-12  4:28 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Shengken Lin @ 2025-02-12  2:06 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Shengken Lin

The function of PageMemcgKmem(page) is the same as that of
folio_memcg_kmem(folio).

Since __memcg_kmem_uncharge_page already uses folio_memcg_kmem to check
if a folio has been uncharged, calling PageMemcgKmem(page) before
__memcg_kmem_uncharge_page is redundant.

Signed-off-by: Shengken Lin <shengken.lin@amlogic.com>
---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 579789600a3c..5a76760de495 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1055,7 +1055,7 @@ __always_inline bool free_pages_prepare(struct page *page,
 	trace_mm_page_free(page, order);
 	kmsan_free_page(page, order);

-	if (memcg_kmem_online() && PageMemcgKmem(page))
+	if (memcg_kmem_online())
 		__memcg_kmem_uncharge_page(page, order);

 	/*
--
2.34.1



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

end of thread, other threads:[~2025-02-20 13:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-12  2:06 [PATCH] mm: Remove redundant PageMemcgKmem(page) call Shengken Lin
2025-02-12  4:28 ` Matthew Wilcox
2025-02-20  9:47   ` Shengken.Lin
2025-02-20 13:22     ` Matthew Wilcox

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