linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] pm_qos_requirement might sleep
@ 2008-08-04 20:52 John Kacur
  2008-08-05  7:25 ` Peter Zijlstra
  0 siblings, 1 reply; 22+ messages in thread
From: John Kacur @ 2008-08-04 20:52 UTC (permalink / raw)
  To: LKML, rt-users
  Cc: Steven Rostedt, Ingo Molnar, Thomas Gleixner, Peter Zijlstra

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

Even after applying some fixes posted by Chirag and Peter Z, I'm still
getting some messages in my log like this
BUG: sleeping function called from invalid context swapper(0) at
kernel/rtmutex.c:743
in_atomic():1 [00000001], irqs_disabled():1
Pid: 0, comm: swapper Tainted: G        W 2.6.26.1-rt1.jk #2

Call Trace:
 [<ffffffff802305d3>] __might_sleep+0x12d/0x132
 [<ffffffff8046cdbe>] __rt_spin_lock+0x34/0x7d
 [<ffffffff8046ce15>] rt_spin_lock+0xe/0x10
 [<ffffffff802532e5>] pm_qos_requirement+0x1f/0x3c
 [<ffffffff803e1b7f>] menu_select+0x7b/0x9c
 [<ffffffff8020b1be>] ? default_idle+0x0/0x5a
 [<ffffffff8020b1be>] ? default_idle+0x0/0x5a
 [<ffffffff803e0b4b>] cpuidle_idle_call+0x68/0xd8
 [<ffffffff803e0ae3>] ? cpuidle_idle_call+0x0/0xd8
 [<ffffffff8020b1be>] ? default_idle+0x0/0x5a
 [<ffffffff8020b333>] cpu_idle+0xb2/0x12d
 [<ffffffff80466af0>] start_secondary+0x186/0x18b

---------------------------
| preempt count: 00000001 ]
| 1-level deep critical section nesting:
----------------------------------------
.. [<ffffffff8020b39c>] .... cpu_idle+0x11b/0x12d
.....[<ffffffff80466af0>] ..   ( <= start_secondary+0x186/0x18b)

The following simple patch makes the messages disappear - however,
there may be a better more fine grained solution, but the problem is
also that all the functions are designed to use the same lock.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pm_qos_requirement.patch --]
[-- Type: text/x-patch; name=pm_qos_requirement.patch, Size: 588 bytes --]

pm_qos_requirement-fix
Signed-off-by: John Kacur <jkacur at gmail dot com>

Index: linux-2.6.26.1-jk-rt1/kernel/pm_qos_params.c
===================================================================
--- linux-2.6.26.1-jk-rt1.orig/kernel/pm_qos_params.c
+++ linux-2.6.26.1-jk-rt1/kernel/pm_qos_params.c
@@ -110,7 +110,7 @@ static struct pm_qos_object *pm_qos_arra
 	&network_throughput_pm_qos
 };
 
-static DEFINE_SPINLOCK(pm_qos_lock);
+static DEFINE_RAW_SPINLOCK(pm_qos_lock);
 
 static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
 		size_t count, loff_t *f_pos);

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2008-08-29 14:29 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-04 20:52 [PATCH RFC] pm_qos_requirement might sleep John Kacur
2008-08-05  7:25 ` Peter Zijlstra
2008-08-05 20:49   ` mark gross
2008-08-05 21:09     ` Peter Zijlstra
2008-08-05 22:18       ` John Kacur
2008-08-11 13:25         ` John Kacur
2008-08-12 22:49         ` mark gross
2008-08-13  8:24           ` John Kacur
2008-08-14 15:52             ` mark gross
2008-08-14 17:48               ` Peter Zijlstra
2008-08-14 22:51                 ` John Kacur
2008-08-20 19:14                   ` mark gross
2008-08-25 16:34                   ` mark gross
2008-08-25 16:35                     ` Peter Zijlstra
2008-08-26  8:48                       ` John Kacur
2008-08-26 16:18                         ` mark gross
2008-08-26 17:45                           ` John Kacur
2008-08-28 19:38                             ` mark gross
2008-08-28 19:44                             ` mark gross
2008-08-29  0:32                               ` Andrew Morton
2008-08-29  6:31                                 ` John Kacur
2008-08-29 14:29                                   ` Steven Rostedt

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