From: Thomas Gleixner <tglx@linutronix.de>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Rob Herring <rob.herring@calxeda.com>,
linux-rt-users <linux-rt-users@vger.kernel.org>,
Gregoire Gentil <gregoire@gentil.com>
Subject: Re: cpufreq + PREEMPT_RT_FULL give bad context sleeping BUG
Date: Tue, 26 Mar 2013 22:07:45 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.02.1303262203560.22263@ionos> (raw)
In-Reply-To: <20130326205107.GB14220@linutronix.de>
On Tue, 26 Mar 2013, Sebastian Andrzej Siewior wrote:
> * Gregoire Gentil | 2013-03-23 10:17:51 [-0700]:
>
> >Hello,
> Hi,
>
> >On OMAP + 3.4 + rt patches with CONFIG_PREEMPT_RT_FULL
> >CONFIG_CPU_FREQ_GOV_ONDEMAND, I get a lot of those cpufreq-related
> >bugs:
> >
> >http://pastebin.com/csy9y3xk
> >
> >BUG: sleeping function called from invalid context at kernel/rtmutex.c:646
> >(__might_sleep+0x124/0x144) from (rt_spin_lock+0x30/0x64)
> >(rt_spin_lock+0x30/0x64) from (clk_get_rate+0x30/0x54)
> >(clk_get_rate+0x30/0x54) from (twd_update_frequency+0x20/0x58)
>
> Here it tries to grab a mutex
>
> >(twd_update_frequency+0x20/0x58) from (smp_call_function_single+0xd0/0x1c4)
> >(smp_call_function_single+0xd0/0x1c4) from
>
> Here it calls a smp functions which runs with interupts off.
>
> >(twd_cpufreq_transition+0x34/0x40)
>
> that means it should trigger on mainline as well.
No. It won't. Mainline uses a spinlock which gets converted to a
sleeping spinlock on rt.
(rt_spin_lock+0x30/0x64) from (clk_get_rate+0x30/0x54)
> >Any idea what I should do to fix this problem?
One possibility would be to convert the clk->spinlock to a raw
spinlock, but you have to audit the code which implications this has
latency wise. In theory the code under the spinlock should not do
anything time consuming, so it should be fine. If it does something
time consuming, we better fix that anyway.
Thanks,
tglx
next prev parent reply other threads:[~2013-03-26 21:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 22:10 [ANNOUNCE] 3.8.4-rt1 Thomas Gleixner
2013-03-23 1:30 ` Luis Claudio R. Goncalves
2013-03-23 17:17 ` cpufreq + PREEMPT_RT_FULL give bad context sleeping BUG Gregoire Gentil
2013-03-26 20:51 ` Sebastian Andrzej Siewior
2013-03-26 21:07 ` Thomas Gleixner [this message]
2013-03-26 21:33 ` Sebastian Andrzej Siewior
2013-03-26 21:38 ` Thomas Gleixner
2013-03-26 21:44 ` Thomas Gleixner
2013-03-27 15:23 ` Gregoire Gentil
2013-04-25 15:23 ` Sebastian Andrzej Siewior
2013-03-23 18:38 ` [ANNOUNCE] 3.8.4-rt1 Sebastian Andrzej Siewior
2013-03-24 1:15 ` Luis Claudio R. Goncalves
2013-03-23 3:31 ` Luis Claudio R. Goncalves
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=alpine.LFD.2.02.1303262203560.22263@ionos \
--to=tglx@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=gregoire@gentil.com \
--cc=linus.walleij@linaro.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=santosh.shilimkar@ti.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).