Messages in this thread Patch in this message | | | Date | Wed, 25 Apr 2007 11:59:21 -0400 | From | "Alan D. Brunelle" <> | Subject | Re: [PATCH 5/15] cfq-iosched: speed up rbtree handling |
| |
Hi Jens -
The attached patch speeds it up even more - I'm finding a >9% reduction in %system with no loss in IO performance. This just sets the cached element when the first is looked for.
Alan From: Alan D. Brunelle <Alan.Brunelle@hp.com>
Update cached leftmost every time it is found.
Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com> ---
block/cfq-iosched.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 8093733..a86a7c3 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -388,10 +388,10 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2) */ static struct rb_node *cfq_rb_first(struct cfq_rb_root *root) { - if (root->left) - return root->left; + if (!root->left) + root->left = rb_first(&root->rb); - return rb_first(&root->rb); + return root->left; } static void cfq_rb_erase(struct rb_node *n, struct cfq_rb_root *root) | |