tech-kern archive

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

Re: Synchronizing if_xennet_xenbus detach with event-handling



I'll give it a shot. Is this sufficient for SMP systems? I thought spl* funcitons only raised the ipl for the local cpu. Isn't it possible for detach and event handling to be executed by different cpus?

On Sat, Feb 6, 2016 at 8:52 AM, Manuel Bouyer <bouyer%antioche.eu.org@localhost> wrote:
On Fri, Feb 05, 2016 at 01:09:28PM -0800, Rohan Desai wrote:
> I'm getting a panic due to a race between the detach path
> (xennet_xenbus_detach) and event handling (xennet_handler called from
> triggered event channel). xennet_xenbus_detach frees up the tx ring and
> xennet_handler tries to access it. I'm not sure what event the event
> channel is being poked for (tx complete, rx ready, other). Does anybody
> know how these two code-paths are supposed to be synchronized ?

xennet_xenbus_detach() runs at splnet(), so this should be enough to prevent
the event handler from being called.

But I see where the race could be: we sleep waiting for the rx grant
ref to be released, the event handler could be called at this time.
I guess just removing the interrupt handler earlier, like in the
attached patch, is enough to fix it. Can you test ?

--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--



Home | Main Index | Thread Index | Old Index