sys_readahead.

Amar Lior (lior@cs.huji.ac.il)
Wed, 16 Jan 2002 09:42:23 +0200 (IST)


Hi all,

I tried to use the new syscall readahead and i found out the
following in do_readahead (mm/filemap.c)
--------------------------------------------------
.....
/* And limit it to a sane percentage of the inactive list..*/
max = nr_inactive_pages/ 2;
if (nr > max)
nr = max;

while (nr) {
page_cache_read(file, index);
index++;
nr--;
}
....
---------------------------

My question is why use only nr_inactive_pages/2. I checked this
value on unloaded machine and it was very very small (~100) pages.
While the nr_free_pages() value was much larger.
Why not take into consideration also the value of nr_free_pages()
and do something like

max = (nr_inactive_pages + nr_free_pages())/ 2;

So if i have free pages i would be able to perform large readaheads

10x

--lior

________________________________________________________________
Lior Amar Distributed Computing Lab MOSIX
E-mail : lior@cs.huji.ac.il
________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/