qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v7 16/21] replay: bottom halves


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH v7 16/21] replay: bottom halves
Date: Mon, 12 Jan 2015 13:16:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0


On 12/01/2015 13:01, Pavel Dovgalyuk wrote:
> -    bh->next = ctx->first_bh;
> -    /* Make sure that the members are ready before putting bh into list */
> -    smp_wmb();
> -    ctx->first_bh = bh;
> +    if (replay_mode != REPLAY_MODE_NONE) {
> +        /* Slower way, but this is a queue and not a stack.
> +           Replay will process the BH in the same order they
> +           came into the queue. */
> +        last = &ctx->first_bh;
> +        while (*last) {
> +            last = &(*last)->next;
> +        }
> +        smp_wmb();
> +        *last = bh;
> +    } else {
> +        bh->next = ctx->first_bh;
> +        /* Make sure that the members are ready before putting bh into list 
> */
> +        smp_wmb();
> +        ctx->first_bh = bh;
> +    }

I am not sure I understand the reason for this, but feel free to change
the list to a QSIMPLEQ, and introduce QSIMPLEQ_INSERT_TAIL_RCU that has
the appropriate barriers.

Paolo



reply via email to

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