From owner-cvs-all@FreeBSD.ORG Fri Jun 11 01:25:37 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 98A5A16A4CE; Fri, 11 Jun 2004 01:25:37 +0000 (GMT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BE5043D31; Fri, 11 Jun 2004 01:25:37 +0000 (GMT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 368565C81A; Thu, 10 Jun 2004 18:25:13 -0700 (PDT) Date: Thu, 10 Jun 2004 18:25:13 -0700 From: Alfred Perlstein To: Robert Watson Message-ID: <20040611012513.GI78955@elvis.mu.org> References: <200406102134.i5ALYcNr004704@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200406102134.i5ALYcNr004704@repoman.freebsd.org> User-Agent: Mutt/1.4.2.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_usrreq.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2004 01:25:37 -0000 * Robert Watson [040610 14:34] wrote: > rwatson 2004-06-10 21:34:38 UTC > > FreeBSD src repository > > Modified files: > sys/kern uipc_usrreq.c > Log: > Introduce a subsystem lock around UNIX domain sockets in order to protect > global and allocated variables. This strategy is derived from work > originally developed by BSDi for BSD/OS, and applied to FreeBSD by Sam > Leffler: > > - Use of an sx lock for the file list mutex may cause problems with regard > to unp_mtx when garbage collection passed file descriptors. That is true, but I don't think there is a reason to hold the UNP lock inside of unp_gc except to protect the unp_gcing variable and when calling into unp_scan. You might be able to gloss over all of it by just using an sx lock instead of a mutex for the UNP lock. > - The locking in unp_pcblist() for sysctl monitoring is correct subject to > the unpcb zone not returning memory for reuse by other subsystems > (consistent with similar existing concerns). > > - Sam's version of this change, as with the BSD/OS version, made use of > both a global lock and per-unpcb locks. However, in practice, the > global lock covered all accesses, so I have simplified out the unpcb > locks in the interest of getting this merged faster (reducing the > overhead but not sacrificing granularity in most cases). We will want > to explore possibilities for improving lock granularity in this code in > the future. I noticed this in the BSD/os version, it was sort of like... "the global lock covers everything, what's the point of the underlying locks..?" Anyhow, good work, but the unp_gc stuff is surely going to bite us and needs to be fixed. -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684