linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: memcontrol: fix the return in mem_cgroup_margin
@ 2016-05-18  7:24 roy.qing.li
  2016-05-18  7:32 ` Michal Hocko
  0 siblings, 1 reply; 8+ messages in thread
From: roy.qing.li @ 2016-05-18  7:24 UTC (permalink / raw)
  To: cgroups, linux-mm; +Cc: hannes, mhocko, vdavydov

From: Li RongQing <roy.qing.li@gmail.com>

when memory+swap is over limit, return 0

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 mm/memcontrol.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index fe787f5..e9211c2 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1090,6 +1090,8 @@ static unsigned long mem_cgroup_margin(struct mem_cgroup *memcg)
 		limit = READ_ONCE(memcg->memsw.limit);
 		if (count <= limit)
 			margin = min(margin, limit - count);
+		else
+			margin = 0;
 	}
 
 	return margin;
-- 
2.1.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-05-24  3:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-18  7:24 [PATCH] mm: memcontrol: fix the return in mem_cgroup_margin roy.qing.li
2016-05-18  7:32 ` Michal Hocko
2016-05-18  7:39   ` Li RongQing
2016-05-19  1:44   ` Li RongQing
2016-05-23 10:37     ` Vladimir Davydov
2016-05-23 12:06       ` Michal Hocko
2016-05-23 12:08         ` Michal Hocko
2016-05-24  3:07         ` Li RongQing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox