From: Rik van Riel <riel@conectiva.com.br>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: [PATCH] 2.4.0-ac8/9 page_launder() fix
Date: Sat, 10 Feb 2001 20:53:59 -0200 (BRDT) [thread overview]
Message-ID: <Pine.LNX.4.21.0102102051450.2378-100000@duckman.distro.conectiva> (raw)
Hi,
the patch below should make page_launder() more well-behaved
than it is in -ac8 and -ac9 ... note, however, that this thing
is still completely untested and only in theory makes page_launder
behave better ;)
Since there seems to be a lot of VM testing going on at the
moment I thought I might as well send it out now so I can get
some feedback before I get into the airplane towards sweden
tomorrow...
cheers,
Rik
--
Linux MM bugzilla: http://linux-mm.org/bugzilla.shtml
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...
http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com/
--- linux-2.4.1-ac8/mm/vmscan.c.orig Fri Feb 9 15:04:16 2001
+++ linux-2.4.1-ac8/mm/vmscan.c Sat Feb 10 20:50:40 2001
@@ -413,7 +413,7 @@
* This code is heavily inspired by the FreeBSD source code. Thanks
* go out to Matthew Dillon.
*
- * XXX: restrict number of pageouts in flight...
+ * XXX: restrict number of pageouts in flight by ->writepage...
*/
#define MAX_LAUNDER (1 << page_cluster)
int page_launder(int gfp_mask, int user)
@@ -514,7 +514,10 @@
spin_unlock(&pagemap_lru_lock);
writepage(page);
- flushed_pages++;
+ /* XXX: all ->writepage()s should use nr_async_pages */
+ if (!PageSwapCache(page))
+ flushed_pages++;
+ maxlaunder--;
page_cache_release(page);
/* And re-start the thing.. */
@@ -636,14 +639,16 @@
* with the paging load in the system and doesn't have
* the IO storm problem, so it just flushes all pages
* needed to fix the free shortage.
- *
- * XXX: keep track of nr_async_pages like the old swap
- * code did?
*/
- if (user)
+ maxlaunder = shortage;
+ maxlaunder -= flushed_pages;
+ maxlaunder -= atomic_read(&nr_async_pages);
+
+ if (maxlaunder <= 0)
+ goto out;
+
+ if (user && maxlaunder > MAX_LAUNDER)
maxlaunder = MAX_LAUNDER;
- else
- maxlaunder = shortage;
/*
* If we are called by a user program, we need to free
@@ -667,6 +672,7 @@
/*
* Return the amount of pages we freed or made freeable.
*/
+out:
return freed_pages + flushed_pages;
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
next reply other threads:[~2001-02-10 22:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-10 22:53 Rik van Riel [this message]
2001-02-10 22:33 ` Marcelo Tosatti
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=Pine.LNX.4.21.0102102051450.2378-100000@duckman.distro.conectiva \
--to=riel@conectiva.com.br \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=marcelo@conectiva.com.br \
/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