[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH experiment 00/35] stackless coroutine backend
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH experiment 00/35] stackless coroutine backend |
Date: |
Thu, 10 Mar 2022 17:42:19 +0000 |
On Thu, Mar 10, 2022 at 01:43:38PM +0100, Paolo Bonzini wrote:
> Here is an experiment with using stackless coroutines in QEMU. It
> only compiles enough code to run tests/unit/test-coroutine, but at
> least it proves that it's possible to quickly test ideas in the
> area of coroutine runtimes. Another idea that could be toyed with
> in a similar manner could be (whoa) C++ coroutines.
>
> As expected, this also found some issues in existing code, so I
> plan to submit patches 1-5 separately.
>
> The new backend (which is the only one that works, due to the required
> code changes) is in patch 7. For the big description of what stackless
> coroutines are, please refer to that patch.
>
> Patches 8-11 do some initial conversions. Patch 12 introduce some
> preprocessor magic that greatly eases the rest of the work, and then
> the tests are converted one at a time, until patch 27 where the only
> ones missing are the CoRwlock tests.
>
> Therefore, patches 28-33 convert CoRwlock and pathces 34-35 take care
> of the corresponding tests, thus concluding the experiment.
Nice, the transformation is clear. It's simpler than Continuation
Passing Style transform because the loops and if statements remain
unmodified. This is a big advantage with the Duff's device-style
approach.
There are a lot of details to decide on in the translator tool and
runtime to optimize the code. I think the way the stack frames are
organized in this patch series is probably for convenience rather than
performance.
Out of curiousity, did you run the perf tests and compare against
ucontext?
Stefan
signature.asc
Description: PGP signature
- [PATCH 17/35] /basic/in_coroutine, (continued)
- [PATCH 17/35] /basic/in_coroutine, Paolo Bonzini, 2022/03/10
- [PATCH 11/35] convert CoMutex to stackless coroutines, Paolo Bonzini, 2022/03/10
- [PATCH 22/35] /perf/function-call, Paolo Bonzini, 2022/03/10
- [PATCH 23/35] /perf/cost, Paolo Bonzini, 2022/03/10
- [PATCH 24/35] /basic/no-dangling-access, Paolo Bonzini, 2022/03/10
- [PATCH 28/35] qemu_co_rwlock_maybe_wake_one, Paolo Bonzini, 2022/03/10
- [PATCH 31/35] qemu_co_rwlock_downgrade, Paolo Bonzini, 2022/03/10
- [PATCH 34/35] /locking/co-rwlock/upgrade, Paolo Bonzini, 2022/03/10
- [PATCH 35/35] /locking/co-rwlock/downgrade, Paolo Bonzini, 2022/03/10
- [PATCH 33/35] qemu_co_rwlock_upgrade, Paolo Bonzini, 2022/03/10
- Re: [PATCH experiment 00/35] stackless coroutine backend,
Stefan Hajnoczi <=
- Re: [PATCH experiment 00/35] stackless coroutine backend, Paolo Bonzini, 2022/03/10
- Re: [PATCH experiment 00/35] stackless coroutine backend, Stefan Hajnoczi, 2022/03/11
- Re: [PATCH experiment 00/35] stackless coroutine backend, Paolo Bonzini, 2022/03/11
- Re: [PATCH experiment 00/35] stackless coroutine backend, Daniel P . Berrangé, 2022/03/11
- Re: [PATCH experiment 00/35] stackless coroutine backend, Paolo Bonzini, 2022/03/13
- Re: [PATCH experiment 00/35] stackless coroutine backend, Stefan Hajnoczi, 2022/03/14