block: cfq: make the io contect sharing lockless
authorJens Axboe <jens.axboe@oracle.com>
Tue, 22 Jan 2008 09:19:12 +0000 (10:19 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 22 Jan 2008 09:27:19 +0000 (10:27 +0100)
commit0b06ada07fa4f47a5fd5727825730cd51dc5a58a
treecdfd059ed636943d8ac30427578d7c55e755623e
parent73f6abcae7c66c4fc04c97086ef82c3fbe0f8b7f
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