Date: Sat, 12 Dec 2015 11:14:05 +0100 From: Hans Petter Selasky <hps@selasky.org> To: Randall Stewart <rrs@netflix.com> Cc: "Alexander V. Chernikov" <melifaro@ipfw.ru>, Adrian Chadd <adrian@freebsd.org>, freebsd-net <freebsd-net@freebsd.org>, Gleb Smirnoff <glebius@FreeBSD.org> Subject: Re: Race between arptimer() and lle removal [WAS: panic in arptimer in r289937] Message-ID: <566BF36D.5060702@selasky.org> In-Reply-To: <91332B46-8CD3-45C0-80D0-AAD29ADD2DE0@netflix.com> References: null <CAJ-VmonvVyTNuYv_as41yPCFdfR5T3FE45DP9MKAc-eyzXzPUg@mail.gmail.com> <2739461446298483@web2h.yandex.ru> <566A94A1.60400@selasky.org> <2850091449828775@web21o.yandex.ru> <566AB081.8050100@selasky.org> <566ABDAF.7060208@selasky.org> <FC434E75-442B-4E3D-9FFE-936C54823E19@netflix.com> <91332B46-8CD3-45C0-80D0-AAD29ADD2DE0@netflix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12/12/15 00:26, Randall Stewart wrote: > Hans: > > After talking with Gleb he tells me part of your test is to kldunload a module. > > Now I think that is the source of the problem. > > Probably the cleanup code failed to stop the timer and did the remove.. thus > when the timer expires it blows up. > > This is not a callout issue.. I think you need to start looking at the cleanup if you > want to pursue this. Randall: Our driver uses a pause of hz ticks to ensure resources are not used any more, which on a fast machine might give exactly hz ticks between ifattach and ifdetach. Is this a problem? What about tunX and tapX devices? In think the right way to ensure races go away is to use Glebs initial approach, because then there is no need to have a check for LLE_LINKED, hence the callback is protected by a mutex, and will be atomically stopped? And use callout_async_drain() when when freeing lle's. Like you write in your previous e-mail, the value of callout_pending() can change during the execution of the arptimer function, and even after the last unlock in arptimer. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?566BF36D.5060702>