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

Hiroki Narukawa posted 1 patch 2 years, 3 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220128083616.6083-1-hnarukaw@yahoo-corp.jp
Maintainers: Kevin Wolf <kwolf@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Hanna Reitz <hreitz@redhat.com>
There is a newer version of this series
hw/block/virtio-blk.c    |  5 +++++
include/qemu/coroutine.h | 10 ++++++++++
util/qemu-coroutine.c    | 20 ++++++++++++++++----
3 files changed, 31 insertions(+), 4 deletions(-)
[PATCH v3 0/1] Patch to adjust coroutine pool size adaptively
Posted by Hiroki Narukawa 2 years, 3 months ago
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(-)

-- 
2.17.1


Re: [PATCH v3 0/1] Patch to adjust coroutine pool size adaptively
Posted by Maxim Levitsky 2 years, 1 month ago
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