]> git.baikalelectronics.ru Git - kernel.git/commit
block: cfq: make the io contect sharing lockless
authorJens Axboe <jens.axboe@oracle.com>
Thu, 24 Jan 2008 07:44:49 +0000 (08:44 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 28 Jan 2008 09:50:33 +0000 (10:50 +0100)
commit623829b14afd34579822da3838e8612cb9afc827
tree602f15808d0f3dcdfcd7cc4491b2cc2ccd266fd2
parent3bc0ea943c83a6e4706a772d63e768c5dc78e43d
block: cfq: make the io contect sharing lockless

The io context sharing introduced a per-ioc spinlock, that would protect
the cfq io context lookup. That is a regression from the original, since
we never needed any locking there because the ioc/cic were process private.

The cic lookup is changed from an rbtree construct to a radix tree, which
we can then use RCU to make the reader side lockless. That is the performance
critical path, modifying the radix tree is only done on process creation
(when that process first does IO, actually) and on process exit (if that
process has done IO).

As it so happens, radix trees are also much faster for this type of
lookup where the key is a pointer. It's a very sparse tree.

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