lkml.org 
[lkml]   [1998]   [Mar]   [11]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateWed, 11 Mar 1998 10:28:47 +0100 (MET)
FromMatthias Hanisch <>
SubjectPATCH: move more functions and data into init memory (2.1.89)
The following patch against 2.1.89 is the result of a walk through the
initialization code dependent on my configuration. It moves about 3500
bytes of code, data and strings into the the init segments (that will be
freed after initialization is done) and so saves 1 page of unswappable
memory in most cases. 

It has worked for me for two days with 2.1.89 (also formerly with 2.1.88) 
and if I get some success reports I'm going to send it to Linus.

I am not so sure about the best method getting init strings into the
initdata segment. I haven't found a clean method like

	"foobar" __initdata

to bring strings directly into .init.data.  Maybe we should consider a new
section .rodata.init or something similar for this.  Also there are some
string arrays like the kernel command line parameters in init/main.c (or
the SCSI blacklist) that I don't know how to move them into .data.init in
a clean way. Suggestions are welcome! 

Let me repeat that the transition to init segments is only done as far as
my configuration is concerned (and this isn't even complete).  Surely
there are a lot of code and data fragments that are only used at
initialization time and should be declared for the init sections.

I am going to volunteer and collect these patches for inclusion into the
kernel.

Have fun,
	Matze

--
Matthias Hanisch    gesch.: matze@camline.com    priv.: matze@pingu.franken.de
                            +49 8137 935-219            +49 8441 82387

"Modell 10 - Software from Experts for Experts"
diff -ru --new-file linux-2.1.89-vanilla/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- linux-2.1.89-vanilla/arch/i386/kernel/setup.c	Tue Mar  3 15:01:07 1998
+++ linux/arch/i386/kernel/setup.c	Tue Mar  3 12:24:19 1998
@@ -107,7 +107,7 @@
 #define RAMDISK_PROMPT_FLAG		0x8000
 #define RAMDISK_LOAD_FLAG		0x4000	
 
-static char command_line[COMMAND_LINE_SIZE] = { 0, };
+static char command_line[COMMAND_LINE_SIZE] __initdata = { 0, };
        char saved_command_line[COMMAND_LINE_SIZE];
 
 __initfunc(void setup_arch(char **cmdline_p,
diff -ru --new-file linux-2.1.89-vanilla/arch/i386/kernel/time.c linux/arch/i386/kernel/time.c
--- linux-2.1.89-vanilla/arch/i386/kernel/time.c	Thu Jan 29 01:01:13 1998
+++ linux/arch/i386/kernel/time.c	Tue Mar  3 12:24:19 1998
@@ -477,7 +477,12 @@
 }
 
 /* not static: needed by APM */
+/* but if APM is not defined this is just called once at init! */
+#ifdef CONFIG_APM
 unsigned long get_cmos_time(void)
+#else
+__initfunc(unsigned long get_cmos_time(void))
+#endif
 {
 	unsigned int year, mon, day, hour, min, sec;
 	int i;
diff -ru --new-file linux-2.1.89-vanilla/arch/i386/mm/init.c linux/arch/i386/mm/init.c
--- linux-2.1.89-vanilla/arch/i386/mm/init.c	Thu Jan 22 06:28:55 1998
+++ linux/arch/i386/mm/init.c	Tue Mar  3 13:41:49 1998
@@ -265,12 +265,19 @@
  * before and after the test are here to work-around some nasty CPU bugs.
  */
 
+static char wpmsg[] __initdata =
+	"Checking if this processor honours the WP bit even in supervisor mode... ";
+#ifndef CONFIG_M386
+static char brokenwpmsg[] __initdata = 
+	"This kernel doesn't support CPU's with broken WP. Recompile it for a 386!";
+#endif
+
 __initfunc(void test_wp_bit(void))
 {
 	unsigned char tmp_reg;
 	unsigned long old = pg0[0];
 
-	printk("Checking if this processor honours the WP bit even in supervisor mode... ");
+	printk(wpmsg);
 	pg0[0] = pte_val(mk_pte(PAGE_OFFSET, PAGE_READONLY));
 	local_flush_tlb();
 	current->mm->mmap->vm_start += PAGE_SIZE;
@@ -290,12 +297,15 @@
 		boot_cpu_data.wp_works_ok = 0;
 		printk("No.\n");
 #ifndef CONFIG_M386
-		panic("This kernel doesn't support CPU's with broken WP. Recompile it for a 386!");
+		panic(brokenwpmsg);
 #endif
 	} else
 		printk(".\n");
 }
 
+static char memmsg[] __initdata =
+	"Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n";
+
 __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem))
 {
 	unsigned long start_low_mem = PAGE_SIZE;
@@ -367,7 +377,7 @@
 #endif
 			free_page(tmp);
 	}
-	printk("Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n",
+	printk(memmsg,
 		(unsigned long) nr_free_pages << (PAGE_SHIFT-10),
 		max_mapnr << (PAGE_SHIFT-10),
 		codepages << (PAGE_SHIFT-10),
diff -ru --new-file linux-2.1.89-vanilla/drivers/char/console.c linux/drivers/char/console.c
--- linux-2.1.89-vanilla/drivers/char/console.c	Fri Feb 20 04:55:26 1998
+++ linux/drivers/char/console.c	Tue Mar  3 12:24:19 1998
@@ -430,7 +430,7 @@
 static unsigned char hardscroll_enabled;
 static unsigned char hardscroll_disabled_by_init = 0;
 
-void no_scroll(char *str, int *ints)
+__initfunc(void no_scroll(char *str, int *ints))
 {
   /*
    * Disabling scrollback is required for the Braillex ib80-piezo
diff -ru --new-file linux-2.1.89-vanilla/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- linux-2.1.89-vanilla/drivers/char/tty_io.c	Tue Mar  3 15:01:13 1998
+++ linux/drivers/char/tty_io.c	Tue Mar  3 12:24:19 1998
@@ -1930,7 +1930,7 @@
  * Just do some early initializations, and do the complex setup
  * later.
  */
-long console_init(long kmem_start, long kmem_end)
+__initfunc(long console_init(long kmem_start, long kmem_end))
 {
 	/* Setup the default TTY line discipline. */
 	memset(ldiscs, 0, sizeof(ldiscs));
diff -ru --new-file linux-2.1.89-vanilla/drivers/scsi/aha1542.c linux/drivers/scsi/aha1542.c
--- linux-2.1.89-vanilla/drivers/scsi/aha1542.c	Thu Jan 22 06:27:09 1998
+++ linux/drivers/scsi/aha1542.c	Tue Mar  3 12:24:20 1998
@@ -28,6 +28,7 @@
 #include <linux/delay.h>
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
+#include <linux/init.h>
 #include <asm/dma.h>
 #include <asm/system.h>
 #include <asm/io.h>
@@ -871,25 +872,35 @@
 }
 
 /* called from init/main.c */
-void aha1542_setup( char *str, int *ints)
+static char ahausage[] __initdata =
+	"aha1542: usage: aha1542=<PORTBASE>[,<BUSON>,<BUSOFF>[,<DMASPEED>]]\n";
+static char toomanymsg[] __initdata =
+	"aha1542: aha1542_setup called too many times! Bad LILO params ?\n";
+static char wrongparmsg[] __initdata =
+	"aha1542: Wrong parameters may cause system malfunction.. We try anyway..\n";
+static char dmaspeedmsg[] __initdata =
+	"aha1542: Valid values for DMASPEED are 5-8, 10 MB/s.  Using jumper defaults.\n";
+static char entrylinemsg[] __initdata =
+	"   Entryline 1: %s\n   Entryline 2: %s\n   This line:   %s\n";
+static char aha1542msg[] __initdata =
+	"aha1542: %s\n";
+
+__initfunc(void aha1542_setup( char *str, int *ints))
 {
-    const char *ahausage = "aha1542: usage: aha1542=<PORTBASE>[,<BUSON>,<BUSOFF>[,<DMASPEED>]]\n";
     static int setup_idx = 0;
     int setup_portbase;
 
     if(setup_idx >= MAXBOARDS)
       {
-	printk("aha1542: aha1542_setup called too many times! Bad LILO params ?\n");
-	printk("   Entryline 1: %s\n",setup_str[0]);
-	printk("   Entryline 2: %s\n",setup_str[1]);
-	printk("   This line:   %s\n",str);
+	printk(toomanymsg);
+	printk(entrylinemsg, setup_str[0], setup_str[1], str);
 	return;
       }
     if (ints[0] < 1 || ints[0] > 4)
       {
-	printk("aha1542: %s\n", str );
+	printk(aha1542msg, str );
 	printk(ahausage);
-	printk("aha1542: Wrong parameters may cause system malfunction.. We try anyway..\n");
+	printk(wrongparmsg);
       }
 
     setup_called[setup_idx]=ints[0];
@@ -917,9 +928,9 @@
 	    atbt = 0x03;
 	    break;
 	default:
-	    printk("aha1542: %s\n", str );
+	    printk(aha1542msg, str );
 	    printk(ahausage);
-	    printk("aha1542: Valid values for DMASPEED are 5-8, 10 MB/s.  Using jumper defaults.\n");
+	    printk(dmaspeedmsg);
 	    break;
       }
       setup_dmaspeed[setup_idx]  = atbt;
diff -ru --new-file linux-2.1.89-vanilla/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
--- linux-2.1.89-vanilla/drivers/scsi/scsi.c	Tue Mar  3 15:01:19 1998
+++ linux/drivers/scsi/scsi.c	Tue Mar  3 18:02:49 1998
@@ -155,7 +155,7 @@
 #endif
 
 
-const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE] =
+const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE] __initdata =
 {
     "Direct-Access    ",
     "Sequential-Access",
@@ -215,7 +215,7 @@
  * has been expanded so that we can specify other types of things we
  * need to be aware of.
  */
-static struct dev_info device_list[] =
+static struct dev_info device_list[] __initdata =
 {
 {"Aashima","IMAGERY 2400SP","1.03",BLIST_NOLUN},/* Locks up if polled for lun != 0 */
 {"CHINON","CD-ROM CDS-431","H42", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */
@@ -285,7 +285,8 @@
 {NULL, NULL, NULL}
 };
 
-static int get_device_flags(unsigned char * response_data){
+__initfunc(static int get_device_flags(unsigned char * response_data))
+{
     int i = 0;
     unsigned char * pnt;
     for(i=0; 1; i++){
@@ -396,11 +397,13 @@
 	up(SCpnt->request.sem);
 }
 
-void scsi_logging_setup(char *str, int *ints) 
+static char loggingmsg[] __initdata =
+	"scsi_logging_setup : usage scsi_logging_level=n (n should be 0 or non-zero)\n";
+
+__initfunc(void scsi_logging_setup(char *str, int *ints))
 {
     if (ints[0] != 1) {
-	printk("scsi_logging_setup : usage scsi_logging_level=n "
-               "(n should be 0 or non-zero)\n");
+	printk(loggingmsg);
     } else {
 	scsi_logging_level = (ints[1])? ~0 : 0;
     }
@@ -412,10 +415,13 @@
 static int max_scsi_luns = 1;
 #endif
 
-void scsi_luns_setup(char *str, int *ints) 
+static char lunsmsg[] __initdata =
+	"scsi_luns_setup : usage max_scsi_luns=n (n should be between 1 and 8)\n";
+
+__initfunc(void scsi_luns_setup(char *str, int *ints))
 {
     if (ints[0] != 1)
-	printk("scsi_luns_setup : usage max_scsi_luns=n (n should be between 1 and 8)\n");
+	printk(lunsmsg);
     else
 	max_scsi_luns = ints[1];
 }
@@ -427,11 +433,11 @@
  *  lun address of all sequential devices to the tape driver, all random
  *  devices to the disk driver.
  */
-static void scan_scsis (struct Scsi_Host *shpnt, 
+__initfunc(static void scan_scsis (struct Scsi_Host *shpnt, 
                         unchar hardcoded,
                         unchar hchannel, 
                         unchar hid, 
-                        unchar hlun)
+                        unchar hlun))
 {
   int             channel;
   int             dev;
@@ -611,9 +617,9 @@
  * Returning 0 means Please don't ask further for lun!=0, 1 means OK go on.
  * Global variables used : scsi_devices(linked list)
  */
-int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun,
+__initfunc(static int scan_scsis_single (int channel, int dev, int lun, int *max_dev_lun,
     int *sparse_lun, Scsi_Device **SDpnt2, Scsi_Cmnd * SCpnt,
-    struct Scsi_Host * shpnt, char *scsi_result)
+    struct Scsi_Host * shpnt, char *scsi_result))
 {
   unsigned char scsi_cmd[12];
   struct Scsi_Device_Template *sdtpnt;
@@ -2055,7 +2061,7 @@
 }
 #endif /* MODULE */   /* } */
 
-static void print_inquiry(unsigned char *data)
+__initfunc(static void print_inquiry(unsigned char *data))
 {
     int i;
 
diff -ru --new-file linux-2.1.89-vanilla/fs/buffer.c linux/fs/buffer.c
--- linux-2.1.89-vanilla/fs/buffer.c	Tue Mar  3 15:01:24 1998
+++ linux/fs/buffer.c	Tue Mar  3 12:24:21 1998
@@ -38,6 +38,7 @@
 #include <linux/blkdev.h>
 #include <linux/sysrq.h>
 #include <linux/file.h>
+#include <linux/init.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -1698,17 +1699,22 @@
 
 /* ===================== Init ======================= */
 
+static char hashpanicmsg[] __initdata =
+	"Failed to allocate buffer hash table\n";
+static char bhpanicmsg[] __initdata =
+	"Cannot create buffer head SLAB cache\n";
+
 /*
  * allocate the hash table and init the free list
  * Use gfp() for the hash table to decrease TLB misses, use
  * SLAB cache for buffer heads.
  */
-void buffer_init(void)
+__initfunc(void buffer_init(void))
 {
 	hash_table = (struct buffer_head **)
 		__get_free_pages(GFP_ATOMIC, HASH_PAGES_ORDER);
 	if (!hash_table)
-		panic("Failed to allocate buffer hash table\n");
+		panic(hashpanicmsg);
 	memset(hash_table,0,NR_HASH*sizeof(struct buffer_head *));
 
 	bh_cachep = kmem_cache_create("buffer_head",
@@ -1716,7 +1722,7 @@
 				      0,
 				      SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if(!bh_cachep)
-		panic("Cannot create buffer head SLAB cache\n");
+		panic(bhpanicmsg);
 	/*
 	 * Allocate the reserved buffer heads.
 	 */
diff -ru --new-file linux-2.1.89-vanilla/fs/file_table.c linux/fs/file_table.c
--- linux-2.1.89-vanilla/fs/file_table.c	Sun Oct 12 19:10:40 1997
+++ linux/fs/file_table.c	Tue Mar  3 12:24:21 1998
@@ -13,6 +13,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
+#include <linux/init.h>
 
 /* SLAB cache for filp's. */
 static kmem_cache_t *filp_cache;
@@ -45,14 +46,16 @@
 	file->f_pprev = &inuse_filps;
 }
 
-/* N.B. This should be an __initfunc ... */
-void file_table_init(void)
+static char filppanicmsg[] __initdata =
+	"VFS: Cannot alloc filp SLAB cache.";
+
+__initfunc(void file_table_init(void))
 {
 	filp_cache = kmem_cache_create("filp", sizeof(struct file),
 				       0,
 				       SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if(!filp_cache)
-		panic("VFS: Cannot alloc filp SLAB cache.");
+		panic(filppanicmsg);
 	/*
 	 * We could allocate the reserved files here, but really
 	 * shouldn't need to: the normal boot process will create
diff -ru --new-file linux-2.1.89-vanilla/fs/inode.c linux/fs/inode.c
--- linux-2.1.89-vanilla/fs/inode.c	Tue Mar  3 15:01:25 1998
+++ linux/fs/inode.c	Tue Mar  3 12:24:21 1998
@@ -8,6 +8,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/dcache.h>
+#include <linux/init.h>
 
 /*
  * New inode.c implementation.
@@ -733,7 +734,7 @@
 /*
  * Initialize the hash tables
  */
-void inode_init(void)
+__initfunc(void inode_init(void))
 {
 	int i;
 	struct list_head *head = inode_hashtable;
diff -ru --new-file linux-2.1.89-vanilla/fs/proc/base.c linux/fs/proc/base.c
--- linux-2.1.89-vanilla/fs/proc/base.c	Thu Jan 22 06:29:59 1998
+++ linux/fs/proc/base.c	Tue Mar  3 12:24:21 1998
@@ -13,6 +13,7 @@
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
+#include <linux/init.h>
 
 static struct file_operations proc_base_operations = {
 	NULL,			/* lseek - default */
@@ -167,7 +168,7 @@
 };
 #endif
 
-void proc_base_init(void)
+__initfunc(void proc_base_init(void))
 {
 #if CONFIG_AP1000
 	proc_register(&proc_pid, &proc_pid_ringbuf);
diff -ru --new-file linux-2.1.89-vanilla/fs/proc/root.c linux/fs/proc/root.c
--- linux-2.1.89-vanilla/fs/proc/root.c	Fri Feb 20 04:54:53 1998
+++ linux/fs/proc/root.c	Tue Mar  3 12:24:21 1998
@@ -13,6 +13,7 @@
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
 #include <linux/config.h>
+#include <linux/init.h>
 #include <asm/bitops.h>
 #ifdef CONFIG_KERNELD
 #include <linux/kerneld.h>
@@ -632,7 +633,7 @@
 };
 #endif
 
-void proc_root_init(void)
+__initfunc(void proc_root_init(void))
 {
 	proc_base_init();
 	proc_register(&proc_root, &proc_root_loadavg);
diff -ru --new-file linux-2.1.89-vanilla/init/main.c linux/init/main.c
--- linux-2.1.89-vanilla/init/main.c	Fri Feb 20 04:55:54 1998
+++ linux/init/main.c	Tue Mar  3 12:24:21 1998
@@ -819,6 +819,9 @@
    better than 1% */
 #define LPS_PREC 8
 
+static char calibmsg[] __initdata = "Calibrating delay loop... ";
+static char bogomipsmsg[] __initdata = "%lu.%02lu BogoMIPS\n";
+
 __initfunc(void calibrate_delay(void))
 {
 	unsigned long ticks, loopbit;
@@ -826,7 +829,7 @@
 
 	loops_per_sec = (1<<12);
 
-	printk("Calibrating delay loop... ");
+	printk(calibmsg);
 	while (loops_per_sec <<= 1) {
 		/* wait for "start of" clock tick */
 		ticks = jiffies;
@@ -857,7 +860,7 @@
 /* finally, adjust loops per second in terms of seconds instead of clocks */	
 	loops_per_sec *= HZ;
 /* Round the value and print it */	
-	printk("%lu.%02lu BogoMIPS\n",
+	printk(bogomipsmsg,
 		(loops_per_sec+2500)/500000,
 		((loops_per_sec+2500)/5000) % 100);
 }
@@ -980,7 +983,10 @@
 /*
  *	Activate the first processor.
  */
- 
+
+static char unifixmsg[] __initdata =
+	"POSIX conformance testing by UNIFIX\n"; 
+
 __initfunc(asmlinkage void start_kernel(void))
 {
 	char * command_line;
@@ -1067,7 +1073,7 @@
 	dquot_init();
 	check_bugs();
 
-	printk("POSIX conformance testing by UNIFIX\n");
+	printk(unifixmsg);
 #ifdef __SMP__
 	smp_init();
 #endif
diff -ru --new-file linux-2.1.89-vanilla/kernel/fork.c linux/kernel/fork.c
--- linux-2.1.89-vanilla/kernel/fork.c	Tue Mar  3 15:01:33 1998
+++ linux/kernel/fork.c	Tue Mar  3 12:24:21 1998
@@ -123,6 +123,9 @@
 	return 0;
 }
 
+static char uidpanicmsg[] __initdata =
+	"Cannot create uid taskcount SLAB cache\n";
+
 __initfunc(void uidcache_init(void))
 {
 	int i;
@@ -131,7 +134,7 @@
 				       0,
 				       SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if(!uid_cachep)
-		panic("Cannot create uid taskcount SLAB cache\n");
+		panic(uidpanicmsg);
 
 	for(i = 0; i < UIDHASH_SZ; i++)
 		uidhash[i] = 0;
@@ -568,6 +571,8 @@
 	memset(f, 0, sizeof(*f));
 }
 
+static char filespanicmsg[] __initdata = "Cannot create files cache";
+
 __initfunc(void filescache_init(void))
 {
 	files_cachep = kmem_cache_create("files_cache", 
@@ -576,5 +581,5 @@
 					 SLAB_HWCACHE_ALIGN,
 					 files_ctor, NULL);
 	if (!files_cachep) 
-		panic("Cannot create files cache"); 
+		panic(filespanicmsg); 
 }
diff -ru --new-file linux-2.1.89-vanilla/kernel/module.c linux/kernel/module.c
--- linux-2.1.89-vanilla/kernel/module.c	Tue Mar  3 15:01:33 1998
+++ linux/kernel/module.c	Tue Mar  3 12:24:22 1998
@@ -10,6 +10,7 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <asm/pgtable.h>
+#include <linux/init.h>
 
 /*
  * Originally by Anonymous (as far as I know...)
@@ -61,7 +62,7 @@
  * Called at boot time
  */
 
-void init_modules(void)
+__initfunc(void init_modules(void))
 {
 	kernel_module.nsyms = __stop___ksymtab - __start___ksymtab;
 
diff -ru --new-file linux-2.1.89-vanilla/kernel/signal.c linux/kernel/signal.c
--- linux-2.1.89-vanilla/kernel/signal.c	Tue Mar  3 15:01:33 1998
+++ linux/kernel/signal.c	Tue Mar  3 12:24:22 1998
@@ -18,6 +18,7 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/slab.h>
+#include <linux/init.h>
 
 #include <asm/uaccess.h>
 
@@ -35,8 +36,7 @@
 
 static kmem_cache_t *signal_queue_cachep;
 
-void
-signals_init(void)
+__initfunc(void signals_init(void))
 {
 	signal_queue_cachep =
 		kmem_cache_create("signal_queue",
diff -ru --new-file linux-2.1.89-vanilla/mm/mmap.c linux/mm/mmap.c
--- linux-2.1.89-vanilla/mm/mmap.c	Tue Mar  3 15:01:34 1998
+++ linux/mm/mmap.c	Tue Mar  3 12:24:22 1998
@@ -704,6 +704,11 @@
 	up(&mm->mmap_sem);
 }
 
+static char vmpanicmsg[] __initdata =
+	"vma_init: Cannot alloc vm_area_struct cache.";
+static char mmpanicmsg[] __initdata =
+	"vma_init: Cannot alloc mm_struct cache.";
+
 __initfunc(void vma_init(void))
 {
 	vm_area_cachep = kmem_cache_create("vm_area_struct",
@@ -711,12 +716,12 @@
 					   0, SLAB_HWCACHE_ALIGN,
 					   NULL, NULL);
 	if(!vm_area_cachep)
-		panic("vma_init: Cannot alloc vm_area_struct cache.");
+		panic(vmpanicmsg);
 
 	mm_cachep = kmem_cache_create("mm_struct",
 				      sizeof(struct mm_struct),
 				      0, SLAB_HWCACHE_ALIGN,
 				      NULL, NULL);
 	if(!mm_cachep)
-		panic("vma_init: Cannot alloc mm_struct cache.");
+		panic(mmpanicmsg);
 }
diff -ru --new-file linux-2.1.89-vanilla/mm/vmscan.c linux/mm/vmscan.c
--- linux-2.1.89-vanilla/mm/vmscan.c	Tue Mar  3 15:01:34 1998
+++ linux/mm/vmscan.c	Tue Mar  3 12:24:22 1998
@@ -22,6 +22,7 @@
 #include <linux/smp_lock.h>
 #include <linux/slab.h>
 #include <linux/dcache.h>
+#include <linux/init.h>
 
 #include <asm/bitops.h>
 #include <asm/pgtable.h>
@@ -498,7 +499,10 @@
  * may be printed in the middle of another driver's init 
  * message).  It looks very bad when that happens.
  */
-void kswapd_setup(void)
+
+static char kswapd_msg[] __initdata = "Starting kswapd v%.*s\n";
+
+__initfunc(void kswapd_setup(void))
 {
        int i;
        char *revision="$Revision: 1.5 $", *s, *e;
diff -ru --new-file linux-2.1.89-vanilla/net/core/sock.c linux/net/core/sock.c
--- linux-2.1.89-vanilla/net/core/sock.c	Tue Mar  3 15:01:35 1998
+++ linux/net/core/sock.c	Tue Mar  3 12:24:22 1998
@@ -105,6 +105,7 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/poll.h>
+#include <linux/init.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -492,7 +493,7 @@
 	kmem_cache_free(sk_cachep, sk);
 }
 
-void sk_init(void)
+__initfunc(void sk_init(void))
 {
 	sk_cachep = kmem_cache_create("sock", sizeof(struct sock), 0,
 				      SLAB_HWCACHE_ALIGN, 0, 0);
diff -ru --new-file linux-2.1.89-vanilla/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- linux-2.1.89-vanilla/net/ipv4/af_inet.c	Tue Mar  3 15:01:37 1998
+++ linux/net/ipv4/af_inet.c	Tue Mar  3 12:24:23 1998
@@ -1050,13 +1050,16 @@
 /*
  *	Called by socket.c on kernel startup.  
  */
+
+static char swanmsg[] __initdata =
+        "Swansea University Computer Society TCP/IP for NET3.037\n";
  
 __initfunc(void inet_proto_init(struct net_proto *pro))
 {
 	struct sk_buff *dummy_skb;
 	struct inet_protocol *p;
 
-	printk(KERN_INFO "Swansea University Computer Society TCP/IP for NET3.037\n");
+	printk(KERN_INFO "%s", swanmsg);
 
 	if (sizeof(struct inet_skb_parm) > sizeof(dummy_skb->cb))
 	{
diff -ru --new-file linux-2.1.89-vanilla/net/ipv4/icmp.c linux/net/ipv4/icmp.c
--- linux-2.1.89-vanilla/net/ipv4/icmp.c	Tue Mar  3 15:01:38 1998
+++ linux/net/ipv4/icmp.c	Tue Mar  3 12:24:23 1998
@@ -1074,6 +1074,9 @@
  { &icmp_statistics.IcmpOutAddrMaskReps, &icmp_statistics.IcmpInAddrMaskReps, icmp_address_reply, 0, }
 };
 
+static char icmppanicmsg[] __initdata =
+        "Failed to create the ICMP control socket.\n";
+
 __initfunc(void icmp_init(struct net_proto_family *ops))
 {
 	int err;
@@ -1088,7 +1091,7 @@
 	icmp_socket->type=SOCK_RAW;
 
 	if ((err=ops->create(icmp_socket, IPPROTO_ICMP))<0)
-		panic("Failed to create the ICMP control socket.\n");
+		panic(icmppanicmsg);
 	icmp_socket->sk->allocation=GFP_ATOMIC;
 	icmp_socket->sk->num = 256;		/* Don't receive any data */
 	icmp_socket->sk->ip_ttl = MAXTTL;
diff -ru --new-file linux-2.1.89-vanilla/net/socket.c linux/net/socket.c
--- linux-2.1.89-vanilla/net/socket.c	Tue Mar  3 15:01:43 1998
+++ linux/net/socket.c	Tue Mar  3 12:24:23 1998
@@ -1446,11 +1446,14 @@
 extern void wanrouter_init(void);
 #endif
 
+static char swanmsg[] __initdata =
+	"Swansea University Computer Society NET3.039 for Linux 2.1\n";
+
 __initfunc(void sock_init(void))
 {
 	int i;
 
-	printk(KERN_INFO "Swansea University Computer Society NET3.039 for Linux 2.1\n");
+	printk(KERN_INFO "%s", swanmsg);
 
 	/*
 	 *	Initialize all address (protocol) families. 
\
 
 \ /
  Last update: 2005-03-22 12:41    [from the cache]
©2003-2008