Date: Fri, 14 Jul 2006 09:58:15 -0400 From: John Baldwin <jhb@freebsd.org> To: Hans Petter Selasky <hselasky@c2i.net> Cc: Perforce Change Reviews <perforce@freebsd.org>, Scott Long <scottl@freebsd.org> Subject: Re: PERFORCE change 101501 for review Message-ID: <200607140958.15594.jhb@freebsd.org> In-Reply-To: <200607140950.12582.hselasky@c2i.net> References: <200607140311.k6E3BGUv013408@repoman.freebsd.org> <200607140950.12582.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607140958.15594.jhb>