From owner-cvs-src@FreeBSD.ORG Tue Aug 19 22:05:04 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F012C106566C; Tue, 19 Aug 2008 22:05:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6CCC68FC23; Tue, 19 Aug 2008 22:05:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m7JM4ocX069334; Tue, 19 Aug 2008 18:04:57 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: John Birrell Date: Tue, 19 Aug 2008 17:52:57 -0400 User-Agent: KMail/1.9.7 References: <200808192129.m7JLT2Zq008617@repoman.freebsd.org> In-Reply-To: <200808192129.m7JLT2Zq008617@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808191752.57600.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 19 Aug 2008 18:04:58 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8058/Tue Aug 19 11:20:36 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx 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 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2008 22:05:05 -0000 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