From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 714CC606A689 for ; Mon, 30 Nov 2026 09:33:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=mgzNleDM Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xXxko-000220-EU; Mon, 30 Nov 2026 04:32:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xXxkI-0001xT-Kn; Mon, 30 Nov 2026 04:32:28 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xXxkE-0006YX-Km; Mon, 30 Nov 2026 04:32:25 -0500 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AU5Yf0S690964; Mon, 30 Nov 2026 09:32:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=IV62hH CrVG/yxyXuJSEdojEMUk1kXah8yoBsXNtxgZk=; b=mgzNleDM5RKoM9h1f6Ji6r feXt0p9rWsxZ+nyomCbfwe/HdUfLgwcd1xb13r0ZtsG1SfLNoGhrVvfVPL9bodPz 5F8WcdlfmG2Y0pKZ1Z6ROuksisApfIEULdbEmYCKeDv22+nt+7aRciDcfJvPdr5v E4wUTeOFRw7Nn+gSifXY9Zgw/LK6hpx9VCKJD5EiQ2AWbPJhAMQTabyEp5W/ooAy Afq987Jepr9AoPoKO6wMVmFDGCqSY4qEIUuV5gM594vtfUKUslmBNbffe70vLiNA 6gvvLkuuxL/n6ARqODbUx+JTKmbhpEDiz3nULDHyIGUuWBYZP0EIyxKCnj3sZm9Q == Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4j7pmsy3re-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 09:32:07 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6AU5JNdH634111; Mon, 30 Nov 2026 09:32:06 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4j8asgm978-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 09:32:06 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6AU9W4le55640562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Nov 2026 09:32:04 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 936F92004B; Mon, 30 Nov 2026 09:32:04 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72D9A20040; Mon, 30 Nov 2026 09:32:04 +0000 (GMT) Received: from [9.68.16.159] (unknown [9.68.16.159]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 30 Nov 2026 09:32:04 +0000 (GMT) Message-ID: <55b4c77b-9303-4168-89cd-3d159151fcad@linux.ibm.com> Date: Mon, 30 Nov 2026 10:32:04 +0100 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: performance regression due to 0bd5a1b3d60c "block: Fix corruption from broken RMW atomicity" To: Kevin Wolf , Paolo Bonzini Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-s390x References: <5fa22932-3a6c-4b77-af53-a2d187e7603f@linux.ibm.com> <20261127113333.2515385-1-pbonzini@redhat.com> Content-Language: en-US From: Christian Borntraeger In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ejpjln97WS2IfgapSvAgcL2BnCmtUzCh X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDAzNiBTYWx0ZWRfX2VtGNEJ8Nc1J 5dditBJ8JnNwm6GeCEA1hVEx8uEQ5sCQXj6CLtk9TgGh738+6j4atjqSOOWDQ33dpKxG54R4bWE hmaSUD+WLgvsrDGyy1fLrVX/ntmil3qpIjoPKRXXv1HQNvyh08GPDtYA28s7EZiqPVryzbyyj+t 3La0OHCW1j3GUI8ilioaGRCpfQDDGuZTYZQlo3/IpkY4+XrXd1ybXXWyz/1QoVs9Wnhievx3xY7 GRBEi/uvdZqC5L3aCavOsqZ5XxCMdkbPniXJZ4GaARFcIIFXWIuqjpO4uv5CTZKAhgfXSFELliA djqZfGOziQgl3Xp+TG6ZuNEBvoiZjqpqH4Bo3E7SR5oUCuj5ijLLZmNG/68Hk+I48RAPJKMK1lW PfaKsn5B8t8HMxB9nrHNcbWva7b4X1YGFMtawrFzWhEFNoKeLD1U45Pez47o+caEZ2m7S5wSIos 4QX/KAzVobD8MipmaKQ== X-Proofpoint-GUID: ejpjln97WS2IfgapSvAgcL2BnCmtUzCh X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDAzNiBTYWx0ZWRfXzlvnBTiJ9Olw QqXtfN69K88NPBUrAf49Yo7ZZrm7dOr6TC6wXvqReJcnCJtCExFQARCjILWHZQ4VZ6ndHv9fad0 LasVRhjZcE7lFtRNWJc9j15SwK94FZI= X-Authority-Analysis: v=2.4 cv=U9cHnuru c=1 sm=1 tr=0 ts=6b0d4297 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=SH7Orq-lAxLWWtp09yoA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_02,2026-11-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300036 Received-SPF: pass client-ip=148.163.156.1; envelope-from=borntraeger@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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?