hi

when looking at PR103455 I found this and I have a question..

code:

   swp_pager_strategy(bp);

        /*
         * wait for the page we want to complete.  VPO_SWAPINPROG is always
         * cleared on completion.  If an I/O error occurs, SWAPBLK_NONE
         * is set in the meta-data.
         */
        VM_OBJECT_LOCK(object);
        while ((mreq->oflags & VPO_SWAPINPROG) != 0) {
                mreq->oflags |= VPO_WANTED;
                vm_page_lock_queues();
                vm_page_flag_set(mreq, PG_REFERENCED);
                vm_page_unlock_queues();
                cnt.v_intrans++;
                if (msleep(mreq, VM_OBJECT_MTX(object), PSWP, "swread", hz*20)) 
{

the swp_pager_strategy() initiates IO (which should issue the wakeup() necessary
for the msleep()). the problem in the PR is that the msleep() is never (within 
the
specified 20 seconds) woken up. I wonder if this is because the wakeup arrives 
BEFORE
the actual msleep() is issued. the page queue locking can take some time so 
there
is a space for a missed wakeup.

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

thnx

roman

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to