Fwd: [patch / 2.1.10] Kswapd cosmetic bug

Erik Andersen (andersee@et.byu.edu)
Mon, 2 Dec 1996 00:32:02 -0700


I am wondering why this patch, dated 16 Nov, never made it into the kernel?
It fixes a real ugly cosmetic bug that has been bothering me for some
time now. This keeps the message from the initialization of kswapd from
mangling the partition check message for people using _MODULES_. People
not using modules do not have this problem. The following from my machine's
boot-up messages demonstrates the problem:

Partition check:
-----> hda:Started kswapd v 1.4.2.2
hda1 hda3 hda4 < hda5 >
hdc: hdc1 hdc2

Obviously the "Started kswapd v 1.4.2.2\n" message is getting mangled with
the hda partition check message. This _SHOULD_ read:

-----> Started kswapd v 1.4.2.2
Partition check:
-----> hda: hda1 hda3 hda4 < hda5 >
hdc: hdc1 hdc2

This problem exists in both the 2.0.x and 2.1.x kernels for module users!
The patch (and message) by Aaron Tiensivu which I am including here was
posted to linux-kernel several weeks ago, and due to recent changes, no
longer patches cleanly into kernel 2.1.14. The problem this patch was
designed to fix is very real, and has not been fixed yet. Is there a
reason that this patch was not included in the kernel several weeks ago?
If this patch is BAD in some way, could someone explain to me what is
wrong with it? This is not an area of the kernel I am familiar with.

-Erik

--
Erik B. Andersen        Web:    http://www.et.byu.edu/~andersee/ 
2485 South State St.    email:  andersee@et.byu.edu or andersee@debian.org
Springville, Ut 84663   phone:  (801) 489-1231
--This message was written using 73% post-consumer electrons--

-----Forwarded message from tiensivu@pilot.msu.edu (Aaron Tiensivu)-----

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?

-----End of forwarded message-----