[Devel,rh7,2/7] mm/memcg: add missing hunk uncharge_kmem

Submitted by Andrey Ryabinin on March 31, 2017, 1:51 p.m.

Details

Message ID 20170331135111.16715-2-aryabinin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Andrey Ryabinin March 31, 2017, 1:51 p.m.
Commit 355ccab81bc9 (reapply of commit a60971691) missed hunk from
memcg_uncharge_kmem()

https://jira.sw.ru/browse/PSBM-62827
Fixes: 355ccab81bc9 ("mm: memcontrol: fix race between kmem uncharge and charge reparenting")
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/memcontrol.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e028861..6163e55 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3066,12 +3066,16 @@  void memcg_charge_kmem_nofail(struct mem_cgroup *memcg, unsigned long nr_pages)
 void memcg_uncharge_kmem(struct mem_cgroup *memcg,
 				unsigned long nr_pages)
 {
+	u64 kmem;
+
+	kmem = page_counter_uncharge(&memcg->kmem, nr_pages);
+
 	page_counter_uncharge(&memcg->memory, nr_pages);
 	if (do_swap_account)
 		page_counter_uncharge(&memcg->memsw, nr_pages);
 
 	/* Not down to 0 */
-	if (page_counter_uncharge(&memcg->kmem, nr_pages))
+	if (kmem)
 		return;
 
 	/*