Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jun 2004 22:35:39 -0400 (EDT)
From:      Robert Watson <rwatson@freebsd.org>
To:        Alfred Perlstein <alfred@freebsd.org>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/kern sys_socket.c
Message-ID:  <Pine.NEB.3.96L.1040620223307.19810D-100000@fledge.watson.org>
In-Reply-To: <20040621022700.GP61448@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 20 Jun 2004, Alfred Perlstein wrote:

> * Robert Watson <rwatson@FreeBSD.org> [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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040620223307.19810D-100000>