qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v9 15/23] aio: replace stack of bottom halve


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH v9 15/23] aio: replace stack of bottom halves with queue
Date: Wed, 18 Feb 2015 14:10:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


On 18/02/2015 12:57, Pavel Dovgalyuk wrote:
> +#define QSIMPLEQ_INSERT_TAIL_RCU(head, elm, field) do {                 \
> +    (elm)->field.sqe_next = NULL;                                       \

Also, smp_wmb() goes here.

My fault: in the previous review I wrote "smp_wmb() must be after the
(elm) assignment". I meant after the assignment of elm's fields (i.e.
write elm's fields before publishing it) but it wasn't clear at all.

Even better, you can replace the following two lines with:

    atomic_rcu_set((head)->sqh_last, (elm));

Paolo

> +    *(head)->sqh_last = (elm);                                          \
> +    smp_wmb();                                                          \

> +    (head)->sqh_last = &(elm)->field.sqe_next;                          \
> +} while (/*CONSTCOND*/0)
> +



reply via email to

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