linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Thinko in kswapd?
@ 2001-03-22 14:58 Stephen C. Tweedie
  2001-03-22 17:36 ` Linus Torvalds
  2001-03-22 17:53 ` Mike Galbraith
  0 siblings, 2 replies; 6+ messages in thread
From: Stephen C. Tweedie @ 2001-03-22 14:58 UTC (permalink / raw)
  To: linux-mm, linux-kernel; +Cc: Alan Cox, Stephen Tweedie, arjanv, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 851 bytes --]

Hi,

There is what appears to be a simple thinko in kswapd.  We really
ought to keep kswapd running as long as there is either a free space
or an inactive page shortfall; but right now we only keep going if
_both_ are short.

Diff below.  With this change, I've got a 64MB box running Applix and
Star Office with multiple open documents plus a few other big apps
running, and switching desktops or going between documents is once
more nice and snappy.  Running a normal heavily populated desktop in
256MB used to be painful, with much apparently unnecessary swapping,
if we had background page-cache intensive operations (eg find|wc)
going on: the patched kernel feels much better interactively,
presumably because kswapd is now doing the work it is supposed to do,
instead of forcing normal apps to go into page stealing mode
themselves.

--Stephen


[-- Attachment #2: 2.4.2-ac20.kswap.diff --]
[-- Type: text/plain, Size: 426 bytes --]

--- mm/vmscan.c.~1~	Fri Mar 16 15:39:24 2001
+++ mm/vmscan.c	Thu Mar 22 13:05:37 2001
@@ -1010,7 +1010,7 @@
 		 * We go to sleep for one second, but if it's needed
 		 * we'll be woken up earlier...
 		 */
-		if (!free_shortage() || !inactive_shortage()) {
+		if (!free_shortage() && !inactive_shortage()) {
 			interruptible_sleep_on_timeout(&kswapd_wait, HZ);
 		/*
 		 * If we couldn't free enough memory, we see if it was

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-03-22 18:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-22 14:58 Thinko in kswapd? Stephen C. Tweedie
2001-03-22 17:36 ` Linus Torvalds
2001-03-22 18:18   ` Stephen C. Tweedie
2001-03-22 17:53 ` Mike Galbraith
2001-03-22 18:09   ` Alan Cox
2001-03-22 18:22     ` Mike Galbraith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox