From: Andrea Righi <andrea@betterlinux.com>
To: Theodore Tso <tytso@MIT.EDU>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan.kim@gmail.com>,
Rik van Riel <riel@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Johannes Weiner <hannes@cmpxchg.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Hugh Dickins <hughd@google.com>,
Jerry James <jamesjer@betterlinux.com>,
Marcus Sorensen <marcus@bluehost.com>,
Matt Heaton <matt@bluehost.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
linux-mm <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] fadvise: move active pages to inactive list with POSIX_FADV_DONTNEED
Date: Thu, 23 Jun 2011 15:39:04 +0200 [thread overview]
Message-ID: <20110623133904.GA1479@thinkpad> (raw)
In-Reply-To: <E03B7391-C7D0-4EBE-96FE-C7537F9E353B@mit.edu>
On Thu, Jun 23, 2011 at 08:10:47AM -0400, Theodore Tso wrote:
>
> On Jun 23, 2011, at 2:36 AM, Andrea Righi wrote:
>
> >
> > With the following solution when posix_fadvise(POSIX_FADV_DONTNEED) is
> > called for an active page instead of removing it from the page cache it
> > is added to the tail of the inactive list. Otherwise, if it's already in
> > the inactive list the page is removed from the page cache.
>
>
> Have you thought about this heuristic? If the page is active, try to
> remove it from the current process's page table. If that drops the
> use count of the page to zero, then drop it from the page cache;
> otherwise, leave it alone.
>
> That way, if the page is being used by anyone else, we don't touch
> the page at all. fadvise() should only affect the current process; if
> it's available to non-root users, it shouldn't be affecting other
> processes, and if it is being actively used by some other process,
> removing it from their page tables so it can be put on the inactive
> list counts as interference, doesn't it?
If the page is mapped in other process page tables we don't touch the
page at all (see lru_deactivate_fn in mm/swap.c).
So the heuristic above it's already implemented. I should have said this
explicitly in my description...
-Andrea
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-06-23 13:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-23 6:36 [PATCH v2] fadvise: move active pages to inactive list with POSIX_FADV_DONTNEED Andrea Righi
2011-06-23 12:10 ` Theodore Tso
2011-06-23 13:39 ` Andrea Righi [this message]
2011-06-23 22:06 ` Minchan Kim
2011-06-23 23:13 ` Andrea Righi
2011-06-24 5:57 ` Shaohua Li
2011-06-24 8:51 ` Andrea Righi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110623133904.GA1479@thinkpad \
--to=andrea@betterlinux.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=jamesjer@betterlinux.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=marcus@bluehost.com \
--cc=matt@bluehost.com \
--cc=minchan.kim@gmail.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=tytso@MIT.EDU \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).