Bug 229274

Summary: RHEL-3 kernel can hang while doing Sysrq on the keyboard during heavy network traffic
Product: Red Hat Enterprise Linux 3 Reporter: Chris Lalancette <clalance>
Component: kernelAssignee: Red Hat Kernel Manager <kernel-mgr>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.8CC: jmoyer
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-19 18:38:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Debugging netconsole patch none

Description Chris Lalancette 2007-02-19 21:18:43 UTC
Description of problem:
The RHEL-3 kernel can hang while doing a Sysrq-? on the keyboard, while there is
heavy network traffic.  Here is how to reproduce

1)  Boot a single processor system with the SMP kernel (or, alternatively, boot
with maxcpus=1)
1)  ping flood from 2 (or more) separate boxes to your victim machine
2)  enable sysrq on the machine (echo 1 > /proc/sys/kernel/sysrq)
3)  Press Alt-Sysrq-t repeatedly

And watch the box spin forever.

What happens is that we take the dev->xmit_lock in softirq context, to process
the incoming/outgoing network packets.  However, interrupts are *not* disabled
during this time.  So if you hit the Sysrq sequence while it is holding the
dev->xmit_lock, printk will be fired, which will lead to the
write_netconsole_msg() function in drivers/net/netconsole.c, which also tries to
take dev->xmit_lock, and we deadlock.

     Jeff suggested that in write_netconsole_msg() we could do a spin_trylock()
and a check for xmit_owner != current_cpu, and if we don't get the lock (because
someone else is already holding it), we just drop the current packet.

Comment 1 Chris Lalancette 2007-02-19 21:32:08 UTC
Created attachment 148369 [details]
Debugging netconsole patch

For the morbidly curious, this is the patch used to show what happens when you
get into this situation.

Comment 2 RHEL Program Management 2007-10-19 18:38:35 UTC
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
 
For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/
 
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.