linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Luciano A. Stertz" <luciano@tteng.com.br>
To: kernelnewbies@nl.linux.org
Cc: linux-mm@kvack.org
Subject: Read-ahead code
Date: Tue, 27 Jul 2004 10:29:26 -0300	[thread overview]
Message-ID: <410658B6.3020701@tteng.com.br> (raw)

	I guess I found a bug in the readahead code, kernel 2.6.7.
	In filemap_nopage, if the memory area is not marked as sequential 
(VM_SEQ_READ isn't set) and the page is not in the page cache, the 
following code is executed:

1                ra_pages = max_sane_readahead(file->f_ra.ra_pages);
2                if (ra_pages) {
3                        long start;
4
5                        start = pgoff - ra_pages / 2;
6                        if (pgoff < 0)
7                                pgoff = 0;
8                        do_page_cache_readahead(mapping, file, pgoff, 
ra_pages);
9                }

	Seems that the author wanted to read ra_pages around pgoff. Shouldn't 
it be using 'start' instead of 'pgoff' in lines 6 to 8?!? Start is 
calculated and never used. Instead of reading pages from start to pgoff 
+ ra_pages/2, it's reading ra_pages from pgoff.

	Luciano

-- 
Luciano A. Stertz
luciano@tteng.com.br
T&T Engenheiros Associados Ltda
http://www.tteng.com.br-
Fone/Fax (51) 3224 8425
--
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:"aart@kvack.org"> aart@kvack.org </a>

             reply	other threads:[~2004-07-27 13:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-27 13:29 Luciano A. Stertz [this message]
2004-07-27 13:38 ` Luciano A. Stertz

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=410658B6.3020701@tteng.com.br \
    --to=luciano@tteng.com.br \
    --cc=kernelnewbies@nl.linux.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