[PATCHSET] block: modularize blkcg config and stat file handling
From: Tejun Heo
Date: Wed Mar 28 2012 - 18:51:41 EST
The way configuration and statistics are handled in block cgroup is
rather depressing. Every configuration and stat counter are defined
in blkcg core and specific policy implementations should go through
some blkcg interface to access and manipulate them and be notified of
By doing things this way, it achieves both complexity and
inflexibility - the code paths are unnecessarily complex while not
achieving any layering or modularity. A configuration or statistics
counter cannot be added to policies without modifying multiple places
in blkcg core code. Wanna implement a new policy? Good luck. The
implementation details are sad too. Stuff goes through needless
layers of functions with hard coded cases on specific counters and
configurations and fields specific to policies are thrown into common
area with some shared and others unused.
This patchset is an attempt at bringing some sanity to blkcg config
and stat file handling. It makes use of the pending dynamic cgroup
file type addition / removal support , which will be merged into
cgroup/for-3.5 once 3.4-rc1 is released.
All conf and stat file handling is moved into the policy
implementaiton the files belong to and blkcg supplies helpers to ease
file handling in policy implementations without requiring full
knowledge of all configurations and statistic counters.
This patchset sheds >500 lines of code while maintaining the same
features and with more comments and much more modular design. Yeah,
it was just wrong.
This patchset contains the following 21 patches
and is on top of
block/for-3.5/core eb7d8c07f9 "cfq: fix cfqg ref handling..."
+  cgroup-cftypes d954ca6469 "cgroup: implement cgroup_rm_cftypes()"
Note that the cgroup branch is temporary and the merge between the two
branches aren't trivial. I'll prepare a proper merged branch once the
cgroup/for-3.5 branch is settled.
This patchset is also available in the following git branch.
block/blk-cgroup.c | 1343 ++++++---------------------------------------------
block/blk-cgroup.h | 414 ++++++---------
block/blk-throttle.c | 318 ++++++++++--
block/cfq-iosched.c | 567 +++++++++++++++++++--
block/cfq.h | 118 ----
5 files changed, 1102 insertions(+), 1658 deletions(-)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/