Li RongQing cbedbac3e6 mm/memcontrol.c: fix the margin computation in mem_cgroup_margin()
mem_cgroup_margin() might return (memory.limit - memory_count) when the
memsw.limit is in excess.  This doesn't happen usually because we do not
allow excess on hard limits and (memory.limit <= memsw.limit), but
__GFP_NOFAIL charges can force the charge and cause the excess when no
memory is really swappable (swap is full or no anonymous memory is
left).

[mhocko@suse.com: rewrote changelog]
  Link: http://lkml.kernel.org/r/20160525155122.GK20132@dhcp22.suse.cz
Link: http://lkml.kernel.org/r/1464068266-27736-1-git-send-email-roy.qing.li@gmail.com
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-27 14:49:37 -07:00
..
2016-05-26 20:00:28 -07:00
2015-06-24 17:49:45 -07:00
2016-05-23 11:18:01 -07:00
2016-05-23 11:18:01 -07:00
2011-07-26 16:49:47 -07:00
2016-05-23 17:04:14 -07:00
2016-03-17 15:09:34 -07:00
2016-05-26 20:00:28 -07:00
2015-09-08 15:35:28 -07:00
2016-05-23 17:04:14 -07:00
2016-03-17 15:09:34 -07:00
2015-11-05 19:34:48 -08:00
2016-05-23 17:04:14 -07:00
2016-03-17 15:09:34 -07:00
2016-05-19 15:20:54 -06:00
2016-05-23 17:04:14 -07:00
2016-05-20 17:58:30 -07:00