Re: Doc for your Adaptive ReadAhead patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 11, 2007 at 04:44:34AM +0000, Jin Steve wrote:
> Just like the function check_ra_success: (Does it mean: last time 
> RA>VM_MAX_CACHE_HIT, so next time no need readahead?)

The cache hit logic is to prevent doing pointless readahead for
an already cached file: the pages are already there.

VM_MAX_CACHE_HIT is the threshold to disable readahead in this case.

> static inline int check_ra_success(struct file_ra_state *ra,
> 			unsigned long nr_to_read, unsigned long actual)
> {
> 	if (actual == 0) {
> 		ra->cache_hit += nr_to_read;
> 		if (ra->cache_hit >= VM_MAX_CACHE_HIT) {
> 			ra_off(ra);
> 			ra->flags |= RA_FLAG_INCACHE;
> 			return 0;
> 		}
> 	} else {
> 		ra->cache_hit=0;
> 	}
> 	return 1;
> }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux