Am 17/08/2022 um 10:04 schrieb Emanuele Giuseppe Esposito: >>> + /* protect against read in job_do_yield_locked */ >>> + JOB_LOCK_GUARD(); >>> + /* ensure the coroutine is quiescent while the AioContext is changed */ >>> + assert(job->pause_count > 0); >> job->pause_count only shows that pausing was requested. The coroutine is >> only really quiescent if job->busy == false, too. >> >> Or maybe job->paused is actually the one you want here. > I think job->paused works too. > Actually it doesn't. At least test-block-iothread test_propagate_mirror() fails, for both job->paused and !job->busy. I think the reason is that if we wait for the flag to be set, we need to actually wait that the job gets to the next pause point, because job_pause() doesn't really pause the job, it just kind of "schedules" the pause on next pause point. So, either we leave pause_count > 0, or somehow wait (I was thinking AIO_WAIT_WHILE(job->paused) but that's probably a very bad idea). Do you have any suggestion for that? Maybe Paolo has a better idea on how to do it? Emanuele
- [PATCH v10 09/21] jobs: use job locks also in... Emanuele Giuseppe Esposito
- Re: [PATCH v10 09/21] jobs: use job lock... Vladimir Sementsov-Ogievskiy
- Re: [PATCH v10 09/21] jobs: use job lock... Kevin Wolf
- [PATCH v10 10/21] block/mirror.c: use of job ... Emanuele Giuseppe Esposito
- Re: [PATCH v10 10/21] block/mirror.c: us... Kevin Wolf
- Re: [PATCH v10 10/21] block/mirror.c... Emanuele Giuseppe Esposito
- [PATCH v10 14/21] jobs: protect job.aio_conte... Emanuele Giuseppe Esposito
- Re: [PATCH v10 14/21] jobs: protect job.... Vladimir Sementsov-Ogievskiy
- Re: [PATCH v10 14/21] jobs: protect job.... Kevin Wolf
- Re: [PATCH v10 14/21] jobs: protect ... Emanuele Giuseppe Esposito
- Re: [PATCH v10 14/21] jobs: prot... Emanuele Giuseppe Esposito
- Re: [PATCH v10 14/21] jobs: ... Emanuele Giuseppe Esposito
- [PATCH v10 03/21] job.c: API functions not us... Emanuele Giuseppe Esposito
- Re: [PATCH v10 03/21] job.c: API functio... Kevin Wolf
- [PATCH v10 06/21] job: move and update commen... Emanuele Giuseppe Esposito
- Re: [PATCH v10 06/21] job: move and upda... Kevin Wolf
- Re: [PATCH v10 06/21] job: move and upda... Stefan Hajnoczi
- [PATCH v10 13/21] job: detect change of aioco... Emanuele Giuseppe Esposito
- Re: [PATCH v10 13/21] job: detect change... Kevin Wolf
- Re: [PATCH v10 13/21] job: detect ch... Emanuele Giuseppe Esposito
- Re: [PATCH v10 13/21] job: detec... Kevin Wolf