From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A5E29138A1A for ; Fri, 2 Jan 2015 14:22:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6522DE07D1; Fri, 2 Jan 2015 14:22:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E0798E07D1 for ; Fri, 2 Jan 2015 14:22:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8D50C3406B2 for ; Fri, 2 Jan 2015 14:22:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 372B6EB82 for ; Fri, 2 Jan 2015 14:22:10 +0000 (UTC) From: "Mike Pagano" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Pagano" Message-ID: <1420208535.8b805110b9e871da0bc842e6df2deaa7f61e6659.mpagano@gentoo> Subject: [gentoo-commits] proj/linux-patches:3.17 commit in: / X-VCS-Repository: proj/linux-patches X-VCS-Files: 0000_README 5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r6-3.17.patch 5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r7-3.17.patch 5002_block-introduce-the-BFQ-v7r6-I-O-sched-for-3.17.patch1 5002_block-introduce-the-BFQ-v7r7-I-O-sched-for-3.17.patch1 5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r6-for-3.17.0.patch 5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r7-for-3.17.0.patch X-VCS-Directories: / X-VCS-Committer: mpagano X-VCS-Committer-Name: Mike Pagano X-VCS-Revision: 8b805110b9e871da0bc842e6df2deaa7f61e6659 X-VCS-Branch: 3.17 Date: Fri, 2 Jan 2015 14:22:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4bb5067d-9a37-4bb0-b8d8-bb0c1d766b0a X-Archives-Hash: d992bd91eb5693066003d3065db24676 commit: 8b805110b9e871da0bc842e6df2deaa7f61e6659 Author: Mike Pagano gentoo org> AuthorDate: Fri Jan 2 14:22:15 2015 +0000 Commit: Mike Pagano gentoo org> CommitDate: Fri Jan 2 14:22:15 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/linux-patches.git;a=commit;h=8b805110 Bumping BFQ patchset to v7r7. --- 0000_README | 12 ++-- ...oups-kconfig-build-bits-for-BFQ-v7r7-3.17.patch | 6 +- ...ntroduce-the-BFQ-v7r7-I-O-sched-for-3.17.patch1 | 76 ++++++++++++++------ ...ly-Queue-Merge-EQM-to-BFQ-v7r7-for-3.17.0.patch | 84 ++++++++++++---------- 4 files changed, 108 insertions(+), 70 deletions(-) diff --git a/0000_README b/0000_README index c62fecf..7c83fab 100644 --- a/0000_README +++ b/0000_README @@ -111,14 +111,14 @@ Patch: 5000_enable-additional-cpu-optimizations-for-gcc.patch From: https://github.com/graysky2/kernel_gcc_patch/ Desc: Kernel patch enables gcc optimizations for additional CPUs. -Patch: 5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r6-3.17.patch +Patch: 5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r7-3.17.patch From: http://algo.ing.unimo.it/people/paolo/disk_sched/ -Desc: BFQ v7r6 patch 1 for 3.17: Build, cgroups and kconfig bits +Desc: BFQ v7r7 patch 1 for 3.17: Build, cgroups and kconfig bits -Patch: 5002_block-introduce-the-BFQ-v7r6-I-O-sched-for-3.17.patch +Patch: 5002_block-introduce-the-BFQ-v7r7-I-O-sched-for-3.17.patch From: http://algo.ing.unimo.it/people/paolo/disk_sched/ -Desc: BFQ v7r6 patch 2 for 3.17: BFQ Scheduler +Desc: BFQ v7r7 patch 2 for 3.17: BFQ Scheduler -Patch: 5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r6-for-3.17.0.patch +Patch: 5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r7-for-3.17.0.patch From: http://algo.ing.unimo.it/people/paolo/disk_sched/ -Desc: BFQ v7r6 patch 3 for 3.17: Early Queue Merge (EQM) +Desc: BFQ v7r7 patch 3 for 3.17: Early Queue Merge (EQM) diff --git a/5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r6-3.17.patch b/5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r7-3.17.patch similarity index 97% rename from 5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r6-3.17.patch rename to 5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r7-3.17.patch index fc428b8..b706587 100644 --- a/5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r6-3.17.patch +++ b/5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r7-3.17.patch @@ -1,7 +1,7 @@ -From 09f6914bcd9af373e34215a711f36970f4c118ef Mon Sep 17 00:00:00 2001 +From fed943e59f99cb147eaa29462318c63c61d02153 Mon Sep 17 00:00:00 2001 From: Paolo Valente Date: Thu, 22 May 2014 11:59:35 +0200 -Subject: [PATCH 1/3] block: cgroups, kconfig, build bits for BFQ-v7r6-3.17 +Subject: [PATCH 1/3] block: cgroups, kconfig, build bits for BFQ-v7r7-3.17 Update Kconfig.iosched and do the related Makefile changes to include kernel configuration options for BFQ. Also add the bfqio controller @@ -100,5 +100,5 @@ index 98c4f9b..13b010d 100644 SUBSYS(perf_event) #endif -- -2.1.2 +2.1.3 diff --git a/5002_block-introduce-the-BFQ-v7r6-I-O-sched-for-3.17.patch1 b/5002_block-introduce-the-BFQ-v7r7-I-O-sched-for-3.17.patch1 similarity index 99% rename from 5002_block-introduce-the-BFQ-v7r6-I-O-sched-for-3.17.patch1 rename to 5002_block-introduce-the-BFQ-v7r7-I-O-sched-for-3.17.patch1 index fba907a..503e664 100644 --- a/5002_block-introduce-the-BFQ-v7r6-I-O-sched-for-3.17.patch1 +++ b/5002_block-introduce-the-BFQ-v7r7-I-O-sched-for-3.17.patch1 @@ -1,9 +1,9 @@ -From dbb7d28e3809638f3732490a48d414171fd4186d Mon Sep 17 00:00:00 2001 +From 03c92eeb2016506fc4f475390da7798efbf02ef5 Mon Sep 17 00:00:00 2001 From: Paolo Valente Date: Thu, 9 May 2013 19:10:02 +0200 -Subject: [PATCH 2/3] block: introduce the BFQ-v7r6 I/O sched for 3.17 +Subject: [PATCH 2/3] block: introduce the BFQ-v7r7 I/O sched for 3.17 -Add the BFQ-v7r6 I/O scheduler to 3.17. +Add the BFQ-v7r7 I/O scheduler to 3.17. The general structure is borrowed from CFQ, as much of the code for handling I/O contexts. Over time, several useful features have been ported from CFQ as well (details in the changelog in README.BFQ). A @@ -56,12 +56,12 @@ until it expires. Signed-off-by: Paolo Valente Signed-off-by: Arianna Avanzini --- - block/bfq-cgroup.c | 930 ++++++++++++ + block/bfq-cgroup.c | 936 ++++++++++++ block/bfq-ioc.c | 36 + - block/bfq-iosched.c | 3887 +++++++++++++++++++++++++++++++++++++++++++++++++++ - block/bfq-sched.c | 1207 ++++++++++++++++ - block/bfq.h | 773 ++++++++++ - 5 files changed, 6833 insertions(+) + block/bfq-iosched.c | 3902 +++++++++++++++++++++++++++++++++++++++++++++++++++ + block/bfq-sched.c | 1214 ++++++++++++++++ + block/bfq.h | 775 ++++++++++ + 5 files changed, 6863 insertions(+) create mode 100644 block/bfq-cgroup.c create mode 100644 block/bfq-ioc.c create mode 100644 block/bfq-iosched.c @@ -70,10 +70,10 @@ Signed-off-by: Arianna Avanzini diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c new file mode 100644 -index 0000000..eb140eb +index 0000000..11e2f1d --- /dev/null +++ b/block/bfq-cgroup.c -@@ -0,0 +1,930 @@ +@@ -0,0 +1,936 @@ +/* + * BFQ: CGROUPS support. + * @@ -154,6 +154,12 @@ index 0000000..eb140eb + entity->new_weight = bfq_ioprio_to_weight(bgrp->ioprio); + entity->new_ioprio = bgrp->ioprio; + } else { ++ if (bgrp->weight < BFQ_MIN_WEIGHT || ++ bgrp->weight > BFQ_MAX_WEIGHT) { ++ printk(KERN_CRIT "bfq_group_init_entity: " ++ "bgrp->weight %d\n", bgrp->weight); ++ BUG(); ++ } + entity->new_weight = bgrp->weight; + entity->new_ioprio = bfq_weight_to_ioprio(bgrp->weight); + } @@ -1048,10 +1054,10 @@ index 0000000..7f6b000 +} diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c new file mode 100644 -index 0000000..b919b03 +index 0000000..97ee934 --- /dev/null +++ b/block/bfq-iosched.c -@@ -0,0 +1,3887 @@ +@@ -0,0 +1,3902 @@ +/* + * Budget Fair Queueing (BFQ) disk scheduler. + * @@ -3730,7 +3736,7 @@ index 0000000..b919b03 + switch (ioprio_class) { + default: + dev_err(bfqq->bfqd->queue->backing_dev_info.dev, -+ "bfq: bad prio %x\n", ioprio_class); ++ "bfq: bad prio class %d\n", ioprio_class); + case IOPRIO_CLASS_NONE: + /* + * No prio set, inherit CPU scheduling settings. @@ -3753,6 +3759,13 @@ index 0000000..b919b03 + break; + } + ++ if (bfqq->entity.new_ioprio < 0 || ++ bfqq->entity.new_ioprio >= IOPRIO_BE_NR) { ++ printk(KERN_CRIT "bfq_init_prio_data: new_ioprio %d\n", ++ bfqq->entity.new_ioprio); ++ BUG(); ++ } ++ + bfqq->entity.ioprio_changed = 1; + + bfq_clear_bfqq_prio_changed(bfqq); @@ -3869,14 +3882,13 @@ index 0000000..b919b03 + + if (bfqq != NULL) { + bfq_init_bfqq(bfqd, bfqq, current->pid, is_sync); ++ bfq_init_prio_data(bfqq, bic); ++ bfq_init_entity(&bfqq->entity, bfqg); + bfq_log_bfqq(bfqd, bfqq, "allocated"); + } else { + bfqq = &bfqd->oom_bfqq; + bfq_log_bfqq(bfqd, bfqq, "using oom bfqq"); + } -+ -+ bfq_init_prio_data(bfqq, bic); -+ bfq_init_entity(&bfqq->entity, bfqg); + } + + if (new_bfqq != NULL) @@ -4533,6 +4545,14 @@ index 0000000..b919b03 + */ + bfq_init_bfqq(bfqd, &bfqd->oom_bfqq, 1, 0); + atomic_inc(&bfqd->oom_bfqq.ref); ++ bfqd->oom_bfqq.entity.new_ioprio = BFQ_DEFAULT_QUEUE_IOPRIO; ++ bfqd->oom_bfqq.entity.new_ioprio_class = IOPRIO_CLASS_BE; ++ /* ++ * Trigger weight initialization, according to ioprio, at the ++ * oom_bfqq's first activation. The oom_bfqq's ioprio and ioprio ++ * class won't be changed any more. ++ */ ++ bfqd->oom_bfqq.entity.ioprio_changed = 1; + + bfqd->queue = q; + @@ -4548,6 +4568,7 @@ index 0000000..b919b03 + } + + bfqd->root_group = bfqg; ++ bfq_init_entity(&bfqd->oom_bfqq.entity, bfqd->root_group); +#ifdef CONFIG_CGROUP_BFQIO + bfqd->active_numerous_groups = 0; +#endif @@ -4923,7 +4944,7 @@ index 0000000..b919b03 + device_speed_thresh[1] = (R_fast[1] + R_slow[1]) / 2; + + elv_register(&iosched_bfq); -+ pr_info("BFQ I/O-scheduler version: v7r6"); ++ pr_info("BFQ I/O-scheduler version: v7r7"); + + return 0; +} @@ -4941,10 +4962,10 @@ index 0000000..b919b03 +MODULE_LICENSE("GPL"); diff --git a/block/bfq-sched.c b/block/bfq-sched.c new file mode 100644 -index 0000000..c4831b7 +index 0000000..2931563 --- /dev/null +++ b/block/bfq-sched.c -@@ -0,0 +1,1207 @@ +@@ -0,0 +1,1214 @@ +/* + * BFQ: Hierarchical B-WF2Q+ scheduler. + * @@ -5573,6 +5594,13 @@ index 0000000..c4831b7 + old_st->wsum -= entity->weight; + + if (entity->new_weight != entity->orig_weight) { ++ if (entity->new_weight < BFQ_MIN_WEIGHT || ++ entity->new_weight > BFQ_MAX_WEIGHT) { ++ printk(KERN_CRIT "update_weight_prio: " ++ "new_weight %d\n", ++ entity->new_weight); ++ BUG(); ++ } + entity->orig_weight = entity->new_weight; + entity->ioprio = + bfq_weight_to_ioprio(entity->orig_weight); @@ -6154,12 +6182,12 @@ index 0000000..c4831b7 +} diff --git a/block/bfq.h b/block/bfq.h new file mode 100644 -index 0000000..d4b9470 +index 0000000..3e41f2d --- /dev/null +++ b/block/bfq.h -@@ -0,0 +1,773 @@ +@@ -0,0 +1,775 @@ +/* -+ * BFQ-v7r6 for 3.17.0: data structures and common functions prototypes. ++ * BFQ-v7r7 for 3.17.0: data structures and common functions prototypes. + * + * Based on ideas and code from CFQ: + * Copyright (C) 2003 Jens Axboe @@ -6184,6 +6212,8 @@ index 0000000..d4b9470 +#define BFQ_MIN_WEIGHT 1 +#define BFQ_MAX_WEIGHT 1000 + ++#define BFQ_DEFAULT_QUEUE_IOPRIO 4 ++ +#define BFQ_DEFAULT_GRP_WEIGHT 10 +#define BFQ_DEFAULT_GRP_IOPRIO 0 +#define BFQ_DEFAULT_GRP_CLASS IOPRIO_CLASS_BE @@ -6932,5 +6962,5 @@ index 0000000..d4b9470 + +#endif /* _BFQ_H */ -- -2.1.2 +2.1.3 diff --git a/5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r6-for-3.17.0.patch b/5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r7-for-3.17.0.patch similarity index 94% rename from 5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r6-for-3.17.0.patch rename to 5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r7-for-3.17.0.patch index 5f4e71b..0b21a90 100644 --- a/5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r6-for-3.17.0.patch +++ b/5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r7-for-3.17.0.patch @@ -1,7 +1,7 @@ -From 596fb4db1452b42d366e54a1ac7902e9fb842643 Mon Sep 17 00:00:00 2001 +From 6b50a66488e742598f14a3fc906fe6a532854964 Mon Sep 17 00:00:00 2001 From: Mauro Andreolini -Date: Sun, 19 Oct 2014 01:15:59 +0200 -Subject: [PATCH 3/3] block, bfq: add Early Queue Merge (EQM) to BFQ-v7r6 for +Date: Thu, 18 Dec 2014 21:52:54 +0100 +Subject: [PATCH 3/3] block, bfq: add Early Queue Merge (EQM) to BFQ-v7r7 for 3.17.0 A set of processes may happen to perform interleaved reads, i.e.,requests @@ -34,13 +34,13 @@ Signed-off-by: Mauro Andreolini Signed-off-by: Arianna Avanzini Signed-off-by: Paolo Valente --- - block/bfq-iosched.c | 743 +++++++++++++++++++++++++++++++++++++--------------- + block/bfq-iosched.c | 751 +++++++++++++++++++++++++++++++++++++--------------- block/bfq-sched.c | 28 -- block/bfq.h | 54 +++- - 3 files changed, 573 insertions(+), 252 deletions(-) + 3 files changed, 581 insertions(+), 252 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c -index b919b03..bbfb4e1 100644 +index 97ee934..328f33c 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -571,6 +571,57 @@ static inline unsigned int bfq_wr_duration(struct bfq_data *bfqd) @@ -349,7 +349,7 @@ index b919b03..bbfb4e1 100644 if (bfqq == NULL || bfqq == cur_bfqq) return NULL; -@@ -1332,6 +1337,307 @@ static struct bfq_queue *bfq_close_cooperator(struct bfq_data *bfqd, +@@ -1332,6 +1337,315 @@ static struct bfq_queue *bfq_close_cooperator(struct bfq_data *bfqd, return bfqq; } @@ -419,6 +419,13 @@ index b919b03..bbfb4e1 100644 + * or with a close queue among the scheduled queues. + * Return NULL if no merge was scheduled, a pointer to the shared bfq_queue + * structure otherwise. ++ * ++ * The OOM queue is not allowed to participate to cooperation: in fact, since ++ * the requests temporarily redirected to the OOM queue could be redirected ++ * again to dedicated queues at any time, the state needed to correctly ++ * handle merging with the OOM queue would be quite complex and expensive ++ * to maintain. Besides, in such a critical condition as an out of memory, ++ * the benefits of queue merging may be little relevant, or even negligible. + */ +static struct bfq_queue * +bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, @@ -429,13 +436,14 @@ index b919b03..bbfb4e1 100644 + if (bfqq->new_bfqq) + return bfqq->new_bfqq; + -+ if (!io_struct) ++ if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq)) + return NULL; + + in_service_bfqq = bfqd->in_service_queue; + + if (in_service_bfqq == NULL || in_service_bfqq == bfqq || -+ !bfqd->in_service_bic) ++ !bfqd->in_service_bic || ++ unlikely(in_service_bfqq == &bfqd->oom_bfqq)) + goto check_scheduled; + + if (bfq_class_idle(in_service_bfqq) || bfq_class_idle(bfqq)) @@ -462,7 +470,7 @@ index b919b03..bbfb4e1 100644 +check_scheduled: + new_bfqq = bfq_close_cooperator(bfqd, bfqq, + bfq_io_struct_pos(io_struct, request)); -+ if (new_bfqq) ++ if (new_bfqq && likely(new_bfqq != &bfqd->oom_bfqq)) + return bfq_setup_merge(bfqq, new_bfqq); + + return NULL; @@ -657,7 +665,7 @@ index b919b03..bbfb4e1 100644 /* * If enough samples have been computed, return the current max budget * stored in bfqd, which is dynamically updated according to the -@@ -1475,61 +1781,6 @@ static struct request *bfq_check_fifo(struct bfq_queue *bfqq) +@@ -1475,61 +1789,6 @@ static struct request *bfq_check_fifo(struct bfq_queue *bfqq) return rq; } @@ -719,7 +727,7 @@ index b919b03..bbfb4e1 100644 static inline unsigned long bfq_bfqq_budget_left(struct bfq_queue *bfqq) { struct bfq_entity *entity = &bfqq->entity; -@@ -2263,7 +2514,7 @@ static inline bool bfq_bfqq_must_idle(struct bfq_queue *bfqq) +@@ -2263,7 +2522,7 @@ static inline bool bfq_bfqq_must_idle(struct bfq_queue *bfqq) */ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) { @@ -728,7 +736,7 @@ index b919b03..bbfb4e1 100644 struct request *next_rq; enum bfqq_expiration reason = BFQ_BFQQ_BUDGET_TIMEOUT; -@@ -2273,17 +2524,6 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) +@@ -2273,17 +2532,6 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) bfq_log_bfqq(bfqd, bfqq, "select_queue: already in-service queue"); @@ -746,7 +754,7 @@ index b919b03..bbfb4e1 100644 if (bfq_may_expire_for_budg_timeout(bfqq) && !timer_pending(&bfqd->idle_slice_timer) && !bfq_bfqq_must_idle(bfqq)) -@@ -2322,10 +2562,7 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) +@@ -2322,10 +2570,7 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) bfq_clear_bfqq_wait_request(bfqq); del_timer(&bfqd->idle_slice_timer); } @@ -758,7 +766,7 @@ index b919b03..bbfb4e1 100644 } } -@@ -2334,40 +2571,30 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) +@@ -2334,40 +2579,30 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd) * in flight (possibly waiting for a completion) or is idling for a * new request, then keep it. */ @@ -806,7 +814,7 @@ index b919b03..bbfb4e1 100644 jiffies_to_msecs(bfqq->wr_cur_max_time), bfqq->wr_coeff, bfqq->entity.weight, bfqq->entity.orig_weight); -@@ -2376,12 +2603,16 @@ static void bfq_update_wr_data(struct bfq_data *bfqd, +@@ -2376,12 +2611,16 @@ static void bfq_update_wr_data(struct bfq_data *bfqd, entity->orig_weight * bfqq->wr_coeff); if (entity->ioprio_changed) bfq_log_bfqq(bfqd, bfqq, "WARN: pending prio change"); @@ -824,7 +832,7 @@ index b919b03..bbfb4e1 100644 time_is_before_jiffies(bfqq->last_wr_start_finish + bfqq->wr_cur_max_time)) { bfqq->last_wr_start_finish = jiffies; -@@ -2390,11 +2621,13 @@ static void bfq_update_wr_data(struct bfq_data *bfqd, +@@ -2390,11 +2629,13 @@ static void bfq_update_wr_data(struct bfq_data *bfqd, bfqq->last_wr_start_finish, jiffies_to_msecs(bfqq->wr_cur_max_time)); bfq_bfqq_end_wr(bfqq); @@ -841,7 +849,7 @@ index b919b03..bbfb4e1 100644 } /* -@@ -2642,6 +2875,25 @@ static inline void bfq_init_icq(struct io_cq *icq) +@@ -2642,6 +2883,25 @@ static inline void bfq_init_icq(struct io_cq *icq) struct bfq_io_cq *bic = icq_to_bic(icq); bic->ttime.last_end_request = jiffies; @@ -867,7 +875,7 @@ index b919b03..bbfb4e1 100644 } static void bfq_exit_icq(struct io_cq *icq) -@@ -2655,6 +2907,13 @@ static void bfq_exit_icq(struct io_cq *icq) +@@ -2655,6 +2915,13 @@ static void bfq_exit_icq(struct io_cq *icq) } if (bic->bfqq[BLK_RW_SYNC]) { @@ -881,7 +889,7 @@ index b919b03..bbfb4e1 100644 bfq_exit_bfqq(bfqd, bic->bfqq[BLK_RW_SYNC]); bic->bfqq[BLK_RW_SYNC] = NULL; } -@@ -2944,6 +3203,10 @@ static void bfq_update_idle_window(struct bfq_data *bfqd, +@@ -2950,6 +3217,10 @@ static void bfq_update_idle_window(struct bfq_data *bfqd, if (!bfq_bfqq_sync(bfqq) || bfq_class_idle(bfqq)) return; @@ -892,7 +900,7 @@ index b919b03..bbfb4e1 100644 enable_idle = bfq_bfqq_idle_window(bfqq); if (atomic_read(&bic->icq.ioc->active_ref) == 0 || -@@ -2991,6 +3254,7 @@ static void bfq_rq_enqueued(struct bfq_data *bfqd, struct bfq_queue *bfqq, +@@ -2997,6 +3268,7 @@ static void bfq_rq_enqueued(struct bfq_data *bfqd, struct bfq_queue *bfqq, if (bfqq->entity.service > bfq_max_budget(bfqd) / 8 || !BFQQ_SEEKY(bfqq)) bfq_update_idle_window(bfqd, bfqq, bic); @@ -900,7 +908,7 @@ index b919b03..bbfb4e1 100644 bfq_log_bfqq(bfqd, bfqq, "rq_enqueued: idle_window=%d (seeky %d, mean %llu)", -@@ -3051,13 +3315,49 @@ static void bfq_rq_enqueued(struct bfq_data *bfqd, struct bfq_queue *bfqq, +@@ -3057,13 +3329,49 @@ static void bfq_rq_enqueued(struct bfq_data *bfqd, struct bfq_queue *bfqq, static void bfq_insert_request(struct request_queue *q, struct request *rq) { struct bfq_data *bfqd = q->elevator->elevator_data; @@ -951,7 +959,7 @@ index b919b03..bbfb4e1 100644 rq->fifo_time = jiffies + bfqd->bfq_fifo_expire[rq_is_sync(rq)]; list_add_tail(&rq->queuelist, &bfqq->fifo); -@@ -3222,18 +3522,6 @@ static void bfq_put_request(struct request *rq) +@@ -3228,18 +3536,6 @@ static void bfq_put_request(struct request *rq) } } @@ -970,7 +978,7 @@ index b919b03..bbfb4e1 100644 /* * Returns NULL if a new bfqq should be allocated, or the old bfqq if this * was the last process referring to said bfqq. -@@ -3242,6 +3530,9 @@ static struct bfq_queue * +@@ -3248,6 +3544,9 @@ static struct bfq_queue * bfq_split_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq) { bfq_log_bfqq(bfqq->bfqd, bfqq, "splitting queue"); @@ -980,7 +988,7 @@ index b919b03..bbfb4e1 100644 if (bfqq_process_refs(bfqq) == 1) { bfqq->pid = current->pid; bfq_clear_bfqq_coop(bfqq); -@@ -3270,6 +3561,7 @@ static int bfq_set_request(struct request_queue *q, struct request *rq, +@@ -3276,6 +3575,7 @@ static int bfq_set_request(struct request_queue *q, struct request *rq, struct bfq_queue *bfqq; struct bfq_group *bfqg; unsigned long flags; @@ -988,7 +996,7 @@ index b919b03..bbfb4e1 100644 might_sleep_if(gfp_mask & __GFP_WAIT); -@@ -3287,25 +3579,26 @@ new_queue: +@@ -3293,25 +3593,26 @@ new_queue: if (bfqq == NULL || bfqq == &bfqd->oom_bfqq) { bfqq = bfq_get_queue(bfqd, bfqg, is_sync, bic, gfp_mask); bic_set_bfqq(bic, bfqq, is_sync); @@ -1027,7 +1035,7 @@ index b919b03..bbfb4e1 100644 } bfqq->allocated[rw]++; -@@ -3316,6 +3609,26 @@ new_queue: +@@ -3322,6 +3623,26 @@ new_queue: rq->elv.priv[0] = bic; rq->elv.priv[1] = bfqq; @@ -1038,7 +1046,7 @@ index b919b03..bbfb4e1 100644 + * queue has just been split, mark a flag so that the + * information is available to the other scheduler hooks. + */ -+ if (bfqq_process_refs(bfqq) == 1) { ++ if (likely(bfqq != &bfqd->oom_bfqq) && bfqq_process_refs(bfqq) == 1) { + bfqq->bic = bic; + if (split) { + bfq_mark_bfqq_just_split(bfqq); @@ -1055,10 +1063,10 @@ index b919b03..bbfb4e1 100644 return 0; diff --git a/block/bfq-sched.c b/block/bfq-sched.c -index c4831b7..546a254 100644 +index 2931563..6764a7e 100644 --- a/block/bfq-sched.c +++ b/block/bfq-sched.c -@@ -1084,34 +1084,6 @@ static struct bfq_queue *bfq_get_next_queue(struct bfq_data *bfqd) +@@ -1091,34 +1091,6 @@ static struct bfq_queue *bfq_get_next_queue(struct bfq_data *bfqd) return bfqq; } @@ -1094,10 +1102,10 @@ index c4831b7..546a254 100644 { if (bfqd->in_service_bic != NULL) { diff --git a/block/bfq.h b/block/bfq.h -index d4b9470..0093084 100644 +index 3e41f2d..e5f4001 100644 --- a/block/bfq.h +++ b/block/bfq.h -@@ -216,18 +216,21 @@ struct bfq_group; +@@ -218,18 +218,21 @@ struct bfq_group; * idle @bfq_queue with no outstanding requests, then * the task associated with the queue it is deemed as * soft real-time (see the comments to the function @@ -1125,7 +1133,7 @@ index d4b9470..0093084 100644 * All the fields are protected by the queue lock of the containing bfqd. */ struct bfq_queue { -@@ -267,6 +270,7 @@ struct bfq_queue { +@@ -269,6 +272,7 @@ struct bfq_queue { unsigned int requests_within_timer; pid_t pid; @@ -1133,7 +1141,7 @@ index d4b9470..0093084 100644 /* weight-raising fields */ unsigned long wr_cur_max_time; -@@ -296,12 +300,42 @@ struct bfq_ttime { +@@ -298,12 +302,42 @@ struct bfq_ttime { * @icq: associated io_cq structure * @bfqq: array of two process queues, the sync and the async * @ttime: associated @bfq_ttime struct @@ -1176,7 +1184,7 @@ index d4b9470..0093084 100644 }; enum bfq_device_speed { -@@ -537,7 +571,7 @@ enum bfqq_state_flags { +@@ -539,7 +573,7 @@ enum bfqq_state_flags { BFQ_BFQQ_FLAG_prio_changed, /* task priority has changed */ BFQ_BFQQ_FLAG_sync, /* synchronous queue */ BFQ_BFQQ_FLAG_budget_new, /* no completion with this budget */ @@ -1185,7 +1193,7 @@ index d4b9470..0093084 100644 * bfqq has timed-out at least once * having consumed at most 2/10 of * its budget -@@ -550,12 +584,13 @@ enum bfqq_state_flags { +@@ -552,12 +586,13 @@ enum bfqq_state_flags { * bfqq has proved to be slow and * seeky until budget timeout */ @@ -1201,7 +1209,7 @@ index d4b9470..0093084 100644 }; #define BFQ_BFQQ_FNS(name) \ -@@ -585,6 +620,7 @@ BFQ_BFQQ_FNS(in_large_burst); +@@ -587,6 +622,7 @@ BFQ_BFQQ_FNS(in_large_burst); BFQ_BFQQ_FNS(constantly_seeky); BFQ_BFQQ_FNS(coop); BFQ_BFQQ_FNS(split_coop); @@ -1210,5 +1218,5 @@ index d4b9470..0093084 100644 #undef BFQ_BFQQ_FNS -- -2.1.2 +2.1.3