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]
Date:	Wed, 19 Aug 2009 20:10:18 +0800
From:	Wu Fengguang <fengguang.wu@...el.com>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc:	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?

On Wed, Aug 19, 2009 at 08:05:19PM +0800, KOSAKI Motohiro wrote:
> >> page_referenced_file?
> >> I think we should change page_referenced().
> >
> > Yeah, good catch.
> >
> >>
> >> Instead, How about this?
> >> ==============================================
> >>
> >> Subject: [PATCH] mm: stop circulating of referenced mlocked pages
> >>
> >> Currently, mlock() systemcall doesn't gurantee to mark the page PG_Mlocked
> >
> >                                                    mark PG_mlocked
> >
> >> because some race prevent page grabbing.
> >> In that case, instead vmscan move the page to unevictable lru.
> >>
> >> However, Recently Wu Fengguang pointed out current vmscan logic isn't so
> >> efficient.
> >> mlocked page can move circulatly active and inactive list because
> >> vmscan check the page is referenced _before_ cull mlocked page.
> >>
> >> Plus, vmscan should mark PG_Mlocked when cull mlocked page.
> >
> >                           PG_mlocked
> >
> >> Otherwise vm stastics show strange number.
> >>
> >> This patch does that.
> >
> > Reviewed-by: Wu Fengguang <fengguang.wu@...el.com>
> 
> Thanks.
> 
> 
> 
> >> Index: b/mm/rmap.c
> >> ===================================================================
> >> --- a/mm/rmap.c       2009-08-18 19:48:14.000000000 +0900
> >> +++ b/mm/rmap.c       2009-08-18 23:47:34.000000000 +0900
> >> @@ -362,7 +362,9 @@ static int page_referenced_one(struct pa
> >>        * unevictable list.
> >>        */
> >>       if (vma->vm_flags & VM_LOCKED) {
> >> -             *mapcount = 1;  /* break early from loop */
> >> +             *mapcount = 1;          /* break early from loop */
> >> +             *vm_flags |= VM_LOCKED; /* for prevent to move active list */
> >
> >> +             try_set_page_mlocked(vma, page);
> >
> > That call is not absolutely necessary?
> 
> Why? I haven't catch your point.

Because we'll eventually hit another try_set_page_mlocked() when
trying to unmap the page. Ie. duplicated with another call you added
in this patch.

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