From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Kevin Wolf <kwolf@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
qemu-s390x <qemu-s390x@nongnu.org>
Subject: Re: performance regression due to 0bd5a1b3d60c "block: Fix corruption from broken RMW atomicity"
Date: Mon, 30 Nov 2026 10:32:04 +0100 [thread overview]
Message-ID: <55b4c77b-9303-4168-89cd-3d159151fcad@linux.ibm.com> (raw)
In-Reply-To: <awmMdcIPI7C_SdE7@redhat.com>
Am 27.11.26 um 14:58 schrieb Kevin Wolf:
> Am 27.11.2026 um 12:33 hat Paolo Bonzini geschrieben:
>> On Fri, 27 Nov 2026 11:36:31 +0100, Kevin Wolf wrote:
>>> Am 26.11.2026 um 16:43 hat Christian Borntraeger geschrieben:
>>>> the fix
>>>> - 0bd5a1b3d60c ("block: Fix corruption from broken RMW atomicity")
>>>> results in a pretty hefty performance regression for my nvme disk via virtio-blk and
>>>> multiple iothreads.
>>>>
>>>> I uses AI to analyze and summarize and the result was seem legit from what I
>>>> can tell, so I paste this is verbatim.
>>>> I verified that 0bd5a1b3d60c is bad and 0bd5a1b3d60c^ is good.
>>>
>>> Do you see any difference after commit cf4f672c (the commit right after
>>> 0bd5a1b3d60c)? Some checks are temporarily duplicated, but I expected
>>> that after the second commit, there shouldn't be any visible difference.
>>>
>>> In your use case, are serialising requests actually present?
>>
>> I suspect the issue is that most of the time you *don't* have serialising
>> requests, but still have to pay for bdrv_find_conflicting_request().
>>
>>> + if (!qatomic_read(&self->bs->serialising_in_flight)) {
>>> + return;
>>> + }
>>
>> I would put that in bdrv_find_conflicting_request instead, since it
>> is more obvious there that the loop requires a serialising request, but
>> yeah - if the above analysis is correct that would fix it.
>
> Yeah, as long as nobody adds more code around the loop in
> bdrv_wait_serialising_requests_locked(), that does the same thing.
> Not sure which one I prefer.
>
> By the way, while you're here, what do you think about the alternative
> idea I mentioned, keeping a separate list bs->serialising_requests?
> Then you wouldn't have to have a counter any more because just checking
> that the list is empty isn't any slower.
>
>> Also, with much joy there is no need to use atomics anymore!
>> tracked_request_set_serialising() and bdrv_find_conflicting_request()
>> are called with reqs_lock taken, and tracked_request_end() takes it
>> just below decrementing req->bs->serialising_in_flight.
>
> Yes, I mentioned that. I just wanted to keep the patch to test as simple
> as possible.
Can we still get the gix into 11.2?
next prev parent reply other threads:[~2026-11-30 9:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 15:43 performance regression due to 0bd5a1b3d60c "block: Fix corruption from broken RMW atomicity" Christian Borntraeger
2026-11-27 10:36 ` Kevin Wolf
2026-11-27 11:33 ` Paolo Bonzini
2026-11-27 13:58 ` Kevin Wolf
2026-11-30 9:32 ` Christian Borntraeger [this message]
2026-11-27 11:33 ` Christian Borntraeger
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=55b4c77b-9303-4168-89cd-3d159151fcad@linux.ibm.com \
--to=borntraeger@linux.ibm.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.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.