[rh7] mm/memcg: correct timeout check.

Submitted by Andrey Ryabinin on Aug. 8, 2019, 9:32 a.m.

Details

Message ID 20190808093200.7399-1-aryabinin@virtuozzo.com
State New
Series "mm/memcg: correct timeout check."
Headers show

Commit Message

Andrey Ryabinin Aug. 8, 2019, 9:32 a.m.
We should use time_before() instead of time_after(), since we want
true value to repeat the loop before timeout reaches.

https://jira.sw.ru/browse/PSBM-96889
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 884f1596bb24..7a0b8815bd00 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4377,7 +4377,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),