Re: [PATCH 01/20 -v5] printk - dont wakeup klogd with interrupts disabled

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Daniel Walker <dwalker@...>
Cc: LKML <linux-kernel@...>, Ingo Molnar <mingo@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, Peter Zijlstra <a.p.zijlstra@...>, Christoph Hellwig <hch@...>, Mathieu Desnoyers <mathieu.desnoyers@...>, Gregory Haskins <ghaskins@...>, Arnaldo Carvalho de Melo <acme@...>, Thomas Gleixner <tglx@...>, Tim Bird <tim.bird@...>, Sam Ravnborg <sam@...>, Frank Ch. Eigler <fche@...>, Jan Kiszka <jan.kiszka@...>, John Stultz <johnstul@...>, Arjan van de Ven <arjan@...>, Steven Rostedt <srostedt@...>
Date: Wednesday, January 23, 2008 - 1:27 pm

On Wed, 23 Jan 2008, Daniel Walker wrote:


It wont get woken up anyway. Did you look at wake_up_klogd?

void wake_up_klogd(void)
{
	if (!oops_in_progress && waitqueue_active(&log_wait))
		wake_up_interruptible(&log_wait);
}


So if oops_in_progress is set, then it still wont get woken. Perhaps it
got woken some other way? Or is oops_in_progress not set in these oops?

One other solution is to make the runqueue locks visible externally. Like:

in sched.c:

int runqueue_is_locked(void)
{
	int cpu = get_cpu();
	struct rq *rq = cpu_rq(cpu);
	int ret;

	ret = spin_is_locked(&rq->lock);
	put_cpu();
	return ret;
}

And in printk we could do:

	if (wake_klogd && !runqueue_is_locked())
		wake_up_klogd();

This probably is the cleanest solution since it simply prevents the
deadlock from occurring.

-- Steve

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

Messages in current thread:
Re: [PATCH 01/20 -v5] printk - dont wakeup klogd with interr..., Mathieu Desnoyers, (Wed Jan 23, 1:25 pm)
Re: [PATCH 01/20 -v5] printk - dont wakeup klogd with interr..., Steven Rostedt, (Wed Jan 23, 1:27 pm)
[PATCH] defer printks in irqs, Tim Bird, (Thu Jan 24, 6:42 pm)
Re: [PATCH] defer printks in irqs, Peter Zijlstra, (Thu Jan 24, 6:48 pm)
Re: [PATCH] defer printks in irqs, Tim Bird, (Thu Jan 24, 7:23 pm)
Re: [PATCH] defer printks in irqs, Andrew Morton, (Sun Jan 27, 2:01 am)
Re: [PATCH] defer printks in irqs, Tim Bird, (Mon Jan 28, 5:14 pm)
Re: [PATCH 01/20 -v5] printk - dont wakeup klogd with interr..., Mathieu Desnoyers, (Wed Jan 23, 1:32 pm)