possibly missed wakeup in swap_pager_getpages()

Alan Cox alc at cs.rice.edu
Fri Mar 9 19:01:56 UTC 2007


Divacky Roman wrote:

>hi
>
>  
>
[snip]

>is my analysis correct? if so, can the race be mitigated by moving the flag setting (hence
>also the locking) after the msleep()?
>
>  
>

No.  When the wakeup is performed, the VPO_SWAPINPROG flag is also 
cleared.  Both operations occur in the I/O completion handler with the 
object locked.  Thus, if the I/O completion handler runs first, the 
msleep on the page within the while loop will not occur because the 
page's VPO_SWAPINPROG  flag is already cleared.

Regards,
Alan



More information about the freebsd-hackers mailing list