]> git.baikalelectronics.ru Git - kernel.git/commit
cfq-iosched: cache prio_tree root in cfqq->p_root
authorJens Axboe <jens.axboe@oracle.com>
Thu, 23 Apr 2009 10:19:38 +0000 (12:19 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 24 Apr 2009 06:54:22 +0000 (08:54 +0200)
commit5df3ca1518bc4c8e6c06c186b5c3b81a7f320506
tree91efc4740f854b94ea84583a2cd6c34d14eafc8e
parent9c55edd3b5e1d0fad83c49ab996de6371c4cac83
cfq-iosched: cache prio_tree root in cfqq->p_root

Currently we look it up from ->ioprio, but ->ioprio can change if
either the process gets its IO priority changed explicitly, or if
cfq decides to temporarily boost it. So if we are unlucky, we can
end up attempting to remove a node from a different rbtree root than
where it was added.

Fix this by using ->org_ioprio as the prio_tree index, since that
will only change for explicit IO priority settings (not for a boost).
Additionally cache the rbtree root inside the cfqq, then we don't have
to add code to reinsert the cfqq in the prio_tree if IO priority changes.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/cfq-iosched.c