[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe |
Date: |
Wed, 21 Sep 2016 18:19:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 21/09/2016 18:05, Emilio G. Cota wrote:
>> > + tb_lock();
>> > +
>> > + /* If it's already been done on request of another CPU,
>> > + * just retry.
>> > + */
>> > + if (atomic_read(&tcg_ctx.tb_ctx.tb_flush_count) != tb_flush_req) {
>> > + goto done;
> tb_flush_count is always accessed with tb_lock held, right? If so, I don't
> see a reason to access it with atomic_read/set.
tb_flush accesses it outside tb_lock. Technically this one you're
quoting need not use atomic_read, but others need to.
>> + cpu_fprintf(f, "TB flush count %d\n",
>> + atomic_read(&tcg_ctx.tb_ctx.tb_flush_count));
>
> s/%d/%u/ would be more appropriate given the type change.
Ok.
Paolo
- [Qemu-devel] [PATCH 08/16] cpus-common: fix uninitialized variable use in run_on_cpu, (continued)
- [Qemu-devel] [PATCH 08/16] cpus-common: fix uninitialized variable use in run_on_cpu, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 09/16] cpus-common: move exclusive work infrastructure from linux-user, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 10/16] docs: include formal model for TCG exclusive sections, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 11/16] cpus-common: always defer async_run_on_cpu work items, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 12/16] cpus-common: remove redundant call to exclusive_idle(), Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 13/16] cpus-common: simplify locking for start_exclusive/end_exclusive, Paolo Bonzini, 2016/09/19
- [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe, Paolo Bonzini, 2016/09/19
[Qemu-devel] [PATCH 16/16] cpus-common: lock-free fast path for cpu_exec_start/end, Paolo Bonzini, 2016/09/19
Re: [Qemu-devel] [PATCH 16/16] cpus-common: lock-free fast path for cpu_exec_start/end, Emilio G. Cota, 2016/09/21
Re: [Qemu-devel] [PATCH 16/16] cpus-common: lock-free fast path for cpu_exec_start/end, Paolo Bonzini, 2016/09/22
[Qemu-devel] [PATCH 14/16] cpus-common: Introduce async_safe_run_on_cpu(), Paolo Bonzini, 2016/09/19