[Devel] [PATCH RHEL9 COMMIT] mm: Fix warn_on condition in mem_cgroup_migrate()

Konstantin Khorenko khorenko at virtuozzo.com
Mon Feb 13 11:20:09 MSK 2023


The commit is pushed to "branch-rh9-5.14.0-162.6.1.vz9.18.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-162.6.1.vz9.18.9
------>
commit e90d10199826de153dc93ed189b519e1dcd497ec
Author: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
Date:   Fri Feb 10 15:46:49 2023 +0200

    mm: Fix warn_on condition in mem_cgroup_migrate()
    
    WARN_ON used a wrong logic operator so the warning triggered
    with no reason. This slipped on rebase. Use the proper condition
    so the warning is valid.
    
    Fixes: b8bc3dbf5e18 ("mm: per memory cgroup page cache limit")
    
    https://jira.sw.ru/browse/PSBM-144609
    Signed-off-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2cfa29bff963..9f566fd438ef 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -7687,7 +7687,7 @@ void mem_cgroup_migrate(struct folio *old, struct folio *new)
 			page_counter_charge(&memcg->memsw, nr_pages);
 	}
 
-	WARN_ON((!PageAnon(&new->page) && !PageSwapBacked(&new->page)) |
+	WARN_ON((!PageAnon(&new->page) && !PageSwapBacked(&new->page)) !=
 		folio_memcg_cache(new));
 
 	if (folio_memcg_cache(new))


More information about the Devel mailing list