> -----Original Message-----
> From: Xen-devel <xen-devel-boun...@lists.xenproject.org> On Behalf Of Jan 
> Beulich
> Sent: 28 September 2020 12:02
> To: xen-devel@lists.xenproject.org
> Cc: Andrew Cooper <andrew.coop...@citrix.com>; George Dunlap 
> <george.dun...@eu.citrix.com>; Ian
> Jackson <i...@xenproject.org>; Julien Grall <jul...@xen.org>; Wei Liu 
> <w...@xen.org>; Stefano Stabellini
> <sstabell...@kernel.org>
> Subject: [PATCH 10/12] evtchn/fifo: use stable fields when recording "last 
> queue" information
> 
> Both evtchn->priority and evtchn->notify_vcpu_id could, prior to recent
> locking adjustments, change behind the back of
> evtchn_fifo_set_pending(). Neither the queue's priority nor the vCPU's
> vcpu_id fields have similar properties, so they seem better suited for
> the purpose. In particular they reflect the respective evtchn fields'
> values at the time they were used to determine queue and vCPU.
> 
> Signed-off-by: Jan Beulich <jbeul...@suse.com>
> 

I think these changes make the code clearer anyway.

Reviewed-by: Paul Durrant <p...@xen.org>

> --- a/xen/common/event_fifo.c
> +++ b/xen/common/event_fifo.c
> @@ -246,8 +246,8 @@ static void evtchn_fifo_set_pending(stru
>          /* Moved to a different queue? */
>          if ( old_q != q )
>          {
> -            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
> -            evtchn->last_priority = evtchn->priority;
> +            evtchn->last_vcpu_id = v->vcpu_id;
> +            evtchn->last_priority = q->priority;
> 
>              spin_unlock_irqrestore(&old_q->lock, flags);
>              spin_lock_irqsave(&q->lock, flags);
> 



Reply via email to