aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-06-01 04:13:43 -0400
committerJens Axboe <axboe@suse.de>2006-06-01 04:13:43 -0400
commitae818a38d4755ba4c16a22a8eacec859511a5393 (patch)
tree923ec4b261ab8b633fff2be9e7b9c4afcf704737
parent25776e3594f841b7fae7b33ebecf009a0a55bed1 (diff)
[PATCH] cfq-iosched: fix bug in timer handling for the idle class
There's a small window from when the timer is entered and we grab the queue lock, where cfq_set_active_queue() could be rearming the timer for us. Seen in the wild on a 12-way ppc box. Fix this by just using mod_timer(), which will do the right thing for us. Signed-off-by: Jens Axboe <axboe@suse.de>
-rw-r--r--block/cfq-iosched.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 5d2047b93eb5..85d188a30f82 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2193,10 +2193,9 @@ static void cfq_idle_class_timer(unsigned long data)
2193 * race with a non-idle queue, reset timer 2193 * race with a non-idle queue, reset timer
2194 */ 2194 */
2195 end = cfqd->last_end_request + CFQ_IDLE_GRACE; 2195 end = cfqd->last_end_request + CFQ_IDLE_GRACE;
2196 if (!time_after_eq(jiffies, end)) { 2196 if (!time_after_eq(jiffies, end))
2197 cfqd->idle_class_timer.expires = end; 2197 mod_timer(&cfqd->idle_class_timer, end);
2198 add_timer(&cfqd->idle_class_timer); 2198 else
2199 } else
2200 cfq_schedule_dispatch(cfqd); 2199 cfq_schedule_dispatch(cfqd);
2201 2200
2202 spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); 2201 spin_unlock_irqrestore(cfqd->queue->queue_lock, flags);