Ooops, I accidently didn't cc the list: ----- Forwarded message from Martin Husemann <mar...@duskware.de> -----
Date: Tue, 7 Apr 2015 22:30:23 +0200 From: Martin Husemann <mar...@duskware.de> To: Masanobu SAITOH <msai...@execsw.org> Subject: Re: CVS commit: src/sys/dev/pci In-Reply-To: <5523b0f9.6000...@execsw.org> User-Agent: Mutt/1.4.2.3i On Tue, Apr 07, 2015 at 07:27:05PM +0900, Masanobu SAITOH wrote: > What does this change fix? To prevent panic on shutdown? Yes: bge0 detaches (say on cpu0) while concurrently the callout triggers (say on cpu1) and the internal data structures are freed concurrently to the access (in bge_tick). My notebook regulary crashed very late during shutdown, but I usually have ddb.onpanic turned off, so I couldn't examine more closely. The change makes sure all "ongoing" callouts have completed before the detach frees internal stuff. > Almost all drviers have the same code. Should we fix all of them > like this? I think so. Maybe the "halt" can be done unconditionally, but only if callout_destroy() will be used imediately afterwards it is important to do so. ozaki-r and I have been chasing similar issues for a while and fixed them whenever we could get hold of concrete lossage. Martin