Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-09-17 Thread Zhenyu Ye
Hi Stefan, On 2020/9/14 21:27, Stefan Hajnoczi wrote: >> >> Theoretically, everything running in an iothread is asynchronous. However, >> some 'asynchronous' actions are not non-blocking entirely, such as >> io_submit(). This will block while the iodepth is too big and I/O pressure >> is too high

Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-09-17 Thread Zhenyu Ye
Hi Daniel, On 2020/9/14 22:42, Daniel P. Berrangé wrote: > On Tue, Aug 11, 2020 at 09:54:08PM +0800, Zhenyu Ye wrote: >> Hi Kevin, >> >> On 2020/8/10 23:38, Kevin Wolf wrote: >>> Am 10.08.2020 um 16:52 hat Zhenyu Ye geschrieben: >>>> Before doing qmp acti

Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-09-18 Thread Zhenyu Ye
Hi Stefan, Fam, On 2020/9/18 0:01, Fam Zheng wrote: > On 2020-09-17 16:44, Stefan Hajnoczi wrote: >> On Thu, Sep 17, 2020 at 03:36:57PM +0800, Zhenyu Ye wrote: >>> When the hang occurs, the QEMU is blocked at: >>> >>> #0 0x95762b64 in ?? () fr

Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-09-18 Thread Zhenyu Ye
On 2020/9/18 22:06, Fam Zheng wrote: > > I can see how blocking in a slow io_submit can cause trouble for main > thread. I think one way to fix it (until it's made truly async in new > kernels) is moving the io_submit call to thread pool, and wrapped in a > coroutine, perhaps. > I'm not sure if a

Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-10-19 Thread Zhenyu Ye
Hi Stefan, On 2020/10/13 18:00, Stefan Hajnoczi wrote: > > Sorry, I lost track of this on-going email thread. > > Thanks for the backtrace. It shows the io_submit call is done while the > AioContext lock is held. The monitor thread is waiting for the > IOThread's AioContext lock. vcpus threads c

Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-10-19 Thread Zhenyu Ye
On 2020/10/19 21:25, Paolo Bonzini wrote: > On 19/10/20 14:40, Zhenyu Ye wrote: >> The kernel backtrace for io_submit in GUEST is: >> >> guest# ./offcputime -K -p `pgrep -nx fio` >> b'finish_task_switch' >> b'__schedule&#x

[Question] qemu-img convert block alignment

2021-04-01 Thread Zhenyu Ye
Hi all, commit 8dcd3c9b91 ("qemu-img: align result of is_allocated_sectors") introduces block alignment when doing qemu-img convert. However, the alignment is: s.alignment = MAX(pow2floor(s.min_sparse), DIV_ROUND_UP(out_bs->bl.request_alignment,

Re: [Question] qemu-img convert block alignment

2021-08-02 Thread Zhenyu Ye
ping? On 2021/4/2 11:52, Zhenyu Ye wrote: > Hi all, > > commit 8dcd3c9b91 ("qemu-img: align result of is_allocated_sectors") > introduces block alignment when doing qemu-img convert. However, the > alignment is: > > s.alignme

Re: [Question] qemu-img convert block alignment

2021-08-04 Thread Zhenyu Ye
On 2021/8/3 23:03, Eric Blake wrote: > On Fri, Apr 02, 2021 at 11:52:25AM +0800, Zhenyu Ye wrote: >> Hi all, >> >> commit 8dcd3c9b91 ("qemu-img: align result of is_allocated_sectors") >> introduces block alignment when doing qemu-img convert. However, the &g

[PATCH v1] qmp: don't hold ctx lock while querying blockstats

2020-07-10 Thread Zhenyu Ye
the I/O returns slowly, the main thread will be stuck until the lock is released, which will affect the vcpu operation and finall cause the vm to be stuck. Signed-off-by: Zhenyu Ye --- block/qapi.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index

[PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-08-10 Thread Zhenyu Ye
qmp actions. Zhenyu Ye (2): util: introduce aio_context_acquire_timeout qmp: use aio_context_acquire_timeout replace aio_context_acquire block/qapi-sysemu.c | 7 ++- block/qapi.c| 6 +- blockdev.c | 35

[PATCH v1 1/2] util: introduce aio_context_acquire_timeout

2020-08-10 Thread Zhenyu Ye
aio_context_acquire_timeout(), which will return ETIMEDOUT after @t seconds. This will be used in next patch. Signed-off-by: Zhenyu Ye --- include/block/aio.h | 5 + include/qemu/thread-posix.h | 1 + include/qemu/thread.h | 1 + util/async.c| 10 ++ util/qemu-thread

[PATCH v1 2/2] qmp: use aio_context_acquire_timeout replace aio_context_acquire

2020-08-10 Thread Zhenyu Ye
the waiting time exceeds LOCK_TIMEOUT (default set to 3 seconds). Signed-off-by: Zhenyu Ye --- block/qapi-sysemu.c | 7 ++- block/qapi.c| 6 +- blockdev.c | 35 ++- include/block/aio.h | 1 + 4 files changed, 42 insertions(+), 7

Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-08-11 Thread Zhenyu Ye
Hi Kevin, On 2020/8/10 23:38, Kevin Wolf wrote: > Am 10.08.2020 um 16:52 hat Zhenyu Ye geschrieben: >> Before doing qmp actions, we need to lock the qemu_global_mutex, >> so the qmp actions should not take too long time. >> >> Unfortunately, some qmp actions need

Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-08-12 Thread Zhenyu Ye
Hi Stefan, On 2020/8/12 21:51, Stefan Hajnoczi wrote: > On Mon, Aug 10, 2020 at 10:52:44PM +0800, Zhenyu Ye wrote: >> Before doing qmp actions, we need to lock the qemu_global_mutex, >> so the qmp actions should not take too long time. >> >> Unfortunately, some qmp

Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-12-21 Thread Zhenyu Ye
On 2020/12/15 0:33, Stefan Hajnoczi wrote: > On Tue, Dec 08, 2020 at 08:47:42AM -0500, Glauber Costa wrote: >> The work we did at the time was in fixing those things in the kernel >> as much as we could. >> But the API is just like that... > The best way for us is to replace io_submit with io_uri