X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=hw%2F9pfs%2Fcoth.h;h=c51289903d0df0ff65f9d3f2649bbe78b490fee9;hb=da9f2eda2551c1cbd98f72730e5b754f2149a85c;hp=fd4a45bc7c35997c048fde284f527ebd68629c57;hpb=d2c5cf7ca15490b4737a5393e51abf0301b98971;p=mirror_qemu.git diff --git a/hw/9pfs/coth.h b/hw/9pfs/coth.h index fd4a45bc7c..c51289903d 100644 --- a/hw/9pfs/coth.h +++ b/hw/9pfs/coth.h @@ -19,7 +19,7 @@ #include "qemu/coroutine.h" #include "9p.h" -/* +/** * we want to use bottom half because we want to make sure the below * sequence of events. * @@ -28,6 +28,16 @@ * 3. Enter the coroutine in the worker thread. * we cannot swap step 1 and 2, because that would imply worker thread * can enter coroutine while step1 is still running + * + * @b PERFORMANCE @b CONSIDERATIONS: As a rule of thumb, keep in mind + * that hopping between threads adds @b latency! So when handling a + * 9pfs request, avoid calling v9fs_co_run_in_worker() too often, because + * this might otherwise sum up to a significant, huge overall latency for + * providing the response for just a single request. For that reason it + * is highly recommended to fetch all data from fs driver with a single + * fs driver request on a background I/O thread (bottom half) in one rush + * first and then eventually assembling the final response from that data + * on main I/O thread (top half). */ #define v9fs_co_run_in_worker(code_block) \ do { \