[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 4/8] qcow2-threads: split out generic path
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 4/8] qcow2-threads: split out generic path |
Date: |
Fri, 14 Dec 2018 00:28:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
On 11/12/18 17:43, Vladimir Sementsov-Ogievskiy wrote:
> + ThreadPool *pool = aio_get_thread_pool(bdrv_get_aio_context(bs));
> +
> + while (s->nb_threads >= QCOW2_MAX_THREADS) {
> + qemu_co_queue_wait(&s->thread_task_queue, NULL);
> + }
> +
> + s->nb_threads++;
> + ret = thread_pool_submit_co(pool, func, arg);
> + s->nb_threads--;
> +
> + qemu_co_queue_next(&s->thread_task_queue);
What lock is protecting this manipulation? I'd rather avoid adding more
users of the AioContext lock, especially manipulation of CoQueues.
One possibility is to do the s->lock unlock/lock here, and then also
rely on that in patch 8.
Paolo
- [Qemu-devel] [PATCH v2 0/8] qcow2: encryption threads, Vladimir Sementsov-Ogievskiy, 2018/12/11
- [Qemu-devel] [PATCH v2 3/8] qcow2-threads: use thread_pool_submit_co, Vladimir Sementsov-Ogievskiy, 2018/12/11
- [Qemu-devel] [PATCH v2 6/8] qcow2: qcow2_co_preadv: skip using hd_qiov when possible, Vladimir Sementsov-Ogievskiy, 2018/12/11
- [Qemu-devel] [PATCH v2 5/8] qcow2: qcow2_co_preadv: improve locking, Vladimir Sementsov-Ogievskiy, 2018/12/11
- [Qemu-devel] [PATCH v2 8/8] qcow2: do encryption in threads, Vladimir Sementsov-Ogievskiy, 2018/12/11
- [Qemu-devel] [PATCH v2 7/8] qcow2: bdrv_co_pwritev: move encryption code out of the lock, Vladimir Sementsov-Ogievskiy, 2018/12/11
- [Qemu-devel] [PATCH v2 4/8] qcow2-threads: split out generic path, Vladimir Sementsov-Ogievskiy, 2018/12/11
- Re: [Qemu-devel] [PATCH v2 4/8] qcow2-threads: split out generic path,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v2 2/8] qcow2: add separate file for threaded data processing functions, Vladimir Sementsov-Ogievskiy, 2018/12/11
- [Qemu-devel] [PATCH v2 1/8] qcow2.h: add missing include, Vladimir Sementsov-Ogievskiy, 2018/12/11
- Re: [Qemu-devel] [PATCH v2 0/8] qcow2: encryption threads, Daniel P . Berrangé, 2018/12/11
- Re: [Qemu-devel] [PATCH v2 0/8] qcow2: encryption threads, Vladimir Sementsov-Ogievskiy, 2018/12/17