block: cfq: make the io contect sharing lockless

Previous thread: blk_end_request: changing arm (take 4) by Linux Kernel Mailing List on Monday, January 28, 2008 - 4:02 pm. (1 message)

Next thread: io_context sharing - anticipatory changes by Linux Kernel Mailing List on Monday, January 28, 2008 - 4:02 pm. (1 message)
From: Linux Kernel Mailing List
Date: Monday, January 28, 2008 - 4:02 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4ac845...
Commit:     4ac845a2e9a816ed5a7b301f56dcc0a3d0b1ba4d
Parent:     66dac98ed0de7a1125fb0dd7907f238f6b9d2f60
Author:     Jens Axboe <jens.axboe@oracle.com>
AuthorDate: Thu Jan 24 08:44:49 2008 +0100
Committer:  Jens Axboe <jens.axboe@oracle.com>
CommitDate: Mon Jan 28 10:50:33 2008 +0100

    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       |  267 +++++++++++++++++++++++++--------------------
 block/ll_rw_blk.c         |   49 ++++++---
 include/linux/iocontext.h |    6 +-
 3 files changed, 185 insertions(+), 137 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index dba52b6..8830893 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -200,7 +200,7 @@ CFQ_CFQQ_FNS(sync);
 static void cfq_dispatch_insert(struct request_queue *, struct request *);
 static struct cfq_queue *cfq_get_queue(struct cfq_data *, int,
 				       struct io_context *, gfp_t);
-static struct cfq_io_context *cfq_cic_rb_lookup(struct cfq_data *,
+static struct cfq_io_context *cfq_cic_lookup(struct cfq_data *,
 						struct io_context *);
 
 ...
Previous thread: blk_end_request: changing arm (take 4) by Linux Kernel Mailing List on Monday, January 28, 2008 - 4:02 pm. (1 message)

Next thread: io_context sharing - anticipatory changes by Linux Kernel Mailing List on Monday, January 28, 2008 - 4:02 pm. (1 message)