linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org,
	linux-rt-users <linux-rt-users@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Carsten Emde <C.Emde@osadl.org>, John Kacur <jkacur@redhat.com>,
	<stable-rt@vger.kernel.org>
Subject: [PATCH RT 4/6] sched: Check for idle task in might_sleep()
Date: Wed, 06 Feb 2013 16:58:22 -0500	[thread overview]
Message-ID: <20130206215915.514847412@goodmis.org> (raw)
In-Reply-To: 20130206215818.969089606@goodmis.org

[-- Attachment #1: 0004-sched-Check-for-idle-task-in-might_sleep.patch --]
[-- Type: text/plain, Size: 985 bytes --]

From: Thomas Gleixner <tglx@linutronix.de>

Idle is not allowed to call sleeping functions ever!

Cc: stable-rt@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/sched/core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index e979551..751ec60 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7536,7 +7536,8 @@ void __might_sleep(const char *file, int line, int preempt_offset)
 	static unsigned long prev_jiffy;	/* ratelimiting */
 
 	rcu_sleep_check(); /* WARN_ON_ONCE() by default, no rate limit reqd. */
-	if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) ||
+	if ((preempt_count_equals(preempt_offset) && !irqs_disabled() &&
+	     !is_idle_task(current)) ||
 	    system_state != SYSTEM_RUNNING || oops_in_progress)
 		return;
 	if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
-- 
1.7.10.4



  parent reply	other threads:[~2013-02-06 21:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 21:58 [PATCH RT 0/6] [ANNOUNCE] 3.4.29-rt42-rc1 stable review Steven Rostedt
2013-02-06 21:58 ` [PATCH RT 1/6] drivers-tty-pl011-irq-disable-madness.patch Steven Rostedt
2013-02-06 21:58 ` [PATCH RT 2/6] mmci: Remove bogus local_irq_save() Steven Rostedt
2013-02-06 21:58 ` [PATCH RT 3/6] sched: Init idle->on_rq in init_idle() Steven Rostedt
2013-02-06 21:58 ` Steven Rostedt [this message]
2013-02-06 21:58 ` [PATCH RT 5/6] mm: swap: Initialize local locks early Steven Rostedt
2013-02-06 21:58 ` [PATCH RT 6/6] Linux 3.4.29-rt42-rc1 Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2013-02-06 22:02 [PATCH RT 0/6] [ANNOUNCE] 3.2.38-rt57-rc1 stable review Steven Rostedt
2013-02-06 22:02 ` [PATCH RT 4/6] sched: Check for idle task in might_sleep() Steven Rostedt

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=20130206215915.514847412@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=C.Emde@osadl.org \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=stable-rt@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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).