cvs commit: src/sys/kern vfs_bio.c

Sam Leffler sam at errno.com
Fri Sep 30 07:50:36 PDT 2005


Poul-Henning Kamp wrote:
> In message <433C0A4B.8030504 at errno.com>, Sam Leffler writes:
> 
> 
>>vmware is great for finding races like these because of the way it 
>>handles concurrency.  I can remember finding many problems like this in 
>>"client operating systems" when I worked on it.
> 
> 
> Can you elaborate on the "the way it handles concurrency" without
> violating any paperwork ?  It sounds like something we should know
> about...
> 

Mostly that code of the form:

unguarded assignment to variable v
wait for interrupt to see if v changed value

will almost always fail (i.e. you must protect against an interrupt when 
writing v).  On real hardware it would typically work because the 
hardware takes enough time to post the interrupt for the cpu to get 
ready to wait.  This kind of kernel programming 101 mistake mostly was 
found in device drivers but not always.

	Sam



More information about the cvs-src mailing list