hugelgupf / p9

Idiomatic Go 9P2000.L client and server, extracted from gVisor for general use
Apache License 2.0
87 stars 19 forks source link

9p localfs server: set iounit to 0 on open and creat #58

Closed rminnich closed 1 year ago

rminnich commented 1 year ago

If the iounit is set to 0, the client (linux kernel) will use up to msize-sizeof(p9header) sized requests for read and write, leading to dramatically better performance.

On an atomicpi, this boosts performance by almost 4x: time dd if=/9/bin/x86_64-linux-gnu-lto-dump-11 of=/dev/null bs=128K 189+1 records in 189+1 records out 24879104 bytes (25 MB, 24 MiB) copied, 0.418601 s, 59.4 MB/s

Without this change, bandwidth was stuck at about 13 MB/s.

With this change, performance is comparable to the LLNL DIOD implementation in C, and about 2x the performance of rust-9p.

Signed-off-by: Ronald G. Minnich rminnich@gmail.com

hugelgupf commented 1 year ago

i wrote a benchmark, but that benchmark is still stuck at 13MB/s: https://github.com/hugelgupf/p9/tree/benchmark

(needs https://github.com/u-root/u-root/pull/2581)

anyway, i'll merge