Johannes Weiner 3fbe724424 mm: memcontrol: simplify detecting when the memory+swap limit is hit
When attempting to charge pages, we first charge the memory counter and
then the memory+swap counter.  If one of the counters is at its limit, we
enter reclaim, but if it's the memory+swap counter, reclaim shouldn't swap
because that wouldn't change the situation.  However, if the counters have
the same limits, we never get to the memory+swap limit.  To know whether
reclaim should swap or not, there is a state flag that indicates whether
the limits are equal and whether hitting the memory limit implies hitting
the memory+swap limit.

Just try the memory+swap counter first.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Dave Hansen <dave@sr71.net>
Cc: Greg Thelen <gthelen@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-10-09 22:25:59 -04:00
..
2014-10-09 22:25:57 -04:00
2014-10-09 22:25:59 -04:00
2012-01-03 22:54:56 -05:00
2014-10-08 12:49:23 -04:00
2011-07-26 16:49:47 -07:00
2014-08-06 18:01:23 -07:00
2014-10-09 22:25:58 -04:00
2014-01-27 21:02:39 -08:00
2014-10-09 22:25:58 -04:00
2014-09-24 14:07:58 +02:00
2014-10-09 22:25:57 -04:00
2014-10-09 22:25:58 -04:00
2014-10-09 22:25:57 -04:00
2014-08-29 16:28:16 -07:00
2014-08-29 16:28:16 -07:00