mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@bonn-fries.net>
To: Helge Hafting <helgehaf@idb.hist.no>, linux-kernel@vger.kernel.org
Subject: Re: [resent PATCH] Re: very slow parallel read performance
Date: Mon, 27 Aug 2001 16:31:21 +0200	[thread overview]
Message-ID: <20010827142441Z16237-32383+1641@humbolt.nl.linux.org> (raw)
In-Reply-To: <Pine.LNX.4.33L.0108241600410.31410-100000@duckman.distro.conectiva> <20010824222226Z16116-32383+1242@humbolt.nl.linux.org> <3B89F1FC.40F747D4@idb.hist.no>
In-Reply-To: <3B89F1FC.40F747D4@idb.hist.no>

On August 27, 2001 09:08 am, Helge Hafting wrote:
> Daniel Phillips wrote:
> > 
> > On August 24, 2001 09:02 pm, Rik van Riel wrote:
> > > I guess in the long run we should have automatic collapse
> > > of the readahead window when we find that readahead window
> > > thrashing is going on, in the short term I think it is
> > > enough to have the maximum readahead size tunable in /proc,
> > > like what is happening in the -ac kernels.
> > 
> > Yes, and the most effective way to detect that the readahead window is too
> > high is by keeping a history of recently evicted pages.  When we find
> > ourselves re-reading pages that were evicted before ever being used we 
> > know exactly what the problem is.
> 
> Counting how much we are reading ahead and comparing with total RAM
> (or total cache) might also be an idea.  We may then read ahead
> a lot for those who runs a handful of processes, and
> do smaller readahead for those that runs thousands of processes.

Yes.  In fact I was just sitting down to write up a design for a new 
readahead-handling strategy that incorporates this idea.  Here are my design 
notes so far:

  - Readahead cache should be able to expand to fill (almost) all
    memory in the absence of other activity.

  - Readahead pages have higher priority than inactive pages, lower
    than active.

  - Readahead cache is naturally a fifo - new chunks of readahead
    are added at the head and unused readahead is (eventually)
    culled from the tail.

  - Readahead cache is important enough to get its own lru list.
    We know it's a fifo so don't have to waste cycles scanning/aging.
    Having a distinct list makes the accounting trivial, vs keeping
    readahead on the active list for example.

  - A new readahead page starts on the readahead queue.  When used
    (by generic_file_read) the readahead page moves to the inactive
    queue and becomes a used-once page (i.e., low priority).  If a
    readahead page reaches the tail of the readahead queue it may
    be culled by moving it to the inactive queue.

  - When the readahead cache fills up past its falloff limit we
    will reduce amount of readahead submitted proportionally by the
    amount the readahead cache exceeds the falloff limit.  At the
    cutoff limit, no new readahead is submitted.

  - At each try_to_free_pages step the readahead queue is culled
    proportionally by the amount it exceeds its falloff limit.  A
    tuning parameter controls the rate at which readahead is 
    culled vs new readahead submissions (is there a better way?).

  - The cutoff limit is adjusted periodically according to the size
    of the active list, implementing the idea that active pages
    take priority over readahead pages.

  - The falloff limit is set proportionally to the cutoff limit.

  - The mechanism operates without user intervention, though there
    are several points at which proportional factors could be
    exposed as tuning parameters.

The overarching idea here is that we can pack more readahead into memory by 
managing it carefully, in such a way that we do not often discard unused 
readahead pages.  In other words, we do as much readahead as possible but 
avoid thrashing.

The advantages seem clear enough that I'll proceed to an implementation
without further ado.

--
Daniel

  reply	other threads:[~2001-08-27 14:24 UTC|newest]

Thread overview: 123+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-23 21:35 Lehmann 
2001-08-24  7:35 ` [resent PATCH] " Roger Larsson
2001-08-24 17:43   ` Rik van Riel
2001-08-24 18:28     ` Roger Larsson
2001-08-24 19:02       ` Rik van Riel
2001-08-24 20:37         ` Gérard Roudier
2001-08-24 23:12           ` Rik van Riel
2001-08-25  8:02             ` Gérard Roudier
2001-08-25  9:26               ` Roger Larsson
2001-08-25 11:49                 ` Gérard Roudier
2001-08-25 17:56                   ` Roger Larsson
2001-08-25 19:13                     ` Gérard Roudier
2001-08-25 13:17               ` Rik van Riel
2001-08-24 22:29         ` Daniel Phillips
2001-08-24 23:10           ` Rik van Riel
2001-08-25  0:42             ` Daniel Phillips
2001-08-27  7:08           ` Helge Hafting
2001-08-27 14:31             ` Daniel Phillips [this message]
2001-08-27 14:42               ` Alex Bligh - linux-kernel
2001-08-27 15:14                 ` Rik van Riel
2001-08-27 16:04                   ` Daniel Phillips
     [not found]                   ` <Pine.LNX.4.33L.0108271213370.5646-100000@imladris.rielhome.cone ctiva>
2001-08-27 19:34                     ` Alex Bligh - linux-kernel
2001-08-27 20:03                       ` Oliver Neukum
2001-08-27 20:19                         ` Alex Bligh - linux-kernel
2001-08-27 21:38                           ` Oliver.Neukum
2001-08-27 22:26                             ` Alex Bligh - linux-kernel
2001-08-27 21:29                       ` Daniel Phillips
2001-08-27 16:02                 ` Daniel Phillips
2001-08-27 19:36                   ` Alex Bligh - linux-kernel
2001-08-27 20:24                     ` Daniel Phillips
2001-08-27 16:55               ` David Lang
2001-08-27 18:54                 ` Daniel Phillips
2001-08-27 18:37               ` Oliver Neukum
2001-08-27 19:04                 ` Daniel Phillips
2001-08-27 19:43                   ` Oliver Neukum
2001-08-27 20:37                     ` Daniel Phillips
2001-08-27 22:10                       ` Oliver.Neukum
2001-08-27 21:44                     ` Linus Torvalds
2001-08-27 22:30                       ` Daniel Phillips
2001-08-27 23:00                       ` Marcelo Tosatti
2001-08-28  3:10                         ` Linus Torvalds
2001-08-27 19:55                 ` Richard Gooch
2001-08-27 20:09                   ` Oliver Neukum
2001-08-27 21:06                   ` Daniel Phillips
2001-08-24 20:18     ` Daniel Phillips
2001-08-24 20:19       ` Rik van Riel
2001-08-24 21:11         ` Daniel Phillips
2001-08-24 23:03           ` Rik van Riel
2001-08-25  0:41             ` Daniel Phillips
2001-08-25  1:34               ` Rik van Riel
2001-08-25 15:49                 ` Daniel Phillips
2001-08-25 15:50                   ` Rik van Riel
2001-08-25 16:28                     ` Lehmann 
2001-08-25 16:34                       ` Rik van Riel
2001-08-25 16:41                         ` Lehmann 
2001-08-26 16:55                       ` Daniel Phillips
2001-08-26 18:39                         ` Rik van Riel
2001-08-26 19:46                           ` Daniel Phillips
2001-08-26 19:52                             ` Rik van Riel
2001-08-26 20:08                               ` Daniel Phillips
2001-08-26 22:33                                 ` Russell King
2001-08-26 23:24                                   ` Daniel Phillips
2001-08-26 23:24                                     ` Russell King
2001-08-27  0:07                                     ` Rik van Riel
2001-08-27  0:02                                 ` Rik van Riel
2001-08-27  0:42                                   ` Daniel Phillips
2001-08-25 16:43                     ` Daniel Phillips
2001-08-25 19:15                       ` Alan Cox
2001-08-25 19:35                         ` Lehmann 
2001-08-25 20:52                           ` Rik van Riel
2001-08-26  1:38                             ` Daniel Phillips
2001-08-26  2:49                               ` Lehmann 
2001-08-26 17:29                                 ` Daniel Phillips
2001-08-26 17:37                                   ` Craig I. Hagan
2001-08-26 18:56                                   ` Rik van Riel
2001-08-26 19:18                                   ` Lehmann 
2001-08-26 21:07                                     ` Daniel Phillips
2001-08-26 22:12                                       ` Rik van Riel
2001-08-26 23:24                                       ` Lehmann 
2001-08-26 20:26                                   ` Gérard Roudier
2001-08-26 21:20                                     ` Daniel Phillips
2001-08-26  3:32                               ` Rik van Riel
2001-08-26 13:22                                 ` Lehmann 
2001-08-26 13:48                                   ` Rik van Riel
2001-08-26 14:55                                     ` Lehmann 
2001-08-26 15:06                                       ` Rik van Riel
2001-08-26 15:25                                         ` Lehmann 
2001-08-25 21:33                           ` Alan Cox
2001-08-25 23:34                             ` Lehmann 
2001-08-26  2:02                               ` Rik van Riel
2001-08-26  2:57                                 ` Lehmann 
2001-08-26  0:46                           ` John Stoffel
2001-08-26  1:07                             ` Alan Cox
2001-08-26  3:30                               ` Rik van Riel
2001-08-26  3:40                             ` Rik van Riel
2001-08-26  5:28                               ` Daniel Phillips
2001-08-24 23:23         ` Lehmann 
     [not found]           ` <200108242344.f7ONi0h21270@mailg.telia.com>
2001-08-25  0:28             ` Lehmann 
2001-08-25  3:09           ` Rik van Riel
2001-08-25  9:13             ` Gérard Roudier
2001-08-26 16:54           ` Daniel Phillips
2001-08-26 18:59             ` Victor Yodaiken
2001-08-26 19:38               ` Rik van Riel
2001-08-26 20:05                 ` Victor Yodaiken
2001-08-26 20:34                   ` Rik van Riel
2001-08-26 20:45                     ` Victor Yodaiken
2001-08-26 21:00                       ` Alan Cox
2001-08-26 20:42               ` Daniel Phillips
2001-08-26 19:31             ` Lehmann 
2001-08-24 19:42   ` Lehmann 
2001-08-24 21:42     ` Gérard Roudier
2001-08-25  0:05   ` Craig I. Hagan
2001-08-27  2:03 Rick Hohensee
2001-08-27  2:52 ` Keith Owens
2001-08-28 17:52 ` Kai Henningsen
2001-08-28 21:54   ` Matthew M
2001-08-28  1:08 Dieter Nützel
2001-08-28  0:05 ` Marcelo Tosatti
2001-08-28  1:54   ` Daniel Phillips
2001-08-28  5:01 ` Mike Galbraith
2001-08-28 18:18 ` Andrew Morton
2001-08-28 18:45   ` Hans Reiser
2001-08-28 15:28 Dieter Nützel

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=20010827142441Z16237-32383+1641@humbolt.nl.linux.org \
    --to=phillips@bonn-fries.net \
    --cc=helgehaf@idb.hist.no \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®