diff mbox series

[2/5] mm: migration of hugetlbfs page skip memcg

Message ID alpine.LSU.2.11.2008301359460.5954@eggly.anvils (mailing list archive)
State New, archived
Headers show
Series mm: fixes to past from future testing | expand

Commit Message

Hugh Dickins Aug. 30, 2020, 9:01 p.m. UTC
hugetlbfs pages do not participate in memcg: so although they do find
most of migrate_page_states() useful, it would be better if they did
not call into mem_cgroup_migrate() - where Qian Cai reported that LTP's
move_pages12 triggers the warning in Alex Shi's prospective commit
"mm/memcg: warning on !memcg after readahead page charged".

Signed-off-by: Hugh Dickins <hughd@google.com>
---
This fixes a likely future warning, but is just a cleanup right now.

 mm/migrate.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Shakeel Butt Aug. 31, 2020, 2:40 p.m. UTC | #1
On Sun, Aug 30, 2020 at 2:01 PM Hugh Dickins <hughd@google.com> wrote:
>
> hugetlbfs pages do not participate in memcg: so although they do find
> most of migrate_page_states() useful, it would be better if they did
> not call into mem_cgroup_migrate() - where Qian Cai reported that LTP's
> move_pages12 triggers the warning in Alex Shi's prospective commit
> "mm/memcg: warning on !memcg after readahead page charged".
>
> Signed-off-by: Hugh Dickins <hughd@google.com>

Reviewed-by: Shakeel Butt <shakeelb@google.com>
Johannes Weiner Sept. 1, 2020, 3:02 p.m. UTC | #2
On Sun, Aug 30, 2020 at 02:01:30PM -0700, Hugh Dickins wrote:
> hugetlbfs pages do not participate in memcg: so although they do find
> most of migrate_page_states() useful, it would be better if they did
> not call into mem_cgroup_migrate() - where Qian Cai reported that LTP's
> move_pages12 triggers the warning in Alex Shi's prospective commit
> "mm/memcg: warning on !memcg after readahead page charged".
> 
> Signed-off-by: Hugh Dickins <hughd@google.com>

Acked-by: Johannes Weiner <hannes@cmpxch.org>
diff mbox series

Patch

--- 5.9-rc2/mm/migrate.c	2020-08-16 17:32:50.665507048 -0700
+++ linux/mm/migrate.c	2020-08-28 17:42:07.967278385 -0700
@@ -668,7 +668,8 @@  void migrate_page_states(struct page *ne
 
 	copy_page_owner(page, newpage);
 
-	mem_cgroup_migrate(page, newpage);
+	if (!PageHuge(page))
+		mem_cgroup_migrate(page, newpage);
 }
 EXPORT_SYMBOL(migrate_page_states);