Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1206023
| From | Peter Hurley <peter@hurleysoftware.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] printk: rebalance printk |
| Date | 2015-08-12 14:40 +0200 |
| Message-ID | <pWDu2-4ta-29@gated-at.bofh.it> (permalink) |
| References | <pWfUK-3Em-17@gated-at.bofh.it> <pWmjw-4EE-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 08/11/2015 02:16 PM, Greg Kroah-Hartman wrote:
> On Tue, Aug 11, 2015 at 07:23:01PM +0800, Pan Xinhui wrote:
>> From: Pan Xinhui <xinhuix.pan@intel.com>
>>
>> printk can be called in any context, It's very useful to output debug
>> info.
>>
>> But it might cause very bad issues on some special cases. For example,
>> some driver hit errors, and it dumps many messages like reg values, etc.
>>
>> Sometimes, printk is called when irqs disabled. This is OKay if there is
>> a few messages. But What would happen if many messages outputted by other
>> drivers at same time.
>>
>> Here is the scenario.
>> CPUA CPUB
>> local_irq_save(flags);
>> printk()
>> while(..) { --> console_unlock
>> printk(...);
>> //hundreds or thousands loops
>> } //all messages flushed out to consoles
>> local_irq_restore(flags);
>>
>
> Where are you seeing this type of scenario "in the wild"? Or is this
> just a "debug/bringup hardware" issue?
There have been problem reports of big machines getting soft-lockup/RCU stall
warnings with serial console attached. I think SLES is carrying patches
from Jan Kara to try to workaround this issue.
> We shouldn't be ever stuck in a
> printk that prints hundreds or thousands of loops, if so, we need to fix
> the kernel code that does that, as we do have control over this.
The loop referred to here is the loop in console_unlock(). Essentially
what happens is one cpu can get trapped in the console_unlock() output
loop; printk()'s from other cpus are only appending to the logbuf since
they can't acquire the console_lock (which is owned by the one cpu trapped
in the output loop).
Regards,
Peter Hurley
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] printk: rebalance printk Pan Xinhui <xinhuix.pan@intel.com> - 2015-08-11 13:30 +0200
Re: [PATCH] printk: rebalance printk Pan Xinhui <xinhuix.pan@intel.com> - 2015-08-11 13:40 +0200
Re: [PATCH] printk: rebalance printk Peter Hurley <peter@hurleysoftware.com> - 2015-08-11 14:10 +0200
Re: [PATCH] printk: rebalance printk Pan Xinhui <xinhuix.pan@intel.com> - 2015-08-12 03:40 +0200
Re: [PATCH] printk: rebalance printk Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-08-11 20:20 +0200
Re: [PATCH] printk: rebalance printk Pan Xinhui <xinhuix.pan@intel.com> - 2015-08-12 04:00 +0200
Re: [PATCH] printk: rebalance printk Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-08-12 04:10 +0200
Re: [PATCH] printk: rebalance printk Pan Xinhui <xinhuix.pan@intel.com> - 2015-08-12 04:30 +0200
Re: [PATCH] printk: rebalance printk Peter Hurley <peter@hurleysoftware.com> - 2015-08-12 14:40 +0200
Re: [PATCH] printk: rebalance printk Pan Xinhui <xinhuix.pan@intel.com> - 2015-08-13 04:20 +0200
csiph-web