From nobody Tue May 7 23:19:04 2024 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=1600250252; cv=none; d=zohomail.com; s=zohoarc; b=Nf2ObmXnanKH4o3f61+LQjz/vvmBojvHrIwTlM9fvz7OHoMHbSgpwYURCY8TobY4ZWCao2y8ek8/RyJBh99cGD0bxXhodYVCPEHzOKUV6vJ6mKvIWn0GE91Peq9aukc6NmMZtRq9aLWZyeUMYG/xW9gOWVuVlzZ7P/KVnNXPNH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600250252; 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=IOxEdH7P12wqsQCMQXkcjSgsqCj59UF4YaQI8tHT/fE=; b=bLc7PibNeP/FBxbiEeV3yce54BnEEIS1DX+p3nzoawSbm0BUWYijTfjutLRwLtx0a08cM0w5XEkB7fgtuQWRxzS3Nwd8vE17/zW9Y5yXoAVIItEdKpyBVFjGd6gxl1DMX/Yy5a8zOMRPaJD0lryXI14HF+e3AqFRufostSFLbBU= 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 1600250252810999.7746726145593; Wed, 16 Sep 2020 02:57:32 -0700 (PDT) Received: from localhost ([::1]:36968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIUBv-0005aj-Mv for importer@patchew.org; Wed, 16 Sep 2020 05:57:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <62777d825ba6a7f9ba749588a9e1e7b273f7e967@lizzy.crudebyte.com>) id 1kIU8A-00081W-4o for qemu-devel@nongnu.org; Wed, 16 Sep 2020 05:53:38 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:45719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <62777d825ba6a7f9ba749588a9e1e7b273f7e967@lizzy.crudebyte.com>) id 1kIU88-0000fG-HS for qemu-devel@nongnu.org; Wed, 16 Sep 2020 05:53:37 -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=IOxEdH7P12wqsQCMQXkcjSgsqCj59UF4YaQI8tHT/fE=; b=NmLpv V0YG5bbsMlo42pNRSY4xDSK0yF9nWneWlv8XaqZh65pgUE4191Tr+aoXtYhirIVTeZ7hmFilJoIaW PP21I5r/5gHvKubQYFR3C240PDorO38sO0dWATiZ2pv0ZQSOrG4ohbls67m7ULwV3s813Zu1cAVv3 1ORGfwEFxLo5WPJJBJ4s7rzUYQoLVDizL0BQj6kuNjvn38/Gpf2QgWWB6EnV7fv0RpB1pEwdD/SKK zB4M2v8ICPlX97AtHzvQYzwPVUy76VoBgdc72TSs894Pg0Fx6Fw6O+YdKOiBjizfxxNv0PAJCaeHN ck0lkJc9+va+sJM19h3HV35QRS9SA==; Message-Id: <62777d825ba6a7f9ba749588a9e1e7b273f7e967.1600166281.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Thu, 3 Sep 2020 16:20:21 +0200 Subject: [PULL 1/2] 9pfs: log warning if msize <= 8192 To: qemu-devel@nongnu.org, Peter Maydell 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=62777d825ba6a7f9ba749588a9e1e7b273f7e967@lizzy.crudebyte.com; helo=lizzy.crudebyte.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/16 05:20:12 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 13 X-Spam_score: 1.3 X-Spam_bar: + X-Spam_report: (1.3 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_96_XX=3.405, 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 autolearn=no 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" It is essential to choose a reasonable high value for 'msize' to avoid severely degraded file I/O performance. This parameter can only be chosen on client/guest side, and a Linux client defaults to an 'msize' of only 8192 if the user did not explicitly specify a value for 'msize', which results in very poor file I/O performance. Unfortunately many users are not aware that they should specify an appropriate value for 'msize' to avoid severe performance issues, so log a performance warning (with a QEMU wiki link explaining this issue in detail) on host side in that case to make it more clear. Currently a client cannot automatically pick a reasonable value for 'msize', because a good value for 'msize' depends on the file I/O potential of the underlying storage on host side, i.e. a feature invisible to the client, and even then a user would still need to trade off between performance profit and additional RAM costs, i.e. with growing 'msize' (RAM occupation), performance still increases, but performance delta will shrink continuously. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: Signed-off-by: Christian Schoenebeck --- hw/9pfs/9p.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 7bb994bbf2..99b6f24fd6 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1353,6 +1353,15 @@ static void coroutine_fn v9fs_version(void *opaque) goto out; } =20 + /* 8192 is the default msize of Linux clients */ + if (s->msize <=3D 8192) { + warn_report_once( + "9p: degraded performance: a reasonable high msize should be " + "chosen on client/guest side (chosen msize is <=3D 8192). See " + "https://wiki.qemu.org/Documentation/9psetup#msize for details= ." + ); + } + marshal: err =3D pdu_marshal(pdu, offset, "ds", s->msize, &version); if (err < 0) { --=20 2.20.1 From nobody Tue May 7 23:19:04 2024 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=1600250171; cv=none; d=zohomail.com; s=zohoarc; b=M6StuV8h9dYqpk8gFseisXGJvLZBDTQDVT1SYkMienDRN4Ue1vsPUBVpQi8vHpX5nNqSYW5VXexy6fYEp8gwJRvv6EnJLVIHgbnHl7tznYRZi4pPTfo0t3ztkKh1gmWQTzJ7YD6u7GThkd5go1SScOinsCzPmFinx5vmfn+fABQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600250171; 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=DqzpM+VGQVKR7OCnZLPpx0lh9Fsm7b5Rfn+2RWn2HXo=; b=DlOrb72LXq03wg0VL3dO227tvwP496w0n7FOYKVeZG6ZL+mV/TexnC/uA5Bz4ezWh7dVVM1pwd5ZGyrtfrHdSui7zxE+tDTJLKQsD8cnb4l3pkDoPp6b1Luiqp4OitQ51j2iuwgqIyV1nLchtO3yILXBnCOGzb8TYRaIkPk37gU= 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 160025017127348.48139935156428; Wed, 16 Sep 2020 02:56:11 -0700 (PDT) Received: from localhost ([::1]:58778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIUAc-0002wY-25 for importer@patchew.org; Wed, 16 Sep 2020 05:56:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIU9A-0001BL-G4 for qemu-devel@nongnu.org; Wed, 16 Sep 2020 05:54:40 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:37623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIU99-0000jl-3Y for qemu-devel@nongnu.org; Wed, 16 Sep 2020 05:54:40 -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=DqzpM+VGQVKR7OCnZLPpx0lh9Fsm7b5Rfn+2RWn2HXo=; b=eMcv9 KjmDBWAUk66OF+1ExXWM2iN6sANkmjUb4zbh64cr8DVDeGWPXwfAoI3CeBm3kit5cztVJYLaz0zRk 9h+l7N3IRmlaSmacgeNRCxzgmZpANz+cajF3lTEm5PZsxrC2OV8BoC15NMFRyuswW0tlCtLiV7yPP Dm84VazLwZyTttR3yED9kZm8Vzx+hWPdA7p+CjDsfVvv8BzQ8dr3ZR8ALBviKPMMFXsrRgmO3HCMY H3BoEYSU7CLZ4yTsGgwJQ031fM/DS403TtjlUVHISVDT9Go8KW55iG6fH7yYz6q+XuBgg99wI9wxK 432FGFk9jFCbqUGHmvdT5ENJZWoWQ==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Sun, 6 Sep 2020 18:50:32 +0200 Subject: [PULL 2/2] 9pfs: disable msize warning for synth driver To: qemu-devel@nongnu.org, Peter Maydell 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=c418f935ac6aed9aa1dc0ceb4b19044a9b7b7968@lizzy.crudebyte.com; helo=lizzy.crudebyte.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/16 05:20:12 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 13 X-Spam_score: 1.3 X-Spam_bar: + X-Spam_report: (1.3 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_96_XX=3.405, 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 autolearn=no 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" Previous patch introduced a performance warning being logged on host side if client connected with an 'msize' <=3D 8192. Disable this performance warning for the synth driver to prevent that warning from being printed whenever the 9pfs (qtest) test cases are running. Introduce a new export flag V9FS_NO_PERF_WARN for that purpose, which might also be used to disable such warnings from the CLI in future. We could have also prevented the warning by simply raising P9_MAX_SIZE in virtio-9p-test.c to any value larger than 8192, however in the context of test cases it makes sense running for edge cases, which includes the lowest 'msize' value supported by the server which is 4096, hence we want to preserve an msize of 4096 for the test client. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: Signed-off-by: Christian Schoenebeck --- fsdev/file-op-9p.h | 4 ++++ hw/9pfs/9p-synth.c | 2 ++ hw/9pfs/9p.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index f2f7772c86..d51cec2f3b 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -64,6 +64,10 @@ typedef struct ExtendedOps { */ #define V9FS_REMAP_INODES 0x00000200 #define V9FS_FORBID_MULTIDEVS 0x00000400 +/* + * Disables certain performance warnings from being logged on host side. + */ +#define V9FS_NO_PERF_WARN 0x00000800 =20 #define V9FS_SEC_MASK 0x0000003C =20 diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index 7eb210ffa8..cec8c0eefc 100644 --- a/hw/9pfs/9p-synth.c +++ b/hw/9pfs/9p-synth.c @@ -541,6 +541,8 @@ static int synth_init(FsContext *ctx, Error **errp) QLIST_INIT(&synth_root.child); qemu_mutex_init(&synth_mutex); =20 + ctx->export_flags |=3D V9FS_NO_PERF_WARN; + /* Add "." and ".." entries for root */ v9fs_add_dir_node(&synth_root, synth_root.attr->mode, "..", synth_root.attr, synth_root.attr->inode); diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 99b6f24fd6..741d222c3f 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1354,7 +1354,7 @@ static void coroutine_fn v9fs_version(void *opaque) } =20 /* 8192 is the default msize of Linux clients */ - if (s->msize <=3D 8192) { + if (s->msize <=3D 8192 && !(s->ctx.export_flags & V9FS_NO_PERF_WARN)) { warn_report_once( "9p: degraded performance: a reasonable high msize should be " "chosen on client/guest side (chosen msize is <=3D 8192). See " --=20 2.20.1