Re: [PATCH v10 14/21] jobs: protect job.aio_context with BQL and job_mutex

2022-08-18 Thread Emanuele Giuseppe Esposito
Am 17/08/2022 um 15:10 schrieb Emanuele Giuseppe Esposito: > > > 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 >>

Re: [PATCH v10 14/21] jobs: protect job.aio_context with BQL and job_mutex

2022-08-17 Thread Emanuele Giuseppe Esposito
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

Re: [PATCH v10 14/21] jobs: protect job.aio_context with BQL and job_mutex

2022-08-17 Thread Emanuele Giuseppe Esposito
Am 05/08/2022 um 11:12 schrieb Kevin Wolf: > Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: >> In order to make it thread safe, implement a "fake rwlock", >> where we allow reads under BQL *or* job_mutex held, but >> writes only under BQL *and* job_mutex. > > Oh, so the "or

Re: [PATCH v10 14/21] jobs: protect job.aio_context with BQL and job_mutex

2022-08-05 Thread Kevin Wolf
Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: > In order to make it thread safe, implement a "fake rwlock", > where we allow reads under BQL *or* job_mutex held, but > writes only under BQL *and* job_mutex. Oh, so the "or BQL" part is only for job.aio_context? Okay. > The onl

Re: [PATCH v10 14/21] jobs: protect job.aio_context with BQL and job_mutex

2022-07-27 Thread Vladimir Sementsov-Ogievskiy
On 7/25/22 10:38, Emanuele Giuseppe Esposito wrote: In order to make it thread safe, implement a "fake rwlock", where we allow reads under BQL *or* job_mutex held, but writes only under BQL *and* job_mutex. The only write we have is in child_job_set_aio_ctx, which always happens under drain (so

[PATCH v10 14/21] jobs: protect job.aio_context with BQL and job_mutex

2022-07-25 Thread Emanuele Giuseppe Esposito
In order to make it thread safe, implement a "fake rwlock", where we allow reads under BQL *or* job_mutex held, but writes only under BQL *and* job_mutex. The only write we have is in child_job_set_aio_ctx, which always happens under drain (so the job is paused). For this reason, introduce job_set