From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Andrzej Siewior Subject: Re: [PATCH RT v2] x86/mce: Defer mce wakeups to threads for PREEMPT_RT Date: Fri, 26 Apr 2013 10:22:35 +0200 Message-ID: <20130426082235.GA20927@linutronix.de> References: <1365705214.9609.58.camel@gandalf.local.home> <20130425164441.GG5561@linutronix.de> <1366909777.10248.17.camel@gandalf.local.home> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: LKML , RT , Thomas Gleixner , Clark Williams , John Kacur , Tony Luck , Borislav Petkov , Mauro Carvalho Chehab , Ingo Molnar , "H. Peter Anvin" To: Steven Rostedt Return-path: Received: from www.linutronix.de ([62.245.132.108]:47536 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752229Ab3DZIWi (ORCPT ); Fri, 26 Apr 2013 04:22:38 -0400 Content-Disposition: inline In-Reply-To: <1366909777.10248.17.camel@gandalf.local.home> Sender: linux-rt-users-owner@vger.kernel.org List-ID: * Steven Rostedt | 2013-04-25 13:09:37 [-0400]: >Thanks, I didn't look hard at the warnings. Now that I booted the kernel I see this |INFO: task mce-notify:78 blocked for more than 120 seconds. |"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. |mce-notify D 00000086 0 78 2 0x00000000 | f2e1bf2c 00000096 f2e1bebc 00000086 f2e1becc c1466606 f3440000 00000001 | c1689000 c106dd0a f2cdddf0 f3471f50 00000000 c1690f00 00000007 00000006 | c146662d f2cdddf0 00000282 00000001 f3449ef8 00000282 f2e1bf10 c106b67d |Call Trace: | [] ? _raw_spin_unlock_irqrestore+0x36/0x70 | [] ? try_to_wake_up+0x5a/0x260 | [] ? _raw_spin_unlock_irqrestore+0x5d/0x70 | [] ? sub_preempt_count+0x4d/0xb0 | [] ? _raw_spin_unlock_irqrestore+0x36/0x70 | [] ? set_bank+0x50/0x50 | [] schedule+0x1e/0x50 | [] kthread+0x67/0x90 | [] ? _raw_spin_unlock_irq+0x22/0x60 | [] ret_from_kernel_thread+0x1b/0x28 | [] ? __init_kthread_worker+0x80/0x80 |no locks held by mce-notify/78. because the new thread is still TASK_UNINTERRUPTIBLE and nobody wakes it up. So I did this: diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index c2d6dc7..332e133 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -1371,17 +1371,19 @@ struct task_struct *mce_notify_helper; static int mce_notify_helper_thread(void *unused) { - while (!kthread_should_stop()) { - __mce_notify_work(); + while (1) { set_current_state(TASK_INTERRUPTIBLE); schedule(); + if (kthread_should_stop()) + break; + __mce_notify_work(); } return 0; } static int mce_notify_work_init(void) { - mce_notify_helper = kthread_create(mce_notify_helper_thread, NULL, + mce_notify_helper = kthread_run(mce_notify_helper_thread, NULL, "mce-notify"); if (!mce_notify_helper) return -ENOMEM; > >-- Steve Sebastian