From nobody Sat Feb 7 05:53:41 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=1587313468; cv=none; d=zohomail.com; s=zohoarc; b=PwBQA66/fyypoo3H0Xw/rRuPynPu1SO/hL67OLaF98Hu/34zqvMI4V35LTthUKsJnXUWHqoxnmKbpjKh4jw6PxcL2B8l5hyDZiTiiDgo0VPz41gWqVXtqzJt8RX2GyU58cTR6+d50fQrzN5Lpo5bHQvQn4Vw6nkZgCRnAWSvbvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587313468; 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=jPdUMVvPDb49VGrJsLB5Dy+OTfiFUvEBcazVO3auyKA=; b=KEzRqHztTtAiE4f/ZEwLcPDxDbh7Fmc7bcw5vFPy7nvFX/gMdbtByJnTg6fdi8madVmY9XtL4FcskFBLVZlbNR6q5n5l1HZQzAtihhSss0jCsK+Pmw8aCGPu9yyR0GUddiSeIYC+fuciGf6DXfBtQdNrkVmnKuclvUKp6BPbXQQ= 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 1587313468861289.867038885136; Sun, 19 Apr 2020 09:24:28 -0700 (PDT) Received: from localhost ([::1]:43948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQCk7-00030B-Kl for importer@patchew.org; Sun, 19 Apr 2020 12:24:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41460 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <963b183c516011237108a0212402affd35f0b799@lizzy.crudebyte.com>) id 1jQCjI-00025J-Ko for qemu-devel@nongnu.org; Sun, 19 Apr 2020 12:23:36 -0400 Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from <963b183c516011237108a0212402affd35f0b799@lizzy.crudebyte.com>) id 1jQCjI-0001S2-8M for qemu-devel@nongnu.org; Sun, 19 Apr 2020 12:23:36 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:36621) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <963b183c516011237108a0212402affd35f0b799@lizzy.crudebyte.com>) id 1jQCjH-0000AX-P2 for qemu-devel@nongnu.org; Sun, 19 Apr 2020 12:23:35 -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=jPdUMVvPDb49VGrJsLB5Dy+OTfiFUvEBcazVO3auyKA=; b=mIz+o 3PDM0Xel6Awqkv1/reRMJZAQeH+9Mbs417FWxI4mKnPI+QcJI9W9dXQOfOvtbClRbcaSqh626hUQk DqepnK748Z6yiyhBsAyeNChBM9Cf5xwwtsJcICVMye+MGZc309qn3IXQ5/TLSIkDmYxZ8FU8QV+b/ i0JHXi5Xi8k6lQC35fgfDYf4n1m+V3CDBmtkg22JZbxR4xw23nCGSWq6L8Pif5v0ud8GaFVwdKcoE eY5fGbeNNPg/nOEleCC3WIdmh8BLI9rZLoQ3G/dYA8ElkL7f4wR94Bigdug0HWcBwwKog49So5ml+ +ug8IO6cZAQYFBlLXysO5xqwu6Fvg==; Message-Id: <963b183c516011237108a0212402affd35f0b799.1587309014.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Sun, 19 Apr 2020 17:07:01 +0200 Subject: [PATCH v6 5/5] 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=963b183c516011237108a0212402affd35f0b799@lizzy.crudebyte.com; helo=lizzy.crudebyte.com X-detected-operating-system: by eggs1p.gnu.org: Linux 3.11 and newer X-Received-From: 91.194.90.13 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 a6851822d5..8b6f76840a 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