From: roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
To: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
Cc: hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
vdavydov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org
Subject: [PATCH] mm: memcontrol: fix the return in mem_cgroup_margin
Date: Wed, 18 May 2016 15:24:15 +0800 [thread overview]
Message-ID: <1463556255-31892-1-git-send-email-roy.qing.li@gmail.com> (raw)
From: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
when memory+swap is over limit, return 0
Signed-off-by: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
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
next reply other threads:[~2016-05-18 7:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-18 7:24 roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w [this message]
[not found] ` <1463556255-31892-1-git-send-email-roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-18 7:32 ` [PATCH] mm: memcontrol: fix the return in mem_cgroup_margin Michal Hocko
[not found] ` <20160518073253.GC21654-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
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
[not found] ` <20160523120620.GP2278-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2016-05-24 3:07 ` Li RongQing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463556255-31892-1-git-send-email-roy.qing.li@gmail.com \
--to=roy.qing.li-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=vdavydov-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox