linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fengguang Wu <wfg@mail.ustc.edu.cn>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 4/6] readahead: context based method: remove readahead_ratio
Date: Sat, 06 Jan 2007 15:26:30 +0800	[thread overview]
Message-ID: <368068421.90598@ustc.edu.cn> (raw)
Message-ID: <20070106072729.877602418@mail.ustc.edu.cn> (raw)
In-Reply-To: 20070106072626.911640026@mail.ustc.edu.cn

[-- Attachment #1: readahead-context-based-method-remove-readahead_ratio.patch --]
[-- Type: text/plain, Size: 1104 bytes --]

The context based readahead is pretty conservative by nature,
so do not apply readahead_ratio here.

Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>

---
 mm/readahead.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- linux-2.6.20-rc3-mm1.orig/mm/readahead.c
+++ linux-2.6.20-rc3-mm1/mm/readahead.c
@@ -1236,9 +1236,7 @@ static unsigned long count_history_pages
 	 * Check the far pages coarsely.
 	 * The enlarged count will contribute to the look-ahead size.
 	 */
-	lookback = ra_max * (LOOKAHEAD_RATIO + 1) *
-						100 / (readahead_ratio | 1);
-
+	lookback = ra_max * LOOKAHEAD_RATIO;
 	for (count += ra_max; count < lookback; count += ra_max)
 		if (!__probe_page(mapping, offset - count))
 			break;
@@ -1384,7 +1382,8 @@ has_history_pages:
 		adjust_rala_aggressive(ra_max, &ra_size, &la_size);
 		ra_set_class(ra, RA_CLASS_CONTEXT_AGGRESSIVE);
 	} else {
-		ra_size = max(ra_min, ra_size * readahead_ratio / 100);
+		if (ra_size < ra_min)
+		    ra_size = ra_min;
 		if (!adjust_rala(ra_max, &ra_size, &la_size))
 			return -1;
 		ra_set_class(ra, RA_CLASS_CONTEXT);

--

  parent reply	other threads:[~2007-01-06  7:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070106072626.911640026@mail.ustc.edu.cn>
2007-01-06  7:26 ` [PATCH 0/6] adaptive readahead update Fengguang Wu
     [not found] ` <20070106072729.455570443@mail.ustc.edu.cn>
2007-01-06  7:26   ` [PATCH 1/6] readahead: sysctl parameters: set readahead_hit_rate=1 Fengguang Wu
     [not found] ` <20070106072729.598977589@mail.ustc.edu.cn>
2007-01-06  7:26   ` [PATCH 2/6] readahead: min/max sizes: remove get_readahead_bounds() Fengguang Wu
     [not found] ` <20070106072729.755581784@mail.ustc.edu.cn>
2007-01-06  7:26   ` [PATCH 3/6] readahead: context based method: update ra_min Fengguang Wu
     [not found] ` <20070106072729.877602418@mail.ustc.edu.cn>
2007-01-06  7:26   ` Fengguang Wu [this message]
     [not found] ` <20070106072730.019364791@mail.ustc.edu.cn>
2007-01-06  7:26   ` [PATCH 5/6] readahead: call scheme: remove get_readahead_bounds() Fengguang Wu
     [not found] ` <20070106072730.157093477@mail.ustc.edu.cn>
2007-01-06  7:26   ` [PATCH 6/6] readahead: nfsd case: remove ra_min Fengguang Wu

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=368068421.90598@ustc.edu.cn \
    --to=wfg@mail.ustc.edu.cn \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).