All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <bvanassche@acm.org>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] block: Optimize bio_init()
Date: Sun, 12 Sep 2021 16:13:26 -0600	[thread overview]
Message-ID: <2adf05af-2d05-ad1d-49da-2b87c00b3e46@kernel.dk> (raw)
In-Reply-To: <b81606eb-b2cb-eaf2-b64c-55390f9b5456@acm.org>

On 9/12/21 4:01 PM, Bart Van Assche wrote:
> On 9/12/21 06:03, Jens Axboe wrote:
>> On 9/11/21 9:19 PM, Bart Van Assche wrote:
>>> The performance numbers in the patch description come from a
>>> Intel Xeon Gold 6154 CPU. I reran the test today on an old Intel
>>> Core i7-4790 CPU and obtained the opposite result: higher IOPS
>>> without this patch than with this patch although the assembler
>>> code looks to be the same. It seems like how fast "rep stos"
>>> runs depends on the CPU type?
>>
>> It does appear so. Which is a bit frustrating...
> 
> Further measurements have shown that this behavior is specific to
> gcc and also that clang always generates faster code for the version
> of bio_init() in my patch. I have reported this as a bug to the gcc
> project. See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102294.

Interesting! Here are some results from my end. First the 3970X again:

gcc-11.1
Elapsed time: 0.980807 s
Elapsed time: 0.452951 s
Elapsed time: 0.949918 s

clang-11.0
Elapsed time: 0.284734 s
Elapsed time: 0.356595 s
Elapsed time: 0.285459 s

And my laptop, which is using:

11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz

gcc-11.1
Elapsed time: 0.218427 s
Elapsed time: 0.235000 s
Elapsed time: 0.214217 s

clang-11.0
Elapsed time: 0.217436 s
Elapsed time: 0.170959 s
Elapsed time: 0.149630 s

All compiles done with -O2 -march=native

Now I kind of want to compile the kernel with clang and see how that
goes...

-- 
Jens Axboe


  reply	other threads:[~2021-09-12 22:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-11 21:47 [PATCH] block: Optimize bio_init() Bart Van Assche
2021-09-11 22:01 ` Jens Axboe
2021-09-11 22:09   ` Jens Axboe
2021-09-11 22:16     ` Jens Axboe
2021-09-12  3:19       ` Bart Van Assche
2021-09-12 13:03         ` Jens Axboe
2021-09-12 22:01           ` Bart Van Assche
2021-09-12 22:13             ` Jens Axboe [this message]
2021-09-13  3:52               ` Bart Van Assche

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=2adf05af-2d05-ad1d-49da-2b87c00b3e46@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=linux-block@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.