From owner-cvs-all@FreeBSD.ORG Sun Dec 30 16:38:45 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B981016A41B; Sun, 30 Dec 2007 16:38:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5E94A13C46E; Sun, 30 Dec 2007 16:38:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 4672C4721A; Sun, 30 Dec 2007 11:38:40 -0500 (EST) Date: Sun, 30 Dec 2007 16:38:40 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Jeff Roberson In-Reply-To: <200712300142.lBU1gF6G049616@repoman.freebsd.org> Message-ID: <20071230162853.L1545@fledge.watson.org> References: <200712300142.lBU1gF6G049616@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/compat/svr4 svr4_stream.c src/sys/dev/streams streams.c src/sys/fs/devfs devfs_vnops.c src/sys/fs/fifofs fifo_vnops.c src/sys/kern kern_descrip.c kern_event.c sys_generic.c sys_pipe.c uipc_mqueue.c uipc_syscalls.c ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 30 Dec 2007 16:38:45 -0000 On Sun, 30 Dec 2007, Jeff Roberson wrote: > Remove explicit locking of struct file. > - Introduce a finit() which is used to initailize the fields of struct file > in such a way that the ops vector is only valid after the data, type, > and flags are valid. > - Protect f_flag and f_count with atomic operations. > - Remove the global list of all files and associated accounting. > - Rewrite the unp garbage collection such that it no longer requires > the global list of all files and instead uses a list of all unp sockets. > - Mark sockets in the accept queue so we don't incorrectly gc them. This sounds like great work! I do have a few questions though: (1) Could we teach "show files" to call out to a function in UNIX domain sockets to print in-flight file descriptors (possibly under a separate heading)? When "show files" showed all files, whether attached to processes or not, it was quite useful for debugging problems with the UNIX domain socket GC code. See point (2). (2) The approach you've found for GCing without a global file list is quite elegant. However, I think the definition of unreachable isn't quite right yet. I'll send you some regression tests via private e-mail that now fail, leading to leaked file descriptors with the new code. Unfortunately, I've not had a chance to try to track them down. (3) The old GC algorithm was not aware of UNIX domain sockets without file descriptors, since it did it based on the global file list. The new code is aware of these other sockets, such as the UNIX domain sockets in the fifofs code. I don't see any specific problems in this area, but we should be aware of it and make sure those cases are handled properly. Robert N M Watson Computer Laboratory University of Cambridge