qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] block: Factor out bdrv_run_co()


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v2] block: Factor out bdrv_run_co()
Date: Wed, 20 May 2020 18:01:43 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

20.05.2020 17:49, Kevin Wolf wrote:
Am 20.05.2020 um 16:05 hat Kevin Wolf geschrieben:
Am 19.05.2020 um 19:56 hat Vladimir Sementsov-Ogievskiy geschrieben:
We have a few bdrv_*() functions that can either spawn a new coroutine
and wait for it with BDRV_POLL_WHILE() or use a fastpath if they are
alreeady running in a coroutine. All of them duplicate basically the
same code.

Factor the common code into a new function bdrv_run_co().

Signed-off-by: Kevin Wolf <address@hidden>
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
    [Factor out bdrv_run_co_entry too]
---

Hi!

I'm a bit lost on rebasing "block/io: safer inc/dec in_flight sections"
(is it needed or not?), so, I decided to send just this one patch:

I suggest to go a bit further, and refactor that bdrv_run_co don't need
additional *ret argument neither NOT_DONE logic.

Hm, this approach adds another indirection and bdrv_pread/pwrite still
seems to be on some hot paths. But maybe this is just the right
motivation to clean up qcow2 a bit and use explicit bdrv_co_*() where it
is possible. I might take a look later.

Still not easily possible it seems. We can add a few coroutine_fn
markers here and there (and probably should do that), but the
interesting I/O is in the Qcow2Cache, which is used from basically
everywhere.


Hmm. Calling *_entry on in-coroutine path is also an extra inderection.

I've posted another solution for this think: auto generation of coroutine 
wrappers code, which produce no extra inderection.

RFC was here, a year ago: 
https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg05322.html

May be, it's time to resend it, as your point gives it a point.

--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]