qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 07/16] cpus-common: move CPU work item managemen


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 07/16] cpus-common: move CPU work item management to common code
Date: Wed, 21 Sep 2016 19:15:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0


On 21/09/2016 19:03, Emilio G. Cota wrote:
>> > -    wi = g_malloc0(sizeof(struct qemu_work_item));
>> > -    wi->func = func;
>> > -    wi->data = data;
>> > -    wi->free = true;
>> > -
>> > -    queue_work_on_cpu(cpu, wi);
>> > +    do_run_on_cpu(cpu, func, data, &qemu_global_mutex);
>> >  }
> AFAICT this is the only caller of do_run_on_cpu. Is qemu_global_mutex
> necessary here? I wonder if we could just use cpu->work_mutex to wait
> on a per-cpu work_cond. Contending for a global lock here doesn't
> make much sense unless I'm missing something. Furthermore, that change
> would allow us to get rid of the atomic accesses to wi.done, which I
> dislike.

Yes, this will be a follow up.

We pass qemu_global_mutex here for qemu_cond_wait to drop the BQL.  But
the real solution is to run work item outside the BQL; they don't need it.

Paolo



reply via email to

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