Re: IRQ off latency of printk is very high

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Tim Bird
Date: Thursday, October 25, 2007 - 2:15 pm

Matt Mackall wrote:

Whether the actual output uses polled I/O doesn't seem to matter.
release_console_sem() (which is where the chars drain out)
used to be called with interrupts enabled (up to at about v. 2.6.17).

While the cpu is in the printk code itself any submitted printks will go
to the log buffer.  It's the draining that's running with
ints off.


Ingo moved the irq_restore to below the release_console_sem()
call, with this commit: a0f1ccfd8d...  Up until then it had
been before the call to release_console_sem.

Here's the code before Ingo's change:
		printk_cpu = UINT_MAX;
		spin_unlock_irqrestore(&logbuf_lock, flags);

		/*
		 * Console drivers may assume that per-cpu resources have
		 * been allocated. So unless they're explicitly marked as
		 * being able to cope (CON_ANYTIME) don't call them until
		 * this CPU is officially up.
		 */
		if (cpu_online(smp_processor_id()) || have_callable_console()) {
			console_may_schedule = 0;
			release_console_sem();
		} else {
			/* Release by hand to avoid flushing the buffer. */
			console_locked = 0;
			up(&console_sem);
		}

And here's the code after:
		printk_cpu = UINT_MAX;
		spin_unlock(&logbuf_lock);

		/*
		 * Console drivers may assume that per-cpu resources have
		 * been allocated. So unless they're explicitly marked as
		 * being able to cope (CON_ANYTIME) don't call them until
		 * this CPU is officially up.
		 */
		if (cpu_online(smp_processor_id()) || have_callable_console()) {
			console_may_schedule = 0;
			release_console_sem();
		} else {
			/* Release by hand to avoid flushing the buffer. */
			console_locked = 0;
			up(&console_sem);
		}
		lockdep_on();
		local_irq_restore(flags);

In even earlier versions of the kernel, the irqrestore was just before
the call to release_console_sem().

I'm just trying to see if the irq_restore can be moved back
where it was, or if there's more going on.
 -- Tim



=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Corporation of America
=============================

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
IRQ off latency of printk is very high, Tim Bird, (Thu Oct 25, 12:44 pm)
Re: IRQ off latency of printk is very high, Matt Mackall, (Thu Oct 25, 1:19 pm)
Re: IRQ off latency of printk is very high, Tim Bird, (Thu Oct 25, 2:15 pm)
Re: IRQ off latency of printk is very high, Mathieu Desnoyers, (Thu Oct 25, 3:28 pm)
Re: IRQ off latency of printk is very high, Tim Bird, (Thu Oct 25, 3:52 pm)
Re: IRQ off latency of printk is very high, Matt Mackall, (Thu Oct 25, 4:12 pm)
Re: IRQ off latency of printk is very high, Tim Bird, (Thu Oct 25, 4:41 pm)
Re: IRQ off latency of printk is very high, Matt Mackall, (Thu Oct 25, 6:23 pm)
Re: IRQ off latency of printk is very high, Pavel Machek, (Mon Oct 29, 11:54 am)
Re: IRQ off latency of printk is very high, Mathieu Desnoyers, (Thu Nov 1, 8:27 am)
Re: IRQ off latency of printk is very high, Pavel Machek, (Thu Nov 1, 2:11 pm)
Re: IRQ off latency of printk is very high, Mathieu Desnoyers, (Thu Nov 1, 3:19 pm)