linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.10-mm1 hang
@ 2005-01-19 16:46 Badari Pulavarty
  2005-01-19 21:31 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Badari Pulavarty @ 2005-01-19 16:46 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

Hi Andrew,

I was playing with kexec+kdump and ran into this on 2.6.10-mm1.
I have seen similar behaviour on 2.6.10. 

I am using a 4-way P-III machine. I have a module which tries
gets same spinlock twice. When I try to "insmod" this module,
my system hangs. All my windows froze, no more new logins,
console froze, doesn't respond to sysrq. I wasn't expecting
a system hang. Why ? Ideas ?

Here is the code.

Thanks,
Badari



[-- Attachment #2: test.c --]
[-- Type: text/x-c, Size: 268 bytes --]

#include <linux/init.h>
#include <asm/uaccess.h>
#include <linux/spinlock.h>
spinlock_t mylock = SPIN_LOCK_UNLOCKED;
static int __init panic_init(void)
{
        spin_lock_irq(&mylock);
        spin_lock_irq(&mylock);
       return 1;
}
 
 
module_init(panic_init);



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

* Re: 2.6.10-mm1 hang
  2005-01-19 16:46 2.6.10-mm1 hang Badari Pulavarty
@ 2005-01-19 21:31 ` Andrew Morton
  2005-01-19 22:01   ` linux-os
  2005-01-20 15:26   ` Badari Pulavarty
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2005-01-19 21:31 UTC (permalink / raw)
  To: Badari Pulavarty; +Cc: linux-kernel

Badari Pulavarty <pbadari@us.ibm.com> wrote:
>
> I was playing with kexec+kdump and ran into this on 2.6.10-mm1.
>  I have seen similar behaviour on 2.6.10. 
> 
>  I am using a 4-way P-III machine. I have a module which tries
>  gets same spinlock twice. When I try to "insmod" this module,
>  my system hangs. All my windows froze, no more new logins,
>  console froze, doesn't respond to sysrq. I wasn't expecting
>  a system hang. Why ? Ideas ?
> 

Maybe all the other CPUs are stuck trying to send an IPI to this one?  An
NMI watchdog trace would tell.

>  #include <linux/init.h>
>  #include <asm/uaccess.h>
>  #include <linux/spinlock.h>
>  spinlock_t mylock = SPIN_LOCK_UNLOCKED;
>  static int __init panic_init(void)
>  {
>          spin_lock_irq(&mylock);
>          spin_lock_irq(&mylock);
>         return 1;
>  }

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

* Re: 2.6.10-mm1 hang
  2005-01-19 22:01   ` linux-os
@ 2005-01-19 21:44     ` Badari Pulavarty
  2005-01-19 22:40     ` Robert Love
  1 sibling, 0 replies; 6+ messages in thread
From: Badari Pulavarty @ 2005-01-19 21:44 UTC (permalink / raw)
  To: linux-os; +Cc: Andrew Morton, Linux Kernel Mailing List

On Wed, 2005-01-19 at 14:01, linux-os wrote:
> On Wed, 19 Jan 2005, Andrew Morton wrote:
> 
> > Badari Pulavarty <pbadari@us.ibm.com> wrote:
> >>
> >> I was playing with kexec+kdump and ran into this on 2.6.10-mm1.
> >>  I have seen similar behaviour on 2.6.10.
> >>
> >>  I am using a 4-way P-III machine. I have a module which tries
> >>  gets same spinlock twice. When I try to "insmod" this module,
> >>  my system hangs. All my windows froze, no more new logins,
> >>  console froze, doesn't respond to sysrq. I wasn't expecting
> >>  a system hang. Why ? Ideas ?
> >>
> >
> > Maybe all the other CPUs are stuck trying to send an IPI to this one?  An
> > NMI watchdog trace would tell.
> >
> >>  #include <linux/init.h>
> >>  #include <asm/uaccess.h>
> >>  #include <linux/spinlock.h>
> >>  spinlock_t mylock = SPIN_LOCK_UNLOCKED;
> >>  static int __init panic_init(void)
> >>  {
> >>          spin_lock_irq(&mylock);
> >>          spin_lock_irq(&mylock);
> >>         return 1;
> >>  }
> > -
> 
> What would you expect this to do? After the first lock is
> obtained, the second MUST fail forever or else the spin-lock
> doesn't work. The code, above, just proves that spin-locks
> work!
> 

I was expecting that one CPU will spin for the lock, while
3 other CPUs do real useful work (on 4-proc machine). Instead
my machine is hung - all my windows froze up, no more "ssh",
doesn't respond to sysrq to get traces. Only thing it does is,
respond to "ping".

Thanks,
Badari


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

* Re: 2.6.10-mm1 hang
  2005-01-19 21:31 ` Andrew Morton
@ 2005-01-19 22:01   ` linux-os
  2005-01-19 21:44     ` Badari Pulavarty
  2005-01-19 22:40     ` Robert Love
  2005-01-20 15:26   ` Badari Pulavarty
  1 sibling, 2 replies; 6+ messages in thread
From: linux-os @ 2005-01-19 22:01 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Badari Pulavarty, linux-kernel

On Wed, 19 Jan 2005, Andrew Morton wrote:

> Badari Pulavarty <pbadari@us.ibm.com> wrote:
>>
>> I was playing with kexec+kdump and ran into this on 2.6.10-mm1.
>>  I have seen similar behaviour on 2.6.10.
>>
>>  I am using a 4-way P-III machine. I have a module which tries
>>  gets same spinlock twice. When I try to "insmod" this module,
>>  my system hangs. All my windows froze, no more new logins,
>>  console froze, doesn't respond to sysrq. I wasn't expecting
>>  a system hang. Why ? Ideas ?
>>
>
> Maybe all the other CPUs are stuck trying to send an IPI to this one?  An
> NMI watchdog trace would tell.
>
>>  #include <linux/init.h>
>>  #include <asm/uaccess.h>
>>  #include <linux/spinlock.h>
>>  spinlock_t mylock = SPIN_LOCK_UNLOCKED;
>>  static int __init panic_init(void)
>>  {
>>          spin_lock_irq(&mylock);
>>          spin_lock_irq(&mylock);
>>         return 1;
>>  }
> -

What would you expect this to do? After the first lock is
obtained, the second MUST fail forever or else the spin-lock
doesn't work. The code, above, just proves that spin-locks
work!


Cheers,
Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
                  98.36% of all statistics are fiction.

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

* Re: 2.6.10-mm1 hang
  2005-01-19 22:01   ` linux-os
  2005-01-19 21:44     ` Badari Pulavarty
@ 2005-01-19 22:40     ` Robert Love
  1 sibling, 0 replies; 6+ messages in thread
From: Robert Love @ 2005-01-19 22:40 UTC (permalink / raw)
  To: linux-os; +Cc: Andrew Morton, Badari Pulavarty, linux-kernel

On Wed, 2005-01-19 at 17:01 -0500, linux-os wrote:

> What would you expect this to do? After the first lock is
> obtained, the second MUST fail forever or else the spin-lock
> doesn't work. The code, above, just proves that spin-locks
> work!

He has a four processor machine.  Since the lock is local, it is
somewhat odd that the other three lock up.

	Robert Love



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

* Re: 2.6.10-mm1 hang
  2005-01-19 21:31 ` Andrew Morton
  2005-01-19 22:01   ` linux-os
@ 2005-01-20 15:26   ` Badari Pulavarty
  1 sibling, 0 replies; 6+ messages in thread
From: Badari Pulavarty @ 2005-01-20 15:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List

I see different behaviours on different architectures.

	i386 - machine hang
	Power5 ppc64 - only the process hang
	Power3 ppc64 - machine hang

I modified it to use spin_lock() instead of spin_lock_irq()  -
things are the way I was expecting. Only process hang, not
the system. 

You may be right on other CPUs stuck on IPI.

Thanks,
Badari

On Wed, 2005-01-19 at 13:31, Andrew Morton wrote:
> Badari Pulavarty <pbadari@us.ibm.com> wrote:
> >
> > I was playing with kexec+kdump and ran into this on 2.6.10-mm1.
> >  I have seen similar behaviour on 2.6.10. 
> > 
> >  I am using a 4-way P-III machine. I have a module which tries
> >  gets same spinlock twice. When I try to "insmod" this module,
> >  my system hangs. All my windows froze, no more new logins,
> >  console froze, doesn't respond to sysrq. I wasn't expecting
> >  a system hang. Why ? Ideas ?
> > 
> 
> Maybe all the other CPUs are stuck trying to send an IPI to this one?  An
> NMI watchdog trace would tell.
> 
> >  #include <linux/init.h>
> >  #include <asm/uaccess.h>
> >  #include <linux/spinlock.h>
> >  spinlock_t mylock = SPIN_LOCK_UNLOCKED;
> >  static int __init panic_init(void)
> >  {
> >          spin_lock_irq(&mylock);
> >          spin_lock_irq(&mylock);
> >         return 1;
> >  }
> 


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

end of thread, other threads:[~2005-01-20 15:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-19 16:46 2.6.10-mm1 hang Badari Pulavarty
2005-01-19 21:31 ` Andrew Morton
2005-01-19 22:01   ` linux-os
2005-01-19 21:44     ` Badari Pulavarty
2005-01-19 22:40     ` Robert Love
2005-01-20 15:26   ` Badari Pulavarty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).