lkml.org 
[lkml]   [2009]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm] vmscan: report vm_flags in page_referenced()
On Tue, 12 May 2009 08:23:09 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> On Tue, 2009-05-12 at 10:51 +0800, Wu Fengguang wrote:
> > @@ -406,6 +408,7 @@ static int page_referenced_anon(struct p
> > if (mem_cont && !mm_match_cgroup(vma->vm_mm, mem_cont))
> > continue;
> > referenced += page_referenced_one(page, vma, &mapcount);
> > + *vm_flags |= vma->vm_flags;
> > if (!mapcount)
> > break;
> > }
>
> Shouldn't that read:
>
> if (page_referenced_on(page, vma, &mapcount)) {
> referenced++;
> *vm_flags |= vma->vm_flags;
> }
>
> So that we only add the vma-flags of those vmas that actually have a
> young bit set?
>
> In which case it'd be more at home in page_referenced_one():
>
> @@ -381,6 +381,8 @@ out_unmap:
> (*mapcount)--;
> pte_unmap_unlock(pte, ptl);
> out:
> + if (referenced)
> + *vm_flags |= vma->vm_flags;
> return referenced;
> }

Good. I am ACK for peter's suggestion.
It can prevent setting vm_flag for worng vma which don't have the page.

--
Kinds Regards
Minchan Kim


\
 
 \ /
  Last update: 2009-05-12 08:47    [W:0.219 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site