From owner-freebsd-current@FreeBSD.ORG Sun Feb 19 04:10:25 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89C4B16A427; Sun, 19 Feb 2006 04:10:16 +0000 (GMT) (envelope-from thompsa@freebsd.org) Received: from dbmail-mx1.orcon.net.nz (loadbalancer1.orcon.net.nz [219.88.242.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id C127443D45; Sun, 19 Feb 2006 04:10:15 +0000 (GMT) (envelope-from thompsa@freebsd.org) Received-SPF: none Received: from heff.fud.org.nz (60-234-149-201.bitstream.orcon.net.nz [60.234.149.201]) by dbmail-mx1.orcon.net.nz (8.13.2/8.13.2/Debian-1) with ESMTP id k1J4AXh4007335; Sun, 19 Feb 2006 17:10:34 +1300 Received: by heff.fud.org.nz (Postfix, from userid 1001) id A8D4D1CC38; Sun, 19 Feb 2006 17:10:12 +1300 (NZDT) Date: Sun, 19 Feb 2006 17:10:12 +1300 From: Andrew Thompson To: John Baldwin Message-ID: <20060219041012.GB78376@heff.fud.org.nz> Mail-Followup-To: Andrew Thompson , John Baldwin , freebsd-current@freebsd.org References: <20060215211534.GA78376@heff.fud.org.nz> <200602171342.13451.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200602171342.13451.jhb@freebsd.org> User-Agent: Mutt/1.5.11 X-Virus-Scanned: ClamAV version 0.88, clamav-milter version 0.87 on dbmail-mx1.orcon.net.nz X-Virus-Status: Clean Cc: freebsd-current@freebsd.org Subject: Re: rwlock patch for bridge X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2006 04:10:25 -0000 On Fri, Feb 17, 2006 at 01:42:11PM -0500, John Baldwin wrote: > On Wednesday 15 February 2006 16:15, Andrew Thompson wrote: > > > > Here is a patch that changes if_bridge to use rwlock(9) rather than the > > handrolled ref counting. Can I please get it reviewed to ensure I have > > the changes correct. I pondered if the order of unlocking the softc > > mutex and grabbing the rlock mattered but decided it didn't. > > Have you thought about replacing both the mutex and ref-count with the single > rwlock? (Perhaps that is infeasible, but it would be somewhat pointless to > just lock one lock so you can turn around and lock the next.) The bridge code makes use of callout_init_mtx(), can a rwlock be passed instead of a mutex? cheers, Andrew