public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@ximian.com>
To: marcelo.tosatti@cyclades.com
Cc: linux-kernel@vger.kernel.org
Subject: [patch] 2.4's sys_readahead is borked
Date: Tue, 03 Feb 2004 19:19:22 -0500	[thread overview]
Message-ID: <1075853962.8022.3.camel@localhost> (raw)

In 2.4, sys_readahead() performs readahead against a maximum of half the
number of inactive pages.  This is dumb, as it ignores the number of
free pages completely.  Worse, in certain situations, such as boot, the
inactive list can be quite small and the free list quite large, but
readahead(2) won't do anything.

The right thing to do is limit sys_readahead() to a maximum of half of
the sum of the number of free pages and inactive pages, which is what
2.6 does.

Attached patch is against 2.4.25-pre8.  Please apply.

	Robert Love

 mm/filemap.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -urN linux-2.4.25-pre8/mm/filemap.c.orig linux-2.4.25-pre8/mm/filemap.c
--- linux-2.4.25-pre8/mm/filemap.c.orig	2004-02-03 19:13:33.540115456 -0500
+++ linux-2.4.25-pre8/mm/filemap.c	2004-02-03 19:13:49.468693944 -0500
@@ -1965,7 +1965,7 @@
 		nr = max;
 
 	/* And limit it to a sane percentage of the inactive list.. */
-	max = nr_inactive_pages / 2;
+	max = (nr_free_pages() + nr_inactive_pages) / 2;
 	if (nr > max)
 		nr = max;
 


             reply	other threads:[~2004-02-04  0:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-04  0:19 Robert Love [this message]
2004-02-04 14:30 ` [patch] 2.4's sys_readahead is borked Marcelo Tosatti
2004-02-04 15:20   ` Robert Love
2004-02-04 18:42     ` Mike Fedyk
2004-02-04 18:47       ` Robert Love
2004-02-07  9:14   ` Arjan van de Ven

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=1075853962.8022.3.camel@localhost \
    --to=rml@ximian.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.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