lkml.org 
[lkml]   [2009]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH v3 1/6] mm: Don't unmap gup()ed page
    On Wed, Apr 15, 2009 at 08:39:04PM +0900, KOSAKI Motohiro wrote:
    > >> +     if (!migration) {
    > >> +             /* re-check */
    > >> +             if (PageSwapCache(page) &&
    > >> +                 page_count(page) != page_mapcount(page) + 2) {
    > >> +                     /* We lose race against get_user_pages_fast() */
    > >> +                     set_pte_at(mm, address, pte, pteval);
    > >> +                     ret = SWAP_FAIL;
    > >> +                     goto out_unmap;
    > >> +             }
    > >> +     }
    > >> +     mmu_notifier_invalidate_page(vma->vm_mm, address);
    > >
    > > With regard to mmu notifier, this is the opposite of the right
    > > ordering. One mmu_notifier_invalidate_page must run _before_ the first
    > > check. The ptep_clear_flush_notify will then stay and there's no need
    > > of a further mmu_notifier_invalidate_page after the second check.
    >
    > OK. but I have one question.
    >
    > Can we assume mmu_notifier is only used by kvm now?
    > if not, we need to make new notifier.

    KVM is no fundamentally different from other users in this respect, so
    I don't see why need a new notifier. If it works for others it'll work
    for KVM and the other way around is true too.

    mmu notifier users can or cannot take a page pin. KVM does. GRU
    doesn't. XPMEM does. All of them releases any pin after
    mmu_notifier_invalidate_page. All that is important is to run
    mmu_notifier_invalidate_page _after_ the ptep_clear_young_notify, so
    that we don't nuke secondary mappings on the pages unless we really go
    to nuke the pte.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2009-04-15 13:47    [W:4.009 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site