public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@bonn-fries.net>
To: "Mike Black" <mblack@csihq.com>, <tridge@valinux.com>,
	<marcelo@conectiva.com.br>
Cc: <linux-kernel@vger.kernel.org>, <riel@conectiva.com.br>,
	"Andrew Morton" <andrewm@uow.edu.au>
Subject: Re: 2.4.8preX VM problems
Date: Wed, 1 Aug 2001 20:39:22 +0200	[thread overview]
Message-ID: <01080120392200.00933@starship> (raw)
In-Reply-To: <Pine.LNX.4.21.0108010504160.9379-100000@freak.distro.conectiva> <20010801105419.8F078424A@lists.samba.org> <020001c11a80$43297110$e1de11cc@csihq.com>
In-Reply-To: <020001c11a80$43297110$e1de11cc@csihq.com>

On Wednesday 01 August 2001 13:51, Mike Black wrote:
> I have come to the opinion that kswapd needs to be a little smarter
> -- if it doesn't find anything to swap shouldn't it go to sleep a
> little longer before trying again?  That way it could gracefully
> degrade itself when it's not making any progress.
>
> In my testing (on a dual 1Ghz/2G machine) the machine "locks up" for
> long periods of time while kswapd runs around trying to do it's
> thing. If I could disable kswapd I would just to test this.

Your wish is my command.  This patch provides a crude-but-effective 
method of disabling kswapd, using:

  echo 1 >/proc/sys/kernel/disable_kswapd

I tested this with dbench and found it runs about half as fast, but 
runs.  This is reassuring because kswapd is supposed to be doing 
something useful.

To apply:

  cd /usr/src/your.2.4.7.tree
  patch -p0 <this.patch

--- ../2.4.7.clean/include/linux/swap.h	Fri Jul 20 21:52:18 2001
+++ ./include/linux/swap.h	Wed Aug  1 19:35:27 2001
@@ -78,6 +78,7 @@
 	int next;			/* next entry on swap list */
 };
 
+extern int disable_kswapd;
 extern int nr_swap_pages;
 extern unsigned int nr_free_pages(void);
 extern unsigned int nr_inactive_clean_pages(void);
--- ../2.4.7.clean/include/linux/sysctl.h	Fri Jul 20 21:52:18 2001
+++ ./include/linux/sysctl.h	Wed Aug  1 19:35:28 2001
@@ -118,7 +118,8 @@
 	KERN_SHMPATH=48,	/* string: path to shm fs */
 	KERN_HOTPLUG=49,	/* string: path to hotplug policy agent */
 	KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee 
instructions */
-	KERN_S390_USER_DEBUG_LOGGING=51  /* int: dumps of user faults */
+	KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */
+	KERN_DISABLE_KSWAPD=52,	/* int: disable kswapd for testing */
 };
 
 
--- ../2.4.7.clean/kernel/sysctl.c	Thu Apr 12 21:20:31 2001
+++ ./kernel/sysctl.c	Wed Aug  1 19:35:28 2001
@@ -249,6 +249,8 @@
 	{KERN_S390_USER_DEBUG_LOGGING,"userprocess_debug",
 	 &sysctl_userprocess_debug,sizeof(int),0644,NULL,&proc_dointvec},
 #endif
+	{KERN_DISABLE_KSWAPD, "disable_kswapd", &disable_kswapd, sizeof (int),
+	 0644, NULL, &proc_dointvec},
 	{0}
 };
 
--- ../2.4.7.clean/mm/vmscan.c	Mon Jul  9 19:18:50 2001
+++ ./mm/vmscan.c	Wed Aug  1 19:35:28 2001
@@ -875,6 +875,8 @@
 DECLARE_WAIT_QUEUE_HEAD(kswapd_wait);
 DECLARE_WAIT_QUEUE_HEAD(kswapd_done);
 
+int disable_kswapd /* = 0 */;
+
 /*
  * The background pageout daemon, started as a kernel thread
  * from the init process. 
@@ -915,6 +917,9 @@
 	 */
 	for (;;) {
 		static long recalc = 0;
+
+		while (disable_kswapd)
+			interruptible_sleep_on_timeout(&kswapd_wait, HZ/10);
 
 		/* If needed, try to free some memory. */
 		if (inactive_shortage() || free_shortage()) 



  reply	other threads:[~2001-08-01 18:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-01  3:05 2.4.8preX VM problems Andrew Tridgell
2001-08-01  2:26 ` Marcelo Tosatti
2001-08-01  4:37   ` Andrew Tridgell
2001-08-01  3:32     ` Marcelo Tosatti
2001-08-01  5:43       ` Andrew Tridgell
2001-08-01  6:09   ` Andrew Tridgell
2001-08-01  6:10     ` Marcelo Tosatti
2001-08-01  8:13       ` Andrew Tridgell
2001-08-01  8:13         ` Marcelo Tosatti
2001-08-01 10:54           ` Andrew Tridgell
2001-08-01 11:51             ` Mike Black
2001-08-01 18:39               ` Daniel Phillips [this message]
2001-08-11 12:06                 ` Pavel Machek
2001-08-16 21:57                   ` Daniel Phillips
2001-08-04  6:50           ` Anton Blanchard
2001-08-04  5:55             ` Marcelo Tosatti
2001-08-04 17:17               ` Anton Blanchard
2001-08-06 22:58                 ` Marcelo Tosatti
2001-08-07 17:18                   ` Anton Blanchard
2001-08-07 21:02                     ` Kernel 2.4.6 & 2.4.7 networking performance: seeing serious delays in TCP layer depending upon packet length Ron Flory

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=01080120392200.00933@starship \
    --to=phillips@bonn-fries.net \
    --cc=andrewm@uow.edu.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=mblack@csihq.com \
    --cc=riel@conectiva.com.br \
    --cc=tridge@valinux.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