Re: [PATCH 00/19] Adaptive read-ahead V8

From: Wu Fengguang
Date: Sat Nov 26 2005 - 09:01:09 EST


On Sat, Nov 26, 2005 at 02:25:24PM +0100, Tomasz Torcz wrote:
> > It's interesting ;)
> > In fact some distributions do have a read-ahead script to preload files on
> > startup. The readahead system call should be enough for this purpose:
> >
> > NAME
> > readahead - perform file readahead into page cache
>
> posix_fadvise() with POSIX_FADV_WILLNEED hint?
> The specified data will be accessed in the near future.

Nod, this one is better.
They do roughly the same thing, while the latter interface is more portable.

Another note: if you do not know precisely which files to readahead, turn on
aggressive readahead feature temporary might help. There are mainly three
parameters that controls the aggressiveness, the following example values should
be large enough:

echo 16 > /proc/sys/vm/readahead_hit_rate # overlook hit rate?
echo 1000 > /proc/sys/vm/readahead_ratio # grow up ra-size quickly?
blockdev --setra 8192 /dev/had # large ra-size limit?

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