Subject: Re: [PATCH] xen-netback: fix race between napi_complete() and interrupt handler

From: David Vrabel <[email-masked]>
Date: Tue, 25 Mar 2014 15:08:15 +0000

On 25/03/14 14:50, Wei Liu wrote:
> You forgot to target this patch to "net" tree in subject line.
> 
> On Tue, Mar 25, 2014 at 02:08:25PM +0000, David Vrabel wrote:
>> When the NAPI budget was not all used, xenvif_poll() would call
>> napi_complete() /after/ enabling the interrupt.  This resulted in a
>> race between the napi_complete() and the napi_schedule() in the
>> interrupt handler.  The use of local_irq_save/restore() avoided by
>> race iff the handler is running on the same CPU but not if it was
>> running on a different CPU.
>>
> 
> OK, I understand this issue now. You mentioned it in the other email
> which made me a bit confused.
> 
> Just curious, how do you trigger this? By re-binding the interrupt to
> another CPU when xenvif_poll is running? I used to run irqbalance (the
> one that works with xen virtual interrupt) but could not trigger a race.
> Probably the race window is too small to trigger?

I haven't seen the race occur, but I've not tried to trigger it.

It may be that as Zoltan says, that the race is harmless but I still
think avoiding the race entirely is preferable.

David