From owner-cvs-all@FreeBSD.ORG Mon Jun 21 02:37:17 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 799FA16A4CE; Mon, 21 Jun 2004 02:37:17 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B89A43D41; Mon, 21 Jun 2004 02:37:14 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i5L2ZdtL020334; Sun, 20 Jun 2004 22:35:39 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i5L2ZdpD020331; Sun, 20 Jun 2004 22:35:39 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sun, 20 Jun 2004 22:35:39 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Alfred Perlstein In-Reply-To: <20040621022700.GP61448@elvis.mu.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern sys_socket.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: Mon, 21 Jun 2004 02:37:17 -0000 On Sun, 20 Jun 2004, Alfred Perlstein wrote: > * Robert Watson [040620 10:35] wrote: > > rwatson 2004-06-20 17:35:50 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/kern sys_socket.c > > Log: > > Annotate two intentionally unlocked reads with comments. > > > > Annotate a potentially inconsistent result returned to user space when > > performing fstaT() on a socket due to not using socket buffer locking. > > There really isn't much point in documenting races with userspace. > > You can't fix them. :) The races I'm annotating are in-kernel races that result in potentially cinconsistent results being returned to userspace. We can provide stale and consistent, or stale and inconsistent, and the difference is how much locking we do in kernel before pushing the information to user space. In some places, such as the recent SO_LINGER commit, I've opted for stronger consistency, and it may be I should make the same choice here too. Since I haven't yet made that choice, I've annotated the weakness in the current code. There will always be some races with user space that we can't solve, based on some combination of timeliness, API constraints, etc. The best we can hope to do in those cases is provide consistent, if stale, data. I'm generally not annotating those races, figuring that if they belong anywhere, it's in man pages or a book on programming user space apps. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research