From nobody Fri Nov 14 19:42:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1762789892; cv=none; d=zohomail.com; s=zohoarc; b=di98Bgv+kjDGx0Q2yuHxwh+q9qPsCGCV+isidtpdci+/j5OC1jeG5XjxSS0Ozhv5EUbwWtVuQkMvPDUFWdp9Nfa5CTvVZW9UIr0aPa66tSPYAVqtlIBCTsQ96nlhr/K1rCz/j1tGxGzHkwhf12ruzRwC4A4DD4THr2HZX4jcc0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762789892; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=J2pGuJH4CZyEZq/sM/g3air/DGds7dY2gM0JmiMpLcY=; b=cnCKCuP5fmgAh0ZEcGXh96k0H6fmZmmxHFHLcr2yWWs/93iywV9IlralNxaNlK1NZg6ur5/4bvHVPjSAnMWb/q0vGQ15H74dZJ1+8iWxuPJcXgp/yyhmnXZdlYT0HDDydY6ygbaLWO6ho8Cz0iwUcLPXS7YWhwMAi5frbb9NyPQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1762789892260348.79528401671735; Mon, 10 Nov 2025 07:51:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vIU9w-0008U5-GQ; Mon, 10 Nov 2025 10:50:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vIU9R-0007Y4-CF for qemu-devel@nongnu.org; Mon, 10 Nov 2025 10:49:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vIU9P-00013s-QR for qemu-devel@nongnu.org; Mon, 10 Nov 2025 10:49:53 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-102-dowbb93hNDqQuDtYqNzvKQ-1; Mon, 10 Nov 2025 10:49:49 -0500 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4777885a071so8636635e9.3 for ; Mon, 10 Nov 2025 07:49:49 -0800 (PST) Received: from localhost (p200300cfd7171f537afd31f3f827a45e.dip0.t-ipconnect.de. [2003:cf:d717:1f53:7afd:31f3:f827:a45e]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4777d9447eesm54863295e9.16.2025.11.10.07.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Nov 2025 07:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762789791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J2pGuJH4CZyEZq/sM/g3air/DGds7dY2gM0JmiMpLcY=; b=EhPnQI9U8NZefKEflshANL0mG8JbCYjYXplUfiWL4hlbE6qC1EqAiEhyPi8Dg5NuwHLw96 EzDMtxCHZK4eSgL4rnH+ZdR3l79ioFftQ2mQccBdAY8HHJx7FaE34C6eYc19jiFXxvd2cj lNwY9/s8WlF5b8gxMVVOPMkQkOL+rEg= X-MC-Unique: dowbb93hNDqQuDtYqNzvKQ-1 X-Mimecast-MFC-AGG-ID: dowbb93hNDqQuDtYqNzvKQ_1762789788 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1762789788; x=1763394588; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J2pGuJH4CZyEZq/sM/g3air/DGds7dY2gM0JmiMpLcY=; b=nuHDg7mPu+6Ujhzsr1WipqJWSjsgiOb4GSHb6LcgYCd5fHG0pasfdNSoOGmpPuBDT7 +ReGVtfdn81bDEFBvPCe5OSKrTkF727B3pIa3PJSMODxJ6JkVMdTDffxA+hqFCjDc/d3 KWingD3MF9JlrZ4Dbl15VcqU8ggg2TlKwIf5ov/PWleKNucDZF6jHv/2Aa5fJ8MA2cRg 6gsspeAzmgg5ASGUC0ze9RbEybhhKA22aY81k/IcdLDY2vYdu8UZ9tLlmmkC/63tEMJI 98RiM+6FmC+4PibNmf3YFBX5Qlgu8pvomDfyGuA6PsM0Zeu6Fz1E7JA95vM99471HxMT n4Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762789788; x=1763394588; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=J2pGuJH4CZyEZq/sM/g3air/DGds7dY2gM0JmiMpLcY=; b=WRiCzdf5HspEvoQfa6KxZ2kgTPt0jXP8HfeXJ/wQbOpPfc4+zNdvS/5x+qCeCk5kLT /EFSOkFHtdaT4BrHr0rboL4RKuUkQugC3Qf+IQ/WzsVRQ+AVvfxc8XJehTpGkRX0SxFB cfLdT8pC11ob+95MZ0R031vzNaePrMnhyxkE3Z9Xmxf68Vv9LHGAJtPC7i5SKXxBQ1Zy UEKbNxwkzYgSFbdkCNz0pOxOTLpCBM6DcNByuL1EgaYAZENIMcfp0zdVr+kmGcDUB75x 2dKaWmMBrnxqX3xqsmbD8xIDt24W0Z1/m71KVcYly1AvXwi8TUKIxqXYqQDAonT+TaPA SR4A== X-Gm-Message-State: AOJu0Ywr1QXP9ywBTgRFgDkwYGKGCZisTUQ0zCKkWBTOtSZIegHxZNkX 4zQbUsBQncjjaMuD2teTnUsERMX8JV4W0yLAEVQr3N1NDNyxXcTUolc2kQaR9s6UAmqFzMUiIVR 495oCW2J4SMQg7dfYCnd6GTw9BWr9Qhyy5k6aSlnB6Vl0ccdXvKL4pKI4 X-Gm-Gg: ASbGncsNOLcUytSXQrWJR5lvbsqkGzfpoifu+J5mYyLBL3rnZH9ZBnXoiy6XB/98x3V vOj8Y5i8qbm5kzwq4lV18hpsKEmWkjm8tfX37FHj/cVgAKBifTdRO5+TCL9/6LTP7NBgffr73TP jY7XtSt4xy07HOHx522CJGlST4gTayG+WAVz2AaFv7eDlKw3WwOtncVKmQVl47ZKWHhMFwCEo0i zwxfWI1wB2tN8Iv/51SCXlv0eByFWQw41dze4dT28ck3WO5r7VgP8WWXKlCh1RdDwaID8b9Nl5x 0e7uTQN2Q13cD2hlKMXMbBmJBcWqOVVno6dXuWit7Gm9BFH+G5V4FtjI3fMR61zRPWSi9kJPXTJ q/oHAwm+YdhdbwhEjIEi1jZ8KK9H+tHUj0Wszg715YB2iOWqctyKFmQSUmQ== X-Received: by 2002:a05:600c:450c:b0:477:55ce:f3c3 with SMTP id 5b1f17b1804b1-4777322d960mr71633955e9.5.1762789788496; Mon, 10 Nov 2025 07:49:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6DGILhuAdQ4Zz6x4jacr5qtFaYvDlrVMmNcmBd35VQG0DI9hsmJrF1Kdug8/S2E5jHQcgMw== X-Received: by 2002:a05:600c:450c:b0:477:55ce:f3c3 with SMTP id 5b1f17b1804b1-4777322d960mr71633645e9.5.1762789788101; Mon, 10 Nov 2025 07:49:48 -0800 (PST) From: Hanna Czenczek To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Hanna Czenczek , Kevin Wolf , Stefan Hajnoczi , Paolo Bonzini , "Richard W . M . Jones" , Ilya Dryomov , Peter Lieven , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Fam Zheng , Ronnie Sahlberg Subject: [PATCH v2 15/19] =?UTF-8?q?blkreplay:=20Run=20BH=20in=20coroutine?= =?UTF-8?q?=E2=80=99s=20AioContext?= Date: Mon, 10 Nov 2025 16:48:50 +0100 Message-ID: <20251110154854.151484-16-hreitz@redhat.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251110154854.151484-1-hreitz@redhat.com> References: <20251110154854.151484-1-hreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1762789892845158500 While it does not matter in which AioContext we run aio_co_wake() to continue an exactly-once-yielding coroutine, making this commit not strictly necessary, there is also no reason why the BH should run in any context but the request=E2=80=99s AioContext. Signed-off-by: Hanna Czenczek --- block/blkreplay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blkreplay.c b/block/blkreplay.c index 16d8b12dd9..8a6845425e 100644 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -63,9 +63,10 @@ static void block_request_create(uint64_t reqid, BlockDr= iverState *bs, Coroutine *co) { Request *req =3D g_new(Request, 1); + AioContext *ctx =3D qemu_coroutine_get_aio_context(co); *req =3D (Request) { .co =3D co, - .bh =3D aio_bh_new(bdrv_get_aio_context(bs), blkreplay_bh_cb, req), + .bh =3D aio_bh_new(ctx, blkreplay_bh_cb, req), }; replay_block_event(req->bh, reqid); } --=20 2.51.1