linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Alex Bligh - linux-kernel <linux-kernel@alex.org.uk>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: 2.5.59-mm5
Date: Fri, 24 Jan 2003 03:16:32 -0800	[thread overview]
Message-ID: <20030124031632.7e28055f.akpm@digeo.com> (raw)
In-Reply-To: <946253340.1043406208@[192.168.100.5]>

Alex Bligh - linux-kernel <linux-kernel@alex.org.uk> wrote:
>
> 
> 
> --On 23 January 2003 19:50 -0800 Andrew Morton <akpm@digeo.com> wrote:
> 
> >   So what anticipatory scheduling does is very simple: if an application
> >   has performed a read, do *nothing at all* for a few milliseconds.  Just
> >   return to userspace (or to the filesystem) in the expectation that the
> >   application or filesystem will quickly submit another read which is
> >   closeby.
> 
> I'm sure this is a really dumb question, as I've never played
> with this subsystem, in which case I apologize in advance.
> 
> Why not follow (by default) the old system where you put the reads
> effectively at the back of the queue. Then rather than doing nothing
> for a few milliseconds, you carry on with doing the writes. However,
> promote the reads to the front of the queue when you have a "good
> lump" of them.

That is the problem.  Reads do not come in "lumps".  They are dependent. 
Consider the case of reading a file:

1: Read the directory.

   This is a single read, and we cannot do anything until it has
   completed.

2: The directory told us where the inode is.  Go read the inode.

   This is a single read, and we cannot do anything until it has
   completed.

3: Go read the first 12 blocks of the file and the first indirect.


   This is a single read, and we cannot do anything until it has
   completed.

The above process can take up to three trips through the request queue.


In this very common scenario, the only way we'll ever get "lumps" of reads is
if some other processes come in and happen to want to read nearby sectors. 
In the best case, the size of the lump is proportional to the number of
processes which are concurrently trying to read something.  This just doesn't
happen enough to be significant or interesting.

But writes are completely different.  There is no dependency between them and
at any point in time we know where on-disk a lot of writes will be placed. 
We don't know that for reads, which is why we need to twiddle thumbs until the
application or filesystem makes up its mind.


--
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/

  reply	other threads:[~2003-01-24 11:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-24  3:50 2.5.59-mm5 Andrew Morton
2003-01-24 11:03 ` 2.5.59-mm5 Alex Bligh - linux-kernel
2003-01-24 11:16   ` Andrew Morton [this message]
2003-01-24 11:23     ` 2.5.59-mm5 Alex Tomas
2003-01-24 11:50       ` 2.5.59-mm5 Andrew Morton
2003-01-24 12:05         ` 2.5.59-mm5 Alex Tomas
2003-01-24 19:12           ` 2.5.59-mm5 Andrew Morton
2003-01-24 19:58             ` 2.5.59-mm5 Alex Tomas
2003-01-25 17:32             ` 2.5.59-mm5 Ed Tomlinson
2003-01-25 17:41               ` 2.5.59-mm5 Andrew Morton
2003-01-25 20:34                 ` 2.5.59-mm5 Ed Tomlinson
2003-01-25 22:33                   ` 2.5.59-mm5 Andrew Morton
2003-01-26  1:43                     ` 2.5.59-mm5 Ed Tomlinson
2003-01-26  2:17                       ` 2.5.59-mm5 Andrew Morton
2003-01-26  3:51                         ` 2.5.59-mm5 Ed Tomlinson
2003-01-26  4:04                           ` 2.5.59-mm5 Andrew Morton
2003-01-24 15:56         ` 2.5.59-mm5 Oliver Xymoron
2003-01-24 16:04           ` 2.5.59-mm5 Nick Piggin
2003-01-24 17:09             ` 2.5.59-mm5 Giuliano Pochini
2003-01-24 17:22               ` 2.5.59-mm5 Nick Piggin
2003-01-24 19:34                 ` 2.5.59-mm5 Valdis.Kletnieks
2003-01-24 20:04                   ` 2.5.59-mm5 Jens Axboe
2003-01-24 22:02                     ` 2.5.59-mm5 Valdis.Kletnieks
2003-01-25 12:28                       ` 2.5.59-mm5 Jens Axboe
2003-01-24 12:14     ` 2.5.59-mm5 Nikita Danilov
2003-01-24 16:00       ` 2.5.59-mm5 Nick Piggin
2003-01-24 11:23   ` 2.5.59-mm5 Jens Axboe
2003-01-24 13:59 ` 2.5.59-mm5 got stuck during boot Helge Hafting
2003-01-24 17:44   ` Ed Tomlinson
2003-01-24 17:56     ` Nick Piggin
2003-01-24 19:18       ` Ed Tomlinson
2003-01-25  8:33 ` 2.5.59-mm5 Andres Salomon

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=20030124031632.7e28055f.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@alex.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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