Gentoo Archives: gentoo-commits

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