linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* migh_sleep during early boot
@ 2003-10-18 23:01 Manfred Spraul
  0 siblings, 0 replies; only message in thread
From: Manfred Spraul @ 2003-10-18 23:01 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

Hi,

With might_sleep reports several calls from invalid contexts during 
early boot:

First some calls due to irq off, preempt off: This are the first stages 
of start_kernel, irqs are not yet enabled.
Then calls with only preemption off: The kernel runs on the future idle 
thread, and these threads have preempt_count==1.

Attached is a patch that fixes the latter bug: ignore the preemption 
counter for the idle threads. I haven't figured out how to identify the 
calls before the first local_irq_enable().

--
    Manfred



[-- Attachment #2: patch-might_sleep_2 --]
[-- Type: text/plain, Size: 421 bytes --]

--- 2.6/kernel/sched.c	2003-10-18 21:17:11.000000000 +0200
+++ build-2.6/kernel/sched.c	2003-10-19 00:49:03.000000000 +0200
@@ -2848,7 +2848,7 @@
 #if defined(in_atomic)
 	static unsigned long prev_jiffy;	/* ratelimiting */
 
-	if (in_atomic() || irqs_disabled()) {
+	if ((in_atomic() && current->pid) || irqs_disabled()) {
 		if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
 			return;
 		prev_jiffy = jiffies;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-18 23:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-18 23:01 migh_sleep during early boot Manfred Spraul

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).