From: Rik van Riel <riel@redhat.com>
To: Mandeep Singh Baines <msb@chromium.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mel@csn.ul.ie>, Minchan Kim <minchan.kim@gmail.com>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
wad@chromium.org, olofj@chromium.org, hughd@chromium.org
Subject: Re: [PATCH] RFC: vmscan: add min_filelist_kbytes sysctl for protecting the working set
Date: Mon, 01 Nov 2010 23:11:13 -0400 [thread overview]
Message-ID: <4CCF8151.3010202@redhat.com> (raw)
In-Reply-To: <AANLkTi=src1L0gAFsogzCmejGOgg5uh=9O4Uw+ZmfBg4@mail.gmail.com>
On 11/01/2010 03:43 PM, Mandeep Singh Baines wrote:
> Yes, this prevents you from reclaiming the active list all at once. But if the
> memory pressure doesn't go away, you'll start to reclaim the active list
> little by little. First you'll empty the inactive list, and then
> you'll start scanning
> the active list and pulling pages from inactive to active. The problem is that
> there is no minimum time limit to how long a page will sit in the inactive list
> before it is reclaimed. Just depends on scan rate which does not depend
> on time.
>
> In my experiments, I saw the active list get smaller and smaller
> over time until eventually it was only a few MB at which point the system came
> grinding to a halt due to thrashing.
I believe that changing the active/inactive ratio has other
potential thrashing issues. Specifically, when the inactive
list is too small, pages may not stick around long enough to
be accessed multiple times and get promoted to the active
list, even when they are in active use.
I prefer a more flexible solution, that automatically does
the right thing.
The problem you see is that the file list gets reclaimed
very quickly, even when it is already very small.
I wonder if a possible solution would be to limit how fast
file pages get reclaimed, when the page cache is very small.
Say, inactive_file * active_file < 2 * zone->pages_high ?
At that point, maybe we could slow down the reclaiming of
page cache pages to be significantly slower than they can
be refilled by the disk. Maybe 100 pages a second - that
can be refilled even by an actual spinning metal disk
without even the use of readahead.
That can be rounded up to one batch of SWAP_CLUSTER_MAX
file pages every 1/4 second, when the number of page cache
pages is very low.
This way HPC and virtual machine hosting nodes can still
get rid of totally unused page cache, but on any system
that actually uses page cache, some minimal amount of
cache will be protected under heavy memory pressure.
Does this sound like a reasonable approach?
I realize the threshold may have to be tweaked...
The big question is, how do we integrate this with the
OOM killer? Do we pretend we are out of memory when
we've hit our file cache eviction quota and kill something?
Would there be any downsides to this approach?
Are there any volunteers for implementing this idea?
(Maybe someone who needs the feature?)
--
All rights reversed
--
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 policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-11-02 3:11 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-28 19:15 [PATCH] RFC: vmscan: add min_filelist_kbytes sysctl for protecting the working set Mandeep Singh Baines
2010-10-28 20:10 ` Andrew Morton
2010-10-28 22:03 ` Mandeep Singh Baines
2010-10-28 23:28 ` Minchan Kim
2010-10-28 23:29 ` Minchan Kim
2010-10-29 0:04 ` KAMEZAWA Hiroyuki
2010-10-29 0:28 ` Minchan Kim
2010-10-28 21:30 ` Rik van Riel
2010-10-28 22:13 ` Mandeep Singh Baines
2010-11-01 7:05 ` KOSAKI Motohiro
2010-11-01 18:24 ` Mandeep Singh Baines
2010-11-01 18:50 ` Rik van Riel
2010-11-01 19:43 ` Mandeep Singh Baines
2010-11-02 3:11 ` Rik van Riel [this message]
2010-11-03 0:48 ` Minchan Kim
2010-11-03 2:00 ` Rik van Riel
2010-11-03 3:03 ` Minchan Kim
2010-11-03 11:41 ` Rik van Riel
2010-11-03 15:42 ` Minchan Kim
2010-11-03 22:40 ` Mandeep Singh Baines
2010-11-03 23:49 ` Minchan Kim
2010-11-04 15:30 ` Rik van Riel
2010-11-08 21:55 ` Mandeep Singh Baines
2010-11-09 2:49 ` KOSAKI Motohiro
2010-11-01 23:46 ` Minchan Kim
2010-11-04 1:52 ` Mandeep Singh Baines
2010-11-05 2:36 ` Minchan Kim
2010-11-09 2:53 ` KOSAKI Motohiro
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=4CCF8151.3010202@redhat.com \
--to=riel@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@chromium.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=minchan.kim@gmail.com \
--cc=msb@chromium.org \
--cc=olofj@chromium.org \
--cc=wad@chromium.org \
/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).