From: Xianghua Xiao on
I would like to have printk output to my ttyS0 console all the time,
with 2.6.33-rt17, after kernel is booted up with all messages shown
normally on the serial port until I login in, from this point on, all
printk messages go to 'dmesg(log_buf)' fine, but I could never get
them shown up on serial console anymore. I tried adjust
/proc/sys/kernel/printk etc none helped.

Switch PREEMPT_RT to PREEMPT_VOLUNTARY and reboot, now everything
works, i.e. I can see printk on my console after I login.

Look at the RT patch itself, I do find some changes to printk itself,
however I'm unsure what is causing this(i.e printk not going to
console after login).

Thanks,
Xianghua
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Xianghua Xiao on
On Tue, May 18, 2010 at 8:13 AM, Xianghua Xiao <xiaoxianghua(a)gmail.com> wrote:
> I would like to have printk output to my ttyS0 console all the time,
> with 2.6.33-rt17, after kernel is booted up with all messages shown
> normally on the serial port until I login in, from this point on, all
> printk messages go to 'dmesg(log_buf)' fine, but I could never get
> them shown up on serial console anymore. I tried adjust
> /proc/sys/kernel/printk etc none helped.
>
> Switch PREEMPT_RT to PREEMPT_VOLUNTARY and reboot, now everything
> works, i.e. I can see printk on my console after I login.
>
> Look at the RT patch itself, I do find some changes to printk itself,
> however I'm unsure what is causing this(i.e printk not going to
> console after login).
>
> Thanks,
> Xianghua
>

Thomas,

I could not get dmesg output to console/serial and
klogd(/var/log/messages) anymore with 2.6.33-rt17 _after_ the kernel
boot is done(on non-RT kernel it works fine). I made below changes it
starts to work again, however I'm unsure how safe the change is.
Please advise.

During googling I found this: http://lkml.org/lkml/2008/1/24/390, fyi.

Thanks a lot!
Xianghua

diff --git a/kernel/printk.c b/kernel/printk.c
index 073d27f..48ef843 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -430,7 +430,6 @@ static void __call_console_drivers(unsigned start,
unsigned end)

for_each_console(con) {
if ((con->flags & CON_ENABLED) && con->write &&
- console_atomic_safe(con) &&
(cpu_online(raw_smp_processor_id()) ||
(con->flags & CON_ANYTIME))) {
set_printk_might_sleep(1);
@@ -1093,9 +1092,6 @@ void release_console_mutex(void)
* printk from non-preemptible sections so this is for the emergency
* case only.
*/
-#ifdef CONFIG_PREEMPT_RT
- if (!in_atomic() && !irqs_disabled())
-#endif
if (wake_klogd)
wake_up_klogd();
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Xianghua Xiao on
On Tue, May 18, 2010 at 2:47 PM, Thomas Gleixner <tglx(a)linutronix.de> wrote:
> On Tue, 18 May 2010, Xianghua Xiao wrote:
>> I could not get dmesg output to console/serial and
>> klogd(/var/log/messages) anymore with 2.6.33-rt17 _after_ the kernel
>> boot is done(on non-RT kernel it works fine). I made below changes it
>> starts to work again, however I'm unsure how safe the change is.
>> Please advise.
>
> Well, obviously it's unsafe if you remove safety checks. And if you
> care to look at the changelog of kernel/printk.c you'll find out why.
>
> Short story: It's introducing nasty latencies.
>
> Use "earlyprintk=serial,ttyS0,115200,keep" if you care, but do not
> complain about the resulting latencies.
>
> Thanks,
>
>        tglx
>

The earlyprintk bootargs did not work...

will try http://lkml.org/lkml/2008/1/24/390 to see if helps on latencies.

While latency is key, we also need klogd to work at least(disabling
output to serial console may be fine), without that hack somehow klogd
did not get invoked and we have nothing logged from the kernel onto
storage device.

Thanks again,
Xianghua
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/