public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][2.6-mm] defer free_initmem() if we have no /init
@ 2004-03-22  6:41 Zwane Mwaikambo
  2004-03-22  7:04 ` Mika Penttilä
  2004-03-22  7:49 ` Olaf Hering
  0 siblings, 2 replies; 5+ messages in thread
From: Zwane Mwaikambo @ 2004-03-22  6:41 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Andrew Morton, olh

In the absence of /init and other nice boot goodies, we fall through to
prepare_namespace() so we shall require initmem to complete boot.

Freeing 1nunedlketo lamdlo y:r3elkpfgeeg
equest at virtual address c06c22a0
 printing eip:
c06c22a0
*pde = 00757027
Oops: 0000 [#1]
PREEMPT SMP DEBUG_PAGEALLOC
CPU:    1
EIP:    0060:[<c06c22a0>]    Not tainted VLI
EFLAGS: 00010213   (2.6.5-rc2-mm1)
EIP is at prepare_namespace+0x0/0xd0
eax: 00000002   ebx: 00000000   ecx: c060b2c0   edx: c060b300
esi: 00000001   edi: 00000000   ebp: dff8ffec   esp: dff8ffd4
ds: 007b   es: 007b   ss: 0068
Process swapper (pid: 1, threadinfo=dff8f000 task=dff1fa50)
Stack: c0103235 00000000 00000000 0000007b c0103170 00000000 00000000 c01051f5
       00000000 00000000 00000000
Call Trace:
 [<c0103235>] init+0xc5/0x190
 [<c0103170>] init+0x0/0x190
 [<c01051f5>] kernel_thread_helper+0x5/0x10

Code:  Bad EIP value.
 <0>Kernel panic: Attempted to kill init!

Index: linux-2.6.5-rc2-mm1/init/main.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.5-rc2-mm1/init/main.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 main.c
--- linux-2.6.5-rc2-mm1/init/main.c	21 Mar 2004 17:02:18 -0000	1.1.1.1
+++ linux-2.6.5-rc2-mm1/init/main.c	21 Mar 2004 20:54:19 -0000
@@ -586,8 +586,8 @@ static int free_initmem_on_exec_helper(v
 	char c;

 	sys_close(fd[1]);
-	sys_read(fd[0], &c, 1);
-	free_initmem();
+	if (sys_read(fd[0], &c, 1) > 0)
+		free_initmem();
 	return 0;
 }

@@ -596,7 +596,7 @@ static void free_initmem_on_exec(void)
 	int fd[2];

 	do_pipe(fd);
-       kernel_thread(free_initmem_on_exec_helper, &fd, SIGCHLD);
+	kernel_thread(free_initmem_on_exec_helper, &fd, SIGCHLD);

 	sys_dup2(fd[1], 255);   /* to get it out of the way */
 	sys_close(fd[0]);
@@ -643,6 +643,7 @@ static int init(void * unused)
 	run_init_process("/init");

 	prepare_namespace();
+	free_initmem();

 	if (sys_open("/dev/console", O_RDWR, 0) < 0)
 		printk("Warning: unable to open an initial console.\n");

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-22  8:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-22  6:41 [PATCH][2.6-mm] defer free_initmem() if we have no /init Zwane Mwaikambo
2004-03-22  7:04 ` Mika Penttilä
2004-03-22  7:49 ` Olaf Hering
2004-03-22  8:12   ` Zwane Mwaikambo
2004-03-22  8:15     ` Olaf Hering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox