public inbox for linux-kernel@vger.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 09/14] readahead: remove parameter ra_max from adjust_rala*()
Date: Fri, 16 Mar 2007 16:49:05 +0800	[thread overview]
Message-ID: <374035059.61077@ustc.edu.cn> (raw)
Message-ID: <20070316085052.868849000@mail.ustc.edu.cn> (raw)
In-Reply-To: 20070316084856.687942000@mail.ustc.edu.cn

[-- Attachment #1: readahead-remove-parameter-ra_max-from-adjust_rala.patch --]
[-- Type: text/plain, Size: 2120 bytes --]

Remove the unused parameter @ra_max from adjust_rala() and
adjust_rala_aggressive().

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

--- linux-2.6.21-rc3-mm2.orig/mm/readahead.c
+++ linux-2.6.21-rc3-mm2/mm/readahead.c
@@ -1000,8 +1000,7 @@ static unsigned long ra_submit(struct fi
  *	- @ra_size stores the estimated thrashing-threshold.
  *	- @la_size stores the look-ahead size of previous request.
  */
-static int adjust_rala(unsigned long ra_max,
-			unsigned long *ra_size, unsigned long *la_size)
+static int adjust_rala(unsigned long *ra_size, unsigned long *la_size)
 {
 	/*
 	 * Cancel asynchrous read-ahead,
@@ -1143,15 +1142,15 @@ state_based_readahead(struct address_spa
 		goto cancel_lookahead;
 	}
 
+	if (!adjust_rala(&ra_size, &la_size))
+		goto cancel_lookahead;
+
 	growth_limit = req_size;
 	growth_limit += ra_max / 16;
 	growth_limit += 2 * ra_old;
 	if (growth_limit > ra_max)
 	    growth_limit = ra_max;
 
-	if (!adjust_rala(growth_limit, &ra_size, &la_size))
-		goto cancel_lookahead;
-
 	limit_rala(growth_limit, la_old, &ra_size, &la_size);
 
 	/* ra_size in its _steady_ state reflects thrashing threshold */
@@ -1345,8 +1344,8 @@ out_unlock:
  * which is safe: the tailing look-ahead part is 'unsafe'. However it will be
  * safeguarded by rescue_pages() when the previous chunks are lost.
  */
-static void adjust_rala_aggressive(unsigned long ra_max,
-				unsigned long *ra_size, unsigned long *la_size)
+static void adjust_rala_aggressive(unsigned long *ra_size,
+				   unsigned long *la_size)
 {
 	pgoff_t offset = *ra_size;
 
@@ -1463,12 +1462,12 @@ has_history_pages:
 
 	if (ra_size >= offset) {
 		ra_size = offset;
-		adjust_rala_aggressive(ra_max, &ra_size, &la_size);
+		adjust_rala_aggressive(&ra_size, &la_size);
 		ra_set_class(ra, RA_CLASS_CONTEXT_AGGRESSIVE);
 	} else {
 		if (ra_size < ra_min)
 		    ra_size = ra_min;
-		if (!adjust_rala(ra_max, &ra_size, &la_size))
+		if (!adjust_rala(&ra_size, &la_size))
 			return -1;
 		ra_set_class(ra, RA_CLASS_CONTEXT);
 	}

--

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

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070316084856.687942000@mail.ustc.edu.cn>
2007-03-16  8:48 ` [PATCH 00/14] Adaptive readahead update Fengguang Wu
     [not found] ` <20070316085051.601015000@mail.ustc.edu.cn>
2007-03-16  8:48   ` [PATCH 01/14] readahead: state based method: check node id Fengguang Wu
     [not found] ` <20070316085051.787637000@mail.ustc.edu.cn>
2007-03-16  8:48   ` [PATCH 02/14] readahead: state based method: decouple readahead_ratio from growth_limit Fengguang Wu
     [not found] ` <20070316085051.939153000@mail.ustc.edu.cn>
2007-03-16  8:48   ` [PATCH 03/14] readahead: state based method: cancel lookahead gracefully Fengguang Wu
     [not found] ` <20070316085052.111038000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 04/14] readahead: thrashing recovery method: check unbalanced aging Fengguang Wu
     [not found] ` <20070316085052.284256000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 05/14] readahead: thrashing recovery method: refill holes Fengguang Wu
     [not found] ` <20070316085052.388486000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 06/14] readahead: call scheme: cleanup Fengguang Wu
     [not found] ` <20070316085052.550263000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 07/14] readahead: call scheme: catch thrashing on lookahead time Fengguang Wu
     [not found] ` <20070316085052.688674000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 08/14] readahead: remove parameter ra_max from thrashing_recovery_readahead() Fengguang Wu
     [not found] ` <20070316085052.868849000@mail.ustc.edu.cn>
2007-03-16  8:49   ` Fengguang Wu [this message]
     [not found] ` <20070316085053.030235000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 10/14] readahead: state based method: protect against tiny size Fengguang Wu
     [not found] ` <20070316085053.155226000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 11/14] readahead: rename state_based_readahead() to clock_based_readahead() Fengguang Wu
     [not found] ` <20070316085053.339604000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 12/14] readahead: account I/O block times for stock readahead Fengguang Wu
     [not found] ` <20070316085053.463858000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 13/14] readahead: rescue_pages() updates Fengguang Wu
     [not found] ` <20070316085053.642868000@mail.ustc.edu.cn>
2007-03-16  8:49   ` [PATCH 14/14] readahead: remove noaction/shrink events 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=374035059.61077@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