History

block: get rid of kblock_schedule_delayed_work()

It was briefly introduced to allow CFQ to to delayed scheduling, but we ended up removing that feature again. So lets kill the function and export, and just switch CFQ back to the normal work schedule since it is now passing in a '0' delay from all call sites.

Jens Axboe committed 17 years ago

Commit 23e018a1 parent 48e025e3 files · +11 −25Browse files

Unified · Split

3 files
  1. block/blk-core.c +0 −8
  2. block/cfq-iosched.c +11 −13
  3. include/linux/blkdev.h +0 −4
block/blk-core.c+0−8
@@ -2492,14 +2492,6 @@ int kblockd_schedule_work(struct request_queue *q, struct work_struct *work) · 2491 unmodified lines
24922492 }
24932493 EXPORT_SYMBOL(kblockd_schedule_work);
24942494
2495−int kblockd_schedule_delayed_work(struct request_queue *q,
2496− struct delayed_work *work,
2497− unsigned long delay)
2498−{
2499− return queue_delayed_work(kblockd_workqueue, work, delay);
2500−}
2501−EXPORT_SYMBOL(kblockd_schedule_delayed_work);
2502−
25032495 int __init blk_dev_init(void)
25042496 {
25052497 BUILD_BUG_ON(__REQ_NR_BITS > 8 *
block/cfq-iosched.c+11−13
@@ -150,7 +150,7 @@ struct cfq_data { · 149 unmodified lines
150150 * idle window management
151151 */
152152 struct timer_list idle_slice_timer;
153− struct delayed_work unplug_work;
153+ struct work_struct unplug_work;
154154
155155 struct cfq_queue *active_queue;
156156 struct cfq_io_context *active_cic;
@@ -268,13 +268,11 @@ static inline int cfq_bio_sync(struct bio *bio) · 111 unmodified lines
268268 * scheduler run of queue, if there are requests pending and no one in the
269269 * driver that will restart queueing
270270 */
271−static inline void cfq_schedule_dispatch(struct cfq_data *cfqd,
272− unsigned long delay)
271+static inline void cfq_schedule_dispatch(struct cfq_data *cfqd)
273272 {
274273 if (cfqd->busy_queues) {
275274 cfq_log(cfqd, "schedule dispatch");
276− kblockd_schedule_delayed_work(cfqd->queue, &cfqd->unplug_work,
277− delay);
275+ kblockd_schedule_work(cfqd->queue, &cfqd->unplug_work);
278276 }
279277 }
280278
@@ -1400,7 +1398,7 @@ static void cfq_put_queue(struct cfq_queue *cfqq) · 1119 unmodified lines
14001398
14011399 if (unlikely(cfqd->active_queue == cfqq)) {
14021400 __cfq_slice_expired(cfqd, cfqq, 0);
1403− cfq_schedule_dispatch(cfqd, 0);
1401+ cfq_schedule_dispatch(cfqd);
14041402 }
14051403
14061404 kmem_cache_free(cfq_pool, cfqq);
@@ -1495,7 +1493,7 @@ static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq) · 88 unmodified lines
14951493 {
14961494 if (unlikely(cfqq == cfqd->active_queue)) {
14971495 __cfq_slice_expired(cfqd, cfqq, 0);
1498− cfq_schedule_dispatch(cfqd, 0);
1496+ cfq_schedule_dispatch(cfqd);
14991497 }
15001498
15011499 cfq_put_queue(cfqq);
@@ -2213,7 +2211,7 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq) · 711 unmodified lines
22132211 }
22142212
22152213 if (!rq_in_driver(cfqd))
2216− cfq_schedule_dispatch(cfqd, 0);
2214+ cfq_schedule_dispatch(cfqd);
22172215 }
22182216
22192217 /*
@@ -2343,7 +2341,7 @@ queue_fail: · 123 unmodified lines
23432341 if (cic)
23442342 put_io_context(cic->ioc);
23452343
2346− cfq_schedule_dispatch(cfqd, 0);
2344+ cfq_schedule_dispatch(cfqd);
23472345 spin_unlock_irqrestore(q->queue_lock, flags);
23482346 cfq_log(cfqd, "set_request fail");
23492347 return 1;
@@ -2352,7 +2350,7 @@ queue_fail: · 2 unmodified lines
23522350 static void cfq_kick_queue(struct work_struct *work)
23532351 {
23542352 struct cfq_data *cfqd =
2355− container_of(work, struct cfq_data, unplug_work.work);
2353+ container_of(work, struct cfq_data, unplug_work);
23562354 struct request_queue *q = cfqd->queue;
23572355
23582356 spin_lock_irq(q->queue_lock);
@@ -2406,7 +2404,7 @@ static void cfq_idle_slice_timer(unsigned long data) · 47 unmodified lines
24062404 expire:
24072405 cfq_slice_expired(cfqd, timed_out);
24082406 out_kick:
2409− cfq_schedule_dispatch(cfqd, 0);
2407+ cfq_schedule_dispatch(cfqd);
24102408 out_cont:
24112409 spin_unlock_irqrestore(cfqd->queue->queue_lock, flags);
24122410 }
@@ -2414,7 +2412,7 @@ out_cont: · 1 unmodified line
24142412 static void cfq_shutdown_timer_wq(struct cfq_data *cfqd)
24152413 {
24162414 del_timer_sync(&cfqd->idle_slice_timer);
2417− cancel_delayed_work_sync(&cfqd->unplug_work);
2415+ cancel_work_sync(&cfqd->unplug_work);
24182416 }
24192417
24202418 static void cfq_put_async_queues(struct cfq_data *cfqd)
@@ -2496,7 +2494,7 @@ static void *cfq_init_queue(struct request_queue *q) · 75 unmodified lines
24962494 cfqd->idle_slice_timer.function = cfq_idle_slice_timer;
24972495 cfqd->idle_slice_timer.data = (unsigned long) cfqd;
24982496
2499− INIT_DELAYED_WORK(&cfqd->unplug_work, cfq_kick_queue);
2497+ INIT_WORK(&cfqd->unplug_work, cfq_kick_queue);
25002498
25012499 cfqd->cfq_quantum = cfq_quantum;
25022500 cfqd->cfq_fifo_expire[0] = cfq_fifo_expire[0];
include/linux/blkdev.h+0−4
@@ -1172,11 +1172,7 @@ static inline void put_dev_sector(Sector p) · 1171 unmodified lines
11721172 }
11731173
11741174 struct work_struct;
1175−struct delayed_work;
11761175 int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
1177−int kblockd_schedule_delayed_work(struct request_queue *q,
1178− struct delayed_work *work,
1179− unsigned long delay);
11801176
11811177 #define MODULE_ALIAS_BLOCKDEV(major,minor) \
11821178 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))