lkml.org 
[lkml]   [2008]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch 3/6] mmu_notifier: invalidate_page callbacks for subsystems with rmap
    I don't understand how this is intended to work.  I think the page flag
    needs to be maintained by the mmu_notifier subsystem.

    Let's assume we have a mapping that has a grant from xpmem and an
    additional grant from kvm. The exporters are not important, the fact
    that there may be two is.

    Assume that the user revokes the grant from xpmem (we call that
    xpmem_remove). As far as xpmem is concerned, there are no longer any
    exports of that page so the page should no longer have its exported
    flag set. Note: This is not a process exit, but a function of xpmem.

    In that case, at the remove time, we have no idea whether the flag should
    be cleared.

    For the invalidate_page side, I think we should have:
    > @@ -473,6 +474,10 @@ int page_mkclean(struct page *page)
    > struct address_space *mapping = page_mapping(page);
    > if (mapping) {
    > ret = page_mkclean_file(mapping, page);
    > + if (unlikely(PageExternalRmap(page))) {
    > + mmu_rmap_notifier(invalidate_page, page);
    > + ClearPageExternalRmap(page);
    > + }
    > if (page_test_dirty(page)) {
    > page_clear_dirty(page);
    > ret = 1;

    I would assume we would then want a function which sets the page flag.

    Additionally, I would think we would want some intervention in the
    freeing of the page side to ensure the page flag is cleared as well.

    Thanks,
    Robin


    \
     
     \ /
      Last update: 2008-01-29 17:31    [W:3.039 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site