From: Simon Kirby <sim@netnation.com>
To: Andrew Morton <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch 6/12] hold atomic kmaps across generic_file_read
Date: Sun, 11 Aug 2002 01:46:52 -0700 [thread overview]
Message-ID: <20020811084652.GB22497@netnation.com> (raw)
In-Reply-To: <3D55FF30.6164040D@zip.com.au>
On Sat, Aug 10, 2002 at 11:07:44PM -0700, Andrew Morton wrote:
> This is interesting.
>
> The 2.5 readahead sort-of does the wrong thing for you. Note how
> fs/mpage.c:mpage_end_io_read() walks the BIO's pages backwards when
> unlocking the pages. And also note that the BIOs are 64kbytes, and
> the readahead window is up to 128k, etc.
>
> See, a boring old commodity disk drive will read 10,000 pages per
> second. The BIO code there is designed to *not* result in 10,000
> context-switches per second in the common case. If the reader is
> capable of processing the data faster than the disk then hold
> them off and present them with large chunks of data.
Hmm. I understand, but I now that I think about it a bit more, I think
I failed to notice the real problem:
The size of the readahead wouldn't matter if it actually prefetched the
data in advance. It's not doing that right now.
What's happening with my MP3 streaming is:
1. read(4k) gets data after a delay. xmms starts playing.
2. read(4k) gets some more data, right way, because readahead worked.
xmms continues.
...
3. read(4k) blocks for a long time while readahead starts up again and
reads a huge block of data. read() then returns the 4k. meanwhile,
xmms has underrun. xmms starts again.
4. goto 2.
It's really easy to see this behavior with the xmms-crossfade plugin and
a large buffer with "buffer debugging" display on. With tcpdump in
another window, I can see that the readahead doesn't start prefetching
until it's right near the end of the data it fetched last, rather than
doing it in advance. This is not obvious except in the case where
read() speed is limited by something like audio playback rates or heavy
processing times.
> But that's all disks. You're not talking about disks.
Well, my example with grep was assuming a CPU the speed of what I have
right now, not something modern. :) "bzip2 -9" would likely apply these
days.
> > This problem is showing up with NFS over a slow link, causing streaming
> > audio to be unusable. On the other end of the speed scale, it probably
> > also affects "grep" and other applications reading from hard disks, etc.
>
> Well, the question is "is the link saturated"? If so then it's not
> solvable. If is is not then that's a bug.
The link is not saturated, but it is used in huge bursts mixed with
periods of silence (where readahead is finished but has not yet started
the next block).
> OK, it's doing 128k of readahead there, which is a bit gross for a floppy.
> You can tune that down with `blockdev --setra N /dev/floppy'. The
Ooh, is there something like this for NFS?
> but `mke2fs /dev/fd0' oopses in 2.5.30. ho hum)
Yes, floppy in 2.5 has been broken for a while...
> So hmm. Good point, thanks. I'll go play some MP3's off floppies.
:)
Simon-
[ Simon Kirby ][ Network Operations ]
[ sim@netnation.com ][ NetNation Communications ]
[ Opinions expressed are not necessarily those of my employer. ]
next prev parent reply other threads:[~2002-08-11 8:43 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-10 0:57 [patch 6/12] hold atomic kmaps across generic_file_read Andrew Morton
2002-08-10 1:33 ` Linus Torvalds
2002-08-10 3:53 ` Andrew Morton
2002-08-10 3:53 ` Linus Torvalds
2002-08-10 6:12 ` Andrew Morton
2002-08-10 7:25 ` Linus Torvalds
2002-08-10 9:08 ` Andrew Morton
2002-08-10 12:44 ` Daniel Phillips
2002-08-10 17:01 ` Linus Torvalds
2002-08-10 18:16 ` Daniel Phillips
2002-08-10 18:32 ` Linus Torvalds
2002-08-10 18:46 ` Daniel Phillips
2002-08-10 14:16 ` Rik van Riel
2002-08-10 17:03 ` Linus Torvalds
2002-08-10 17:36 ` Jamie Lokier
2002-08-10 17:46 ` Linus Torvalds
2002-08-10 17:55 ` Jamie Lokier
2002-08-10 18:42 ` Linus Torvalds
2002-08-10 18:52 ` Jeff Garzik
2002-08-10 19:01 ` Christoph Hellwig
2002-08-10 19:04 ` Jeff Garzik
2002-08-12 15:20 ` Ingo Oeser
2002-08-12 0:18 ` Albert D. Cahalan
2002-08-12 14:11 ` Jeff Garzik
2002-08-12 14:46 ` David Woodhouse
2002-08-10 19:10 ` Jamie Lokier
2002-08-10 22:42 ` Linus Torvalds
2002-08-11 3:17 ` Simon Kirby
2002-08-11 6:07 ` Andrew Morton
2002-08-11 8:46 ` Simon Kirby [this message]
2002-08-11 9:36 ` Andrew Morton
2002-08-11 9:49 ` Andrew Morton
2002-08-11 10:28 ` Andrew Morton
2002-08-11 18:52 ` Linus Torvalds
2002-08-12 3:28 ` Andrew Morton
2002-08-12 3:27 ` Linus Torvalds
2002-08-12 4:08 ` Andrew Morton
2002-08-12 6:20 ` Simon Kirby
2002-08-12 6:44 ` Andrew Morton
2002-08-12 19:43 ` Trond Myklebust
2002-08-12 20:43 ` Andrew Morton
2002-08-11 8:00 ` Daniel Phillips
2002-08-11 19:00 ` Linus Torvalds
2002-08-11 19:43 ` Daniel Phillips
2002-08-11 0:34 ` Andrew Morton
2002-08-11 0:56 ` Linus Torvalds
2002-08-11 1:27 ` Andrew Morton
2002-08-12 7:45 ` Rusty Russell
2002-08-12 9:45 ` Daniel Phillips
2002-08-12 20:29 ` Linus Torvalds
2002-08-12 21:21 ` Daniel Phillips
2002-08-12 17:30 ` Linus Torvalds
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=20020811084652.GB22497@netnation.com \
--to=sim@netnation.com \
--cc=akpm@zip.com.au \
--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