aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-01 17:38:43 -0400
committerTejun Heo <tj@kernel.org>2012-04-01 17:38:43 -0400
commit2ce4d50f9cfab40831eee5e51e950d5c4724994b (patch)
tree80dec4f311844b6a2af8a3f621ba9965de345d6d /block
parent60c2bc2d5a12369deef395cda41638d7e6b6bf19 (diff)
cfq: collapse cfq.h into cfq-iosched.c
block/cfq.h contains some functions which interact with blkcg; however, this is only part of it and cfq-iosched.c already has quite some #ifdef CONFIG_CFQ_GROUP_IOSCHED. With conf/stat handling being moved to specific policies, having these relay functions isolated in cfq.h doesn't make much sense. Collapse cfq.h into cfq-iosched.c for now. Let's split blkcg support properly later if necessary. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c114
-rw-r--r--block/cfq.h118
2 files changed, 113 insertions, 119 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 119e061a767..2e13e9e689b 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -15,7 +15,6 @@
15#include <linux/ioprio.h> 15#include <linux/ioprio.h>
16#include <linux/blktrace_api.h> 16#include <linux/blktrace_api.h>
17#include "blk.h" 17#include "blk.h"
18#include "cfq.h"
19 18
20static struct blkio_policy_type blkio_policy_cfq; 19static struct blkio_policy_type blkio_policy_cfq;
21 20
@@ -367,6 +366,9 @@ CFQ_CFQQ_FNS(wait_busy);
367#undef CFQ_CFQQ_FNS 366#undef CFQ_CFQQ_FNS
368 367
369#ifdef CONFIG_CFQ_GROUP_IOSCHED 368#ifdef CONFIG_CFQ_GROUP_IOSCHED
369
370#include "blk-cgroup.h"
371
370static inline struct cfq_group *blkg_to_cfqg(struct blkio_group *blkg) 372static inline struct cfq_group *blkg_to_cfqg(struct blkio_group *blkg)
371{ 373{
372 return blkg_to_pdata(blkg, &blkio_policy_cfq); 374 return blkg_to_pdata(blkg, &blkio_policy_cfq);
@@ -396,6 +398,82 @@ static inline void cfqg_put(struct cfq_group *cfqg)
396 blk_add_trace_msg((cfqd)->queue, "%s " fmt, \ 398 blk_add_trace_msg((cfqd)->queue, "%s " fmt, \
397 blkg_path(cfqg_to_blkg((cfqg))), ##args) \ 399 blkg_path(cfqg_to_blkg((cfqg))), ##args) \
398 400
401static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
402 struct blkio_policy_type *pol,
403 struct blkio_group *curr_blkg,
404 bool direction, bool sync)
405{
406 blkiocg_update_io_add_stats(blkg, pol, curr_blkg, direction, sync);
407}
408
409static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
410 struct blkio_policy_type *pol, unsigned long dequeue)
411{
412 blkiocg_update_dequeue_stats(blkg, pol, dequeue);
413}
414
415static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
416 struct blkio_policy_type *pol, unsigned long time,
417 unsigned long unaccounted_time)
418{
419 blkiocg_update_timeslice_used(blkg, pol, time, unaccounted_time);
420}
421
422static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg,
423 struct blkio_policy_type *pol)
424{
425 blkiocg_set_start_empty_time(blkg, pol);
426}
427
428static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
429 struct blkio_policy_type *pol, bool direction,
430 bool sync)
431{
432 blkiocg_update_io_remove_stats(blkg, pol, direction, sync);
433}
434
435static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
436 struct blkio_policy_type *pol, bool direction,
437 bool sync)
438{
439 blkiocg_update_io_merged_stats(blkg, pol, direction, sync);
440}
441
442static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg,
443 struct blkio_policy_type *pol)
444{
445 blkiocg_update_idle_time_stats(blkg, pol);
446}
447
448static inline void
449cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
450 struct blkio_policy_type *pol)
451{
452 blkiocg_update_avg_queue_size_stats(blkg, pol);
453}
454
455static inline void
456cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
457 struct blkio_policy_type *pol)
458{
459 blkiocg_update_set_idle_time_stats(blkg, pol);
460}
461
462static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
463 struct blkio_policy_type *pol, uint64_t bytes,
464 bool direction, bool sync)
465{
466 blkiocg_update_dispatch_stats(blkg, pol, bytes, direction, sync);
467}
468
469static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg,
470 struct blkio_policy_type *pol, uint64_t start_time,
471 uint64_t io_start_time, bool direction, bool sync)
472{
473 blkiocg_update_completion_stats(blkg, pol, start_time, io_start_time,
474 direction, sync);
475}
476
399#else /* CONFIG_CFQ_GROUP_IOSCHED */ 477#else /* CONFIG_CFQ_GROUP_IOSCHED */
400 478
401static inline struct cfq_group *blkg_to_cfqg(struct blkio_group *blkg) { return NULL; } 479static inline struct cfq_group *blkg_to_cfqg(struct blkio_group *blkg) { return NULL; }
@@ -407,6 +485,40 @@ static inline void cfqg_put(struct cfq_group *cfqg) { }
407 blk_add_trace_msg((cfqd)->queue, "cfq%d " fmt, (cfqq)->pid, ##args) 485 blk_add_trace_msg((cfqd)->queue, "cfq%d " fmt, (cfqq)->pid, ##args)
408#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do {} while (0) 486#define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do {} while (0)
409 487
488static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
489 struct blkio_policy_type *pol,
490 struct blkio_group *curr_blkg, bool direction,
491 bool sync) { }
492static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
493 struct blkio_policy_type *pol, unsigned long dequeue) { }
494static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
495 struct blkio_policy_type *pol, unsigned long time,
496 unsigned long unaccounted_time) { }
497static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg,
498 struct blkio_policy_type *pol) { }
499static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
500 struct blkio_policy_type *pol, bool direction,
501 bool sync) { }
502static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
503 struct blkio_policy_type *pol, bool direction,
504 bool sync) { }
505static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg,
506 struct blkio_policy_type *pol) { }
507static inline void
508cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
509 struct blkio_policy_type *pol) { }
510
511static inline void
512cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
513 struct blkio_policy_type *pol) { }
514
515static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
516 struct blkio_policy_type *pol, uint64_t bytes,
517 bool direction, bool sync) { }
518static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg,
519 struct blkio_policy_type *pol, uint64_t start_time,
520 uint64_t io_start_time, bool direction, bool sync) { }
521
410#endif /* CONFIG_CFQ_GROUP_IOSCHED */ 522#endif /* CONFIG_CFQ_GROUP_IOSCHED */
411 523
412#define cfq_log(cfqd, fmt, args...) \ 524#define cfq_log(cfqd, fmt, args...) \
diff --git a/block/cfq.h b/block/cfq.h
deleted file mode 100644
index c8b15ef57e5..00000000000
--- a/block/cfq.h
+++ /dev/null
@@ -1,118 +0,0 @@
1#ifndef _CFQ_H
2#define _CFQ_H
3#include "blk-cgroup.h"
4
5#ifdef CONFIG_CFQ_GROUP_IOSCHED
6static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
7 struct blkio_policy_type *pol,
8 struct blkio_group *curr_blkg,
9 bool direction, bool sync)
10{
11 blkiocg_update_io_add_stats(blkg, pol, curr_blkg, direction, sync);
12}
13
14static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
15 struct blkio_policy_type *pol, unsigned long dequeue)
16{
17 blkiocg_update_dequeue_stats(blkg, pol, dequeue);
18}
19
20static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
21 struct blkio_policy_type *pol, unsigned long time,
22 unsigned long unaccounted_time)
23{
24 blkiocg_update_timeslice_used(blkg, pol, time, unaccounted_time);
25}
26
27static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg,
28 struct blkio_policy_type *pol)
29{
30 blkiocg_set_start_empty_time(blkg, pol);
31}
32
33static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
34 struct blkio_policy_type *pol, bool direction,
35 bool sync)
36{
37 blkiocg_update_io_remove_stats(blkg, pol, direction, sync);
38}
39
40static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
41 struct blkio_policy_type *pol, bool direction,
42 bool sync)
43{
44 blkiocg_update_io_merged_stats(blkg, pol, direction, sync);
45}
46
47static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg,
48 struct blkio_policy_type *pol)
49{
50 blkiocg_update_idle_time_stats(blkg, pol);
51}
52
53static inline void
54cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
55 struct blkio_policy_type *pol)
56{
57 blkiocg_update_avg_queue_size_stats(blkg, pol);
58}
59
60static inline void
61cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
62 struct blkio_policy_type *pol)
63{
64 blkiocg_update_set_idle_time_stats(blkg, pol);
65}
66
67static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
68 struct blkio_policy_type *pol, uint64_t bytes,
69 bool direction, bool sync)
70{
71 blkiocg_update_dispatch_stats(blkg, pol, bytes, direction, sync);
72}
73
74static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg,
75 struct blkio_policy_type *pol, uint64_t start_time,
76 uint64_t io_start_time, bool direction, bool sync)
77{
78 blkiocg_update_completion_stats(blkg, pol, start_time, io_start_time,
79 direction, sync);
80}
81
82#else /* CFQ_GROUP_IOSCHED */
83static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
84 struct blkio_policy_type *pol,
85 struct blkio_group *curr_blkg, bool direction,
86 bool sync) { }
87static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
88 struct blkio_policy_type *pol, unsigned long dequeue) { }
89static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
90 struct blkio_policy_type *pol, unsigned long time,
91 unsigned long unaccounted_time) { }
92static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg,
93 struct blkio_policy_type *pol) { }
94static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
95 struct blkio_policy_type *pol, bool direction,
96 bool sync) { }
97static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
98 struct blkio_policy_type *pol, bool direction,
99 bool sync) { }
100static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg,
101 struct blkio_policy_type *pol) { }
102static inline void
103cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
104 struct blkio_policy_type *pol) { }
105
106static inline void
107cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
108 struct blkio_policy_type *pol) { }
109
110static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
111 struct blkio_policy_type *pol, uint64_t bytes,
112 bool direction, bool sync) { }
113static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg,
114 struct blkio_policy_type *pol, uint64_t start_time,
115 uint64_t io_start_time, bool direction, bool sync) { }
116
117#endif /* CFQ_GROUP_IOSCHED */
118#endif