net/filter: Optimize filter_send to coroutine
authorRao Lei <lei.rao@intel.com>
Fri, 14 Jan 2022 05:09:02 +0000 (13:09 +0800)
committerJason Wang <jasowang@redhat.com>
Mon, 14 Feb 2022 03:50:44 +0000 (11:50 +0800)
commit611382968069f54914e3cfff30f2a3b92c6219cd
tree340811c3ff3725fc90c43fbcefacb64e57155092
parent09313cdb44b2ccec218bc85f39073954f91ee9ea
net/filter: Optimize filter_send to coroutine

This patch is to improve the logic of QEMU main thread sleep code in
qemu_chr_write_buffer() where it can be blocked and can't run other
coroutines during COLO IO stress test.

Our approach is to put filter_send() in a coroutine. In this way,
filter_send() will call qemu_coroutine_yield() in qemu_co_sleep_ns(),
so that it can be scheduled out and QEMU main thread has opportunity to
run other tasks.

Signed-off-by: Lei Rao <lei.rao@intel.com>
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/filter-mirror.c