Skip to content

Commit 0bbfeb8

Browse files
jteravestJens Axboe
authored andcommitted
cfq-iosched: Always provide group isolation.
Effectively, make group_isolation=1 the default and remove the tunable. The setting group_isolation=0 was because by default we idle on sync-noidle tree and on fast devices, this can be very harmful for throughput. However, this problem can also be addressed by tuning slice_idle and possibly group_idle on faster storage devices. This change simplifies the CFQ code by removing the feature entirely. Signed-off-by: Justin TerAvest <teravest@google.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent 6fae9c2 commit 0bbfeb8

2 files changed

Lines changed: 1 addition & 64 deletions

File tree

‎Documentation/cgroups/blkio-controller.txt‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -343,34 +343,6 @@ Common files among various policies
343343

344344
CFQ sysfs tunable
345345
=================
346-
/sys/block/<disk>/queue/iosched/group_isolation
347-
-----------------------------------------------
348-
349-
If group_isolation=1, it provides stronger isolation between groups at the
350-
expense of throughput. By default group_isolation is 0. In general that
351-
means that if group_isolation=0, expect fairness for sequential workload
352-
only. Set group_isolation=1 to see fairness for random IO workload also.
353-
354-
Generally CFQ will put random seeky workload in sync-noidle category. CFQ
355-
will disable idling on these queues and it does a collective idling on group
356-
of such queues. Generally these are slow moving queues and if there is a
357-
sync-noidle service tree in each group, that group gets exclusive access to
358-
disk for certain period. That means it will bring the throughput down if
359-
group does not have enough IO to drive deeper queue depths and utilize disk
360-
capacity to the fullest in the slice allocated to it. But the flip side is
361-
that even a random reader should get better latencies and overall throughput
362-
if there are lots of sequential readers/sync-idle workload running in the
363-
system.
364-
365-
If group_isolation=0, then CFQ automatically moves all the random seeky queues
366-
in the root group. That means there will be no service differentiation for
367-
that kind of workload. This leads to better throughput as we do collective
368-
idling on root sync-noidle tree.
369-
370-
By default one should run with group_isolation=0. If that is not sufficient
371-
and one wants stronger isolation between groups, then set group_isolation=1
372-
but this will come at cost of reduced throughput.
373-
374346
/sys/block/<disk>/queue/iosched/slice_idle
375347
------------------------------------------
376348
On a faster hardware CFQ can be slow, especially with sequential workload.

‎block/cfq-iosched.c‎

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ struct cfq_queue {
146146
struct cfq_rb_root *service_tree;
147147
struct cfq_queue *new_cfqq;
148148
struct cfq_group *cfqg;
149-
struct cfq_group *orig_cfqg;
150149
/* Number of sectors dispatched from queue in single dispatch round */
151150
unsigned long nr_sectors;
152151
};
@@ -285,7 +284,6 @@ struct cfq_data {
285284
unsigned int cfq_slice_idle;
286285
unsigned int cfq_group_idle;
287286
unsigned int cfq_latency;
288-
unsigned int cfq_group_isolation;
289287

290288
unsigned int cic_index;
291289
struct list_head cic_list;
@@ -1187,32 +1185,6 @@ static void cfq_service_tree_add(struct cfq_data *cfqd, struct cfq_queue *cfqq,
11871185
int new_cfqq = 1;
11881186
int group_changed = 0;
11891187

1190-
#ifdef CONFIG_CFQ_GROUP_IOSCHED
1191-
if (!cfqd->cfq_group_isolation
1192-
&& cfqq_type(cfqq) == SYNC_NOIDLE_WORKLOAD
1193-
&& cfqq->cfqg && cfqq->cfqg != &cfqd->root_group) {
1194-
/* Move this cfq to root group */
1195-
cfq_log_cfqq(cfqd, cfqq, "moving to root group");
1196-
if (!RB_EMPTY_NODE(&cfqq->rb_node))
1197-
cfq_group_service_tree_del(cfqd, cfqq->cfqg);
1198-
cfqq->orig_cfqg = cfqq->cfqg;
1199-
cfqq->cfqg = &cfqd->root_group;
1200-
cfqd->root_group.ref++;
1201-
group_changed = 1;
1202-
} else if (!cfqd->cfq_group_isolation
1203-
&& cfqq_type(cfqq) == SYNC_WORKLOAD && cfqq->orig_cfqg) {
1204-
/* cfqq is sequential now needs to go to its original group */
1205-
BUG_ON(cfqq->cfqg != &cfqd->root_group);
1206-
if (!RB_EMPTY_NODE(&cfqq->rb_node))
1207-
cfq_group_service_tree_del(cfqd, cfqq->cfqg);
1208-
cfq_put_cfqg(cfqq->cfqg);
1209-
cfqq->cfqg = cfqq->orig_cfqg;
1210-
cfqq->orig_cfqg = NULL;
1211-
group_changed = 1;
1212-
cfq_log_cfqq(cfqd, cfqq, "moved to origin group");
1213-
}
1214-
#endif
1215-
12161188
service_tree = service_tree_for(cfqq->cfqg, cfqq_prio(cfqq),
12171189
cfqq_type(cfqq));
12181190
if (cfq_class_idle(cfqq)) {
@@ -2542,7 +2514,7 @@ static int cfq_dispatch_requests(struct request_queue *q, int force)
25422514
static void cfq_put_queue(struct cfq_queue *cfqq)
25432515
{
25442516
struct cfq_data *cfqd = cfqq->cfqd;
2545-
struct cfq_group *cfqg, *orig_cfqg;
2517+
struct cfq_group *cfqg;
25462518

25472519
BUG_ON(cfqq->ref <= 0);
25482520

@@ -2554,7 +2526,6 @@ static void cfq_put_queue(struct cfq_queue *cfqq)
25542526
BUG_ON(rb_first(&cfqq->sort_list));
25552527
BUG_ON(cfqq->allocated[READ] + cfqq->allocated[WRITE]);
25562528
cfqg = cfqq->cfqg;
2557-
orig_cfqg = cfqq->orig_cfqg;
25582529

25592530
if (unlikely(cfqd->active_queue == cfqq)) {
25602531
__cfq_slice_expired(cfqd, cfqq, 0);
@@ -2564,8 +2535,6 @@ static void cfq_put_queue(struct cfq_queue *cfqq)
25642535
BUG_ON(cfq_cfqq_on_rr(cfqq));
25652536
kmem_cache_free(cfq_pool, cfqq);
25662537
cfq_put_cfqg(cfqg);
2567-
if (orig_cfqg)
2568-
cfq_put_cfqg(orig_cfqg);
25692538
}
25702539

25712540
/*
@@ -3953,7 +3922,6 @@ static void *cfq_init_queue(struct request_queue *q)
39533922
cfqd->cfq_slice_idle = cfq_slice_idle;
39543923
cfqd->cfq_group_idle = cfq_group_idle;
39553924
cfqd->cfq_latency = 1;
3956-
cfqd->cfq_group_isolation = 0;
39573925
cfqd->hw_tag = -1;
39583926
/*
39593927
* we optimistically start assuming sync ops weren't delayed in last
@@ -4029,7 +3997,6 @@ SHOW_FUNCTION(cfq_slice_sync_show, cfqd->cfq_slice[1], 1);
40293997
SHOW_FUNCTION(cfq_slice_async_show, cfqd->cfq_slice[0], 1);
40303998
SHOW_FUNCTION(cfq_slice_async_rq_show, cfqd->cfq_slice_async_rq, 0);
40313999
SHOW_FUNCTION(cfq_low_latency_show, cfqd->cfq_latency, 0);
4032-
SHOW_FUNCTION(cfq_group_isolation_show, cfqd->cfq_group_isolation, 0);
40334000
#undef SHOW_FUNCTION
40344001

40354002
#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \
@@ -4063,7 +4030,6 @@ STORE_FUNCTION(cfq_slice_async_store, &cfqd->cfq_slice[0], 1, UINT_MAX, 1);
40634030
STORE_FUNCTION(cfq_slice_async_rq_store, &cfqd->cfq_slice_async_rq, 1,
40644031
UINT_MAX, 0);
40654032
STORE_FUNCTION(cfq_low_latency_store, &cfqd->cfq_latency, 0, 1, 0);
4066-
STORE_FUNCTION(cfq_group_isolation_store, &cfqd->cfq_group_isolation, 0, 1, 0);
40674033
#undef STORE_FUNCTION
40684034

40694035
#define CFQ_ATTR(name) \
@@ -4081,7 +4047,6 @@ static struct elv_fs_entry cfq_attrs[] = {
40814047
CFQ_ATTR(slice_idle),
40824048
CFQ_ATTR(group_idle),
40834049
CFQ_ATTR(low_latency),
4084-
CFQ_ATTR(group_isolation),
40854050
__ATTR_NULL
40864051
};
40874052

0 commit comments

Comments
 (0)