lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090512114456.GB5926@localhost>
Date:	Tue, 12 May 2009 19:44:56 +0800
From:	Wu Fengguang <fengguang.wu@...el.com>
To:	Minchan Kim <minchan.kim@...il.com>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"hannes@...xchg.org" <hannes@...xchg.org>,
	"riel@...hat.com" <riel@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"tytso@....edu" <tytso@....edu>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"elladan@...imo.com" <elladan@...imo.com>,
	"npiggin@...e.de" <npiggin@...e.de>,
	"cl@...ux-foundation.org" <cl@...ux-foundation.org>,
	"kosaki.motohiro@...fujitsu.com" <kosaki.motohiro@...fujitsu.com>
Subject: Re: [PATCH -mm] vmscan: report vm_flags in page_referenced()

On Tue, May 12, 2009 at 02:44:13PM +0800, Minchan Kim wrote:
> On Tue, 12 May 2009 08:23:09 +0200
> Peter Zijlstra <peterz@...radead.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.

Good suggestions!  I realized now it is a flaky idea to not do that in
page_referenced_one(), hehe.

Thanks,
Fengguang
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ