mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
[PATCH] CFQ io scheduler: scheduler switch oops
If cfq is managing a queue and a new scheduler is later selected, it is possible for the cfqd unplug_work work to be queued after the kblockd work struct has been flushed. The problem is the ordering of cfq_shutdown_timer_wq() and blk_put_queue() in cfq_put_cfqd(). The latter may rearm the work, leaving cfq_kick_queue() with dead data. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
52a5e15f66
commit
96c51ce94e
1 changed files with 3 additions and 2 deletions
|
@ -2249,10 +2249,11 @@ static void cfq_put_cfqd(struct cfq_data *cfqd)
|
||||||
if (!atomic_dec_and_test(&cfqd->ref))
|
if (!atomic_dec_and_test(&cfqd->ref))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cfq_shutdown_timer_wq(cfqd);
|
|
||||||
|
|
||||||
blk_put_queue(q);
|
blk_put_queue(q);
|
||||||
|
|
||||||
|
cfq_shutdown_timer_wq(cfqd);
|
||||||
|
q->elevator->elevator_data = NULL;
|
||||||
|
|
||||||
mempool_destroy(cfqd->crq_pool);
|
mempool_destroy(cfqd->crq_pool);
|
||||||
kfree(cfqd->crq_hash);
|
kfree(cfqd->crq_hash);
|
||||||
kfree(cfqd->cfq_hash);
|
kfree(cfqd->cfq_hash);
|
||||||
|
|
Loading…
Reference in a new issue