[parisc-linux-cvs] linux deller

Helge Deller deller@gmx.de
Tue, 16 Apr 2002 01:49:42 +0200


--------------Boundary-00=_UIVMZ885L9H5VOH0BM3C
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

On Tuesday 16 April 2002 01:49, Helge Deller wrote:
> CVSROOT:	/var/cvs
> Module name:	linux
> Changes by:	deller	02/04/15 17:49:12
>
> Modified files:
> 	arch/parisc/mm : init.c
>
> Log message:
> !!! DANGEROUS !!!
> - re-enable the freeing of initmem
>
> I had no problems, Richard had no problems, so let's try if anyone else
> hits any bug (it's the easiest way to find the bug NOW !!!)
>
> Maybe last time we hit other problems which are solved by now and which we
> assumed to be caused by the freeing of bootmem.
> So, let's try to find the bug now the hard way :-)



--------------Boundary-00=_UIVMZ885L9H5VOH0BM3C
Content-Type: text/plain;
  charset="iso-8859-1";
  name="diff2"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="diff2"

Index: init.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/mm/init.c,v
retrieving revision 1.47
diff -u -p -r1.47 init.c
--- init.c	2002/02/04 19:29:43	1.47
+++ init.c	2002/04/15 23:42:14
@@ -370,13 +370,23 @@ static void __init setup_bootmem(void)
 
 void free_initmem(void)
 {
-	unsigned long addr;
-
 	/* FIXME: */
+#if 0
 	printk(KERN_INFO "NOT FREEING INITMEM (%dk)\n",
 			(&__init_end - &__init_begin) >> 10);
 	return;
+#endif
+	unsigned long addr;
+	
+	printk(KERN_INFO "Freeing unused kernel memory: ");
 
+#if 1
+	cli();	/* disable all interrupts */
+	memset(&__init_begin, 0xff, 
+		(unsigned long)&__init_end - (unsigned long)&__init_begin);
+	sti();	/* re-enable all interrupts */
+#endif
+	
 	addr = (unsigned long)(&__init_begin);
 	for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
 		ClearPageReserved(virt_to_page(addr));
@@ -385,8 +395,7 @@ void free_initmem(void)
 		num_physpages++;
 	}
 
-	printk(KERN_INFO "Freeing unused kernel memory: %dk freed\n",
-			(&__init_end - &__init_begin) >> 10);
+	printk("%dk freed\n", (&__init_end - &__init_begin) >> 10);
 }
 
 /*

--------------Boundary-00=_UIVMZ885L9H5VOH0BM3C--