Re: [RFC][PATCH] vmscan: report vm_flags in page_referenced()

Wu Fengguang
2009-05-17T11:26:20Z

On Mon, May 11, 2009 at 07:45:00AM +0800, Minchan Kim wrote:
> Sorry for late.
>
> On Sat, 9 May 2009 14:56:40 +0800
> Wu Fengguang <fengguang.wu@intel.com> wrote:
>
> > Hmm, this reminded me of the mlocked page protection logic in
> > page_referenced_one(). Why shall the "if (vma->vm_flags & VM_LOCKED)"
> > check be placed *after* the page_check_address() check? Is there a
> > case that an *existing* page frame is not mapped to the VM_LOCKED vma?
> > And why not to protect the page in such a case?
>
>
> I also have been having a question that routine.
> As annotation said, it seems to prevent increaseing referenced counter for mlocked page to move the page to unevictable list ASAP.
> Is right?

That's right. And it is only stopping the reference count for the
current VMA - if the reference count has already been elevated, the
mlocked page will continue to float in the [in]active lists.

> But now, page_referenced use refereced variable as just flag not count.
> So, I think referecned variable counted is meaningless.

Yes kind of, but anyway it costs nothing :-)

Thanks,
Fengguang