[v3,2/3] hugetlb: memcg: account hugetlb-backed memory in memory controller (fix)

Message ID 20231004194506.946908-1-nphamcs@gmail.com
State New
Headers
Series None |

Commit Message

Nhat Pham Oct. 4, 2023, 7:45 p.m. UTC
  Ensure hugetlb folio migration also transfers the memcg metadata.

This fixlet should be squashed to the following patch:
https://lore.kernel.org/lkml/20231003001828.2554080-3-nphamcs@gmail.com/
hugetlb: memcg: account hugetlb-backed memory in memory controller

Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Nhat Pham <nphamcs@gmail.com>
---
 mm/migrate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Andrew Morton Oct. 6, 2023, 5:25 p.m. UTC | #1
On Wed,  4 Oct 2023 12:45:06 -0700 Nhat Pham <nphamcs@gmail.com> wrote:

> Ensure hugetlb folio migration also transfers the memcg metadata.
> 
> This fixlet should be squashed to the following patch:
> https://lore.kernel.org/lkml/20231003001828.2554080-3-nphamcs@gmail.com/
> hugetlb: memcg: account hugetlb-backed memory in memory controller
> 

I've rather lost track of what's going on here.  I'll drop the series
"hugetlb memcg accounting" v3.  Please resend everything and let's try
again.
  
Nhat Pham Oct. 6, 2023, 6:23 p.m. UTC | #2
On Fri, Oct 6, 2023 at 10:25 AM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Wed,  4 Oct 2023 12:45:06 -0700 Nhat Pham <nphamcs@gmail.com> wrote:
>
> > Ensure hugetlb folio migration also transfers the memcg metadata.
> >
> > This fixlet should be squashed to the following patch:
> > https://lore.kernel.org/lkml/20231003001828.2554080-3-nphamcs@gmail.com/
> > hugetlb: memcg: account hugetlb-backed memory in memory controller
> >
>
> I've rather lost track of what's going on here.  I'll drop the series
> "hugetlb memcg accounting" v3.  Please resend everything and let's try
> again.
>

Sure thing! I'll send a v4 with everything cleaned up + squashed
in a moment. Apologies for the confusion.
  

Patch

diff --git a/mm/migrate.c b/mm/migrate.c
index 7d1804c4a5d9..6034c7ed1d65 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -633,8 +633,7 @@  void folio_migrate_flags(struct folio *newfolio, struct folio *folio)
 
 	folio_copy_owner(newfolio, folio);
 
-	if (!folio_test_hugetlb(folio))
-		mem_cgroup_migrate(folio, newfolio);
+	mem_cgroup_migrate(folio, newfolio);
 }
 EXPORT_SYMBOL(folio_migrate_flags);