[net.unix-wizards] BSD 4.2 biodone

jwf@munsell.UUCP (Jim Franklin) (10/16/86)

In BSD 4.2 and SUN 3.0, routine biodone() in {u,v}fs_bio.c is called
by block device drivers when they are done performing i/o on a block
buffer.

At the end of the routine, biodone issues a wakeup() on the block buffer,
to wake up anyone that wanted the same buffer.  It does this without
testing the buffer flags for B_WANTED.  I don't understand this -- I
thought that anyone sleep()ing on a block buffer was required to set
B_WANTED.

Isn't biodone doing needless wakeups?  I realize that wakeup will be a
no-op if no one is actually sleeping on the buffer, but it still has to
compute the hash value of the buffer and search all of the corresponding
sleep queue for processes with a matching sleep address.  This seems like
wasted cpu cycles, given the number of times that biodone will be called.

Am I missing something somewhere??  Please respond by mail.  Thanks ...
-----
{harvard!adelie,{decvax,allegra,talcott}!encore}!munsell!jwf

Jim Franklin, Eikonix Corp., 23 Crosby Drive, Bedford, MA 01730
Phone: (617) 275-5070 x415