[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f11576a0908210417y340f7017r20d87d81c6243184@mail.gmail.com>
Date: Fri, 21 Aug 2009 20:17:51 +0900
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: Minchan Kim <minchan.kim@...il.com>
Cc: Wu Fengguang <fengguang.wu@...el.com>,
Rik van Riel <riel@...hat.com>,
Jeff Dike <jdike@...toit.com>, Avi Kivity <avi@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
"Yu, Wilfred" <wilfred.yu@...el.com>,
"Kleen, Andi" <andi.kleen@...el.com>,
Hugh Dickins <hugh.dickins@...cali.co.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
Christoph Lameter <cl@...ux-foundation.org>,
Mel Gorman <mel@....ul.ie>,
LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>
Subject: Re: [RFC] respect the referenced bit of KVM guest pages?
>> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists