cfq-iosched: compact io_context radix_tree
authorKonstantin Khlebnikov <khlebnikov@openvz.org>
Thu, 20 May 2010 19:21:41 +0000 (23:21 +0400)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 24 May 2010 07:06:59 +0000 (09:06 +0200)
commit80b15c7389caa81a3860f9fc2ee47ec0ea572a63
tree469486c0371134b18f32741be35bce59f783d864
parentbca4b914b5da3d8e7b9b647f620b71dc85c0c394
cfq-iosched: compact io_context radix_tree

Use small consequent indexes as radix tree keys instead of sparse cfqd address.

This change will reduce radix tree depth from 11 (6 for 32-bit hosts)
to 1 if host have <=64 disks under cfq control, or to 0 if there only one disk.
So, this patch save 10*560 bytes for each process (5*296 for 32-bit hosts)

For each cfqd allocate cic index from ida.
To unlink dead cic from tree without cfqd access store index into ->key.
(bit 0 -- dead mark, bits 1..30 -- index: ida produce id in range 0..2^31-1)

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