mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
@ 2004-04-30 16:11 Mikael Pettersson
  2004-04-30 18:21 ` Jonathan Corbet
  2004-04-30 18:27 ` Andrew Morton
  0 siblings, 2 replies; 10+ messages in thread
From: Mikael Pettersson @ 2004-04-30 16:11 UTC (permalink / raw)
  To: ak; +Cc: linux-kernel

The change to mm/slab.c between 2.6.6-rc2-bk4 and -bk5
broke x86-64 SMP. The symptoms are general protection
faults in __switch_to shortly after init starts, and
then the machine is dead. (Can't be more specific, my
box can't log early boot oopses.)

I'm only seeing this with x86-64 SMP; x86-64 UP and i386
SMP on the same machine (Athlon64 UP) have no problems.

Reverting 2.6.6-rc2-bk5's change to mm/slab.c eliminates
the problem.

/Mikael

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

* Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
  2004-04-30 16:11 [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP Mikael Pettersson
@ 2004-04-30 18:21 ` Jonathan Corbet
  2004-04-30 18:27 ` Andrew Morton
  1 sibling, 0 replies; 10+ messages in thread
From: Jonathan Corbet @ 2004-04-30 18:21 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: linux-kernel, ak

> The change to mm/slab.c between 2.6.6-rc2-bk4 and -bk5
> broke x86-64 SMP. The symptoms are general protection
> faults in __switch_to shortly after init starts, and
> then the machine is dead. (Can't be more specific, my
> box can't log early boot oopses.)
> 
> I'm only seeing this with x86-64 SMP; x86-64 UP and i386
> SMP on the same machine (Athlon64 UP) have no problems.

FWIW, this sure looks a lot like the boot-time crash I'm seeing; I get the
same __switch_to oopses once init starts.  *But* I'm running a UP,
no-preempt kernel.  And I get it with -rc1 as well.  Might reverting the
later slab change be concealing a different problem?

jon

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

* Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
  2004-04-30 16:11 [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP Mikael Pettersson
  2004-04-30 18:21 ` Jonathan Corbet
@ 2004-04-30 18:27 ` Andrew Morton
  2004-04-30 19:29   ` Jonathan Corbet
                     ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Andrew Morton @ 2004-04-30 18:27 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: ak, linux-kernel

Mikael Pettersson <mikpe@csd.uu.se> wrote:
>
> The change to mm/slab.c between 2.6.6-rc2-bk4 and -bk5
> broke x86-64 SMP. The symptoms are general protection
> faults in __switch_to shortly after init starts, and
> then the machine is dead. (Can't be more specific, my
> box can't log early boot oopses.)
> 
> I'm only seeing this with x86-64 SMP; x86-64 UP and i386
> SMP on the same machine (Athlon64 UP) have no problems.
> 
> Reverting 2.6.6-rc2-bk5's change to mm/slab.c eliminates
> the problem.

The "-bk5" terminology doesn't mean much to people who use bitkeeper or who
use http://www.kernel.org/pub/linux/kernel/v2.5/testing/cset/ - I assume
you refer to the alignment changes?

Does this fix?

diff -puN include/asm-x86_64/processor.h~a include/asm-x86_64/processor.h
--- 25/include/asm-x86_64/processor.h~a	Fri Apr 30 11:24:58 2004
+++ 25-akpm/include/asm-x86_64/processor.h	Fri Apr 30 11:25:28 2004
@@ -20,6 +20,8 @@
 #include <asm/mmsegment.h>
 #include <linux/personality.h>
 
+#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES
+
 #define TF_MASK		0x00000100
 #define IF_MASK		0x00000200
 #define IOPL_MASK	0x00003000

_


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

* Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
  2004-04-30 18:27 ` Andrew Morton
@ 2004-04-30 19:29   ` Jonathan Corbet
  2004-04-30 20:31     ` Andrew Morton
  2004-04-30 19:33   ` R. J. Wysocki
  2004-05-01  1:48   ` Andi Kleen
  2 siblings, 1 reply; 10+ messages in thread
From: Jonathan Corbet @ 2004-04-30 19:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Mikael Pettersson, ak

> Does this fix?
> 
> diff -puN include/asm-x86_64/processor.h~a include/asm-x86_64/processor.h
> --- 25/include/asm-x86_64/processor.h~a	Fri Apr 30 11:24:58 2004
> +++ 25-akpm/include/asm-x86_64/processor.h	Fri Apr 30 11:25:28 2004
> @@ -20,6 +20,8 @@
>  #include <asm/mmsegment.h>
>  #include <linux/personality.h>
>  
> +#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES
> +

That made my x86_64 boot problem go away; with that patch the system comes
up just fine.

Now I have weird display problems with my Radeon card instead.  Ever seen X
running 100% in kernel space, unkillable?

jon

Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net

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

* Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
  2004-04-30 18:27 ` Andrew Morton
  2004-04-30 19:29   ` Jonathan Corbet
@ 2004-04-30 19:33   ` R. J. Wysocki
  2004-04-30 20:24     ` Andrew Morton
  2004-05-01  1:48   ` Andi Kleen
  2 siblings, 1 reply; 10+ messages in thread
From: R. J. Wysocki @ 2004-04-30 19:33 UTC (permalink / raw)
  To: Andrew Morton, Mikael Pettersson; +Cc: ak, linux-kernel

On Friday 30 of April 2004 20:27, Andrew Morton wrote:
> Mikael Pettersson <mikpe@csd.uu.se> wrote:
> > The change to mm/slab.c between 2.6.6-rc2-bk4 and -bk5
> > broke x86-64 SMP. The symptoms are general protection
> > faults in __switch_to shortly after init starts, and
> > then the machine is dead. (Can't be more specific, my
> > box can't log early boot oopses.)
> >
> > I'm only seeing this with x86-64 SMP; x86-64 UP and i386
> > SMP on the same machine (Athlon64 UP) have no problems.
> >
> > Reverting 2.6.6-rc2-bk5's change to mm/slab.c eliminates
> > the problem.
>
> The "-bk5" terminology doesn't mean much to people who use bitkeeper or who
> use http://www.kernel.org/pub/linux/kernel/v2.5/testing/cset/ - I assume
> you refer to the alignment changes?
>
> Does this fix?
>
> diff -puN include/asm-x86_64/processor.h~a include/asm-x86_64/processor.h
> --- 25/include/asm-x86_64/processor.h~a	Fri Apr 30 11:24:58 2004
> +++ 25-akpm/include/asm-x86_64/processor.h	Fri Apr 30 11:25:28 2004
> @@ -20,6 +20,8 @@
>  #include <asm/mmsegment.h>
>  #include <linux/personality.h>
>
> +#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES
> +
>  #define TF_MASK		0x00000100
>  #define IF_MASK		0x00000200
>  #define IOPL_MASK	0x00003000
>

AFAICS, yes, it does. :-)
I'm now (happily) running 2.6.6-rc3 on a dual-Opteron box.

RJW


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

* Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
  2004-04-30 19:33   ` R. J. Wysocki
@ 2004-04-30 20:24     ` Andrew Morton
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2004-04-30 20:24 UTC (permalink / raw)
  To: R. J. Wysocki; +Cc: mikpe, ak, linux-kernel, Manfred Spraul

"R. J. Wysocki" <rjwysocki@sisk.pl> wrote:
>
> > Does this fix?
> >
> > diff -puN include/asm-x86_64/processor.h~a include/asm-x86_64/processor.h
> > --- 25/include/asm-x86_64/processor.h~a	Fri Apr 30 11:24:58 2004
> > +++ 25-akpm/include/asm-x86_64/processor.h	Fri Apr 30 11:25:28 2004
> > @@ -20,6 +20,8 @@
> >  #include <asm/mmsegment.h>
> >  #include <linux/personality.h>
> >
> > +#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES
> > +
> >  #define TF_MASK		0x00000100
> >  #define IF_MASK		0x00000200
> >  #define IOPL_MASK	0x00003000
> >
> 
> AFAICS, yes, it does. :-)
> I'm now (happily) running 2.6.6-rc3 on a dual-Opteron box.

OK, thanks.  I suspect that change has broken other architectures for the
same reason.

I think I'll just change the default:

 
diff -puN kernel/fork.c~task-struct-alignment-fix kernel/fork.c
--- 25/kernel/fork.c~task-struct-alignment-fix	Fri Apr 30 13:22:24 2004
+++ 25-akpm/kernel/fork.c	Fri Apr 30 13:22:36 2004
@@ -211,7 +211,7 @@ void __init fork_init(unsigned long memp
 {
 #ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
 #ifndef ARCH_MIN_TASKALIGN
-#define ARCH_MIN_TASKALIGN	0
+#define ARCH_MIN_TASKALIGN	L1_CACHE_BYTES
 #endif
 	/* create a slab on which task_structs can be allocated */
 	task_struct_cachep =

_


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

* Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
  2004-04-30 19:29   ` Jonathan Corbet
@ 2004-04-30 20:31     ` Andrew Morton
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2004-04-30 20:31 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-kernel, mikpe, ak

corbet@lwn.net (Jonathan Corbet) wrote:
>
> > Does this fix?
> > 
> > diff -puN include/asm-x86_64/processor.h~a include/asm-x86_64/processor.h
> > --- 25/include/asm-x86_64/processor.h~a	Fri Apr 30 11:24:58 2004
> > +++ 25-akpm/include/asm-x86_64/processor.h	Fri Apr 30 11:25:28 2004
> > @@ -20,6 +20,8 @@
> >  #include <asm/mmsegment.h>
> >  #include <linux/personality.h>
> >  
> > +#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES
> > +
> 
> That made my x86_64 boot problem go away; with that patch the system comes
> up just fine.

OK, thanks.  It broke parisc too...

> Now I have weird display problems with my Radeon card instead.  Ever seen X
> running 100% in kernel space, unkillable?

I did, about a year ago.  It was spinning madly in some ioctl waiting for a
bit in a device register to change state.  Are you able to generate a
kernel profile while it's being silly?  That will tell us where it's stuck.

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

* Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
  2004-04-30 18:27 ` Andrew Morton
  2004-04-30 19:29   ` Jonathan Corbet
  2004-04-30 19:33   ` R. J. Wysocki
@ 2004-05-01  1:48   ` Andi Kleen
  2004-05-01  2:01     ` Andrew Morton
  2 siblings, 1 reply; 10+ messages in thread
From: Andi Kleen @ 2004-05-01  1:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Mikael Pettersson, ak, linux-kernel

> Does this fix?
> 
> diff -puN include/asm-x86_64/processor.h~a include/asm-x86_64/processor.h
> --- 25/include/asm-x86_64/processor.h~a	Fri Apr 30 11:24:58 2004
> +++ 25-akpm/include/asm-x86_64/processor.h	Fri Apr 30 11:25:28 2004
> @@ -20,6 +20,8 @@
>  #include <asm/mmsegment.h>
>  #include <linux/personality.h>
>  
> +#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES

16 should be enough actually. The problem is the FXSAVE instruction that 
is used to switch the FPU state, and that only requires 16 byte alignment.

-Andi

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

* Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
  2004-05-01  1:48   ` Andi Kleen
@ 2004-05-01  2:01     ` Andrew Morton
  2004-05-01  2:02       ` Andi Kleen
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2004-05-01  2:01 UTC (permalink / raw)
  To: Andi Kleen; +Cc: mikpe, ak, linux-kernel

Andi Kleen <ak@suse.de> wrote:
>
> > Does this fix?
> > 
> > diff -puN include/asm-x86_64/processor.h~a include/asm-x86_64/processor.h
> > --- 25/include/asm-x86_64/processor.h~a	Fri Apr 30 11:24:58 2004
> > +++ 25-akpm/include/asm-x86_64/processor.h	Fri Apr 30 11:25:28 2004
> > @@ -20,6 +20,8 @@
> >  #include <asm/mmsegment.h>
> >  #include <linux/personality.h>
> >  
> > +#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES
> 
> 16 should be enough actually. The problem is the FXSAVE instruction that 
> is used to switch the FPU state, and that only requires 16 byte alignment.
> 

yup.  I sent Linus the patch which changes the default from 0 to
L1_CACHE_SIZE in kernel/fork.c.  x86_64 can override that by setting
ARCH_MIN_TASKALIGN to 16 in asm/processor.h

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

* Re: [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP
  2004-05-01  2:01     ` Andrew Morton
@ 2004-05-01  2:02       ` Andi Kleen
  0 siblings, 0 replies; 10+ messages in thread
From: Andi Kleen @ 2004-05-01  2:02 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andi Kleen, mikpe, linux-kernel

On Fri, Apr 30, 2004 at 07:01:02PM -0700, Andrew Morton wrote:
> Andi Kleen <ak@suse.de> wrote:
> >
> > > Does this fix?
> > > 
> > > diff -puN include/asm-x86_64/processor.h~a include/asm-x86_64/processor.h
> > > --- 25/include/asm-x86_64/processor.h~a	Fri Apr 30 11:24:58 2004
> > > +++ 25-akpm/include/asm-x86_64/processor.h	Fri Apr 30 11:25:28 2004
> > > @@ -20,6 +20,8 @@
> > >  #include <asm/mmsegment.h>
> > >  #include <linux/personality.h>
> > >  
> > > +#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES
> > 
> > 16 should be enough actually. The problem is the FXSAVE instruction that 
> > is used to switch the FPU state, and that only requires 16 byte alignment.
> > 
> 
> yup.  I sent Linus the patch which changes the default from 0 to
> L1_CACHE_SIZE in kernel/fork.c.  x86_64 can override that by setting
> ARCH_MIN_TASKALIGN to 16 in asm/processor.h

Ok, I will change it in my next patchkit.

For i386 it is the same - 16 should be enough.

-Andi

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

end of thread, other threads:[~2004-05-01  2:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-30 16:11 [BUG] 2.6.6-rc2-bk5 mm/slab.c change broke x86-64 SMP Mikael Pettersson
2004-04-30 18:21 ` Jonathan Corbet
2004-04-30 18:27 ` Andrew Morton
2004-04-30 19:29   ` Jonathan Corbet
2004-04-30 20:31     ` Andrew Morton
2004-04-30 19:33   ` R. J. Wysocki
2004-04-30 20:24     ` Andrew Morton
2004-05-01  1:48   ` Andi Kleen
2004-05-01  2:01     ` Andrew Morton
2004-05-01  2:02       ` Andi Kleen

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

Powered by JetHome