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>,
	"Rik van Riel" <riel@conectiva.com.br>,
	"David Ford" <david@blue-labs.org>
Cc: "Jeffrey W. Baker" <jwbaker@acm.org>,
	"Richard B. Johnson" <root@chaos.analogic.com>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH] Disable kswapd through proc (was Ongoing 2.4 VM suckage)
Date: Sat, 4 Aug 2001 01:58:57 +0200	[thread overview]
Message-ID: <0108040158570K.01827@starship> (raw)
In-Reply-To: <Pine.LNX.4.33L.0108031751590.11893-100000@imladris.rielhome.conectiva> <007801c11c67$87d55980$b6562341@cfl.rr.com>
In-Reply-To: <007801c11c67$87d55980$b6562341@cfl.rr.com>

On Friday 03 August 2001 23:59, Mike Black wrote:
> I floated this idea a while ago but didn't receive any comments (or
> flames)...
> Couldn't kswapd just gracefully back-off when it doesn't make any progress?
>
> In my case (with ext3/raid5 and a tiobench test) kswapd NEVER actually
> swaps anything out.
> It just chews CPU time.
> So...if kswapd just said "didn't make any progress...*2 last sleep" so it
> would degrade itself.
> Doesn't sound like a major rewrite to me.

See attached patch, it lets you disable kswapd yourself through proc:

  echo 1 >/proc/sys/kernel/disable_kswapd

You can find out for yourself if it actually helps.

--- ../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()) 

  parent reply	other threads:[~2001-08-04  1:01 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-02 18:29 Ongoing 2.4 VM suckage Jeffrey W. Baker
2001-08-02 18:52 ` Richard B. Johnson
2001-08-02 19:10   ` Jeffrey W. Baker
2001-08-02 19:54     ` Richard B. Johnson
2001-08-02 20:10       ` Jeffrey W. Baker
2001-08-02 20:16         ` Rik van Riel
2001-08-02 20:28           ` Rik van Riel
2001-08-03 17:59             ` David Ford
2001-08-03 20:53               ` Rik van Riel
2001-08-03 21:59                 ` Mike Black
2001-08-03 22:08                   ` Rik van Riel
2001-08-04  1:06                     ` Daniel Phillips
2001-08-03 23:58                   ` Daniel Phillips [this message]
2001-08-04  7:21                   ` Stephen Satchell
2001-08-06  8:55                     ` Helge Hafting
2001-08-06 16:37                     ` Jeremy Linton
2001-08-07  7:51                       ` David Weinehall
2001-08-03 22:47                 ` David Ford
2001-08-02 21:01         ` Richard B. Johnson
2001-08-02 21:11           ` Jeffrey W. Baker
2001-08-02 21:44             ` Jakob Østergaard
2001-08-02 21:52               ` Jeffrey W. Baker
2001-08-02 21:56                 ` Miles Lane
2001-08-02 22:05                   ` Jeffrey W. Baker
2001-08-02 22:07                 ` Rik van Riel
2001-08-02 22:17                   ` Jeffrey W. Baker
2001-08-02 22:27                     ` Rik van Riel
2001-08-02 22:32                       ` Jeffrey W. Baker
2001-08-02 22:56                       ` BERECZ Szabolcs
2001-08-03 13:07                       ` jlnance
2001-08-03 13:31                         ` Richard B. Johnson
2001-08-06 13:22                         ` Luigi Genoni
2001-08-06 13:29                           ` David S. Miller
2001-08-02 23:46                     ` Ongoing 2.4 VM suckage pagemap_lru_lock Jeremy Linton
2001-08-02 22:15                 ` Ongoing 2.4 VM suckage Pavel Zaitsev
2001-08-02 22:20                 ` Jakob Østergaard
2001-08-03 12:04 ` Anders Peter Fugmann
2001-08-03 16:03   ` Rik van Riel
2001-08-03 16:24     ` Anders Peter Fugmann
2001-08-03 21:24       ` Rik van Riel
2001-08-03 22:00         ` Anders Peter Fugmann

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=0108040158570K.01827@starship \
    --to=phillips@bonn-fries.net \
    --cc=david@blue-labs.org \
    --cc=jwbaker@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mblack@csihq.com \
    --cc=riel@conectiva.com.br \
    --cc=root@chaos.analogic.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