qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v4 25/28] cputlb: introduce tlb_flush_* async work


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC v4 25/28] cputlb: introduce tlb_flush_* async work.
Date: Wed, 7 Sep 2016 12:08:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0


On 11/08/2016 17:24, Alex Bennée wrote:
> +    if (cpu->created && !qemu_cpu_is_self(cpu)) {

Is the cpu->created necessary?  It may introduce some potential races
and doesn't really add much.

> +        if (atomic_bool_cmpxchg(&cpu->pending_tlb_flush, false, true)) {

This is slightly cheaper:

        if (!atomic_xchg(&cpu->pending_tlb_flush, true)) {

Paolo

> +            async_run_on_cpu(cpu, tlb_flush_global_async_work,
> +                             GINT_TO_POINTER(flush_global));
> +        }
> +    } else {
> +        tlb_flush_nocheck(cpu, flush_global);
> +    }



reply via email to

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