qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

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