[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v3 13/19] tcg: rename tcg_current_cpu to tcg_curre
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [RFC v3 13/19] tcg: rename tcg_current_cpu to tcg_current_rr_cpu |
Date: |
Mon, 06 Jun 2016 17:05:32 +0100 |
User-agent: |
mu4e 0.9.17; emacs 25.0.94.5 |
Paolo Bonzini <address@hidden> writes:
> On 03/06/2016 22:40, Alex Bennée wrote:
>> +/* Kick the currently round-robin scheduled vCPU */
>> +static void qemu_cpu_kick_rr_cpu(void)
>> +{
>> + CPUState *cpu;
>> + do {
>> + cpu = atomic_mb_read(&tcg_current_rr_cpu);
>> + if (cpu) {
>> + cpu_exit(cpu);
>> + }
>> + } while (cpu != atomic_mb_read(&tcg_current_rr_cpu));
>> +}
>
> Interesting way to get rid of the global exit_request. I like it, but
> could you get stuck on NULL tcg_current_rr_cpu now?
If tcg_current_rr_cpu is still NULL when you read the second time (i.e.
hasn't changed) then we'll exit the loop and your don't really need to
do anything as your outside the vCPU TCG code.
>
> I think you should redo these two patches like this:
>
> - rename qemu_cpu_kick_no_halt to qemu_cpu_kick_rr_cpu and
> tcg_current_cpu to tcg_current_rr_cpu; possibly move functions around
>
That is this patch isn't it?
> - extract handle_icount_deadline
Sure I can do that separately.
>
> - then everything else in patches 13 and 14, squashed
I was wondering after I posted if I should split all the current_cpu
stuff out as I don't think I need it straight away...
>
> Paolo
--
Alex Bennée
- Re: [Qemu-devel] [RFC v3 04/19] docs: new design document multi-thread-tcg.txt (DRAFTING), (continued)
- [Qemu-devel] [RFC v3 07/19] translate-all: Add assert_memory_lock annotations, Alex Bennée, 2016/06/03
- [Qemu-devel] [RFC v3 12/19] tcg: add kick timer for single-threaded vCPU emulation, Alex Bennée, 2016/06/03
- [Qemu-devel] [RFC v3 08/19] tcg: protect TBContext with tb_lock., Alex Bennée, 2016/06/03
- [Qemu-devel] [RFC v3 11/19] tcg: add options for enabling MTTCG, Alex Bennée, 2016/06/03
- [Qemu-devel] [RFC v3 13/19] tcg: rename tcg_current_cpu to tcg_current_rr_cpu, Alex Bennée, 2016/06/03
Re: [Qemu-devel] [RFC v3 13/19] tcg: rename tcg_current_cpu to tcg_current_rr_cpu, Alex Bennée, 2016/06/07
[Qemu-devel] [RFC v3 14/19] tcg: remove global exit_request, Alex Bennée, 2016/06/03
[Qemu-devel] [RFC v3 09/19] target-arm/arm-powerctl: wake up sleeping CPUs, Alex Bennée, 2016/06/03
[Qemu-devel] [RFC v3 10/19] tcg: cpus rm tcg_exec_all(), Alex Bennée, 2016/06/03
[Qemu-devel] [RFC v3 18/19] tcg: Ensure safe TB lookup out of 'tb_lock', Alex Bennée, 2016/06/03