linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	Gene Heskett <gene.heskett@gmail.com>
Subject: Re: [PATCH] mm: evict streaming IO cache first
Date: Sun, 16 Nov 2008 16:20:26 -0500	[thread overview]
Message-ID: <49208E9A.5080801@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0811161013270.3468@nehalem.linux-foundation.org>

Linus Torvalds wrote:
> On Sat, 15 Nov 2008, Andrew Morton wrote:
>> Really, I think that the old approach of observing the scanner
>> behaviour (rather than trying to predict it) was better.
> 
> That's generally true. Self-adjusting behaviour rather than a-priori rules 
> would be much nicer. However, we apparently need to fix this some way. 
> Anybody willing to re-introduce some of the old logic?

The old behaviour has big problems, especially on large memory
systems.  If the old behaviour worked right, we would not have
been working on the split LRU code for the last year and a half.

Due to programs manipulating memory many pages at a time, the
LRU ends up getting mapped and cache pages on the list in bunches.

On large memory systems, after the scanner runs into a bunch
of mapped pages, it will switch to evicting mapped pages, even
if the next bunch of pages turns out to be cache pages.

I am not convinced that "reacting to what happened in the last
1/4096th of the LRU" is any better than "look at the list stats
and decide what to do".

Andrew's objection to how things behave on small memory systems
(the patch does not change anything) is valid, but going back
to the old behaviour does not seem like an option to me, either.

I will take a look at producing smoother self tuning behaviour
in get_scan_ratio(), with logic along these lines:
- the more file pages are inactive, the more eviction should
   focus on file pages, because we are not eating away at the
   working set yet
- the more file pages are active, the more there needs to be
   a balance between file and anon scanning, because we are
   starting to get to the working sets for both

I wonder if the "do not do mark_page_accessed at page fault time"
patch is triggering the current troublesome behaviour in the VM,
because actively used file pages are not moved out of the way of
the VM - which leads get_scan_ratio to believe that we are already
hitting the working set on the file side and should also start
scanning the anon LRUs.

-- 
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-11-16 21:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-15  9:38 KOSAKI Motohiro
2008-11-16  0:58 ` Rik van Riel
2008-11-16  5:00 ` Andrew Morton
2008-11-16 18:15   ` Linus Torvalds
2008-11-16 21:20     ` Rik van Riel [this message]
2008-11-16 21:28       ` Hugh Dickins
2008-11-17  4:47       ` Andrew Morton
2008-11-17  6:19         ` Nick Piggin
2008-11-17  6:30         ` KAMEZAWA Hiroyuki
2008-11-17  6:39           ` KOSAKI Motohiro
2008-11-17  6:54             ` KAMEZAWA Hiroyuki
2008-11-17  7:03               ` KOSAKI Motohiro
2008-11-17  8:22                 ` KAMEZAWA Hiroyuki
2008-11-17  8:32                   ` KOSAKI Motohiro
2008-11-17 16:22                   ` Rik van Riel
2008-11-17 16:22               ` Linus Torvalds
2008-11-17 16:27                 ` Rik van Riel
2008-11-17 16:37                 ` Linus Torvalds
2008-11-17 16:54                   ` Rik van Riel
2008-11-17 17:06                     ` Linus Torvalds
2008-11-17 17:16                       ` [PATCH] vmscan: fix get_scan_ratio comment Rik van Riel
2008-11-17 17:32                         ` KOSAKI Motohiro
2008-11-17 17:35                         ` Linus Torvalds
2008-11-17 18:53                           ` Rik van Riel
2008-11-17 20:23                             ` Rik van Riel
2008-11-18  0:06                 ` [PATCH] vmscan: evict streaming IO first Rik van Riel
2008-12-01 20:24                   ` Andrew Morton

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=49208E9A.5080801@redhat.com \
    --to=riel@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=gene.heskett@gmail.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.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