diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2010-06-18 10:39:47 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-06-18 13:57:47 -0400 |
commit | e98ef89b30b8a2e882b11d4965347015770f3627 (patch) | |
tree | c67bc9a9dc9b2c2806f9bc283847e5cd9d9780ce /block/cfq.h | |
parent | c10b61f0910466b4b99c266a7d76ac4390743fb5 (diff) |
cfq-iosched: Fixed boot warning with BLK_CGROUP=y and CFQ_GROUP_IOSCHED=n
Hi Jens,
Few days back Ingo noticed a CFQ boot time warning. This patch fixes it.
The issue here is that with CFQ_GROUP_IOSCHED=n, CFQ should not really
be making blkio stat related calls.
> Hm, it's still not entirely fixed, as of 2.6.35-rc2-00131-g7908a9e. With
> some
> configs i get bad spinlock warnings during bootup:
>
> [ 28.968013] initcall net_olddevs_init+0x0/0x82 returned 0 after 93750
> usecs
> [ 28.972003] calling b44_init+0x0/0x55 @ 1
> [ 28.976009] bus: 'pci': add driver b44
> [ 28.976374] sda:
> [ 28.978157] BUG: spinlock bad magic on CPU#1, async/0/117
> [ 28.980000] lock: 7e1c5bbc, .magic: 00000000, .owner: <none>/-1, +.owner_cpu: 0
> [ 28.980000] Pid: 117, comm: async/0 Not tainted +2.6.35-rc2-tip-01092-g010e7ef-dirty #8183
> [ 28.980000] Call Trace:
> [ 28.980000] [<41ba6d55>] ? printk+0x20/0x24
> [ 28.980000] [<4134b7b7>] spin_bug+0x7c/0x87
> [ 28.980000] [<4134b853>] do_raw_spin_lock+0x1e/0x123
> [ 28.980000] [<41ba92ca>] ? _raw_spin_lock_irqsave+0x12/0x20
> [ 28.980000] [<41ba92d2>] _raw_spin_lock_irqsave+0x1a/0x20
> [ 28.980000] [<4133476f>] blkiocg_update_io_add_stats+0x25/0xfb
> [ 28.980000] [<41335dae>] ? cfq_prio_tree_add+0xb1/0xc1
> [ 28.980000] [<41337bc7>] cfq_insert_request+0x8c/0x425
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/cfq.h')
-rw-r--r-- | block/cfq.h | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/block/cfq.h b/block/cfq.h new file mode 100644 index 000000000000..8783318dc5be --- /dev/null +++ b/block/cfq.h | |||
@@ -0,0 +1,115 @@ | |||
1 | #ifndef _CFQ_H | ||
2 | #define _CFQ_H | ||
3 | #include "blk-cgroup.h" | ||
4 | |||
5 | #ifdef CONFIG_CFQ_GROUP_IOSCHED | ||
6 | static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg, | ||
7 | struct blkio_group *curr_blkg, bool direction, bool sync) | ||
8 | { | ||
9 | blkiocg_update_io_add_stats(blkg, curr_blkg, direction, sync); | ||
10 | } | ||
11 | |||
12 | static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg, | ||
13 | unsigned long dequeue) | ||
14 | { | ||
15 | blkiocg_update_dequeue_stats(blkg, dequeue); | ||
16 | } | ||
17 | |||
18 | static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg, | ||
19 | unsigned long time) | ||
20 | { | ||
21 | blkiocg_update_timeslice_used(blkg, time); | ||
22 | } | ||
23 | |||
24 | static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg) | ||
25 | { | ||
26 | blkiocg_set_start_empty_time(blkg); | ||
27 | } | ||
28 | |||
29 | static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg, | ||
30 | bool direction, bool sync) | ||
31 | { | ||
32 | blkiocg_update_io_remove_stats(blkg, direction, sync); | ||
33 | } | ||
34 | |||
35 | static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg, | ||
36 | bool direction, bool sync) | ||
37 | { | ||
38 | blkiocg_update_io_merged_stats(blkg, direction, sync); | ||
39 | } | ||
40 | |||
41 | static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg) | ||
42 | { | ||
43 | blkiocg_update_idle_time_stats(blkg); | ||
44 | } | ||
45 | |||
46 | static inline void | ||
47 | cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg) | ||
48 | { | ||
49 | blkiocg_update_avg_queue_size_stats(blkg); | ||
50 | } | ||
51 | |||
52 | static inline void | ||
53 | cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg) | ||
54 | { | ||
55 | blkiocg_update_set_idle_time_stats(blkg); | ||
56 | } | ||
57 | |||
58 | static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg, | ||
59 | uint64_t bytes, bool direction, bool sync) | ||
60 | { | ||
61 | blkiocg_update_dispatch_stats(blkg, bytes, direction, sync); | ||
62 | } | ||
63 | |||
64 | static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg, uint64_t start_time, uint64_t io_start_time, bool direction, bool sync) | ||
65 | { | ||
66 | cfq_blkiocg_update_completion_stats(blkg, start_time, io_start_time, | ||
67 | direction, sync); | ||
68 | } | ||
69 | |||
70 | static inline void cfq_blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, | ||
71 | struct blkio_group *blkg, void *key, dev_t dev) { | ||
72 | blkiocg_add_blkio_group(blkcg, blkg, key, dev); | ||
73 | } | ||
74 | |||
75 | static inline int cfq_blkiocg_del_blkio_group(struct blkio_group *blkg) | ||
76 | { | ||
77 | return blkiocg_del_blkio_group(blkg); | ||
78 | } | ||
79 | |||
80 | #else /* CFQ_GROUP_IOSCHED */ | ||
81 | static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg, | ||
82 | struct blkio_group *curr_blkg, bool direction, bool sync) {} | ||
83 | |||
84 | static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg, | ||
85 | unsigned long dequeue) {} | ||
86 | |||
87 | static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg, | ||
88 | unsigned long time) {} | ||
89 | static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg) {} | ||
90 | static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg, | ||
91 | bool direction, bool sync) {} | ||
92 | static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg, | ||
93 | bool direction, bool sync) {} | ||
94 | static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg) | ||
95 | { | ||
96 | } | ||
97 | static inline void | ||
98 | cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg) {} | ||
99 | |||
100 | static inline void | ||
101 | cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg) {} | ||
102 | |||
103 | static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg, | ||
104 | uint64_t bytes, bool direction, bool sync) {} | ||
105 | static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg, uint64_t start_time, uint64_t io_start_time, bool direction, bool sync) {} | ||
106 | |||
107 | static inline void cfq_blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, | ||
108 | struct blkio_group *blkg, void *key, dev_t dev) {} | ||
109 | static inline int cfq_blkiocg_del_blkio_group(struct blkio_group *blkg) | ||
110 | { | ||
111 | return 0; | ||
112 | } | ||
113 | |||
114 | #endif /* CFQ_GROUP_IOSCHED */ | ||
115 | #endif | ||