Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Aug 2008 17:52:57 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        John Birrell <jb@freebsd.org>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/cddl/contrib/opensolaris/uts/common/dtrace dtrace.c
Message-ID:  <200808191752.57600.jhb@freebsd.org>
In-Reply-To: <200808192129.m7JLT2Zq008617@repoman.freebsd.org>
References:  <200808192129.m7JLT2Zq008617@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808191752.57600.jhb>