lkml.org 
[lkml]   [2009]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [RFC] respect the referenced bit of KVM guest pages?
    From
    >> Hmm, I think
    >>
    >> 1. Anyway, we need turn on PG_mlock.
    >
    > I add my patch again to explain.
    >
    > diff --git a/mm/rmap.c b/mm/rmap.c
    > index ed63894..283266c 100644
    > --- a/mm/rmap.c
    > +++ b/mm/rmap.c
    > @@ -358,6 +358,7 @@ static int page_referenced_one(struct page *page,
    >         */
    >        if (vma->vm_flags & VM_LOCKED) {
    >                *mapcount = 1;  /* break early from loop */
    > +               *vm_flags |= VM_LOCKED;
    >                goto out_unmap;
    >        }
    >
    > diff --git a/mm/vmscan.c b/mm/vmscan.c
    > index d224b28..d156e1d 100644
    > --- a/mm/vmscan.c
    > +++ b/mm/vmscan.c
    > @@ -632,7 +632,8 @@ static unsigned long shrink_page_list(struct
    > list_head *page_list,
    >                                                sc->mem_cgroup, &vm_flags);
    >                /* In active use or really unfreeable?  Activate it. */
    >                if (sc->order <= PAGE_ALLOC_COSTLY_ORDER &&
    > -                                       referenced && page_mapping_inuse(page))
    > +                                       referenced && page_mapping_inuse(page)
    > +                                       && !(vm_flags & VM_LOCKED))
    >                        goto activate_locked;
    >
    > By this check, the page can be reached at try_to_unmap after
    > page_referenced in shrink_page_list. At that time PG_mlocked will be
    > set.

    You are right.
    Please add my Reviewed-by sign to your patch.

    Thanks.
    --
    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-08-21 13:21    [W:0.027 / U:30.140 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site