lkml.org 
[lkml]   [1997]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectkswapd initialization bug fix for 2.1.46
I just updated my kswapd initialization patch so that this new version 
patches cleanly against 2.1.46. This fixes the problem in the latest
and greatest. I would really it if this goes into 2.1.47, since
this has been bugging me for a while. This modifies the initialization
of kswapd so that it prints out its init message before the kswapd kernel
thread is spawned. This ensures that the kswapd initialization message will
never be printed in the middle of another driver's init message.

Before:

Partition check:
hda:Started kswapd v 1.23
hda1 hda2 hda3
hdc: hdc1 hdc2 < hdc5 hdc6 >
VFS: Mounted root (ext2 filesystem) readonly.


After:

Starting kswapd v 1.23
[--------Several driver init messages snipped--------]
Partition check:
hda: hda1 hda2 hda3
hdc: hdc1 hdc2 < hdc5 hdc6 >
VFS: Mounted root (ext2 filesystem) readonly.
-Erik

--
Erik B. Andersen Web: http://www.inconnect.com/~andersen/
email: andersee@debian.org
--This message was written using 73% post-consumer electrons--


************************************************************
21-kswapd-init-fix.patch follows:
************************************************************
--- linux-2.1.46.virgin/init/main.c Tue Jul 22 21:40:52 1997
+++ linux/init/main.c Tue Jul 22 22:31:25 1997
@@ -62,6 +62,7 @@
static int init(void *);
extern int bdflush(void *);
extern int kswapd(void *);
+extern void kswapd_setup(void);

extern void init_IRQ(void);
extern void init_modules(void);
@@ -966,6 +967,7 @@
/* Launch bdflush from here, instead of the old syscall way. */
kernel_thread(bdflush, NULL, 0);
/* Start the background pageout daemon. */
+ kswapd_setup();
kernel_thread(kswapd, NULL, 0);

#if CONFIG_AP1000
--- linux-2.1.46.virgin/mm/vmscan.c Tue Jul 22 21:40:52 1997
+++ linux/mm/vmscan.c Tue Jul 22 22:31:54 1997
@@ -406,14 +406,30 @@
}

/*
+ * Before we start the kernel thread, print out the
+ * kswapd initialization message (otherwise the init message
+ * may be printed in the middle of another driver's init
+ * message). It looks very bad when that happens.
+ */
+void kswapd_setup(void)
+{
+ int i;
+ char *revision="$Revision: 1.23 $", *s, *e;
+
+ if ((s = strchr(revision, ':')) &&
+ (e = strchr(s, '$')))
+ s++, i = e - s;
+ else
+ s = revision, i = -1;
+ printk ("Starting kswapd v%.*s\n", i, s);
+}
+
+/*
* The background pageout daemon.
* Started as a kernel thread from the init process.
*/
int kswapd(void *unused)
{
- int i;
- char *revision="$Revision: 1.23 $", *s, *e;
-
current->session = 1;
current->pgrp = 1;
sprintf(current->comm, "kswapd");
@@ -434,13 +450,6 @@

init_swap_timer();

- if ((s = strchr(revision, ':')) &&
- (e = strchr(s, '$')))
- s++, i = e - s;
- else
- s = revision, i = -1;
- printk ("Started kswapd v%.*s\n", i, s);
-
while (1) {
kswapd_awake = 0;
current->signal = 0;
@@ -496,7 +505,6 @@
}
timer_active |= (1<<SWAP_TIMER);
}
-

/*
* Initialise the swap timer
\
 
 \ /
  Last update: 2005-03-22 13:39    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site