lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 May 2011 10:34:16 -0700
From:	Justin TerAvest <teravest@...gle.com>
To:	Namhyung Kim <namhyung@...il.com>
Cc:	Jens Axboe <axboe@...nel.dk>, lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/4] cfq-iosched: reduce bit operations in cfq_choose_req()

Why make this change? Are we that sensitive to the number of operations?

It makes the code a bit harder to read, I think.

On Mon, May 23, 2011 at 8:18 PM, Namhyung Kim <namhyung@...il.com> wrote:
> Reduce the number of bit operations in cfq_choose_req() on average
> (and worst) cases.
>
> Signed-off-by: Namhyung Kim <namhyung@...il.com>
> ---
>  block/cfq-iosched.c |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index 151a050e692c..a79e62063144 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -665,15 +665,11 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2,
>        if (rq2 == NULL)
>                return rq1;
>
> -       if (rq_is_sync(rq1) && !rq_is_sync(rq2))
> -               return rq1;
> -       else if (rq_is_sync(rq2) && !rq_is_sync(rq1))
> -               return rq2;
> -       if ((rq1->cmd_flags & REQ_META) && !(rq2->cmd_flags & REQ_META))
> -               return rq1;
> -       else if ((rq2->cmd_flags & REQ_META) &&
> -                !(rq1->cmd_flags & REQ_META))
> -               return rq2;
> +       if (rq_is_sync(rq1) != rq_is_sync(rq2))
> +               return rq_is_sync(rq1) ? rq1 : rq2;
> +
> +       if ((rq1->cmd_flags ^ rq2->cmd_flags) & REQ_META)
> +               return rq1->cmd_flags & REQ_META ? rq1 : rq2;
>
>        s1 = blk_rq_pos(rq1);
>        s2 = blk_rq_pos(rq2);
> --
> 1.7.5.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ