Skip to content

Commit

Permalink
block: get rid of kblock_schedule_delayed_work()
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jens Axboe committed Oct 5, 2009
1 parent 48e025e commit 23e018a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
8 changes: 0 additions & 8 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2492,14 +2492,6 @@ int kblockd_schedule_work(struct request_queue *q, struct work_struct *work)
}
EXPORT_SYMBOL(kblockd_schedule_work);

int kblockd_schedule_delayed_work(struct request_queue *q,
struct delayed_work *work,
unsigned long delay)
{
return queue_delayed_work(kblockd_workqueue, work, delay);
}
EXPORT_SYMBOL(kblockd_schedule_delayed_work);

int __init blk_dev_init(void)
{
BUILD_BUG_ON(__REQ_NR_BITS > 8 *
Expand Down
24 changes: 11 additions & 13 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ struct cfq_data {
* idle window management
*/
struct timer_list idle_slice_timer;
struct delayed_work unplug_work;
struct work_struct unplug_work;

struct cfq_queue *active_queue;
struct cfq_io_context *active_cic;
Expand Down Expand Up @@ -268,13 +268,11 @@ static inline int cfq_bio_sync(struct bio *bio)
* scheduler run of queue, if there are requests pending and no one in the
* driver that will restart queueing
*/
static inline void cfq_schedule_dispatch(struct cfq_data *cfqd,
unsigned long delay)
static inline void cfq_schedule_dispatch(struct cfq_data *cfqd)
{
if (cfqd->busy_queues) {
cfq_log(cfqd, "schedule dispatch");
kblockd_schedule_delayed_work(cfqd->queue, &cfqd->unplug_work,
delay);
kblockd_schedule_work(cfqd->queue, &cfqd->unplug_work);
}
}

Expand Down Expand Up @@ -1400,7 +1398,7 @@ static void cfq_put_queue(struct cfq_queue *cfqq)

if (unlikely(cfqd->active_queue == cfqq)) {
__cfq_slice_expired(cfqd, cfqq, 0);
cfq_schedule_dispatch(cfqd, 0);
cfq_schedule_dispatch(cfqd);
}

kmem_cache_free(cfq_pool, cfqq);
Expand Down Expand Up @@ -1495,7 +1493,7 @@ static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq)
{
if (unlikely(cfqq == cfqd->active_queue)) {
__cfq_slice_expired(cfqd, cfqq, 0);
cfq_schedule_dispatch(cfqd, 0);
cfq_schedule_dispatch(cfqd);
}

cfq_put_queue(cfqq);
Expand Down Expand Up @@ -2213,7 +2211,7 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq)
}

if (!rq_in_driver(cfqd))
cfq_schedule_dispatch(cfqd, 0);
cfq_schedule_dispatch(cfqd);
}

/*
Expand Down Expand Up @@ -2343,7 +2341,7 @@ cfq_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask)
if (cic)
put_io_context(cic->ioc);

cfq_schedule_dispatch(cfqd, 0);
cfq_schedule_dispatch(cfqd);
spin_unlock_irqrestore(q->queue_lock, flags);
cfq_log(cfqd, "set_request fail");
return 1;
Expand All @@ -2352,7 +2350,7 @@ cfq_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask)
static void cfq_kick_queue(struct work_struct *work)
{
struct cfq_data *cfqd =
container_of(work, struct cfq_data, unplug_work.work);
container_of(work, struct cfq_data, unplug_work);
struct request_queue *q = cfqd->queue;

spin_lock_irq(q->queue_lock);
Expand Down Expand Up @@ -2406,15 +2404,15 @@ static void cfq_idle_slice_timer(unsigned long data)
expire:
cfq_slice_expired(cfqd, timed_out);
out_kick:
cfq_schedule_dispatch(cfqd, 0);
cfq_schedule_dispatch(cfqd);
out_cont:
spin_unlock_irqrestore(cfqd->queue->queue_lock, flags);
}

static void cfq_shutdown_timer_wq(struct cfq_data *cfqd)
{
del_timer_sync(&cfqd->idle_slice_timer);
cancel_delayed_work_sync(&cfqd->unplug_work);
cancel_work_sync(&cfqd->unplug_work);
}

static void cfq_put_async_queues(struct cfq_data *cfqd)
Expand Down Expand Up @@ -2496,7 +2494,7 @@ static void *cfq_init_queue(struct request_queue *q)
cfqd->idle_slice_timer.function = cfq_idle_slice_timer;
cfqd->idle_slice_timer.data = (unsigned long) cfqd;

INIT_DELAYED_WORK(&cfqd->unplug_work, cfq_kick_queue);
INIT_WORK(&cfqd->unplug_work, cfq_kick_queue);

cfqd->cfq_quantum = cfq_quantum;
cfqd->cfq_fifo_expire[0] = cfq_fifo_expire[0];
Expand Down
4 changes: 0 additions & 4 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -1172,11 +1172,7 @@ static inline void put_dev_sector(Sector p)
}

struct work_struct;
struct delayed_work;
int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
int kblockd_schedule_delayed_work(struct request_queue *q,
struct delayed_work *work,
unsigned long delay);

#define MODULE_ALIAS_BLOCKDEV(major,minor) \
MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
Expand Down

0 comments on commit 23e018a

Please sign in to comment.