qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Roman Penyaev <roman.penyaev@profitbricks.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH V2 1/1] linux-aio: prevent submitting more than MAX_EVENTS
Date: Fri, 15 Jul 2016 14:57:03 +0200	[thread overview]
Message-ID: <b42548f7-56c0-1790-88ce-2a746ff52a21@redhat.com> (raw)
In-Reply-To: <CAJrWOzCh9+TtWvB3zbEkAAmPS+XBZxR5VyBZc7bQy1uuJHBg0w@mail.gmail.com>



On 15/07/2016 13:35, Roman Penyaev wrote:
> On Fri, Jul 15, 2016 at 12:17 PM, Roman Penyaev
> <roman.penyaev@profitbricks.com> wrote:
>> On Fri, Jul 15, 2016 at 11:58 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>
>>>
>>> On 15/07/2016 11:18, Roman Penyaev wrote:
>>>> Those 3 red spikes and a blue hill is what we have to focus on.  The
>>>> blue hill at the right corner of the chart means that almost always the
>>>> ring buffer was observed as full, i.e. qemu_laio_completion_bh() got
>>>> a chance to reap completions not very often, meanwhile completed
>>>> requests stand in the ring buffer for quite a long time which degrades
>>>> the overall performance.
>>>>
>>>> The results covered by the red line are much better and that can be
>>>> explained by those 3 red spikes, which are almost in the middle of the
>>>> whole distribution, i.e. qemu_laio_completion_bh() is called more often,
>>>> completed requests do not stall, giving fio a chance to submit new fresh
>>>> requests.
>>>>
>>>> The theoretical fix would be to schedule completion BH just after
>>>> successful io_submit, i.e.:
>>>
>>> What about removing the qemu_bh_cancel but keeping the rest of the patch?
>>
>> That exactly what I did.  Numbers go to expected from ~1600MB/s to ~1800MB/s.
>> So basically this hunk of the debatable patch:
>>
>>      if (event_notifier_test_and_clear(&s->e)) {
>> -        qemu_bh_schedule(s->completion_bh);
>> +        qemu_laio_completion_bh(s);
>>      }
>>
>> does not have any impact and can be ignored.  At least I did not notice
>> anything important.

Thanks, this means that we should either add back the other line, or
wrap qemu_laio_completion_bh in a loop.  The rationale is that an
io_getevents that doesn't find any event is extremely cheap.

>>> I'm also interested in a graph with this patch ("linux-aio: prevent
>>> submitting more than MAX_EVENTS") on top of origin/master.
>>
>> I can plot it also of course.
> 
> So, finally I have it.
> 
> Same link:
> https://docs.google.com/spreadsheets/d/12CIt6EKiJLqNx0OHNqiabR-oFBrqkH0LN3mjzZ5jGeo/edit?usp=sharing
> 
> last sheet:
> "1789MB/s"
> 
> Not that much interesting: almost all the time we complete maximum:
> MAX_LIMIT requests at once.  But of course that expected on such
> device.  Probably other good metrics should be taken into account.

And this means that we probably should raise MAX_LIMIT.

Paolo

  reply	other threads:[~2016-07-15 12:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 17:51 [Qemu-devel] [PATCH 1/1] linux-aio: prevent submitting more than MAX_EVENTS Roman Pen
2016-07-13  2:23 ` Fam Zheng
2016-07-13  7:57   ` [Qemu-devel] [PATCH V2 " Roman Pen
2016-07-13 10:31     ` Paolo Bonzini
2016-07-13 11:33       ` Roman Penyaev
2016-07-13 11:45         ` Kevin Wolf
2016-07-13 14:53           ` Roman Penyaev
2016-07-15  9:18           ` Roman Penyaev
2016-07-15  9:58             ` Paolo Bonzini
2016-07-15 10:17               ` Roman Penyaev
2016-07-15 10:37                 ` Paolo Bonzini
2016-07-15 11:35                 ` Roman Penyaev
2016-07-15 12:57                   ` Paolo Bonzini [this message]
2016-07-15 15:03             ` Roman Penyaev
2016-07-13 12:22     ` Eric Blake
2016-07-13 12:57       ` Roman Penyaev
2016-07-14 12:18     ` Stefan Hajnoczi
2016-07-13  7:43 ` [Qemu-devel] [PATCH " Paolo Bonzini
2016-07-13  7:50   ` Roman Penyaev

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=b42548f7-56c0-1790-88ce-2a746ff52a21@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=roman.penyaev@profitbricks.com \
    --cc=stefanha@redhat.com \
    /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).