:
:Thanks, your solution looks pretty good.  I guess as part of the
:try_to_page_it_all_in, I'll want to call swap_pager_unswapped() on
:each page.  Now I really wish I had noticed swap_pager_unswapped()
:earlier; it would have made my job much easier!

    As long as you properly check and dirty the page you can get rid
    of the backing swap.

:I'm worried that vm_proc_swapin_all() has a similar race with the
:swapout daemon.  Presently I assume that my references to the
:UPAGES object and the associated pages remain valid after the
:faultin(), and that I can use swap_pager_freeswapspace() to free
:the correct metadata, instead of calling swap_pager_unswapped() on
:each page.  Should just hold the process lock until the metadata
:are freed?

    Hmm.  Well, the proc lock is not held during vm_proc_swapin()
    (but the PS_SWAPPINGIN flag is set).  The proc lock is held during
    vm_proc_swapout().

    In your vm_proc_swapin_all() you seem to be doing the right thing
    in regards to the mutexes and retry, and you have already marked
    the device is SW_CLOSING so if something does get in there and
    try to swap the process back in it shouldn't allocate swap you are
    trying to free.

    I think you may be ok.

                                        -Matt
                                        Matthew Dillon 
                                        <[EMAIL PROTECTED]>

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to