Skip to content

9pfs: readdir optimization

Christian Schoenebeck qemu-devel 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest7 patches 7 repliesIn review
  2. v76 patches 5 repliesSuperseded
  3. v65 patches 24 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v56 patches0 repliesSuperseded
v411 patches27 repliesApplied
v311 patches13 repliesSuperseded
v29 patches16 repliesSuperseded
v19 patches4 repliesSuperseded

Changes in v8 from the cover letter

* Split previous patch 3 into two patches [patch 3], [patch 4].

* Error out if a 9p2000.u client sends a Treaddir request, likewise error out if a 9p2000.L client sends a Tread request on a directory [patch 6].

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7tests/virtio-9p: added split readdir teststests/qtest/virtio-9p-test.c+108 -02 replies
2/79pfs: make v9fs_readdir_response_size() publichw/9pfs/9p.c hw/9pfs/9p.h+9 -21 reply
3/79pfs: split out fs driver core of v9fs_co_readdir()hw/9pfs/codir.c+23 -142 replies
4/79pfs: add new function v9fs_co_readdir_many()hw/9pfs/9p.h hw/9pfs/codir.c hw/9pfs/coth.h+190 -02 replies
5/79pfs: T_readdir latency optimizationhw/9pfs/9p.c+58 -740 replies
6/79pfs: differentiate readdir lock between 9P2000.u vs. 9P2000.Lhw/9pfs/9p.c hw/9pfs/9p.h+40 -80 replies
7/79pfs: clarify latency of v9fs_co_run_in_worker()hw/9pfs/coth.h+11 -10 replies

Reviews trailers per patch

3 of 7 patches have a Reviewed-by or Acked-by.

PatchGreg Kurz
1/7R-b
2/7R-b
3/7R-b
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 0/7] 9pfs: readdir optimization

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 5.

v7->v8:

* Split previous patch 3 into two patches [patch 3], [patch 4].

* Error out if a 9p2000.u client sends a Treaddir request, likewise error out if a 9p2000.L client sends a Tread request on a directory [patch 6].

Unchanged patches: [patch 1], [patch 2], [patch 5], [patch 7].

Message-ID of previous version (v7):
[email protected]

Message-ID of version with performance benchmark (v4):
[email protected]

Christian Schoenebeck (7):
tests/virtio-9p: added split readdir tests
9pfs: make v9fs_readdir_response_size() public
9pfs: split out fs driver core of v9fs_co_readdir() 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                 | 159 ++++++++++++++--------------
 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, 434 insertions(+), 94 deletions(-)
Signature · 1 line
2.20.1