public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: CONFIG_SLAB_DEBUG and NUMA API
       [not found] ` <20040705234945.1f920d1b.akpm@osdl.org>
@ 2004-07-06 21:03   ` Andi Kleen
  2004-07-07  8:10     ` R. J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Andi Kleen @ 2004-07-06 21:03 UTC (permalink / raw)
  To: Andrew Morton; +Cc: arjanv, linux-kernel

On Mon, Jul 05, 2004 at 11:49:45PM -0700, Andrew Morton wrote:
> Andi Kleen <ak@muc.de> wrote:
> >
> > 
> > I tested 2.6.7-mm6 with NUMA on with CONFIG_SLAB_DEBUG and I didn't see any 
> > oopses. Do you have a recipe to reproduce them?
> > 
> 
> Still happens here.  Booting SLES9.1 with the attached config.

[...]

Here's a patch. The problem was that the kernel exit would allocate
memory to send exit signals after the local mempolicy was already freed, 
but not zeroed.  When the allocator tried to grab more memory it would
fall over.

-Andi

-------------------------------------------------------------

Move the memory policy freeing to later in exit to make sure 
the last memory allocations don't use an uninitialized policy


diff -u linux-2.6.7-mm6/kernel/exit.c-o linux-2.6.7-mm6/kernel/exit.c
--- linux-2.6.7-mm6/kernel/exit.c-o	2004-07-06 05:59:39.000000000 +0200
+++ linux-2.6.7-mm6/kernel/exit.c	2004-07-06 22:58:39.000000000 +0200
@@ -828,9 +828,6 @@
 	__exit_fs(tsk);
 	exit_namespace(tsk);
 	exit_thread();
-#ifdef CONFIG_NUMA
-	mpol_free(tsk->mempolicy);
-#endif
 
 	if (tsk->signal->leader)
 		disassociate_ctty(1);
@@ -841,6 +838,10 @@
 
 	tsk->exit_code = code;
 	exit_notify(tsk);
+#ifdef CONFIG_NUMA
+	mpol_free(tsk->mempolicy);
+	tsk->mempolicy = NULL;
+#endif
 	schedule();
 	BUG();
 	/* Avoid "noreturn function does return".  */

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

* Re: CONFIG_SLAB_DEBUG and NUMA API
  2004-07-06 21:03   ` CONFIG_SLAB_DEBUG and NUMA API Andi Kleen
@ 2004-07-07  8:10     ` R. J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: R. J. Wysocki @ 2004-07-07  8:10 UTC (permalink / raw)
  To: Andi Kleen, Andrew Morton; +Cc: arjanv, linux-kernel

On Tuesday 06 of July 2004 23:03, Andi Kleen wrote:
> On Mon, Jul 05, 2004 at 11:49:45PM -0700, Andrew Morton wrote:
> > Andi Kleen <ak@muc.de> wrote:
> > > I tested 2.6.7-mm6 with NUMA on with CONFIG_SLAB_DEBUG and I didn't see
> > > any oopses. Do you have a recipe to reproduce them?
> >
> > Still happens here.  Booting SLES9.1 with the attached config.
>
> [...]
>
> Here's a patch. The problem was that the kernel exit would allocate
> memory to send exit signals after the local mempolicy was already freed,
> but not zeroed.  When the allocator tried to grab more memory it would
> fall over.
>
> -Andi
>
> -------------------------------------------------------------
>
> Move the memory policy freeing to later in exit to make sure
> the last memory allocations don't use an uninitialized policy

It fixed the problems that I had reported on both 2.6.7-mm6 and 2.6.7-bk18.  
Thanks a lot,

rjw

-- 
Rafael J. Wysocki
----------------------------
For a successful technology, reality must take precedence over public 
relations, for nature cannot be fooled.
					-- Richard P. Feynman

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

end of thread, other threads:[~2004-07-07  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20040706063149.GA37299@muc.de>
     [not found] ` <20040705234945.1f920d1b.akpm@osdl.org>
2004-07-06 21:03   ` CONFIG_SLAB_DEBUG and NUMA API Andi Kleen
2004-07-07  8:10     ` R. J. Wysocki

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