RFC Second threading model.
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest9 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | Add read-write lock to QEMUqemu-thread.c qemu-thread.h | +50 | 0 replies | |
| 2/9 | Introduce lock fid_list_lock to protect the fid list.hw/ hw/ | +31 | 0 replies | |
| 3/9 | Global rename lockhw/ | +3 | 0 replies | |
| 4/9 | Convert stat into 2nd threading modelhw/ hw/ | +37 | 0 replies | |
| 5/9 | Convert wstat into 2nd threading modelhw/ hw/ | +94 | 0 replies | |
| 6/9 | Convert open into 2nd threading modelhw/ hw/ | +51 | 0 replies | |
| 7/9 | Convert walk into 2nd threading modelhw/ hw/ | +68 | 0 replies | |
| 8/9 | Convert read into 2nd threading modelhw/ hw/ | +91 | 0 replies | |
| 9/9 | Convert write into 2nd threading model.hw/ hw/ | +39 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [RFC PATCH 0/9] Second threading model.
Hi,
This patch implements the second threading model. The first model can be referred here:
http://www.mail-archive.com/[email protected]/msg43846.html
The features of the second threading model:
* The VCPU thread runs the Qemu code until the first blocking call is encountered.
* The work to be done in the blocking call is assigned to an asynchronous thread and the VCPU thread continues running the Qemu code.
* If any blocking call is encountered by the asynchronous thread, it simply waits for the blocking call to finish and continues to run the succeeding part after that.
* There is no constant context switching between the VCPU thread and the asynchronous thread.
* The code flow is simple to understand when compared to the first threading model.
I have run the following test to measure the performance:
To test the v9fs_write call which is converted to the second threading model, I run X dd threads in parallel on the virtfs exported directory. The following is the command I use for running 2 dd threads in parallel:
time dd if=/dev/zero of=null1 bs=4k count=1000 oflag=sync & time dd if=/dev/zero of=null1 bs=4k count=1000 oflag=sync
Here is how the performance comparison between the original code, first threading model and second threading model looks like:
1 2 3 5 10
no threading: real time(s) 18.1 46.4 99.2 360.8 1518.6
system time(s) 18.0 38.3 66.8 211.7 551.6
throughput(kbps) 226 353 373 235 2681st model: real time 18.8 48.6 77.7 164.5 451.3
system time 0.6 0.2 0.18 0.68 2.4
throughput 218 336 474 624 9142nd model: real time 23.1 37.8 57.1 166.5 430
system time 0.9 1.8 0.24 0.7 3.0
throughput 177 432 430 611 940This patchset needs to be applied on top of the threadlets infrastructure series available here:
http://www.mail-archive.com/[email protected]/msg43842.html
The following series implements...
---
Sripathi Kodi (9):
Add read-write lock to QEMU
Introduce lock fid_list_lock to protect the fid list. Global rename lock
Convert stat into 2nd threading model Convert wstat into 2nd threading model Convert open into 2nd threading model Convert walk into 2nd threading model Convert read into 2nd threading model Convert write into 2nd threading model.
hw/virtio-9p.c | 950 +++++++++++++++++++++++--------------------------------- hw/virtio-9p.h | 27 ++ qemu-thread.c | 40 ++ qemu-thread.h | 10 + 4 files changed, 463 insertions(+), 564 deletions(-)
Signature · 1 line
arun