public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <wfg@mail.ustc.edu.cn>
To: Jin Steve <shjjiejin@hotmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Doc for your Adaptive ReadAhead patch
Date: Wed, 11 Apr 2007 14:15:40 +0800	[thread overview]
Message-ID: <376272342.15519@ustc.edu.cn> (raw)
Message-ID: <20070411061540.GA5890@mail.ustc.edu.cn> (raw)
In-Reply-To: <BAY128-F4C8C995FA1398AE0DF231B55F0@phx.gbl>

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;
> }

           reply	other threads:[~2007-04-11  6:20 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <BAY128-F4C8C995FA1398AE0DF231B55F0@phx.gbl>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=376272342.15519@ustc.edu.cn \
    --to=wfg@mail.ustc.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shjjiejin@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox