* Read-ahead code
@ 2004-07-27 13:29 Luciano A. Stertz
2004-07-27 13:38 ` Luciano A. Stertz
0 siblings, 1 reply; 2+ messages in thread
From: Luciano A. Stertz @ 2004-07-27 13:29 UTC (permalink / raw)
To: kernelnewbies; +Cc: linux-mm
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Read-ahead code
2004-07-27 13:29 Read-ahead code Luciano A. Stertz
@ 2004-07-27 13:38 ` Luciano A. Stertz
0 siblings, 0 replies; 2+ messages in thread
From: Luciano A. Stertz @ 2004-07-27 13:38 UTC (permalink / raw)
To: kernelnewbies, linux-mm; +Cc: Luciano A. Stertz
Oops, it's already fixed in 2.6.8-rc2, forget it.
Luciano
Luciano A. Stertz wrote:
> 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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-07-27 13:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-27 13:29 Read-ahead code Luciano A. Stertz
2004-07-27 13:38 ` Luciano A. Stertz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox