linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET] block: modularize blkcg config and stat file handling
@ 2012-03-28 22:51 Tejun Heo
  2012-03-28 22:51 ` [PATCH 01/21] blkcg: remove unused @pol and @plid parameters Tejun Heo
                   ` (23 more replies)
  0 siblings, 24 replies; 56+ messages in thread
From: Tejun Heo @ 2012-03-28 22:51 UTC (permalink / raw)
  To: axboe; +Cc: vgoyal, ctalbott, rni, linux-kernel, cgroups, containers

Hello,

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
the changes.

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 [1], 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

 0001-blkcg-remove-unused-pol-and-plid-parameters.patch
 0002-blkcg-BLKIO_STAT_CPU_SECTORS-doesn-t-have-subcounter.patch
 0003-blkcg-introduce-blkg_stat-and-blkg_rwstat.patch
 0004-blkcg-restructure-statistics-printing.patch
 0005-blkcg-drop-blkiocg_file_write_u64.patch
 0006-blkcg-restructure-configuration-printing.patch
 0007-blkcg-restructure-blkio_group-configruation-setting.patch
 0008-blkcg-blkg_conf_prep.patch
 0009-blkcg-export-conf-stat-helpers-to-prepare-for-reorga.patch
 0010-blkcg-implement-blkio_policy_type-cftypes.patch
 0011-blkcg-move-conf-stat-file-handling-code-to-policies.patch
 0012-cfq-collapse-cfq.h-into-cfq-iosched.c.patch
 0013-blkcg-move-statistics-update-code-to-policies.patch
 0014-blkcg-cfq-doesn-t-need-per-cpu-dispatch-stats.patch
 0015-blkcg-add-blkio_policy_ops-operations-for-exit-and-s.patch
 0016-blkcg-move-blkio_group_stats-to-cfq-iosched.c.patch
 0017-blkcg-move-blkio_group_stats_cpu-and-friends-to-blk-.patch
 0018-blkcg-move-blkio_group_conf-weight-to-cfq.patch
 0019-blkcg-move-blkio_group_conf-iops-and-bps-to-blk-thro.patch
 0020-blkcg-pass-around-pd-pdata-instead-of-pd-itself-in-p.patch
 0021-blkcg-drop-BLKCG_STAT_-PRIV-POL-OFF-macros.patch

and is on top of

  block/for-3.5/core eb7d8c07f9 "cfq: fix cfqg ref handling..."
+ [1] 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.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git blkcg-files

diffstat follows.

 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(-)

--
tejun

[1] http://thread.gmane.org/gmane.linux.kernel.containers/22623

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2012-04-04 18:36 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28 22:51 [PATCHSET] block: modularize blkcg config and stat file handling Tejun Heo
2012-03-28 22:51 ` [PATCH 01/21] blkcg: remove unused @pol and @plid parameters Tejun Heo
2012-03-28 22:51 ` [PATCH 02/21] blkcg: BLKIO_STAT_CPU_SECTORS doesn't have subcounters Tejun Heo
2012-03-28 22:51 ` [PATCH 03/21] blkcg: introduce blkg_stat and blkg_rwstat Tejun Heo
2012-03-28 22:51 ` [PATCH 04/21] blkcg: restructure statistics printing Tejun Heo
2012-03-28 22:51 ` [PATCH 05/21] blkcg: drop blkiocg_file_write_u64() Tejun Heo
2012-03-28 22:51 ` [PATCH 06/21] blkcg: restructure configuration printing Tejun Heo
2012-03-28 22:51 ` [PATCH 07/21] blkcg: restructure blkio_group configruation setting Tejun Heo
2012-03-28 22:51 ` [PATCH 08/21] blkcg: blkg_conf_prep() Tejun Heo
2012-03-28 22:53   ` Tejun Heo
2012-03-28 22:51 ` [PATCH 09/21] blkcg: export conf/stat helpers to prepare for reorganization Tejun Heo
2012-03-28 22:51 ` [PATCH 10/21] blkcg: implement blkio_policy_type->cftypes Tejun Heo
2012-03-28 22:51 ` [PATCH 11/21] blkcg: move conf/stat file handling code to policies Tejun Heo
2012-03-28 22:51 ` [PATCH 12/21] cfq: collapse cfq.h into cfq-iosched.c Tejun Heo
2012-03-28 22:51 ` [PATCH 13/21] blkcg: move statistics update code to policies Tejun Heo
2012-03-28 22:51 ` [PATCH 14/21] blkcg: cfq doesn't need per-cpu dispatch stats Tejun Heo
2012-03-28 22:51 ` [PATCH 15/21] blkcg: add blkio_policy_ops operations for exit and stat reset Tejun Heo
2012-03-28 22:51 ` [PATCH 16/21] blkcg: move blkio_group_stats to cfq-iosched.c Tejun Heo
2012-03-28 22:51 ` [PATCH 17/21] blkcg: move blkio_group_stats_cpu and friends to blk-throttle.c Tejun Heo
2012-03-28 22:51 ` [PATCH 18/21] blkcg: move blkio_group_conf->weight to cfq Tejun Heo
2012-04-01 21:09   ` Vivek Goyal
2012-04-01 21:22     ` Tejun Heo
2012-04-02 21:39   ` Tao Ma
2012-04-02 21:49     ` Tejun Heo
2012-04-02 22:03       ` Tao Ma
2012-04-02 22:17         ` Tejun Heo
2012-04-02 22:20           ` Tao Ma
2012-04-02 22:25             ` Vivek Goyal
2012-04-02 22:28               ` Tejun Heo
2012-04-02 22:41               ` Tao Ma
2012-04-03 15:37                 ` IOPS based scheduler (Was: Re: [PATCH 18/21] blkcg: move blkio_group_conf->weight to cfq) Vivek Goyal
2012-04-03 16:36                   ` Tao Ma
2012-04-03 16:50                     ` Vivek Goyal
2012-04-03 17:26                       ` Tao Ma
2012-04-04 12:35                         ` Shaohua Li
2012-04-04 13:37                           ` Vivek Goyal
2012-04-04 14:52                             ` Shaohua Li
2012-04-04 15:10                               ` Vivek Goyal
2012-04-04 16:06                                 ` Tao Ma
2012-04-04 16:45                             ` Tao Ma
2012-04-04 16:50                               ` Vivek Goyal
2012-04-04 17:17                                 ` Vivek Goyal
2012-04-04 17:18                                 ` Tao Ma
2012-04-04 17:27                                   ` Vivek Goyal
2012-04-04 18:22                                   ` Vivek Goyal
2012-04-04 18:36                                     ` Tao Ma
2012-04-04 13:31                         ` Vivek Goyal
2012-03-28 22:51 ` [PATCH 19/21] blkcg: move blkio_group_conf->iops and ->bps to blk-throttle Tejun Heo
2012-03-28 22:51 ` [PATCH 20/21] blkcg: pass around pd->pdata instead of pd itself in prfill functions Tejun Heo
2012-03-28 22:51 ` [PATCH 21/21] blkcg: drop BLKCG_STAT_{PRIV|POL|OFF} macros Tejun Heo
2012-03-29  8:18 ` [PATCHSET] block: modularize blkcg config and stat file handling Jens Axboe
2012-04-02 20:02   ` Tejun Heo
2012-04-02 21:51     ` Jens Axboe
2012-04-02 22:33       ` Tejun Heo
2012-04-01 19:38 ` Vivek Goyal
2012-04-01 21:42 ` Tejun Heo

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).