All of lore.kernel.org
 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 10/14] readahead: state based method: protect against tiny size
Date: Fri, 16 Mar 2007 16:49:06 +0800	[thread overview]
Message-ID: <374035060.29167@ustc.edu.cn> (raw)
Message-ID: <20070316085053.030235000@mail.ustc.edu.cn> (raw)
In-Reply-To: 20070316084856.687942000@mail.ustc.edu.cn

[-- Attachment #1: readahead-state-based-method-protect-against-tiny-size.patch --]
[-- Type: text/plain, Size: 1159 bytes --]

Move the tiny I/O size protection code from limit_rala() to
state_based_readahead().

limit_rala() is also called by context based readahead, which has its own
minimal readahead size.

Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
---
 mm/readahead.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- linux-2.6.21-rc3-mm2.orig/mm/readahead.c
+++ linux-2.6.21-rc3-mm2/mm/readahead.c
@@ -1031,13 +1031,6 @@ static void limit_rala(unsigned long ra_
 	unsigned long stream_shift;
 
 	/*
-	 * Protect against too small I/O sizes,
-	 * by mapping [0, 4*min] to [min, 4*min].
-	 */
-	if (*ra_size < 4 * MIN_RA_PAGES)
-		*ra_size = MIN_RA_PAGES + *ra_size * 3 / 4;
-
-	/*
 	 * Apply basic upper limits.
 	 */
 	if (*ra_size > ra_max)
@@ -1145,6 +1138,13 @@ state_based_readahead(struct address_spa
 	if (!adjust_rala(&ra_size, &la_size))
 		goto cancel_lookahead;
 
+	/*
+	 * Protect against too small I/O sizes,
+	 * by mapping [0, 4*min] to [min, 4*min].
+	 */
+	if (ra_size < 4 * MIN_RA_PAGES)
+		ra_size = MIN_RA_PAGES + ra_size * 3 / 4;
+
 	growth_limit = req_size;
 	growth_limit += ra_max / 16;
 	growth_limit += 2 * ra_old;

--

  parent reply	other threads:[~2007-03-16  8:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16  8:48 [PATCH 00/14] Adaptive readahead update Fengguang Wu
2007-03-16  8:48 ` Fengguang Wu
2007-03-16  8:48 ` [PATCH 01/14] readahead: state based method: check node id Fengguang Wu
2007-03-16  8:48   ` Fengguang Wu
2007-03-16  8:48 ` [PATCH 02/14] readahead: state based method: decouple readahead_ratio from growth_limit Fengguang Wu
2007-03-16  8:48   ` Fengguang Wu
2007-03-16  8:48 ` [PATCH 03/14] readahead: state based method: cancel lookahead gracefully Fengguang Wu
2007-03-16  8:48   ` Fengguang Wu
2007-03-16  8:49 ` [PATCH 04/14] readahead: thrashing recovery method: check unbalanced aging Fengguang Wu
2007-03-16  8:49   ` Fengguang Wu
2007-03-16  8:49 ` [PATCH 05/14] readahead: thrashing recovery method: refill holes Fengguang Wu
2007-03-16  8:49   ` Fengguang Wu
2007-03-16  8:49 ` [PATCH 06/14] readahead: call scheme: cleanup Fengguang Wu
2007-03-16  8:49   ` Fengguang Wu
2007-03-16  8:49 ` [PATCH 07/14] readahead: call scheme: catch thrashing on lookahead time Fengguang Wu
2007-03-16  8:49   ` Fengguang Wu
2007-03-16  8:49 ` [PATCH 08/14] readahead: remove parameter ra_max from thrashing_recovery_readahead() Fengguang Wu
2007-03-16  8:49   ` Fengguang Wu
2007-03-16  8:49 ` [PATCH 09/14] readahead: remove parameter ra_max from adjust_rala*() Fengguang Wu
2007-03-16  8:49   ` Fengguang Wu
2007-03-16  8:49 ` Fengguang Wu [this message]
2007-03-16  8:49   ` [PATCH 10/14] readahead: state based method: protect against tiny size Fengguang Wu
2007-03-16  8:49 ` [PATCH 11/14] readahead: rename state_based_readahead() to clock_based_readahead() Fengguang Wu
2007-03-16  8:49   ` Fengguang Wu
2007-03-16  8:49 ` [PATCH 12/14] readahead: account I/O block times for stock readahead Fengguang Wu
2007-03-16  8:49   ` Fengguang Wu
2007-03-16  8:49 ` [PATCH 13/14] readahead: rescue_pages() updates Fengguang Wu
2007-03-16  8:49   ` Fengguang Wu
2007-03-16  8:49 ` [PATCH 14/14] readahead: remove noaction/shrink events Fengguang Wu
2007-03-16  8:49   ` 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=374035060.29167@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.