Skip to content

Commit b0a1ea5

Browse files
committed
Merge branch 'for-4.3/blkcg' of git://git.kernel.dk/linux-block
Pull blk-cg updates from Jens Axboe: "A bit later in the cycle, but this has been in the block tree for a a while. This is basically four patchsets from Tejun, that improve our buffered cgroup writeback. It was dependent on the other cgroup changes, but they went in earlier in this cycle. Series 1 is set of 5 patches that has cgroup writeback updates: - bdi_writeback iteration fix which could lead to some wb's being skipped or repeated during e.g. sync under memory pressure. - Simplification of wb work wait mechanism. - Writeback tracepoints updated to report cgroup. Series 2 is is a set of updates for the CFQ cgroup writeback handling: cfq has always charged all async IOs to the root cgroup. It didn't have much choice as writeback didn't know about cgroups and there was no way to tell who to blame for a given writeback IO. writeback finally grew support for cgroups and now tags each writeback IO with the appropriate cgroup to charge it against. This patchset updates cfq so that it follows the blkcg each bio is tagged with. Async cfq_queues are now shared across cfq_group, which is per-cgroup, instead of per-request_queue cfq_data. This makes all IOs follow the weight based IO resource distribution implemented by cfq. - Switched from GFP_ATOMIC to GFP_NOWAIT as suggested by Jeff. - Other misc review points addressed, acks added and rebased. Series 3 is the blkcg policy cleanup patches: This patchset contains assorted cleanups for blkcg_policy methods and blk[c]g_policy_data handling. - alloc/free added for blkg_policy_data. exit dropped. - alloc/free added for blkcg_policy_data. - blk-throttle's async percpu allocation is replaced with direct allocation. - all methods now take blk[c]g_policy_data instead of blkcg_gq or blkcg. And finally, series 4 is a set of patches cleaning up the blkcg stats handling: blkcg's stats have always been somwhat of a mess. This patchset tries to improve the situation a bit. - The following patches added to consolidate blkcg entry point and blkg creation. This is in itself is an improvement and helps colllecting common stats on bio issue. - per-blkg stats now accounted on bio issue rather than request completion so that bio based and request based drivers can behave the same way. The issue was spotted by Vivek. - cfq-iosched implements custom recursive stats and blk-throttle implements custom per-cpu stats. This patchset make blkcg core support both by default. - cfq-iosched and blk-throttle keep track of the same stats multiple times. Unify them" * 'for-4.3/blkcg' of git://git.kernel.dk/linux-block: (45 commits) blkcg: use CGROUP_WEIGHT_* scale for io.weight on the unified hierarchy blkcg: s/CFQ_WEIGHT_*/CFQ_WEIGHT_LEGACY_*/ blkcg: implement interface for the unified hierarchy blkcg: misc preparations for unified hierarchy interface blkcg: separate out tg_conf_updated() from tg_set_conf() blkcg: move body parsing from blkg_conf_prep() to its callers blkcg: mark existing cftypes as legacy blkcg: rename subsystem name from blkio to io blkcg: refine error codes returned during blkcg configuration blkcg: remove unnecessary NULL checks from __cfqg_set_weight_device() blkcg: reduce stack usage of blkg_rwstat_recursive_sum() blkcg: remove cfqg_stats->sectors blkcg: move io_service_bytes and io_serviced stats into blkcg_gq blkcg: make blkg_[rw]stat_recursive_sum() to be able to index into blkcg_gq blkcg: make blkcg_[rw]stat per-cpu blkcg: add blkg_[rw]stat->aux_cnt and replace cfq_group->dead_stats with it blkcg: consolidate blkg creation in blkcg_bio_issue_check() blk-throttle: improve queue bypass handling blkcg: move root blkg lookup optimization from throtl_lookup_tg() to __blkg_lookup() blkcg: inline [__]blkg_lookup() ...
2 parents 33e247c + 69d7fde commit b0a1ea5

File tree

17 files changed

+1422
-1078
lines changed

17 files changed

+1422
-1078
lines changed

Documentation/cgroups/blkio-controller.txt

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Proportional weight policy files
201201
specifies the number of bytes.
202202

203203
- blkio.io_serviced
204-
- Number of IOs completed to/from the disk by the group. These
204+
- Number of IOs (bio) issued to the disk by the group. These
205205
are further divided by the type of operation - read or write, sync
206206
or async. First two fields specify the major and minor number of the
207207
device, third field specifies the operation type and the fourth field
@@ -327,18 +327,11 @@ Note: If both BW and IOPS rules are specified for a device, then IO is
327327
subjected to both the constraints.
328328

329329
- blkio.throttle.io_serviced
330-
- Number of IOs (bio) completed to/from the disk by the group (as
331-
seen by throttling policy). These are further divided by the type
332-
of operation - read or write, sync or async. First two fields specify
333-
the major and minor number of the device, third field specifies the
334-
operation type and the fourth field specifies the number of IOs.
335-
336-
blkio.io_serviced does accounting as seen by CFQ and counts are in
337-
number of requests (struct request). On the other hand,
338-
blkio.throttle.io_serviced counts number of IO in terms of number
339-
of bios as seen by throttling policy. These bios can later be
340-
merged by elevator and total number of requests completed can be
341-
lesser.
330+
- Number of IOs (bio) issued to the disk by the group. These
331+
are further divided by the type of operation - read or write, sync
332+
or async. First two fields specify the major and minor number of the
333+
device, third field specifies the operation type and the fourth field
334+
specifies the number of IOs.
342335

343336
- blkio.throttle.io_service_bytes
344337
- Number of bytes transferred to/from the disk by the group. These
@@ -347,11 +340,6 @@ Note: If both BW and IOPS rules are specified for a device, then IO is
347340
device, third field specifies the operation type and the fourth field
348341
specifies the number of bytes.
349342

350-
These numbers should roughly be same as blkio.io_service_bytes as
351-
updated by CFQ. The difference between two is that
352-
blkio.io_service_bytes will not be updated if CFQ is not operating
353-
on request queue.
354-
355343
Common files among various policies
356344
-----------------------------------
357345
- blkio.reset_stats

Documentation/cgroups/unified-hierarchy.txt

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CONTENTS
2727
5-3-1. Format
2828
5-3-2. Control Knobs
2929
5-4. Per-Controller Changes
30-
5-4-1. blkio
30+
5-4-1. io
3131
5-4-2. cpuset
3232
5-4-3. memory
3333
6. Planned Changes
@@ -203,7 +203,7 @@ other issues. The mapping from nice level to weight isn't obvious or
203203
universal, and there are various other knobs which simply aren't
204204
available for tasks.
205205

206-
The blkio controller implicitly creates a hidden leaf node for each
206+
The io controller implicitly creates a hidden leaf node for each
207207
cgroup to host the tasks. The hidden leaf has its own copies of all
208208
the knobs with "leaf_" prefixed. While this allows equivalent control
209209
over internal tasks, it's with serious drawbacks. It always adds an
@@ -438,9 +438,62 @@ may be specified in any order and not all pairs have to be specified.
438438

439439
5-4. Per-Controller Changes
440440

441-
5-4-1. blkio
441+
5-4-1. io
442442

443-
- blk-throttle becomes properly hierarchical.
443+
- blkio is renamed to io. The interface is overhauled anyway. The
444+
new name is more in line with the other two major controllers, cpu
445+
and memory, and better suited given that it may be used for cgroup
446+
writeback without involving block layer.
447+
448+
- Everything including stat is always hierarchical making separate
449+
recursive stat files pointless and, as no internal node can have
450+
tasks, leaf weights are meaningless. The operation model is
451+
simplified and the interface is overhauled accordingly.
452+
453+
io.stat
454+
455+
The stat file. The reported stats are from the point where
456+
bio's are issued to request_queue. The stats are counted
457+
independent of which policies are enabled. Each line in the
458+
file follows the following format. More fields may later be
459+
added at the end.
460+
461+
$MAJ:$MIN rbytes=$RBYTES wbytes=$WBYTES rios=$RIOS wrios=$WIOS
462+
463+
io.weight
464+
465+
The weight setting, currently only available and effective if
466+
cfq-iosched is in use for the target device. The weight is
467+
between 1 and 10000 and defaults to 100. The first line
468+
always contains the default weight in the following format to
469+
use when per-device setting is missing.
470+
471+
default $WEIGHT
472+
473+
Subsequent lines list per-device weights of the following
474+
format.
475+
476+
$MAJ:$MIN $WEIGHT
477+
478+
Writing "$WEIGHT" or "default $WEIGHT" changes the default
479+
setting. Writing "$MAJ:$MIN $WEIGHT" sets per-device weight
480+
while "$MAJ:$MIN default" clears it.
481+
482+
This file is available only on non-root cgroups.
483+
484+
io.max
485+
486+
The maximum bandwidth and/or iops setting, only available if
487+
blk-throttle is enabled. The file is of the following format.
488+
489+
$MAJ:$MIN rbps=$RBPS wbps=$WBPS riops=$RIOPS wiops=$WIOPS
490+
491+
${R|W}BPS are read/write bytes per second and ${R|W}IOPS are
492+
read/write IOs per second. "max" indicates no limit. Writing
493+
to the file follows the same format but the individual
494+
settings may be ommitted or specified in any order.
495+
496+
This file is available only on non-root cgroups.
444497

445498

446499
5-4-2. cpuset

block/bio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ int bio_associate_current(struct bio *bio)
19901990

19911991
get_io_context_active(ioc);
19921992
bio->bi_ioc = ioc;
1993-
bio->bi_css = task_get_css(current, blkio_cgrp_id);
1993+
bio->bi_css = task_get_css(current, io_cgrp_id);
19941994
return 0;
19951995
}
19961996
EXPORT_SYMBOL_GPL(bio_associate_current);

0 commit comments

Comments
 (0)