mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Ram Pai <linuxram@us.ibm.com>
Cc: ornati@lycos.it, gandalf@wlug.westbo.se, linux-kernel@vger.kernel.org
Subject: Re: Strange IDE performance change in 2.6.1-rc1 (again)
Date: Thu, 8 Jan 2004 17:17:28 -0800	[thread overview]
Message-ID: <20040108171728.54a72cf7.akpm@osdl.org> (raw)
In-Reply-To: <1073610357.12720.20.camel@dyn319250.beaverton.ibm.com>

Ram Pai <linuxram@us.ibm.com> wrote:
>
> Ok, I did some analysis and found that 'hdparm -t <device> '
> generates reads which are of size 1M. This means 256 page requests are
> generated by a single read.  
> 
> do_generic_mapping_read()  gets the request to read 256 pages. But with
> the latest change, this function calls do_pagecahce_readahead() to keep 
> 256 pages ready in cache. And after having done that
> do_generic_mapping_read() tries to access those 256 pages.
> But by then some of the pages may have been replaced under low pagecache
> conditions. Hence we end up spending extra time reading those pages
> again into the page cache.
> 
> I think the same problem must exist while reading files too. Paulo
> Ornati used cat command to read the file. cat just generates 1 page
> request per read and hence the problem did not show up. The problem must
> show up if 'dd if=big_file of=/dev/null bs=1M count=256' is used.
> 
> To conclude, I think the bug is with the changes to filemap.c 
> If the changes are reverted the regression seen with blockdevices should
> go away.
> 
> Well this is my theory, somebody should validate it,

One megabyte seems like far too litte memory to be triggering the effect
which you describe.  But yes, the risk is certainly there.

You could verify this with:

--- 25/mm/filemap.c~a	Thu Jan  8 17:15:57 2004
+++ 25-akpm/mm/filemap.c	Thu Jan  8 17:16:06 2004
@@ -629,8 +629,10 @@ find_page:
 			handle_ra_miss(mapping, ra, index);
 			goto no_cached_page;
 		}
-		if (!PageUptodate(page))
+		if (!PageUptodate(page)) {
+			printk("eek!\n");
 			goto page_not_up_to_date;
+		}
 page_ok:
 		/* If users can be writing to this page using arbitrary
 		 * virtual addresses, take care about potential aliasing


But still, that up-front readahead loop is undesirable and yes, it would be
better if we could go back to the original design in there.

  reply	other threads:[~2004-01-09  1:16 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-02 16:02 Paolo Ornati
2004-01-02 18:08 ` Ed Sweetman
2004-01-02 21:04   ` Paolo Ornati
2004-01-02 21:27     ` Valdis.Kletnieks
2004-01-03 10:20       ` Paolo Ornati
2004-01-02 21:32     ` Mike Fedyk
2004-01-02 22:34       ` Martin Josefsson
2004-01-03 11:13         ` Paolo Ornati
2004-01-03 22:40           ` Andrew Morton
2004-01-04 14:30             ` Paolo Ornati
2004-01-05 23:19               ` Ram Pai
2004-01-07 14:59                 ` Paolo Ornati
2004-01-07 19:23                   ` Ram Pai
2004-01-07 20:12                     ` Paolo Ornati
2004-01-07 23:57                       ` Andrew Morton
2004-01-08  7:31                         ` Ram Pai
2004-01-09  1:05                         ` Ram Pai
2004-01-09  1:17                           ` Andrew Morton [this message]
2004-01-09 19:15                             ` Ram Pai
2004-01-09 19:44                               ` Andrew Morton
2004-01-10 14:48                               ` Paolo Ornati
2004-01-10 16:00                                 ` Ed Sweetman
2004-01-10 16:19                                   ` Ed Sweetman
2004-01-10 17:29                                     ` Paolo Ornati
2004-01-10 17:29                                   ` Paolo Ornati
2004-03-29 15:45               ` Ram Pai
2004-01-04 17:15             ` Buffer and Page cache coherent? was: " Mike Fedyk
2004-01-04 22:10               ` Andrew Morton
2004-01-04 23:22                 ` Mike Fedyk
2004-01-04 23:32                   ` Andrew Morton
2004-01-04 23:45                     ` Mike Fedyk
2004-01-05  0:23                       ` Andrew Morton
2004-01-03 10:20       ` Paolo Ornati
2004-01-03  3:33     ` Tobias Diedrich
2004-01-03  4:15       ` Valdis.Kletnieks
2004-01-03 13:39         ` Tobias Diedrich
2004-01-03 20:56           ` Tobias Diedrich
2004-01-04  3:02         ` jw schultz

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=20040108171728.54a72cf7.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=gandalf@wlug.westbo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=ornati@lycos.it \
    /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

Powered by JetHome