Files
linux/include/linux
Ying Han 0ae5e89c60 memcg: count the soft_limit reclaim in global background reclaim
The global kswapd scans per-zone LRU and reclaims pages regardless of the
cgroup. It breaks memory isolation since one cgroup can end up reclaiming
pages from another cgroup. Instead we should rely on memcg-aware target
reclaim including per-memcg kswapd and soft_limit hierarchical reclaim under
memory pressure.

In the global background reclaim, we do soft reclaim before scanning the
per-zone LRU. However, the return value is ignored. This patch is the first
step to skip shrink_zone() if soft_limit reclaim does enough work.

This is part of the effort which tries to reduce reclaiming pages in global
LRU in memcg. The per-memcg background reclaim patchset further enhances the
per-cgroup targetting reclaim, which I should have V4 posted shortly.

Try running multiple memory intensive workloads within seperate memcgs. Watch
the counters of soft_steal in memory.stat.

  $ cat /dev/cgroup/A/memory.stat | grep 'soft'
  soft_steal 240000
  soft_scan 240000
  total_soft_steal 240000
  total_soft_scan 240000

This patch:

In the global background reclaim, we do soft reclaim before scanning the
per-zone LRU.  However, the return value is ignored.

We would like to skip shrink_zone() if soft_limit reclaim does enough
work.  Also, we need to make the memory pressure balanced across per-memcg
zones, like the logic vm-core.  This patch is the first step where we
start with counting the nr_scanned and nr_reclaimed from soft_limit
reclaim into the global scan_control.

Signed-off-by: Ying Han <yinghan@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Acked-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-26 17:12:35 -07:00
..
2011-03-31 11:26:23 -03:00
2011-05-04 14:08:36 -07:00
2011-03-31 11:26:23 -03:00
2011-05-26 19:45:40 +02:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-01 22:24:19 +03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2010-03-12 15:53:10 -08:00
2011-02-24 19:58:42 +01:00
2010-10-15 21:18:59 +02:00
2011-01-20 18:30:17 -08:00
2010-11-23 20:14:46 +00:00
2010-05-27 09:12:53 -07:00
2011-01-31 14:03:00 -08:00
2011-01-15 20:07:45 -05:00
2011-03-10 08:52:07 +01:00
2011-03-22 17:43:59 -07:00
2011-03-11 14:25:50 +00:00
2010-06-24 21:30:09 -07:00
2011-03-31 11:26:23 -03:00
2010-12-16 17:53:38 +01:00
2011-03-31 11:26:23 -03:00
2011-05-26 17:12:34 -07:00
2011-05-26 17:12:34 -07:00
2011-03-31 11:26:23 -03:00
2010-10-25 08:02:40 -07:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-22 17:44:15 -07:00
2011-05-13 11:45:33 -07:00
2011-01-10 08:51:44 -08:00
2010-05-19 22:41:57 -04:00
2010-08-04 11:00:45 +02:00
2011-05-23 10:47:06 -05:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-10 11:35:17 +01:00
2011-05-24 10:21:29 +02:00
2011-05-24 10:21:29 +02:00
2010-10-21 14:47:59 +02:00
2011-05-13 14:37:28 -04:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-23 19:46:17 -07:00
2011-01-12 20:16:43 -05:00
2011-03-14 19:12:20 -04:00
2010-08-19 17:18:03 -07:00
2011-03-31 11:26:23 -03:00
2011-01-10 08:51:44 -08:00
2011-01-07 17:50:27 +11:00
2011-03-31 11:26:23 -03:00
2011-01-07 17:50:23 +11:00
2010-12-07 20:16:56 +01:00
2010-10-25 14:11:37 -07:00
2010-05-21 09:34:29 -07:00
2011-03-05 10:56:00 +01:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-05-23 13:59:54 +02:00
2010-03-07 22:17:09 +01:00
2010-10-12 16:53:37 +02:00
2011-05-26 12:03:50 -07:00
2010-03-02 12:23:42 +01:00
2011-02-23 00:53:26 +00:00
2011-05-25 20:43:32 +02:00
2011-03-31 11:26:23 -03:00
2011-05-08 16:41:45 -07:00
2010-06-03 03:21:52 -07:00
2010-11-16 10:58:30 -08:00
2010-09-21 18:04:47 -07:00
2011-02-27 16:11:51 -08:00
2010-08-19 17:16:23 -07:00
2010-10-26 16:52:08 -07:00
2010-08-09 20:45:05 -07:00
2011-03-31 11:26:23 -03:00
2010-11-24 11:16:42 -08:00
2010-10-07 14:08:55 +01:00
2010-06-03 03:21:52 -07:00
2011-03-31 11:26:23 -03:00
2010-08-10 11:49:21 -07:00
2010-12-09 20:17:07 -08:00
2011-03-31 11:26:23 -03:00
2010-08-12 11:27:58 +02:00
2011-02-17 11:12:40 -08:00
2010-10-22 15:34:12 -05:00
2011-01-13 17:32:31 -08:00
2011-05-25 08:39:52 -07:00
2011-03-17 11:59:32 +11:00
2011-01-13 17:32:47 -08:00
2011-02-13 16:54:24 -08:00
2011-01-24 14:45:11 +10:30
2011-05-24 22:55:24 +10:00
2010-09-09 18:57:24 -07:00
2011-03-31 11:26:23 -03:00
2011-05-22 08:47:53 -04:00
2010-04-03 14:56:05 -07:00
2011-03-31 11:26:23 -03:00
2011-05-19 20:50:53 -04:00
2011-05-24 14:33:35 +02:00
2011-04-25 18:14:10 -07:00
2010-12-06 11:03:46 -08:00
2010-06-03 03:21:52 -07:00
2011-05-26 09:20:31 -07:00
2011-05-26 09:20:31 -07:00
2011-05-19 16:55:27 +09:30
2011-01-16 13:47:07 -05:00
2011-03-31 11:26:23 -03:00
2010-10-12 16:53:34 +02:00
2011-05-05 11:10:14 -07:00
2011-05-20 11:46:11 -07:00
2011-03-31 11:26:23 -03:00
2011-03-23 15:29:04 -04:00
2011-05-26 17:12:34 -07:00
2010-07-05 16:14:52 -06:00
2011-04-20 17:01:19 +10:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-01-16 13:47:07 -05:00
2010-10-24 15:07:11 -07:00
2011-04-18 10:35:30 -07:00
2010-08-21 23:40:14 -07:00
2011-03-11 15:13:26 -05:00
2010-07-19 01:58:48 +02:00
2011-03-31 11:26:23 -03:00
2011-05-24 12:10:51 +02:00
2010-08-04 21:53:17 -07:00
2011-01-13 08:03:21 -08:00
2011-03-31 11:26:23 -03:00
2011-05-13 16:31:00 -07:00
2011-03-31 11:26:23 -03:00
2010-10-29 04:16:31 -04:00
2011-01-14 02:36:43 +00:00
2011-05-05 23:16:59 -07:00
2010-09-08 18:16:55 -07:00
2010-03-12 15:52:44 -08:00
2010-08-09 16:47:27 -04:00
2011-03-31 11:26:23 -03:00
2010-11-15 13:24:06 -05:00
2011-05-25 08:39:19 -07:00
2010-05-11 10:09:47 +02:00
2010-03-12 15:53:10 -08:00
2010-06-03 03:21:52 -07:00
2010-10-30 12:12:50 +02:00
2011-05-24 15:22:17 +02:00
2011-03-31 11:26:23 -03:00
2011-05-26 13:38:58 +10:00
2011-05-05 11:10:14 -07:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2010-08-09 16:48:44 -04:00
2011-03-31 11:26:23 -03:00
2010-08-30 13:23:33 -07:00
2011-02-28 18:00:31 -08:00
2010-03-25 17:18:43 -07:00
2011-02-02 15:28:18 +01:00
2010-09-09 20:41:20 +02:00
2010-11-29 08:55:25 +11:00
2010-11-29 08:55:22 +11:00
2011-03-31 11:26:23 -03:00
2010-12-20 09:37:33 +01:00
2010-05-19 22:40:47 -04:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-01-24 14:45:11 +10:30
2010-05-19 22:15:46 +09:30
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-01-13 08:03:24 -08:00
2010-04-06 20:35:58 +04:00