[Devel] [PATCH RHEL7 COMMIT] mm/memcg: correct timeout check.

Konstantin Khorenko khorenko at virtuozzo.com
Thu Aug 8 18:02:41 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.21.3.vz7.106.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.21.3.vz7.106.10
------>
commit e74167daa6f70ed6c78e7a2e861e9bf751e8f424
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Thu Aug 8 18:02:39 2019 +0300

    mm/memcg: correct timeout check.
    
    We should use time_before() instead of time_after(), since we want
    true value to repeat the loop before timeout reaches.
    
    Fixes: 6c56498a819e ("mm/memcg: use timeout instead of iteration count to
    determine leak.")
    
    https://jira.sw.ru/browse/PSBM-96889
    Signed-off-by: Andrey Ryabinin <aryabinin 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 5271921766d3..817299be726f 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4378,7 +4378,7 @@ static void mem_cgroup_reparent_charges(struct mem_cgroup *memcg)
 		 * charge before adding to the LRU.
 		 */
 	} while ((page_counter_read(&memcg->memory) -
-		 page_counter_read(&memcg->kmem) > 0) && time_after(jiffies, timeout));
+		 page_counter_read(&memcg->kmem) > 0) && time_before(jiffies, timeout));
 
 	WARN_ONCE((page_counter_read(&memcg->memory) -
 			page_counter_read(&memcg->kmem) > 0),



More information about the Devel mailing list