From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 820871FF146 for ; Tue, 28 Apr 2026 16:52:45 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DEF1117045; Tue, 28 Apr 2026 16:52:44 +0200 (CEST) Message-ID: <64873004-7d86-4500-9e85-b1cebc41efca@proxmox.com> Date: Tue, 28 Apr 2026 16:52:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH qemu] fdmon-io_uring: avoid idle event loop being accounted as IO wait To: Fiona Ebner , pve-devel@lists.proxmox.com References: <20260414211600.4023940-1-t.lamprecht@proxmox.com> <3689d164-e7d3-44c1-96b8-2b84b7342dd5@proxmox.com> <525c4dad-6d04-41f0-8a21-9302b0c6baa4@proxmox.com> <43287141-78a6-4524-a7ce-573f6098d079@proxmox.com> Content-Language: en-US From: Thomas Lamprecht In-Reply-To: <43287141-78a6-4524-a7ce-573f6098d079@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777387864875 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.003 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: FILAY6YRNPMRRDR4WSG5HLHBP2FW7QIL X-Message-ID-Hash: FILAY6YRNPMRRDR4WSG5HLHBP2FW7QIL X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 28.04.26 um 16:40 schrieb Fiona Ebner: >>>>> + * Number of in-flight requests to be accounted for IO wait. >>>>> + * Must be accessed using atomics. >>> >>> why though? AioContext is strictly single-threaded nowadays and (enqueue) >>> and process_cqe (dequeue) run on the owning thread. Or is this just >>> defensive protection for potential future changes - as it's cheap I'm >>> fine with it, just wanted to know if I'm overlooking something here. >> >> No, looking over it again, I think you are right. I was under the >> impression that somehow vCPUs might also add SQEs, but no, that happens >> in the iothread already. > > vCPU threads might reach fdmon_io_uring_wait() via aio_poll() (e.g. via > virtio_scsi_dataplane_stop() during Linux guest boot), so atomics are > really necessary. Ack, they are cheap enough for us to not really care here in any case, but good to actually know about why they are required.