From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <groug@kaod.org>
Subject: [PATCH v7 0/6] 9pfs: readdir optimization
Date: Sun, 19 Jul 2020 15:43:47 +0200 [thread overview]
Message-ID: <cover.1595166227.git.qemu_oss@crudebyte.com> (raw)
As previously mentioned, I was investigating performance issues with 9pfs.
Raw file read/write of 9pfs is actually quite good, provided that client
picked a reasonable high msize (maximum message size). I would recommend
to log a warning on 9p server side if a client attached with a small msize
that would cause performance issues for that reason.
However there are other aspects where 9pfs currently performs suboptimally,
especially readdir handling of 9pfs is extremely slow, a simple readdir
request of a guest typically blocks for several hundred milliseconds or
even several seconds, no matter how powerful the underlying hardware is.
The reason for this performance issue: latency.
Currently 9pfs is heavily dispatching a T_readdir request numerous times
between main I/O thread and a background I/O thread back and forth; in fact
it is actually hopping between threads even multiple times for every single
directory entry during T_readdir request handling which leads in total to
huge latencies for a single T_readdir request.
This patch series aims to address this severe performance issue of 9pfs
T_readdir request handling. The actual performance optimization is patch 4.
v6->v7:
* Rebased to master: SHA-1 b442119329
* Handle directory seeking more consistently by doing it in
do_readdir_many() instead of in v9fs_readdir() [patch 3], [patch 4].
* Updated API doc on v9fs_co_readdir_many(): make it clear that
v9fs_free_dirents() must always be called, including error cases
[patch 3].
* New patch: use different lock type for 9p2000.u vs. 9p2000.L
[patch 5].
Unchanged patches: [patch 1], [patch 2], [patch 6].
Message-ID of previous version (v6):
cover.1587309014.git.qemu_oss@crudebyte.com
Message-ID of version with performance benchmark (v4):
cover.1579567019.git.qemu_oss@crudebyte.com
Christian Schoenebeck (6):
tests/virtio-9p: added split readdir tests
9pfs: make v9fs_readdir_response_size() public
9pfs: add new function v9fs_co_readdir_many()
9pfs: T_readdir latency optimization
9pfs: differentiate readdir lock between 9P2000.u vs. 9P2000.L
9pfs: clarify latency of v9fs_co_run_in_worker()
hw/9pfs/9p.c | 144 ++++++++++++-------------
hw/9pfs/9p.h | 50 ++++++++-
hw/9pfs/codir.c | 196 +++++++++++++++++++++++++++++++++--
hw/9pfs/coth.h | 15 ++-
tests/qtest/virtio-9p-test.c | 108 +++++++++++++++++++
5 files changed, 419 insertions(+), 94 deletions(-)
--
2.20.1
next reply other threads:[~2020-07-19 14:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-19 13:43 Christian Schoenebeck [this message]
2020-07-19 11:20 ` [PATCH v7 1/6] tests/virtio-9p: added split readdir tests Christian Schoenebeck
2020-07-19 11:24 ` [PATCH v7 2/6] 9pfs: make v9fs_readdir_response_size() public Christian Schoenebeck
2020-07-19 12:29 ` [PATCH v7 3/6] 9pfs: add new function v9fs_co_readdir_many() Christian Schoenebeck
2020-07-28 8:33 ` Christian Schoenebeck
2020-07-28 8:46 ` Greg Kurz
2020-07-28 9:34 ` Christian Schoenebeck
2020-07-28 9:46 ` Greg Kurz
2020-07-19 13:11 ` [PATCH v7 4/6] 9pfs: T_readdir latency optimization Christian Schoenebeck
2020-07-19 13:20 ` [PATCH v7 5/6] 9pfs: differentiate readdir lock between 9P2000.u vs. 9P2000.L Christian Schoenebeck
2020-07-28 9:46 ` Christian Schoenebeck
2020-07-19 13:39 ` [PATCH v7 6/6] 9pfs: clarify latency of v9fs_co_run_in_worker() Christian Schoenebeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1595166227.git.qemu_oss@crudebyte.com \
--to=qemu_oss@crudebyte.com \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).