linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: linux-rt-users@vger.kernel.org,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: Re: [PATCH v2 2/2] mce: don't try to wake thread before it exists.
Date: Fri, 6 Mar 2015 22:12:22 +0100	[thread overview]
Message-ID: <20150306211222.GI10155@linutronix.de> (raw)
In-Reply-To: <20150306210127.GH10155@linutronix.de>

* Sebastian Andrzej Siewior | 2015-03-06 22:01:27 [+0100]:

>We only miss a printk. The userland helper is not yet ready and we won't
>anyone one waiting on the wait queue. So it should be enough to simply
>check if the swait is ready.

So this should be enough and I fold this in you #1 patch. And now I see
that swork_queue() might be called from hardirq context so it needs irqs
off. I fix that one, too. But after that we should be good to go.

--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1385,6 +1385,7 @@ static void __mce_notify_work(struct swo
 }
 
 #ifdef CONFIG_PREEMPT_RT_FULL
+static bool notify_work_ready __read_mostly;
 static struct swork_event notify_work;
 
 static int mce_notify_work_init(void)
@@ -1396,12 +1397,14 @@ static int mce_notify_work_init(void)
 		return err;
 
 	INIT_SWORK(&notify_work, __mce_notify_work);
+	notify_work_ready = true;
 	return 0;
 }
 
 static void mce_notify_work(void)
 {
-	swork_queue(&notify_work);
+	if (notify_work_ready)
+		swork_queue(&notify_work);
 }
 #else
 static void mce_notify_work(void)

Sebastian

  reply	other threads:[~2015-03-06 21:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 14:20 [PATCH v2 0/2] mce patches rebased on simple work queue Daniel Wagner
2015-02-27 14:20 ` [PATCH v2 1/2] x86/mce: Defer mce wakeups to threads for PREEMPT_RT Daniel Wagner
2015-02-27 14:20 ` [PATCH v2 2/2] mce: don't try to wake thread before it exists Daniel Wagner
2015-03-06 21:01   ` Sebastian Andrzej Siewior
2015-03-06 21:12     ` Sebastian Andrzej Siewior [this message]
2015-03-09  6:47       ` Daniel Wagner
2015-03-09  6:38     ` Daniel Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150306211222.GI10155@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=daniel.wagner@bmw-carit.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).