Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:3.18 commit in: /
Date: Thu, 01 Jan 2015 14:15:32
Message-Id: 1420121719.410aa733bb46912b99ce35684653ffe4466c15a3.mpagano@gentoo
1 commit: 410aa733bb46912b99ce35684653ffe4466c15a3
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 1 14:15:19 2015 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 1 14:15:19 2015 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/linux-patches.git;a=commit;h=410aa733
7
8 Bump BFQ to v7r6. Remove old.
9
10 ---
11 ...oups-kconfig-build-bits-for-BFQ-v7r7-3.18.patch | 4 +-
12 ...ntroduce-the-BFQ-v7r7-I-O-sched-for-3.18.patch1 | 74 +++++++++++++------
13 ...ly-Queue-Merge-EQM-to-BFQ-v7r7-for-3.18.0.patch | 84 ++++++++++++----------
14 3 files changed, 100 insertions(+), 62 deletions(-)
15
16 diff --git a/5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r6-3.18.patch b/5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r7-3.18.patch
17 similarity index 97%
18 rename from 5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r6-3.18.patch
19 rename to 5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r7-3.18.patch
20 index 617e934..9f0a7b3 100644
21 --- a/5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r6-3.18.patch
22 +++ b/5001_block-cgroups-kconfig-build-bits-for-BFQ-v7r7-3.18.patch
23 @@ -1,7 +1,7 @@
24 -From 419f79b0ff5a322c1d0d88a687a207f948c6b2ee Mon Sep 17 00:00:00 2001
25 +From e5cfe6a861feffa55dda77cd60bdb571fc7c3065 Mon Sep 17 00:00:00 2001
26 From: Paolo Valente <paolo.valente@×××××××.it>
27 Date: Mon, 8 Dec 2014 16:04:25 +0100
28 -Subject: [PATCH 1/3] block: cgroups, kconfig, build bits for BFQ-v7r6-3.18
29 +Subject: [PATCH 1/3] block: cgroups, kconfig, build bits for BFQ-v7r7-3.18
30
31 Update Kconfig.iosched and do the related Makefile changes to include
32 kernel configuration options for BFQ. Also add the bfqio controller
33
34 diff --git a/5002_block-introduce-the-BFQ-v7r6-I-O-sched-for-3.18.patch1 b/5002_block-introduce-the-BFQ-v7r7-I-O-sched-for-3.18.patch1
35 similarity index 99%
36 rename from 5002_block-introduce-the-BFQ-v7r6-I-O-sched-for-3.18.patch1
37 rename to 5002_block-introduce-the-BFQ-v7r7-I-O-sched-for-3.18.patch1
38 index 981e93f..dcd10f7 100644
39 --- a/5002_block-introduce-the-BFQ-v7r6-I-O-sched-for-3.18.patch1
40 +++ b/5002_block-introduce-the-BFQ-v7r7-I-O-sched-for-3.18.patch1
41 @@ -1,9 +1,9 @@
42 -From 37542f69f6f11019b792c0b60ddc468edd0d5487 Mon Sep 17 00:00:00 2001
43 +From df04e0bc0d8b72775a74d45e355af9433f8e420e Mon Sep 17 00:00:00 2001
44 From: Paolo Valente <paolo.valente@×××××××.it>
45 Date: Thu, 9 May 2013 19:10:02 +0200
46 -Subject: [PATCH 2/3] block: introduce the BFQ-v7r6 I/O sched for 3.18
47 +Subject: [PATCH 2/3] block: introduce the BFQ-v7r7 I/O sched for 3.18
48
49 -Add the BFQ-v7r6 I/O scheduler to 3.18.
50 +Add the BFQ-v7r7 I/O scheduler to 3.18.
51 The general structure is borrowed from CFQ, as much of the code for
52 handling I/O contexts. Over time, several useful features have been
53 ported from CFQ as well (details in the changelog in README.BFQ). A
54 @@ -56,12 +56,12 @@ until it expires.
55 Signed-off-by: Paolo Valente <paolo.valente@×××××××.it>
56 Signed-off-by: Arianna Avanzini <avanzini.arianna@×××××.com>
57 ---
58 - block/bfq-cgroup.c | 930 ++++++++++++
59 + block/bfq-cgroup.c | 936 ++++++++++++
60 block/bfq-ioc.c | 36 +
61 - block/bfq-iosched.c | 3887 +++++++++++++++++++++++++++++++++++++++++++++++++++
62 - block/bfq-sched.c | 1207 ++++++++++++++++
63 - block/bfq.h | 773 ++++++++++
64 - 5 files changed, 6833 insertions(+)
65 + block/bfq-iosched.c | 3902 +++++++++++++++++++++++++++++++++++++++++++++++++++
66 + block/bfq-sched.c | 1214 ++++++++++++++++
67 + block/bfq.h | 775 ++++++++++
68 + 5 files changed, 6863 insertions(+)
69 create mode 100644 block/bfq-cgroup.c
70 create mode 100644 block/bfq-ioc.c
71 create mode 100644 block/bfq-iosched.c
72 @@ -70,10 +70,10 @@ Signed-off-by: Arianna Avanzini <avanzini.arianna@×××××.com>
73
74 diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
75 new file mode 100644
76 -index 0000000..eb140eb
77 +index 0000000..11e2f1d
78 --- /dev/null
79 +++ b/block/bfq-cgroup.c
80 -@@ -0,0 +1,930 @@
81 +@@ -0,0 +1,936 @@
82 +/*
83 + * BFQ: CGROUPS support.
84 + *
85 @@ -154,6 +154,12 @@ index 0000000..eb140eb
86 + entity->new_weight = bfq_ioprio_to_weight(bgrp->ioprio);
87 + entity->new_ioprio = bgrp->ioprio;
88 + } else {
89 ++ if (bgrp->weight < BFQ_MIN_WEIGHT ||
90 ++ bgrp->weight > BFQ_MAX_WEIGHT) {
91 ++ printk(KERN_CRIT "bfq_group_init_entity: "
92 ++ "bgrp->weight %d\n", bgrp->weight);
93 ++ BUG();
94 ++ }
95 + entity->new_weight = bgrp->weight;
96 + entity->new_ioprio = bfq_weight_to_ioprio(bgrp->weight);
97 + }
98 @@ -1048,10 +1054,10 @@ index 0000000..7f6b000
99 +}
100 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
101 new file mode 100644
102 -index 0000000..b919b03
103 +index 0000000..97ee934
104 --- /dev/null
105 +++ b/block/bfq-iosched.c
106 -@@ -0,0 +1,3887 @@
107 +@@ -0,0 +1,3902 @@
108 +/*
109 + * Budget Fair Queueing (BFQ) disk scheduler.
110 + *
111 @@ -3730,7 +3736,7 @@ index 0000000..b919b03
112 + switch (ioprio_class) {
113 + default:
114 + dev_err(bfqq->bfqd->queue->backing_dev_info.dev,
115 -+ "bfq: bad prio %x\n", ioprio_class);
116 ++ "bfq: bad prio class %d\n", ioprio_class);
117 + case IOPRIO_CLASS_NONE:
118 + /*
119 + * No prio set, inherit CPU scheduling settings.
120 @@ -3753,6 +3759,13 @@ index 0000000..b919b03
121 + break;
122 + }
123 +
124 ++ if (bfqq->entity.new_ioprio < 0 ||
125 ++ bfqq->entity.new_ioprio >= IOPRIO_BE_NR) {
126 ++ printk(KERN_CRIT "bfq_init_prio_data: new_ioprio %d\n",
127 ++ bfqq->entity.new_ioprio);
128 ++ BUG();
129 ++ }
130 ++
131 + bfqq->entity.ioprio_changed = 1;
132 +
133 + bfq_clear_bfqq_prio_changed(bfqq);
134 @@ -3869,14 +3882,13 @@ index 0000000..b919b03
135 +
136 + if (bfqq != NULL) {
137 + bfq_init_bfqq(bfqd, bfqq, current->pid, is_sync);
138 ++ bfq_init_prio_data(bfqq, bic);
139 ++ bfq_init_entity(&bfqq->entity, bfqg);
140 + bfq_log_bfqq(bfqd, bfqq, "allocated");
141 + } else {
142 + bfqq = &bfqd->oom_bfqq;
143 + bfq_log_bfqq(bfqd, bfqq, "using oom bfqq");
144 + }
145 -+
146 -+ bfq_init_prio_data(bfqq, bic);
147 -+ bfq_init_entity(&bfqq->entity, bfqg);
148 + }
149 +
150 + if (new_bfqq != NULL)
151 @@ -4533,6 +4545,14 @@ index 0000000..b919b03
152 + */
153 + bfq_init_bfqq(bfqd, &bfqd->oom_bfqq, 1, 0);
154 + atomic_inc(&bfqd->oom_bfqq.ref);
155 ++ bfqd->oom_bfqq.entity.new_ioprio = BFQ_DEFAULT_QUEUE_IOPRIO;
156 ++ bfqd->oom_bfqq.entity.new_ioprio_class = IOPRIO_CLASS_BE;
157 ++ /*
158 ++ * Trigger weight initialization, according to ioprio, at the
159 ++ * oom_bfqq's first activation. The oom_bfqq's ioprio and ioprio
160 ++ * class won't be changed any more.
161 ++ */
162 ++ bfqd->oom_bfqq.entity.ioprio_changed = 1;
163 +
164 + bfqd->queue = q;
165 +
166 @@ -4548,6 +4568,7 @@ index 0000000..b919b03
167 + }
168 +
169 + bfqd->root_group = bfqg;
170 ++ bfq_init_entity(&bfqd->oom_bfqq.entity, bfqd->root_group);
171 +#ifdef CONFIG_CGROUP_BFQIO
172 + bfqd->active_numerous_groups = 0;
173 +#endif
174 @@ -4923,7 +4944,7 @@ index 0000000..b919b03
175 + device_speed_thresh[1] = (R_fast[1] + R_slow[1]) / 2;
176 +
177 + elv_register(&iosched_bfq);
178 -+ pr_info("BFQ I/O-scheduler version: v7r6");
179 ++ pr_info("BFQ I/O-scheduler version: v7r7");
180 +
181 + return 0;
182 +}
183 @@ -4941,10 +4962,10 @@ index 0000000..b919b03
184 +MODULE_LICENSE("GPL");
185 diff --git a/block/bfq-sched.c b/block/bfq-sched.c
186 new file mode 100644
187 -index 0000000..c4831b7
188 +index 0000000..2931563
189 --- /dev/null
190 +++ b/block/bfq-sched.c
191 -@@ -0,0 +1,1207 @@
192 +@@ -0,0 +1,1214 @@
193 +/*
194 + * BFQ: Hierarchical B-WF2Q+ scheduler.
195 + *
196 @@ -5573,6 +5594,13 @@ index 0000000..c4831b7
197 + old_st->wsum -= entity->weight;
198 +
199 + if (entity->new_weight != entity->orig_weight) {
200 ++ if (entity->new_weight < BFQ_MIN_WEIGHT ||
201 ++ entity->new_weight > BFQ_MAX_WEIGHT) {
202 ++ printk(KERN_CRIT "update_weight_prio: "
203 ++ "new_weight %d\n",
204 ++ entity->new_weight);
205 ++ BUG();
206 ++ }
207 + entity->orig_weight = entity->new_weight;
208 + entity->ioprio =
209 + bfq_weight_to_ioprio(entity->orig_weight);
210 @@ -6154,12 +6182,12 @@ index 0000000..c4831b7
211 +}
212 diff --git a/block/bfq.h b/block/bfq.h
213 new file mode 100644
214 -index 0000000..01dcdc4
215 +index 0000000..649afe9
216 --- /dev/null
217 +++ b/block/bfq.h
218 -@@ -0,0 +1,773 @@
219 +@@ -0,0 +1,775 @@
220 +/*
221 -+ * BFQ-v7r6 for 3.18.0: data structures and common functions prototypes.
222 ++ * BFQ-v7r7 for 3.18.0: data structures and common functions prototypes.
223 + *
224 + * Based on ideas and code from CFQ:
225 + * Copyright (C) 2003 Jens Axboe <axboe@××××××.dk>
226 @@ -6184,6 +6212,8 @@ index 0000000..01dcdc4
227 +#define BFQ_MIN_WEIGHT 1
228 +#define BFQ_MAX_WEIGHT 1000
229 +
230 ++#define BFQ_DEFAULT_QUEUE_IOPRIO 4
231 ++
232 +#define BFQ_DEFAULT_GRP_WEIGHT 10
233 +#define BFQ_DEFAULT_GRP_IOPRIO 0
234 +#define BFQ_DEFAULT_GRP_CLASS IOPRIO_CLASS_BE
235
236 diff --git a/5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r6-for-3.18.0.patch b/5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r7-for-3.18.0.patch
237 similarity index 94%
238 rename from 5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r6-for-3.18.0.patch
239 rename to 5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r7-for-3.18.0.patch
240 index 5c9a70b..1292c2b 100644
241 --- a/5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r6-for-3.18.0.patch
242 +++ b/5003_block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r7-for-3.18.0.patch
243 @@ -1,7 +1,7 @@
244 -From 04f637beb4b6801a81894e9918eee5899e5cc5b5 Mon Sep 17 00:00:00 2001
245 +From b941be79912544b39141eff175bc1964568a5b1b Mon Sep 17 00:00:00 2001
246 From: Mauro Andreolini <mauro.andreolini@×××××××.it>
247 -Date: Sun, 19 Oct 2014 01:15:59 +0200
248 -Subject: [PATCH 3/3] block, bfq: add Early Queue Merge (EQM) to BFQ-v7r6 for
249 +Date: Thu, 18 Dec 2014 21:32:08 +0100
250 +Subject: [PATCH 3/3] block, bfq: add Early Queue Merge (EQM) to BFQ-v7r7 for
251 3.18.0
252
253 A set of processes may happen to perform interleaved reads, i.e.,requests
254 @@ -27,20 +27,20 @@ EQM is then simpler and more compact than the pair of mechanisms used in
255 CFQ.
256
257 Finally, EQM also preserves the typical low-latency properties of BFQ, by
258 -properly restoring the weight-raising state of a queue when it gets back to
259 +properly restoring the weight-raising state of a queue when it gets back to
260 a non-merged state.
261
262 Signed-off-by: Mauro Andreolini <mauro.andreolini@×××××××.it>
263 Signed-off-by: Arianna Avanzini <avanzini.arianna@×××××.com>
264 Signed-off-by: Paolo Valente <paolo.valente@×××××××.it>
265 ---
266 - block/bfq-iosched.c | 743 +++++++++++++++++++++++++++++++++++++---------------
267 + block/bfq-iosched.c | 751 +++++++++++++++++++++++++++++++++++++---------------
268 block/bfq-sched.c | 28 --
269 block/bfq.h | 54 +++-
270 - 3 files changed, 573 insertions(+), 252 deletions(-)
271 + 3 files changed, 581 insertions(+), 252 deletions(-)
272
273 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
274 -index b919b03..bbfb4e1 100644
275 +index 97ee934..328f33c 100644
276 --- a/block/bfq-iosched.c
277 +++ b/block/bfq-iosched.c
278 @@ -571,6 +571,57 @@ static inline unsigned int bfq_wr_duration(struct bfq_data *bfqd)
279 @@ -349,7 +349,7 @@ index b919b03..bbfb4e1 100644
280 if (bfqq == NULL || bfqq == cur_bfqq)
281 return NULL;
282
283 -@@ -1332,6 +1337,307 @@ static struct bfq_queue *bfq_close_cooperator(struct bfq_data *bfqd,
284 +@@ -1332,6 +1337,315 @@ static struct bfq_queue *bfq_close_cooperator(struct bfq_data *bfqd,
285 return bfqq;
286 }
287
288 @@ -419,6 +419,13 @@ index b919b03..bbfb4e1 100644
289 + * or with a close queue among the scheduled queues.
290 + * Return NULL if no merge was scheduled, a pointer to the shared bfq_queue
291 + * structure otherwise.
292 ++ *
293 ++ * The OOM queue is not allowed to participate to cooperation: in fact, since
294 ++ * the requests temporarily redirected to the OOM queue could be redirected
295 ++ * again to dedicated queues at any time, the state needed to correctly
296 ++ * handle merging with the OOM queue would be quite complex and expensive
297 ++ * to maintain. Besides, in such a critical condition as an out of memory,
298 ++ * the benefits of queue merging may be little relevant, or even negligible.
299 + */
300 +static struct bfq_queue *
301 +bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq,
302 @@ -429,13 +436,14 @@ index b919b03..bbfb4e1 100644
303 + if (bfqq->new_bfqq)
304 + return bfqq->new_bfqq;
305 +
306 -+ if (!io_struct)
307 ++ if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq))
308 + return NULL;
309 +
310 + in_service_bfqq = bfqd->in_service_queue;
311 +
312 + if (in_service_bfqq == NULL || in_service_bfqq == bfqq ||
313 -+ !bfqd->in_service_bic)
314 ++ !bfqd->in_service_bic ||
315 ++ unlikely(in_service_bfqq == &bfqd->oom_bfqq))
316 + goto check_scheduled;
317 +
318 + if (bfq_class_idle(in_service_bfqq) || bfq_class_idle(bfqq))
319 @@ -462,7 +470,7 @@ index b919b03..bbfb4e1 100644
320 +check_scheduled:
321 + new_bfqq = bfq_close_cooperator(bfqd, bfqq,
322 + bfq_io_struct_pos(io_struct, request));
323 -+ if (new_bfqq)
324 ++ if (new_bfqq && likely(new_bfqq != &bfqd->oom_bfqq))
325 + return bfq_setup_merge(bfqq, new_bfqq);
326 +
327 + return NULL;
328 @@ -657,7 +665,7 @@ index b919b03..bbfb4e1 100644
329 /*
330 * If enough samples have been computed, return the current max budget
331 * stored in bfqd, which is dynamically updated according to the
332 -@@ -1475,61 +1781,6 @@ static struct request *bfq_check_fifo(struct bfq_queue *bfqq)
333 +@@ -1475,61 +1789,6 @@ static struct request *bfq_check_fifo(struct bfq_queue *bfqq)
334 return rq;
335 }
336
337 @@ -719,7 +727,7 @@ index b919b03..bbfb4e1 100644
338 static inline unsigned long bfq_bfqq_budget_left(struct bfq_queue *bfqq)
339 {
340 struct bfq_entity *entity = &bfqq->entity;
341 -@@ -2263,7 +2514,7 @@ static inline bool bfq_bfqq_must_idle(struct bfq_queue *bfqq)
342 +@@ -2263,7 +2522,7 @@ static inline bool bfq_bfqq_must_idle(struct bfq_queue *bfqq)
343 */
344 static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
345 {
346 @@ -728,7 +736,7 @@ index b919b03..bbfb4e1 100644
347 struct request *next_rq;
348 enum bfqq_expiration reason = BFQ_BFQQ_BUDGET_TIMEOUT;
349
350 -@@ -2273,17 +2524,6 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
351 +@@ -2273,17 +2532,6 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
352
353 bfq_log_bfqq(bfqd, bfqq, "select_queue: already in-service queue");
354
355 @@ -746,7 +754,7 @@ index b919b03..bbfb4e1 100644
356 if (bfq_may_expire_for_budg_timeout(bfqq) &&
357 !timer_pending(&bfqd->idle_slice_timer) &&
358 !bfq_bfqq_must_idle(bfqq))
359 -@@ -2322,10 +2562,7 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
360 +@@ -2322,10 +2570,7 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
361 bfq_clear_bfqq_wait_request(bfqq);
362 del_timer(&bfqd->idle_slice_timer);
363 }
364 @@ -758,7 +766,7 @@ index b919b03..bbfb4e1 100644
365 }
366 }
367
368 -@@ -2334,40 +2571,30 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
369 +@@ -2334,40 +2579,30 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
370 * in flight (possibly waiting for a completion) or is idling for a
371 * new request, then keep it.
372 */
373 @@ -806,7 +814,7 @@ index b919b03..bbfb4e1 100644
374 jiffies_to_msecs(bfqq->wr_cur_max_time),
375 bfqq->wr_coeff,
376 bfqq->entity.weight, bfqq->entity.orig_weight);
377 -@@ -2376,12 +2603,16 @@ static void bfq_update_wr_data(struct bfq_data *bfqd,
378 +@@ -2376,12 +2611,16 @@ static void bfq_update_wr_data(struct bfq_data *bfqd,
379 entity->orig_weight * bfqq->wr_coeff);
380 if (entity->ioprio_changed)
381 bfq_log_bfqq(bfqd, bfqq, "WARN: pending prio change");
382 @@ -824,7 +832,7 @@ index b919b03..bbfb4e1 100644
383 time_is_before_jiffies(bfqq->last_wr_start_finish +
384 bfqq->wr_cur_max_time)) {
385 bfqq->last_wr_start_finish = jiffies;
386 -@@ -2390,11 +2621,13 @@ static void bfq_update_wr_data(struct bfq_data *bfqd,
387 +@@ -2390,11 +2629,13 @@ static void bfq_update_wr_data(struct bfq_data *bfqd,
388 bfqq->last_wr_start_finish,
389 jiffies_to_msecs(bfqq->wr_cur_max_time));
390 bfq_bfqq_end_wr(bfqq);
391 @@ -841,7 +849,7 @@ index b919b03..bbfb4e1 100644
392 }
393
394 /*
395 -@@ -2642,6 +2875,25 @@ static inline void bfq_init_icq(struct io_cq *icq)
396 +@@ -2642,6 +2883,25 @@ static inline void bfq_init_icq(struct io_cq *icq)
397 struct bfq_io_cq *bic = icq_to_bic(icq);
398
399 bic->ttime.last_end_request = jiffies;
400 @@ -867,7 +875,7 @@ index b919b03..bbfb4e1 100644
401 }
402
403 static void bfq_exit_icq(struct io_cq *icq)
404 -@@ -2655,6 +2907,13 @@ static void bfq_exit_icq(struct io_cq *icq)
405 +@@ -2655,6 +2915,13 @@ static void bfq_exit_icq(struct io_cq *icq)
406 }
407
408 if (bic->bfqq[BLK_RW_SYNC]) {
409 @@ -881,7 +889,7 @@ index b919b03..bbfb4e1 100644
410 bfq_exit_bfqq(bfqd, bic->bfqq[BLK_RW_SYNC]);
411 bic->bfqq[BLK_RW_SYNC] = NULL;
412 }
413 -@@ -2944,6 +3203,10 @@ static void bfq_update_idle_window(struct bfq_data *bfqd,
414 +@@ -2950,6 +3217,10 @@ static void bfq_update_idle_window(struct bfq_data *bfqd,
415 if (!bfq_bfqq_sync(bfqq) || bfq_class_idle(bfqq))
416 return;
417
418 @@ -892,7 +900,7 @@ index b919b03..bbfb4e1 100644
419 enable_idle = bfq_bfqq_idle_window(bfqq);
420
421 if (atomic_read(&bic->icq.ioc->active_ref) == 0 ||
422 -@@ -2991,6 +3254,7 @@ static void bfq_rq_enqueued(struct bfq_data *bfqd, struct bfq_queue *bfqq,
423 +@@ -2997,6 +3268,7 @@ static void bfq_rq_enqueued(struct bfq_data *bfqd, struct bfq_queue *bfqq,
424 if (bfqq->entity.service > bfq_max_budget(bfqd) / 8 ||
425 !BFQQ_SEEKY(bfqq))
426 bfq_update_idle_window(bfqd, bfqq, bic);
427 @@ -900,7 +908,7 @@ index b919b03..bbfb4e1 100644
428
429 bfq_log_bfqq(bfqd, bfqq,
430 "rq_enqueued: idle_window=%d (seeky %d, mean %llu)",
431 -@@ -3051,13 +3315,49 @@ static void bfq_rq_enqueued(struct bfq_data *bfqd, struct bfq_queue *bfqq,
432 +@@ -3057,13 +3329,49 @@ static void bfq_rq_enqueued(struct bfq_data *bfqd, struct bfq_queue *bfqq,
433 static void bfq_insert_request(struct request_queue *q, struct request *rq)
434 {
435 struct bfq_data *bfqd = q->elevator->elevator_data;
436 @@ -951,7 +959,7 @@ index b919b03..bbfb4e1 100644
437 rq->fifo_time = jiffies + bfqd->bfq_fifo_expire[rq_is_sync(rq)];
438 list_add_tail(&rq->queuelist, &bfqq->fifo);
439
440 -@@ -3222,18 +3522,6 @@ static void bfq_put_request(struct request *rq)
441 +@@ -3228,18 +3536,6 @@ static void bfq_put_request(struct request *rq)
442 }
443 }
444
445 @@ -970,7 +978,7 @@ index b919b03..bbfb4e1 100644
446 /*
447 * Returns NULL if a new bfqq should be allocated, or the old bfqq if this
448 * was the last process referring to said bfqq.
449 -@@ -3242,6 +3530,9 @@ static struct bfq_queue *
450 +@@ -3248,6 +3544,9 @@ static struct bfq_queue *
451 bfq_split_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq)
452 {
453 bfq_log_bfqq(bfqq->bfqd, bfqq, "splitting queue");
454 @@ -980,7 +988,7 @@ index b919b03..bbfb4e1 100644
455 if (bfqq_process_refs(bfqq) == 1) {
456 bfqq->pid = current->pid;
457 bfq_clear_bfqq_coop(bfqq);
458 -@@ -3270,6 +3561,7 @@ static int bfq_set_request(struct request_queue *q, struct request *rq,
459 +@@ -3276,6 +3575,7 @@ static int bfq_set_request(struct request_queue *q, struct request *rq,
460 struct bfq_queue *bfqq;
461 struct bfq_group *bfqg;
462 unsigned long flags;
463 @@ -988,7 +996,7 @@ index b919b03..bbfb4e1 100644
464
465 might_sleep_if(gfp_mask & __GFP_WAIT);
466
467 -@@ -3287,25 +3579,26 @@ new_queue:
468 +@@ -3293,25 +3593,26 @@ new_queue:
469 if (bfqq == NULL || bfqq == &bfqd->oom_bfqq) {
470 bfqq = bfq_get_queue(bfqd, bfqg, is_sync, bic, gfp_mask);
471 bic_set_bfqq(bic, bfqq, is_sync);
472 @@ -1027,7 +1035,7 @@ index b919b03..bbfb4e1 100644
473 }
474
475 bfqq->allocated[rw]++;
476 -@@ -3316,6 +3609,26 @@ new_queue:
477 +@@ -3322,6 +3623,26 @@ new_queue:
478 rq->elv.priv[0] = bic;
479 rq->elv.priv[1] = bfqq;
480
481 @@ -1038,7 +1046,7 @@ index b919b03..bbfb4e1 100644
482 + * queue has just been split, mark a flag so that the
483 + * information is available to the other scheduler hooks.
484 + */
485 -+ if (bfqq_process_refs(bfqq) == 1) {
486 ++ if (likely(bfqq != &bfqd->oom_bfqq) && bfqq_process_refs(bfqq) == 1) {
487 + bfqq->bic = bic;
488 + if (split) {
489 + bfq_mark_bfqq_just_split(bfqq);
490 @@ -1055,10 +1063,10 @@ index b919b03..bbfb4e1 100644
491
492 return 0;
493 diff --git a/block/bfq-sched.c b/block/bfq-sched.c
494 -index c4831b7..546a254 100644
495 +index 2931563..6764a7e 100644
496 --- a/block/bfq-sched.c
497 +++ b/block/bfq-sched.c
498 -@@ -1084,34 +1084,6 @@ static struct bfq_queue *bfq_get_next_queue(struct bfq_data *bfqd)
499 +@@ -1091,34 +1091,6 @@ static struct bfq_queue *bfq_get_next_queue(struct bfq_data *bfqd)
500 return bfqq;
501 }
502
503 @@ -1094,10 +1102,10 @@ index c4831b7..546a254 100644
504 {
505 if (bfqd->in_service_bic != NULL) {
506 diff --git a/block/bfq.h b/block/bfq.h
507 -index 01dcdc4..a193a56 100644
508 +index 649afe9..0767d75 100644
509 --- a/block/bfq.h
510 +++ b/block/bfq.h
511 -@@ -216,18 +216,21 @@ struct bfq_group;
512 +@@ -218,18 +218,21 @@ struct bfq_group;
513 * idle @bfq_queue with no outstanding requests, then
514 * the task associated with the queue it is deemed as
515 * soft real-time (see the comments to the function
516 @@ -1125,7 +1133,7 @@ index 01dcdc4..a193a56 100644
517 * All the fields are protected by the queue lock of the containing bfqd.
518 */
519 struct bfq_queue {
520 -@@ -267,6 +270,7 @@ struct bfq_queue {
521 +@@ -269,6 +272,7 @@ struct bfq_queue {
522 unsigned int requests_within_timer;
523
524 pid_t pid;
525 @@ -1133,7 +1141,7 @@ index 01dcdc4..a193a56 100644
526
527 /* weight-raising fields */
528 unsigned long wr_cur_max_time;
529 -@@ -296,12 +300,42 @@ struct bfq_ttime {
530 +@@ -298,12 +302,42 @@ struct bfq_ttime {
531 * @icq: associated io_cq structure
532 * @bfqq: array of two process queues, the sync and the async
533 * @ttime: associated @bfq_ttime struct
534 @@ -1176,7 +1184,7 @@ index 01dcdc4..a193a56 100644
535 };
536
537 enum bfq_device_speed {
538 -@@ -537,7 +571,7 @@ enum bfqq_state_flags {
539 +@@ -539,7 +573,7 @@ enum bfqq_state_flags {
540 BFQ_BFQQ_FLAG_prio_changed, /* task priority has changed */
541 BFQ_BFQQ_FLAG_sync, /* synchronous queue */
542 BFQ_BFQQ_FLAG_budget_new, /* no completion with this budget */
543 @@ -1185,7 +1193,7 @@ index 01dcdc4..a193a56 100644
544 * bfqq has timed-out at least once
545 * having consumed at most 2/10 of
546 * its budget
547 -@@ -550,12 +584,13 @@ enum bfqq_state_flags {
548 +@@ -552,12 +586,13 @@ enum bfqq_state_flags {
549 * bfqq has proved to be slow and
550 * seeky until budget timeout
551 */
552 @@ -1201,7 +1209,7 @@ index 01dcdc4..a193a56 100644
553 };
554
555 #define BFQ_BFQQ_FNS(name) \
556 -@@ -585,6 +620,7 @@ BFQ_BFQQ_FNS(in_large_burst);
557 +@@ -587,6 +622,7 @@ BFQ_BFQQ_FNS(in_large_burst);
558 BFQ_BFQQ_FNS(constantly_seeky);
559 BFQ_BFQQ_FNS(coop);
560 BFQ_BFQQ_FNS(split_coop);