mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corrado Zoccolo <czoccolo@gmail.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>,
	Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [RFC PATCH 3/5] cfq-iosched: reimplement priorities using  different service trees
Date: Tue, 20 Oct 2009 12:43:20 +0200	[thread overview]
Message-ID: <4e5e476b0910200343s1d7913daq5719d8a4d84fb491@mail.gmail.com> (raw)
In-Reply-To: <20091020005813.GD10727@kernel.dk>

On Tue, Oct 20, 2009 at 2:58 AM, Jens Axboe <jens.axboe@oracle.com> wrote:
> 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?
It stands for "workload". When defining all-caps constants, one has to
avoid possible clashes adding pre/suf-fixes.
Any suggestion for better naming?
>
>> +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.
I don't see much difference: my brain just translates the former in
the latter, and the former takes up less screen space.
But you are the maintainer, so I'll write it as you want.

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

Thanks
Corrado
>
> --
> Jens Axboe
>
>

  reply	other threads:[~2009-10-20 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19 20:21 Corrado Zoccolo
2009-10-20  0:58 ` Jens Axboe
2009-10-20 10:43   ` Corrado Zoccolo [this message]
2009-10-20 13:19     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e5e476b0910200343s1d7913daq5719d8a4d84fb491@mail.gmail.com \
    --to=czoccolo@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome