cvs commit: src/sys/cddl/contrib/opensolaris/uts/common/dtrace dtrace.c

John Baldwin jhb at freebsd.org
Tue Aug 19 22:05:05 UTC 2008


On Tuesday 19 August 2008 05:28:58 pm John Birrell wrote:
> jb          2008-08-19 21:28:58 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/cddl/contrib/opensolaris/uts/common/dtrace dtrace.c 
>   Log:
>   SVN rev 181879 on 2008-08-19 21:28:58Z by jb
>   
>   Add calls to callout_drain() to ensure the callouts are flushed before
>   we free memory from underneath them.
>   
>   This fixes an occasional panic I've been seeing in softclock() where a bad
>   pointer would be encountered when pushing DTrace hard.
>   
>   Revision  Changes    Path
>   1.6       +2 -0      
src/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

If you aren't holding the mutex here, then just do a callout_drain() w/o a 
callout_stop().  If you are holding the mutex here, callout_drain() can 
deadlock.  If you aren't using callout_init_mtx() but are acquiring your 
mutex in the callout handler, you will need to not reschedule yourself in 
your callout handlers if the associated "task" has been stopped (i.e. you'll 
need to check a flag after acquiring your lock and abort early if it is set, 
etc.)

-- 
John Baldwin


More information about the cvs-src mailing list