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/