From nobody Mon Feb 9 01:21:56 2026 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=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1596016534; cv=none; d=zohomail.com; s=zohoarc; b=bIJ7wGyZi9gKMWcLpa3a1eYuTPXlRNvncNZF5aTQm5WphOkPOAQzrH6nO+9zPPnypqY3g8BUpUXVaopNDtO3Fzo8ZijmgJXfwfwcxq5xiB9FPIgB8WK8fjfw5KHgr8ZvFD2Y6XVCRrHU6gzYPVWS9gQBORRmZaKf3rGV18Jj1R0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596016534; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=dniHciHWD1s2sUmY62gnL597ZGnuF2fTUNk4k5tqqLE=; b=VP6D6OlR16XndTnsEw5aDPLe7BIKvIh1UrElD8X7jVB3nadJFWwB91BrSlNvqTCYCSrvVhloa6UcAZgFHTVTqPPU6U/be7ys3VnyvH0UJ7kpt1ip+CP0fw1W4zFjttdTy7IeycNXga+PqQEXv/d64ENInVkz0fmI7ndNmdaf0C8= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1596016534549702.5258036523157; Wed, 29 Jul 2020 02:55:34 -0700 (PDT) Received: from localhost ([::1]:44360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0io9-0007IK-7a for importer@patchew.org; Wed, 29 Jul 2020 05:55:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <4d34d332e1aaa8a2cf8dc0b5da4fd7727f2a86e8@lizzy.crudebyte.com>) id 1k0inC-0006mX-M6 for qemu-devel@nongnu.org; Wed, 29 Jul 2020 05:54:34 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:52617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <4d34d332e1aaa8a2cf8dc0b5da4fd7727f2a86e8@lizzy.crudebyte.com>) id 1k0inB-0005b8-05 for qemu-devel@nongnu.org; Wed, 29 Jul 2020 05:54:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=dniHciHWD1s2sUmY62gnL597ZGnuF2fTUNk4k5tqqLE=; b=T4HVI o3G/b2kvUTzD/Trl662Id6d+vin4uY7aXwVFcv/nxvI0Ve+oe+cqFtfMgGiwhuEFnWQsxmzTge5gz ISv9up9d5pvuWYLfr1aoTIZrT4UJsK5inm8Q0nvTXnF3GnamsYKy5HUwInZpRw73PdjIGC2CD+m89 dFD2aQx4I1MZ4AJXp2df+2E/YL7am1wX57oI9t5TA4BmIxun7jUXNh8aMjmYiHVN1NYjUKjx28Boc VBE3nOon17A2CeaODFPAH5MuuQtiKFIHdEgq6o3jZHFcwDxsssgh/Q5kug5j57K9fJVd7Kfm7/oAq kagJpAPYHKuHfAR923qTxp0IKXB1A==; Message-Id: <4d34d332e1aaa8a2cf8dc0b5da4fd7727f2a86e8.1596012787.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Wed, 29 Jul 2020 10:42:28 +0200 Subject: [PATCH v8 7/7] 9pfs: clarify latency of v9fs_co_run_in_worker() To: qemu-devel@nongnu.org Cc: Greg Kurz 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: none client-ip=91.194.90.13; envelope-from=4d34d332e1aaa8a2cf8dc0b5da4fd7727f2a86e8@lizzy.crudebyte.com; helo=lizzy.crudebyte.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/29 05:20:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @crudebyte.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" As we just fixed a severe performance issue with Treaddir request handling, clarify this overall issue as a comment on v9fs_co_run_in_worker() with the intention to hopefully prevent such performance mistakes in future (and fixing other yet outstanding ones). Signed-off-by: Christian Schoenebeck --- hw/9pfs/coth.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/9pfs/coth.h b/hw/9pfs/coth.h index fd4a45bc7c..c51289903d 100644 --- a/hw/9pfs/coth.h +++ b/hw/9pfs/coth.h @@ -19,7 +19,7 @@ #include "qemu/coroutine.h" #include "9p.h" =20 -/* +/** * we want to use bottom half because we want to make sure the below * sequence of events. * @@ -28,6 +28,16 @@ * 3. Enter the coroutine in the worker thread. * we cannot swap step 1 and 2, because that would imply worker thread * can enter coroutine while step1 is still running + * + * @b PERFORMANCE @b CONSIDERATIONS: As a rule of thumb, keep in mind + * that hopping between threads adds @b latency! So when handling a + * 9pfs request, avoid calling v9fs_co_run_in_worker() too often, because + * this might otherwise sum up to a significant, huge overall latency for + * providing the response for just a single request. For that reason it + * is highly recommended to fetch all data from fs driver with a single + * fs driver request on a background I/O thread (bottom half) in one rush + * first and then eventually assembling the final response from that data + * on main I/O thread (top half). */ #define v9fs_co_run_in_worker(code_block) \ do { \ --=20 2.20.1