BSD 4.2 biodone(), wakeup()

Jim Franklin jwf at munsell.UUCP
Thu Oct 16 07:42:49 AEST 1986


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



More information about the Comp.unix.wizards mailing list