public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: Steven Pratt <slpratt@austin.ibm.com>
Cc: linux-kernel@vger.kernel.org, Ram Pai <linuxram@us.ibm.com>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 3/4] readahead: factor out duplicated code
Date: Thu, 03 Feb 2005 14:32:34 +0300	[thread overview]
Message-ID: <42020BD2.D2FF82B7@tv-sign.ru> (raw)
In-Reply-To: 42014825.1040400@austin.ibm.com

Steven Pratt wrote:
>
> >+static int make_ahead_window(struct address_space *mapping, struct file *filp,
> >+		struct file_ra_state *ra, int force)
> >+{
> >+	int block, ret;
> >+
> >+	block = force || (ra->prev_page >= ra->ahead_start);
> >+	ret = blockable_page_cache_readahead(mapping, filp,
> >+			ra->ahead_start, ra->ahead_size, ra, block);
> >+
> >+	if (!ret && !force) {
> >
> This really needs to be
>
>     if (!ret && !block) {
>

Current code:

	block = offset + newsize-1 >= ra->ahead_start;
	if (!blockable_page_cache_readahead(..., block) {
		ra->ahead_start = 0;
		ra->ahead_size = 0;
	}

Patched code:
	make_ahead_window(..., 0); // force == 0

So i think the patch is correct.

> otherwise we can have an aheadwindow which was never populated which
> will cause slow reads which we want to avoid in all cases.

may be, but this patch tries not to change the current behavior.

Oleg.

      reply	other threads:[~2005-02-03 10:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-29 11:11 [PATCH 3/4] readahead: factor out duplicated code Oleg Nesterov
2005-01-29 11:35 ` Oleg Nesterov
2005-02-03  2:43   ` Ram
2005-02-03 11:34     ` Oleg Nesterov
2005-02-02 21:37 ` Steven Pratt
2005-02-03 11:32   ` Oleg Nesterov [this message]

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=42020BD2.D2FF82B7@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=slpratt@austin.ibm.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