Re: [RFC] Track mlock()ed pages

2007-01-27 Thread Rik van Riel
Andrew Morton wrote: On Sat, 27 Jan 2007 17:19:21 -0500 Rik van Riel <[EMAIL PROTECTED]> wrote: Andrew Morton wrote: Of course it would. But how do you know it is "too expensive"? We "scan all the vmas mapping a page" as a matter of course in the page scanner - millions of times a minute.

Re: [RFC] Track mlock()ed pages

2007-01-27 Thread Andrew Morton
On Sat, 27 Jan 2007 17:19:21 -0500 Rik van Riel <[EMAIL PROTECTED]> wrote: > Andrew Morton wrote: > > > Of course it would. But how do you know it is "too expensive"? We "scan > > all the vmas mapping a page" as a matter of course in the page scanner - > > millions of times a minute. If that's

Re: [RFC] Track mlock()ed pages

2007-01-27 Thread Rik van Riel
Andrew Morton wrote: Of course it would. But how do you know it is "too expensive"? We "scan all the vmas mapping a page" as a matter of course in the page scanner - millions of times a minute. If that's "too expensive" then ouch. We can do it lazily. At mlock time, move pages onto the mlo

Re: [RFC] Track mlock()ed pages

2007-01-26 Thread Andrew Morton
On Fri, 26 Jan 2007 10:23:44 -0800 (PST) Christoph Lameter <[EMAIL PROTECTED]> wrote: > On Fri, 26 Jan 2007, Andrew Morton wrote: > > > > Large amounts of mlocked pages may be a problem for > > > > > > 1. Reclaim behavior. > > > > > > 2. Defragmentation > > > > > > > We know that. What has

Re: [RFC] Track mlock()ed pages

2007-01-26 Thread Christoph Lameter
On Fri, 26 Jan 2007, Andrew Morton wrote: > > Large amounts of mlocked pages may be a problem for > > > > 1. Reclaim behavior. > > > > 2. Defragmentation > > > > We know that. What has that to do with this patch? Knowing how much mlocked pages are where is necessary to solve these issues.

Re: [RFC] Track mlock()ed pages

2007-01-26 Thread KAMEZAWA Hiroyuki
On Fri, 26 Jan 2007 10:10:27 -0800 Andrew Morton <[EMAIL PROTECTED]> wrote: > On Fri, 26 Jan 2007 07:44:42 -0800 (PST) > Christoph Lameter <[EMAIL PROTECTED]> wrote: > > > On Fri, 26 Jan 2007, Andrew Morton wrote: > > > > > > > > Track mlocked pages via a ZVC > > > > > > Why? > > > > Large amo

Re: [RFC] Track mlock()ed pages

2007-01-26 Thread Andrew Morton
On Fri, 26 Jan 2007 07:44:42 -0800 (PST) Christoph Lameter <[EMAIL PROTECTED]> wrote: > On Fri, 26 Jan 2007, Andrew Morton wrote: > > > > > > Track mlocked pages via a ZVC > > > > Why? > > Large amounts of mlocked pages may be a problem for > > 1. Reclaim behavior. > > 2. Defragmentation >

Re: [RFC] Track mlock()ed pages

2007-01-26 Thread Christoph Lameter
On Fri, 26 Jan 2007, Andrew Morton wrote: > > > > Track mlocked pages via a ZVC > > Why? Large amounts of mlocked pages may be a problem for 1. Reclaim behavior. 2. Defragmentation > You could perhaps go for a walk across all the other vmas which presently > map this page. If any of them h

Re: [RFC] Track mlock()ed pages

2007-01-26 Thread Nick Piggin
Andrew Morton wrote: On Thu, 25 Jan 2007 22:36:17 -0800 (PST) Christoph Lameter <[EMAIL PROTECTED]> wrote: I can't think of an easy way to do this without per-page state. ie. another page flag. Thats what I am trying to avoid. You could perhaps go for a walk across all the other vmas whi

Re: [RFC] Track mlock()ed pages

2007-01-26 Thread Nick Piggin
Christoph Lameter wrote: On Fri, 26 Jan 2007, Nick Piggin wrote: Christoph Lameter wrote: Add NR_MLOCK Track mlocked pages via a ZVC I think it is not quite right. You are tracking the number of ptes that point to mlocked pages, which can be >= the actual number of pages. Mlocked pages

Re: [RFC] Track mlock()ed pages

2007-01-26 Thread Andrew Morton
On Thu, 25 Jan 2007 22:36:17 -0800 (PST) Christoph Lameter <[EMAIL PROTECTED]> wrote: > On Fri, 26 Jan 2007, Nick Piggin wrote: > > > Christoph Lameter wrote: > > > Add NR_MLOCK > > > > > > Track mlocked pages via a ZVC Why? > > I think it is not quite right. You are tracking the number of pte

Re: [RFC] Track mlock()ed pages

2007-01-25 Thread Christoph Lameter
On Fri, 26 Jan 2007, Nick Piggin wrote: > Christoph Lameter wrote: > > Add NR_MLOCK > > > > Track mlocked pages via a ZVC > > I think it is not quite right. You are tracking the number of ptes > that point to mlocked pages, which can be >= the actual number of pages. Mlocked pages are not inher

Re: [RFC] Track mlock()ed pages

2007-01-25 Thread Nick Piggin
Christoph Lameter wrote: Add NR_MLOCK Track mlocked pages via a ZVC I think it is not quite right. You are tracking the number of ptes that point to mlocked pages, which can be >= the actual number of pages. Also, page_add_anon_rmap still needs to be balanced with page_remove_rmap. I can't t

[RFC] Track mlock()ed pages

2007-01-25 Thread Christoph Lameter
Add NR_MLOCK Track mlocked pages via a ZVC Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]> Index: linux-2.6.20-rc6/include/linux/mmzone.h === --- linux-2.6.20-rc6.orig/include/linux/mmzone.h2007-01-25 20:29:58.