mbox series

[v3,0/1] Patch to adjust coroutine pool size adaptively

Message ID 20220128083616.6083-1-hnarukaw@yahoo-corp.jp (mailing list archive)
Headers show
Series Patch to adjust coroutine pool size adaptively | expand

Message

成川 弘樹 Jan. 28, 2022, 8:36 a.m. UTC
Resending patch with decreasing coroutine pool size on device remove

We encountered random disk IO performance drop since qemu-5.0.0, and this patch fixes it.

Commit message in c740ad92 implied to adjust coroutine pool size adaptively, so I tried to implement this.

Changes from v2:
Decrease coroutine pool size on device remove

Changes from v1:
Use qatomic_read properly


Hiroki Narukawa (1):
  util: adjust coroutine pool size to virtio block queue

 hw/block/virtio-blk.c    |  5 +++++
 include/qemu/coroutine.h | 10 ++++++++++
 util/qemu-coroutine.c    | 20 ++++++++++++++++----
 3 files changed, 31 insertions(+), 4 deletions(-)

Comments

Maxim Levitsky March 17, 2022, 7:10 p.m. UTC | #1
On Fri, 2022-01-28 at 17:36 +0900, Hiroki Narukawa wrote:
> Resending patch with decreasing coroutine pool size on device remove
> 
> We encountered random disk IO performance drop since qemu-5.0.0, and this patch fixes it.
> 
> Commit message in c740ad92 implied to adjust coroutine pool size adaptively, so I tried to implement this.
> 
> Changes from v2:
> Decrease coroutine pool size on device remove
> 
> Changes from v1:
> Use qatomic_read properly
> 
> 
> Hiroki Narukawa (1):
>   util: adjust coroutine pool size to virtio block queue
> 
>  hw/block/virtio-blk.c    |  5 +++++
>  include/qemu/coroutine.h | 10 ++++++++++
>  util/qemu-coroutine.c    | 20 ++++++++++++++++----
>  3 files changed, 31 insertions(+), 4 deletions(-)
> 

I just bisected this to break my 32 bit qemu setup that I use for testing.

L1 is 32 bit VM with 16 GB of RAM (with PAE) with 16 vCPUs, and
L2 is 32 bit VM with 1.3 GB of RAM and 14 vCPUs (2 less)


Qemu runs out of memory, because new number of coroutines is quite high (14 * 256).
I understand that 32 bit qemu is very limited anyway, so I won't argue
against this patch. Just FYI. 

As a workaround I reduced the virtio-blk queue-size to 16
and it seems to work again. I am only keeping this configuration to test
that it boots thus performance is not an issue.

Option to override the coroutine pool size would be ideal in this case IMHO though.

Best regards,
	Maxim Levitsky