lkml.org 
[lkml]   [2007]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [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)
\
 
 \ /
  Last update: 2007-04-25 18:05    [W:0.110 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site