Skip to content

RFC memcg: inode-based dirty-set controller

Konstantin Khebnikov cgroups linux-fsdevel linux-mm lkml 1 version In review

Get series with b4
b4 am 20150115180242.10450.92.stgit@buzz

Versions newest first

  1. v1 RFC Latest6 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6memcg: inode-based dirty and writeback pages accountingfs/inode.c include/linux/fs.h include/linux/memcontrol.h +3 more+150 -10 replies
2/6memcg: dirty-set limiting and filtered writebackfs/fs-writeback.c include/linux/backing-dev.h include/linux/memcontrol.h +4 more+190 -70 replies
3/6memcg: track shared inodes with dirty pagesfs/fs-writeback.c include/linux/fs.h include/linux/memcontrol.h +2 more+33 -23 replies
4/6percpu_ratelimit: high-performance ratelimiting counterinclude/linux/percpu_ratelimit.h lib/Makefile lib/percpu_ratelimit.c+214 -00 replies
5/6delay-injection: resource management via procrastinationinclude/linux/sched.h include/trace/events/sched.h kernel/sched/core.c +1 more+92 -00 replies
6/6memcg: filesystem bandwidth controllerblock/blk-core.c fs/direct-io.c include/linux/memcontrol.h +2 more+110 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCHSET RFC 0/6] memcg: inode-based dirty-set controller

This is ressurection of my old RFC patch for dirty-set accounting cgroup [1] Now it's merged into memory cgroup and got bandwidth controller as a bonus.

That shows alternative solution: less accurate but much less monstrous than accurate page-based dirty-set controller from Tejun Heo.

Memory overhead: +1 pointer into struct address_space. Perfomance overhead is almost zero, no new locks added.

Idea is stright forward: link each inode to some cgroup when first dirty page appers and account all dirty pages to it. Writeback is implemented as single per-bdi writeback work which writes only inodes which belong to memory cgroups where amount of dirty memory is beyond thresholds.

Third patch adds trick for handling shared inodes which have dirty pages from several cgroups: it marks whole inode as shared and alters writeback filter for it.

The rest is an example of bandwith and iops controller build on top of that. Design is completely original, I bet nobody ever used task-works for that =)

[1] [PATCH RFC] fsio: filesystem io accounting cgroup
http://marc.info/?l=linux-kernel&m=137331569501655&w=2

Patches also available here:
https://github.com/koct9i/linux.git branch memcg_dirty_control

---

Konstantin Khebnikov (6):
memcg: inode-based dirty and writeback pages accounting
memcg: dirty-set limiting and filtered writeback
memcg: track shared inodes with dirty pages
percpu_ratelimit: high-performance ratelimiting counter
delay-injection: resource management via procrastination
memcg: filesystem bandwidth controller

 block/blk-core.c                 |    2 
 fs/direct-io.c                   |    2 
 fs/fs-writeback.c                |   22 ++
 fs/inode.c                       |    1 
 include/linux/backing-dev.h      |    1 
 include/linux/fs.h               |   14 +
 include/linux/memcontrol.h       |   27 +++
 include/linux/percpu_ratelimit.h |   45 ++++
 include/linux/sched.h            |    7 +
 include/linux/writeback.h        |    1 
 include/trace/events/sched.h     |    7 +
 include/trace/events/writeback.h |    1 
 kernel/sched/core.c              |   66 +++++++
 kernel/sched/fair.c              |   12 +
 lib/Makefile                     |    1 
 lib/percpu_ratelimit.c           |  168 +++++++++++++++++
 mm/memcontrol.c                  |  381 ++++++++++++++++++++++++++++++++++++++
 mm/page-writeback.c              |   32 +++
 mm/readahead.c                   |    2 
 mm/truncate.c                    |    1 
 mm/vmscan.c                      |    4 
 21 files changed, 787 insertions(+), 10 deletions(-)
 create mode 100644 include/linux/percpu_ratelimit.h
 create mode 100644 lib/percpu_ratelimit.c

--
Signature

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>