Re2: Synchronization philosophy (was: Re: FreeBSD mail list etiquette)

Matthew Dillon dillon at
Sun Oct 26 00:12:58 PDT 2003

:Again, I think it comes down to the fact that memory allocation APIs
:typically offer choices to the consumer: block if the resources aren't
:available, or fail.  My mood swings a bit back and forth as to what the
:ideal strategy would/should be at the lowest level, but I think as you
:move up the stack, the exact semantics at the bottom matter less.  The
:APIs are generally clear, but it's the programming layered on top of it
:that's sloppy (alternatively: at the bottom level API, the behavior is
:well-documented, but as you move up the stack, the behavior typically
:becomes more poorly documented).  While it's probably appropriate to say
:"this is a property of poor programming, or at least, programming done
:against a model that we want no longer to hold true", there's still the
:issue of cleaning up the legacy code...
:Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
:robert at      Network Associates Laboratories

    Oh, and I just realized... particularly in the case of 5.x, I have 
    noticed that the vnode and lockmgr *INTERLOCK* mutexes seem to present
    a severe blocking/synchronization problem for coders.  There is a lot
    of code in 5.x which must obtain and hold the interlock in order to
    guarentee that the lockmgr operation that is about to be executed with
    LK_NOWAIT will, in fact, not wait (on the interlock).  Yowzer!

    I'd consider that a serious problem because it interferes directly with
    the abstraction that LK_NOWAIT is supposed to provide.  The problem is
    even more severe due to the 5.x's other little quirks like kernel
    thread preemption by non-interrupts and cpu migration.

					Matthew Dillon 
					<dillon at>

More information about the freebsd-hackers mailing list