linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] block: Optimize bio_init()
Date: Sat, 11 Sep 2021 20:19:10 -0700	[thread overview]
Message-ID: <c728eac8-3246-2a6d-84bd-a04fa62fbc04@acm.org> (raw)
In-Reply-To: <fe7f7cc7-2403-7ec6-7c1c-abb6ac6a68fa@kernel.dk>

On 9/11/21 15:16, Jens Axboe wrote:
> Looking at profile:
> 
>   43.34 │      rep    stos %rax,%es:(%rdi)
> I do wonder if rep stos is just not very well suited for small regions,
> either in general or particularly on AMD.
> 
> What do your profiles look like for before and after?

Since I do not know which tool was used to obtain the above
information, I ran perf record -ags sleep 10 while the test
was running. I could not find bio_init in the output. I think
that means that that function got inlined. But
bio_alloc_bioset() showed up in the output. The time spent in
that function is lower if IOPS are higher.

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?

Bart.


  reply	other threads:[~2021-09-12  3:19 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 [this message]
2021-09-12 13:03         ` Jens Axboe
2021-09-12 22:01           ` Bart Van Assche
2021-09-12 22:13             ` Jens Axboe
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=c728eac8-3246-2a6d-84bd-a04fa62fbc04@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).