linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -mmotm 0/4] memcg: per cgroup dirty limit (v5)
@ 2010-03-07 20:57 Andrea Righi
  2010-03-07 20:57 ` [PATCH -mmotm 1/4] memcg: dirty memory documentation Andrea Righi
                   ` (3 more replies)
  0 siblings, 4 replies; 41+ messages in thread
From: Andrea Righi @ 2010-03-07 20:57 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki, Balbir Singh, Daisuke Nishimura
  Cc: Vivek Goyal, Peter Zijlstra, Trond Myklebust, Suleiman Souhlal,
	Greg Thelen, Kirill A. Shutemov, Andrew Morton, containers,
	linux-kernel, linux-mm

Control the maximum amount of dirty pages a cgroup can have at any given time.

Per cgroup dirty limit is like fixing the max amount of dirty (hard to reclaim)
page cache used by any cgroup. So, in case of multiple cgroup writers, they
will not be able to consume more than their designated share of dirty pages and
will be forced to perform write-out if they cross that limit.

The overall design is the following:

 - account dirty pages per cgroup
 - limit the number of dirty pages via memory.dirty_ratio / memory.dirty_bytes
   and memory.dirty_background_ratio / memory.dirty_background_bytes in
   cgroupfs
 - start to write-out (directly or background) when the cgroup limits are
   exceeded

This feature is supposed to be strictly connected to any underlying IO
controller implementation, so we can stop increasing dirty pages in VM layer
and enforce a write-out before any cgroup will consume the global amount of
dirty pages defined by /proc/sys/vm/dirty_ratio|dirty_bytes and
/proc/sys/vm/dirty_background_ratio|dirty_background_bytes.

Changelog (v4 -> v5)
~~~~~~~~~~~~~~~~~~~~~~
 * fixed a potential deadlock between lock_page_cgroup and mapping->tree_lock
   (I'm not sure I did the right thing for this point, so review and tests are
   very welcome)
 * introduce inc/dec functions to update file cache accounting
 * export only a restricted subset of mem_cgroup_stat_index flags
 * fixed a bug in determine_dirtyable_memory() to correctly return the local
   memcg dirtyable memory
 * always use global dirty memory settings in calc_period_shift()

-Andrea

--
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] 41+ messages in thread
* [PATCH -mmotm 0/4] memcg: per cgroup dirty limit (v4)
@ 2010-03-04 10:40 Andrea Righi
  2010-03-04 10:40 ` [PATCH -mmotm 4/4] memcg: dirty pages instrumentation Andrea Righi
  0 siblings, 1 reply; 41+ messages in thread
From: Andrea Righi @ 2010-03-04 10:40 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki, Balbir Singh
  Cc: Vivek Goyal, Peter Zijlstra, Trond Myklebust, Suleiman Souhlal,
	Greg Thelen, Daisuke Nishimura, Kirill A. Shutemov, Andrew Morton,
	containers, linux-kernel, linux-mm

Control the maximum amount of dirty pages a cgroup can have at any given time.

Per cgroup dirty limit is like fixing the max amount of dirty (hard to reclaim)
page cache used by any cgroup. So, in case of multiple cgroup writers, they
will not be able to consume more than their designated share of dirty pages and
will be forced to perform write-out if they cross that limit.

The overall design is the following:

 - account dirty pages per cgroup
 - limit the number of dirty pages via memory.dirty_ratio / memory.dirty_bytes
   and memory.dirty_background_ratio / memory.dirty_background_bytes in
   cgroupfs
 - start to write-out (background or actively) when the cgroup limits are
   exceeded

This feature is supposed to be strictly connected to any underlying IO
controller implementation, so we can stop increasing dirty pages in VM layer
and enforce a write-out before any cgroup will consume the global amount of
dirty pages defined by the /proc/sys/vm/dirty_ratio|dirty_bytes and
/proc/sys/vm/dirty_background_ratio|dirty_background_bytes limits.

Changelog (v3 -> v4)
~~~~~~~~~~~~~~~~~~~~~~
 * handle the migration of tasks across different cgroups
   NOTE: at the moment we don't move charges of file cache pages, so this
   functionality is not immediately necessary. However, since the migration of
   file cache pages is in plan, it is better to start handling file pages
   anyway.
 * properly account dirty pages in nilfs2
   (thanks to Kirill A. Shutemov <kirill@shutemov.name>)
 * lockless access to dirty memory parameters
 * fix: page_cgroup lock must not be acquired under mapping->tree_lock
   (thanks to Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> and
    KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>)
 * code restyling

-Andrea

--
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] 41+ messages in thread

end of thread, other threads:[~2010-03-11 23:50 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-07 20:57 [PATCH -mmotm 0/4] memcg: per cgroup dirty limit (v5) Andrea Righi
2010-03-07 20:57 ` [PATCH -mmotm 1/4] memcg: dirty memory documentation Andrea Righi
2010-03-07 20:57 ` [PATCH -mmotm 2/4] page_cgroup: introduce file cache flags Andrea Righi
2010-03-07 20:57 ` [PATCH -mmotm 3/4] memcg: dirty pages accounting and limiting infrastructure Andrea Righi
2010-03-08  1:44   ` Daisuke Nishimura
2010-03-08  1:56     ` KAMEZAWA Hiroyuki
2010-03-08  2:17       ` Daisuke Nishimura
2010-03-08  2:37         ` KAMEZAWA Hiroyuki
2010-03-08  8:07           ` Daisuke Nishimura
2010-03-08  8:31             ` KAMEZAWA Hiroyuki
2010-03-09  0:12               ` Andrea Righi
2010-03-09  0:19                 ` KAMEZAWA Hiroyuki
2010-03-09  1:29                   ` [PATCH mmotm 2.5/4] memcg: disable irq at page cgroup lock (Re: [PATCH -mmotm 3/4] memcg: dirty pages accounting and limiting infrastructure) Daisuke Nishimura
2010-03-09  2:07                     ` KAMEZAWA Hiroyuki
2010-03-09  4:50                     ` Balbir Singh
2010-03-10  1:43                       ` Daisuke Nishimura
2010-03-10  3:56                         ` Balbir Singh
2010-03-11  4:31                           ` Daisuke Nishimura
2010-03-11  4:49                             ` KAMEZAWA Hiroyuki
2010-03-11  4:58                               ` Daisuke Nishimura
2010-03-11  5:13                                 ` KAMEZAWA Hiroyuki
2010-03-11  6:15                                   ` KAMEZAWA Hiroyuki
2010-03-11  7:50                                     ` Daisuke Nishimura
2010-03-11  8:06                                       ` KAMEZAWA Hiroyuki
2010-03-11 16:54                               ` Vivek Goyal
2010-03-11 22:34                                 ` Andrea Righi
2010-03-11 23:46                                 ` KAMEZAWA Hiroyuki
2010-03-09  9:07                     ` Andrea Righi
2010-03-09  0:18               ` [PATCH -mmotm 3/4] memcg: dirty pages accounting and limiting infrastructure Daisuke Nishimura
2010-03-09  0:20                 ` KAMEZAWA Hiroyuki
2010-03-09  0:52                   ` Daisuke Nishimura
2010-03-09  0:03             ` Andrea Righi
2010-03-07 20:57 ` [PATCH -mmotm 4/4] memcg: dirty pages instrumentation Andrea Righi
2010-03-08  2:31   ` KAMEZAWA Hiroyuki
  -- strict thread matches above, loose matches on Subject: below --
2010-03-04 10:40 [PATCH -mmotm 0/4] memcg: per cgroup dirty limit (v4) Andrea Righi
2010-03-04 10:40 ` [PATCH -mmotm 4/4] memcg: dirty pages instrumentation Andrea Righi
2010-03-04 16:18   ` Vivek Goyal
2010-03-04 16:28     ` Andrea Righi
2010-03-04 19:41   ` Vivek Goyal
2010-03-04 21:51     ` Andrea Righi
2010-03-05  6:38   ` Balbir Singh
2010-03-05 22:55     ` Andrea Righi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).