Thread (24 messages) flat view 24 messages, 7 authors, 2012-10-14

Re: [regression] boot failure on alpha, bisected

From: Oleg Nesterov <oleg@redhat.com>
Date: 2012-10-08 18:58:38
Also in: lkml
Subsystem: the rest · Maintainer: Linus Torvalds

On 10/07, Al Viro wrote:
On Sun, Oct 07, 2012 at 07:33:36PM +0200, Oleg Nesterov wrote:
quoted
quoted
Um...  There's a bunch of architectures that are in the same situation.
grep for do_notify_resume() and you'll see...
And every do_notify_resume() should be changed anyway, do_signal() and
tracehook_notify_resume() should be re-ordered.
There's a bit more to it.
[...big snip...]
Thanks Al. I need to read your email carefully.

But what do you think we should do right now to fix this particular
bug?

So far I am going to send the patch below. This was always wrong,
even before task_works were added. key_replace_session_keyring()
was might_sleep() too but it also did lock_irq/unlock_irq, so this
was not noticed before.

Or do you think we should add local_irq_enable() into
arch/alpha/kernel/signal.c:do_notify_resume() before
tracehook_notify_resume and wait for other similar report?

Oleg.
---
diff --git a/kernel/task_work.c b/kernel/task_work.c
index 65bd3c9..fd18bd7 100644
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -51,6 +51,10 @@ void task_work_run(void)
 	struct task_struct *task = current;
 	struct callback_head *work, *head, *next;
 
+	if (WARN_ONCE(irqs_disabled(),
+		      "do_notify_resume() with irqs disabled, fix this arch."))
+		local_irq_enable();
+
 	for (;;) {
 		/*
 		 * work->func() can do task_work_add(), do not set
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help