9pfs: add new function v9fs_co_readdir_many()
authorChristian Schoenebeck <qemu_oss@crudebyte.com>
Wed, 29 Jul 2020 08:12:33 +0000 (10:12 +0200)
committerChristian Schoenebeck <qemu_oss@crudebyte.com>
Wed, 12 Aug 2020 07:17:32 +0000 (09:17 +0200)
commit2149675b195f2d9a1a4e3b966d45aba234def69b
tree86497b565aeebbc91263901e7eeb6a3bab9be2aa
parentdd8151f4fed6ee078a33cff4caa9ac5c558940ef
9pfs: add new function v9fs_co_readdir_many()

The newly added function v9fs_co_readdir_many() retrieves multiple
directory entries with a single fs driver request. It is intended to
replace uses of v9fs_co_readdir(), the latter only retrieves a
single directory entry per fs driver request instead.

The reason for this planned replacement is that for every fs driver
request the coroutine is dispatched from main I/O thread to a
background I/O thread and eventually dispatched back to main I/O
thread. Hopping between threads adds latency. So if a 9pfs Treaddir
request reads a large amount of directory entries, this currently
sums up to huge latencies of several hundred ms or even more. So
using v9fs_co_readdir_many() instead of v9fs_co_readdir() will
provide significant performance improvements.

Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <73dc827a12ef577ae7e644dcf34a5c0e443ab42f.1596012787.git.qemu_oss@crudebyte.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
hw/9pfs/9p.h
hw/9pfs/codir.c
hw/9pfs/coth.h