* Problems with stuck spinlocks in 2.2.19 @ 2001-06-18 18:08 Craig Tierney 2001-06-18 18:25 ` Peter Rival 0 siblings, 1 reply; 6+ messages in thread From: Craig Tierney @ 2001-06-18 18:08 UTC (permalink / raw) To: axp-list I am running linux-2.2.19 on a base of Redhat 6.1 on several dual processor UP2000 nodes. Packages that are requred to be upgraded according to the kernel have been. The kernel has been patched to include a few NFS patches for this kernel. I am having problems with the nodes hanging up. I am getting messages like the following: sched.c:28 spinlock stuck in identd at fffffc000032de14(0) owner ps at fffffc0000350cd8(1) read_write.c:41 The messages are not all the same. Once I saw when csh was fighting with csh. I did not record all the messages though. When these messages start to show up on the console, the node never gets unstuck. You cannot rsh into the node. Rebooting is the only way to clear it up. Since these nodes are in a cluster, there are many rsh and ssh processes to the boxes for mpi jobs. My real question is not what is wrong, but how can I debug lock problems like this? The line numbers never seem to correspond to any lines in the source code that are relevant (sometimes #include lines, other times just white space, but not to spinlocks or other SMP mechanisms). Thanks, Craig -- Craig Tierney (ctierney@hpti.com) phone: 303-497-3112 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems with stuck spinlocks in 2.2.19 2001-06-18 18:08 Problems with stuck spinlocks in 2.2.19 Craig Tierney @ 2001-06-18 18:25 ` Peter Rival 2001-06-18 19:11 ` Greg Lindahl 2001-06-18 19:35 ` Craig Tierney 0 siblings, 2 replies; 6+ messages in thread From: Peter Rival @ 2001-06-18 18:25 UTC (permalink / raw) To: axp-list Hi Craig, Your best bet is probably to rebuild your cluster with -fomit-frame-pointer turned off and -g3 added to the compile flags. That way you'll get a full symbol table to work with. From there, you can "gdb vmlinux /proc/kcore" and then "list *0xfffffc000032de14". That will tell you where the spinlock is coming from. Hrm... read_write.c sounds familiar... This is supposed to be just a debugging message, but has been known to cause systems to hang. If you're feeling adventurous, you could always set DEBUG_SPINLOCK to 0 in arch/alpha/kernel/spinlock.c. The real problem, if memory serves, is that I think you're running into a proble with the global kernel lock in the lseek() routine which isn't fixed until the 2.4 series. Sure you can't make that upgrade? I'm doubting it, but thought I'd ask anyway. :) - Pete Craig Tierney wrote: > I am running linux-2.2.19 on a base of Redhat 6.1 on > several dual processor UP2000 nodes. Packages > that are requred to be upgraded according to the kernel > have been. The kernel has been patched to include > a few NFS patches for this kernel. > > I am having problems with the nodes hanging up. > I am getting messages like the following: > > sched.c:28 spinlock stuck in identd at fffffc000032de14(0) owner ps at > fffffc0000350cd8(1) read_write.c:41 > > The messages are not all the same. Once I saw when > csh was fighting with csh. I did not record all > the messages though. > > When these messages start to show up on the console, > the node never gets unstuck. You cannot rsh into > the node. Rebooting is the only way to clear it up. > > Since these nodes are in a cluster, there are many > rsh and ssh processes to the boxes for mpi jobs. > > My real question is not what is wrong, but how can > I debug lock problems like this? The line numbers never > seem to correspond to any lines in the source code > that are relevant (sometimes #include lines, other times > just white space, but not to spinlocks or other SMP > mechanisms). > > Thanks, > Craig > > -- > Craig Tierney (ctierney@hpti.com) > phone: 303-497-3112 > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems with stuck spinlocks in 2.2.19 2001-06-18 18:25 ` Peter Rival @ 2001-06-18 19:11 ` Greg Lindahl 2001-06-18 19:35 ` Craig Tierney 1 sibling, 0 replies; 6+ messages in thread From: Greg Lindahl @ 2001-06-18 19:11 UTC (permalink / raw) To: axp-list On Mon, Jun 18, 2001 at 02:25:32PM -0400, Peter Rival wrote: > The real > problem, if memory serves, is that I think you're running into a proble > with the global kernel lock in the lseek() routine which isn't fixed > until the 2.4 series. Sure you can't make that upgrade? I'm doubting > it, but thought I'd ask anyway. :) Sigh. Can you point out any discussion of this anywhere? No, "upgrade to 2.4" is not a good answer for everyone. -- g ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems with stuck spinlocks in 2.2.19 2001-06-18 18:25 ` Peter Rival 2001-06-18 19:11 ` Greg Lindahl @ 2001-06-18 19:35 ` Craig Tierney 2001-06-18 20:05 ` Peter Rival 2001-06-19 23:07 ` Craig Tierney 1 sibling, 2 replies; 6+ messages in thread From: Craig Tierney @ 2001-06-18 19:35 UTC (permalink / raw) To: axp-list On Mon, Jun 18, 2001 at 02:25:32PM -0400, Peter Rival wrote: > Hi Craig, > > Your best bet is probably to rebuild your cluster with > -fomit-frame-pointer turned off and -g3 added to the compile flags. That > way you'll get a full symbol table to work with. From there, you can > "gdb vmlinux /proc/kcore" and then "list *0xfffffc000032de14". That will > tell you where the spinlock is coming from. Hrm... read_write.c sounds > familiar... > > This is supposed to be just a debugging message, but has been known > to cause systems to hang. If you're feeling adventurous, you could > always set DEBUG_SPINLOCK to 0 in arch/alpha/kernel/spinlock.c. The real > problem, if memory serves, is that I think you're running into a proble > with the global kernel lock in the lseek() routine which isn't fixed > until the 2.4 series. Sure you can't make that upgrade? I'm doubting > it, but thought I'd ask anyway. :) In a perfect world of course. I am rebuild the kernel as you suggested and will try that out. The problem with this is that it takes about 24 hours before we start to see a failure on one of the nodes. I am looking that the source code for read_write.c between 2.4.4 and 2.2.19. It seems that in the llseek routines there are not that many changes. The main difference between the size of a couple of the types (int to long) that the lock_kernel() and unlock kernel calls have been moved from sys_lseek() to llseek(). 2.2.19 version of llseek: static inline loff_t llseek(struct file *file, loff_t offset, int origin) { loff_t (*fn)(struct file *, loff_t, int); fn = default_llseek; if (file->f_op && file->f_op->llseek) fn = file->f_op->llseek; return fn(file, offset, origin); } 2.4.4 version of llseek: static inline loff_t llseek(struct file *file, loff_t offset, int origin) { loff_t (*fn)(struct file *, loff_t, int); loff_t retval; fn = default_llseek; if (file->f_op && file->f_op->llseek) fn = file->f_op->llseek; lock_kernel(); retval = fn(file, offset, origin); unlock_kernel(); return retval; } In sys_lseek in 2.2.19, the lock_kernel() is at the beginning of the function and unlock_kernel() is right at the end. The llseek function is called only from sys_lseek. The code beyond that is no different as far as I can tell. The lock is just a bit more localized. Or were you saying that the global lock has the problem and not how the global lock is called in lseek? Craig > > - Pete > > Craig Tierney wrote: > > > I am running linux-2.2.19 on a base of Redhat 6.1 on > > several dual processor UP2000 nodes. Packages > > that are requred to be upgraded according to the kernel > > have been. The kernel has been patched to include > > a few NFS patches for this kernel. > > > > I am having problems with the nodes hanging up. > > I am getting messages like the following: > > > > sched.c:28 spinlock stuck in identd at fffffc000032de14(0) owner ps at > > fffffc0000350cd8(1) read_write.c:41 > > > > The messages are not all the same. Once I saw when > > csh was fighting with csh. I did not record all > > the messages though. > > > > When these messages start to show up on the console, > > the node never gets unstuck. You cannot rsh into > > the node. Rebooting is the only way to clear it up. > > > > Since these nodes are in a cluster, there are many > > rsh and ssh processes to the boxes for mpi jobs. > > > > My real question is not what is wrong, but how can > > I debug lock problems like this? The line numbers never > > seem to correspond to any lines in the source code > > that are relevant (sometimes #include lines, other times > > just white space, but not to spinlocks or other SMP > > mechanisms). > > > > Thanks, > > Craig > > > > -- > > Craig Tierney (ctierney@hpti.com) > > phone: 303-497-3112 > > > > _______________________________________________ > > Axp-list mailing list > > Axp-list@redhat.com > > https://listman.redhat.com/mailman/listinfo/axp-list > > > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list -- Craig Tierney (ctierney@hpti.com) phone: 303-497-3112 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems with stuck spinlocks in 2.2.19 2001-06-18 19:35 ` Craig Tierney @ 2001-06-18 20:05 ` Peter Rival 2001-06-19 23:07 ` Craig Tierney 1 sibling, 0 replies; 6+ messages in thread From: Peter Rival @ 2001-06-18 20:05 UTC (permalink / raw) To: axp-list Craig Tierney wrote: > On Mon, Jun 18, 2001 at 02:25:32PM -0400, Peter Rival wrote: <snip> > > until the 2.4 series. Sure you can't make that upgrade? I'm doubting > > it, but thought I'd ask anyway. :) > > In a perfect world of course. > I didn't expect you could. One nice thing about my systems not being used for production boxen. :) > > I am rebuild the kernel as you suggested and will try that out. > The problem with this is that it takes about 24 hours before > we start to see a failure on one of the nodes. > I understand that feeling. We have tests that take _days_ sometimes. ;) If you're just rebuilding with the same kernel config, you shouldn't need to reboot - the symbols should pretty much match up with what you have in your running kernel. It's worth a try, anyway... > > I am looking that the source code for read_write.c between > 2.4.4 and 2.2.19. It seems that in the llseek routines there > are not that many changes. The main difference between > the size of a couple of the types (int to long) that the > lock_kernel() and unlock kernel calls have been moved > from sys_lseek() to llseek(). > <snip code detective work> > > In sys_lseek in 2.2.19, the lock_kernel() is at the beginning > of the function and unlock_kernel() is right at the end. The > llseek function is called only from sys_lseek. > > The code beyond that is no different as far as I can tell. The > lock is just a bit more localized. > Right. The difference is not in the llseek() code, but rather in the other users of the global kernel lock. Usually it's not used because it's a good design decision, but because it's easier to get working that way. > > Or were you saying that the global lock has the problem and not > how the global lock is called in lseek? > Both.:) I don't see any _real_ reason to have the global lock held in a filesystem-specific call such as lseek(). Last thing I checked, it doesn't have much to do with networking, or VM, or scheduling, or... The important question is not only who is waiting for the lock, but who is holding it. If you really want to dig into this, get the lockmeter patches from oss.sgi.com/projects/lockmeter. I ported them over to Alpha about a year ago - I'm not positive about the 2.2 patches, but when I did the port I made sure both 2.2 and 2.4 (then 2.3) worked. Patch in, rebuild, reboot and run your load. Somewhere in the middle (I'm assuming the load is somewhat steady-state) run lockmeter for say 5 minutes. The report you get should tell you who is the big culprit for the lock problem you're seeing. I'm hoping that it's in the global kernel lock and that it's in code that you can make some fairly easy changes to. :) Of course, this is quite a bit of work, so I wouldn't blame you for not putting yourself through it. Let me/us know what you come up with in whatever you're able to check out. - Pete ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems with stuck spinlocks in 2.2.19 2001-06-18 19:35 ` Craig Tierney 2001-06-18 20:05 ` Peter Rival @ 2001-06-19 23:07 ` Craig Tierney 1 sibling, 0 replies; 6+ messages in thread From: Craig Tierney @ 2001-06-19 23:07 UTC (permalink / raw) To: axp-list I added debugging to the kernel and this is what I found from the last crash: sched.c:28 spinlock stuck in init at fffffc000032de14(0) owner slocate at fffffc 00003591ec(1) stat.c:41 Then I did: gdb /boot/vmlinux-2.2.19-smp-debug /proc/kcore The first pointer (0xfffffc000032de14) is: 0xfffffc000032de14 is in schedule (/usr/src/linux-2.2.19/include/asm/smplock.h:2 8). 23 * Re-acquire the kernel lock 24 */ 25 static __inline__ void reacquire_kernel_lock(struct task_struct *task) 26 { 27 if (task->lock_depth >= 0) 28 spin_lock(&kernel_flag); 29 } 30 31 /* 32 * Getting the big kernel lock. The second point (0xfffffc00003591ec) is: 0xfffffc00003591ec is in sys_newlstat (/usr/src/linux-2.2.19/include/asm/smplock .h:40). 35 * so we only need to worry about other 36 * CPU's. 37 */ 38 static __inline__ void lock_kernel(void) 39 { 40 if (!++current->lock_depth) 41 spin_lock(&kernel_flag); 42 } 43 44 static __inline__ void unlock_kernel(void) So sys_newlstat takes us back into the filesystem fs/stat.c. The function has a big kernel lock and unlock. So sys_newlstat is trying to lock_kernel(). However, the scheduler feels like trying to reacquire_kernel_lock. I am assuming right now that the pointer to current and task are the same (maybe) at the time of the crash. Question: is the thread of execution in sys_newlstat getting stuck, therefore never releasing the kernel lock and sched.c just happens to be the other thread complaining, or are they both trying to get the kernel lock and getting stuck? I think it is the former. I am tracing down the sys_newlstat command to find any 'real' function that could be doing work and getting hung up for some reason. Craig ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-06-19 23:04 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2001-06-18 18:08 Problems with stuck spinlocks in 2.2.19 Craig Tierney 2001-06-18 18:25 ` Peter Rival 2001-06-18 19:11 ` Greg Lindahl 2001-06-18 19:35 ` Craig Tierney 2001-06-18 20:05 ` Peter Rival 2001-06-19 23:07 ` Craig Tierney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox