]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - VBLADE/vblade-master/contrib/vblade-17-aio.2.README
Merge branch 'master' of https://github.com/ventoy/Ventoy
[Ventoy.git] / VBLADE / vblade-master / contrib / vblade-17-aio.2.README
1 This proof-of-concept patch modifies vblade to access the underlying block
2 device using POSIX asynchronous IO (AIO) rather than using normal blocking
3 read() and write(). AIO allows vblade to receive and queue several several ATA
4 read/write commands at once, returning the response to the client
5 asynchronously as each IO operation completes. It should be most beneficial
6 for devices which experience very non-sequential IO. An AIO-enabled vblade is
7 also a good starting point if you want to generalise vblade to export multiple
8 devices without the complexity and overhead of a multithreaded approach.
9
10 The patch implements AIO support for both Linux and FreeBSD, but I have not
11 tested the FreeBSD support and would therefore be especially interested to
12 hear success/failure reports for compiling and running AIO vblade on FreeBSD.
13 A SIGIO handler which writes a single byte to a pipe is used to notify the
14 main poll() loop that AIO operations have completed and are ready to return to
15 the client. Running oprofile on a box with a heavily loaded loopback
16 vblade-aio suggests that it spends an inordinate amount of time in the signal
17 handler. Some method of poll()ing directly on the AIO events at the same time
18 as the socket fd could cut this overhead out completely.
19
20 More generally, experimenting on Linux with standard O_DIRECT vblade and
21 O_DIRECT vblade-aio on a loopback interface with MTU 9000 suggests that the
22 performance difference on a single RAID1-backed block device is fairly small:
23 swamped by the performance of the network and the underlying block device.
24 However, the POSIX AIO in glibc librt is emulated in userspace threads rather
25 than using the kernel AIO api. A kernel-backed POSIX AIO implementation should
26 perform better, especially for multiple access to a single block device.
27
28 I would be delighted to hear any feedback and experiences from people running
29 vblade together with this patch.
30
31 Chris Webb <chris@arachsys.com>, 2008-04-21.