[patch / 2.1.10] Kswapd cosmetic bug

Aaron Tiensivu (tiensivu@pilot.msu.edu)
Sat, 16 Nov 1996 20:08:13 -0500 (EST)


I have some time to kill and am going after little nitpicky things that have
been bothering me for a while.

Here's one of them:

Before:

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
Partition check:
hda:Started kswapd v 1.4.2.2
hda1 hda2 hda3

After:

Starting kswapd v 1.4.2.2
Real Time Clock Driver v1.07
hda: IBM-DJAA-31700, ATA DISK drive
hdd: FX001DE, ATAPI CDROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
eth0: SMC Ultra at 0x260, 00 00 C0 47 76 82, assigned IRQ 10 memory
0xe8000-0xebfff.
eth1: WD80x3 at 0x280, 00 00 C0 2E A1 27 WD8003, IRQ 7, shared memory at
0xee000-0xeffff.
Partition check:
hda: hda1 hda2 hda3

----

Notice that the 'Started kswapd v 1.4.2.2' doesn't invade the 'Partition
check:' text section.

It usually only happens when a lot of modules are used.

Easy to fix, I hope it makes it into the kernel.
This patch is against 2.1.10, but should work on any recent version.

--- linux/mm/vmscan.c.virgin Sat Nov 16 19:41:20 1996
+++ linux/mm/vmscan.c Sat Nov 16 19:44:59 1996
@@ -369,6 +369,19 @@
}

+void kswapd_init(void)
+{
+ int i;
+ char *revision="$Revision: 1.4.2.2 $", *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.
@@ -376,7 +389,6 @@
int kswapd(void *unused)
{
int i;
- char *revision="$Revision: 1.4.2.2 $", *s, *e;

current->session = 1;
current->pgrp = 1;
@@ -402,13 +414,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;
--- linux/init/main.c.virgin Sat Nov 16 19:37:08 1996
+++ linux/init/main.c Sat Nov 16 19:46:04 1996
@@ -59,6 +59,7 @@
static int init(void *);
extern int bdflush(void *);
extern int kswapd(void *);
+extern void kswapd_init(void);

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

#ifdef CONFIG_BLK_DEV_INITRD

---
Which is worse: ignorance or apathy?  Who knows?  Who cares?