lkml.org 
[lkml]   [2009]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 3/5] cfq-iosched: reimplement priorities using different service trees
On Mon, Oct 19 2009, Corrado Zoccolo wrote:
> We use different service trees for different priority classes.
> This allows a simplification in the service tree insertion code, that no
> longer has to consider priority while walking the tree.

> +enum wl_prio_t {
> + IDLE_WL = -1,
> + BE_WL = 0,
> + RT_WL = 1
> +};

WL?

> +static struct cfq_rb_root *service_tree_for(enum wl_prio_t prio,
> + struct cfq_data *cfqd)
> +{
> + return prio == IDLE_WL ? &cfqd->service_tree_idle :
> + &cfqd->service_trees[prio];
> +}

Don't do it...

static struct cfq_rb_root *service_tree_for(enum wl_prio_t prio,
struct cfq_data *cfqd)
{
if (prio == IDLE_WL)
return &cfqd->service_tree_idle;

return &cfqd->service_trees[prio];
}

much cleaner. There are more of these in this patch.

Otherwise it looks sane, and I agree that making the insert cleaner here
is a good bonus.

--
Jens Axboe



\
 
 \ /
  Last update: 2009-10-20 03:01    [W:0.378 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site