From owner-p4-projects@FreeBSD.ORG Fri Jul 14 14:32:54 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3D52316A4E5; Fri, 14 Jul 2006 14:32:54 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02F7616A4E0; Fri, 14 Jul 2006 14:32:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61EE943D45; Fri, 14 Jul 2006 14:32:53 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k6EEWh9d006267; Fri, 14 Jul 2006 10:32:44 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Hans Petter Selasky Date: Fri, 14 Jul 2006 09:58:15 -0400 User-Agent: KMail/1.9.1 References: <200607140311.k6E3BGUv013408@repoman.freebsd.org> <200607140950.12582.hselasky@c2i.net> In-Reply-To: <200607140950.12582.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607140958.15594.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 14 Jul 2006 10:32:45 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1599/Fri Jul 14 01:35:31 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Perforce Change Reviews , Scott Long Subject: Re: PERFORCE change 101501 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2006 14:32:54 -0000 On Friday 14 July 2006 03:50, Hans Petter Selasky wrote: > On Friday 14 July 2006 05:11, Scott Long wrote: > > http://perforce.freebsd.org/chv.cgi?CH=101501 > > > > Change 101501 by scottl@scottl-x64 on 2006/07/14 03:10:59 > > > > Re-allow anonymous CCB's. > > > > Affected files ... > > > > .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#41 edit > > .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_low.c#9 edit > > > > Differences ... > > > > ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#41 (text+ko) > > ==== > > > > @@ -4981,9 +4981,11 @@ > > union ccb *new_ccb; > > > > new_ccb = malloc(sizeof(*new_ccb), M_CAMXPT, M_WAITOK); > > - callout_handle_init(&new_ccb->ccb_h.timeout_ch); > > - callout_init(&new_ccb->ccb_h.callout, > > - (sim->flags & CAM_SIM_MPSAFE) ? 1 : 0); > > + if (sim != NULL) { > > + callout_handle_init(&new_ccb->ccb_h.timeout_ch); > > + callout_init(&new_ccb->ccb_h.callout, > > + (sim->flags & CAM_SIM_MPSAFE) ? 1 : 0); > > + } > > return (new_ccb); > > } > > > > Shouldn't you use "callout_init_mtx()", when dropping Giant, to avoid timout > after timeout stop situations ? Depends. callout_init_mtx() implies MPSAFE, and Scott only wants to have MPSAFE callouts with MPSAFE sims. It is true that callout_init_mtx() makes callout_stop() race-free when you hold the mutex though which is nice. -- John Baldwin