You are proposing replacing the current buffer locks with two separate
locks, one for ownership and the other for I/O. Frankly, I do not find
this simpler or easier to understand than what we have now. I also
take some issue with the cost of the lockmgr code. It is large, but
the critical paths through it are pretty short (it was derived from
the MACH lock code which had been pretty well tuned). There is some
long and hairy stuff in there like draining locks. But if you intend
to have locks in malloced memory, you must have a way to ensure that
all references go away before you deallocate it. And while long and
nasty, that code is (hopefully) not executed terribly frequently.
I will also note that adding the surrounding splbio/splx to all the
BUF_ macros nearly doubled the cycle count on those functions. As
nearly every instance is already splbio protected (since the B_BUSY
and B_WANTED code also required protection to avoid races), it would
make a big performance improvement to just go make sure that all the
BUF_ calls are already protected rather than needlessly add those splbio
and splx calls.
Kirk
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message