timer: do not spin_trylock() on UP

This will void a warning comming from the spin-lock debugging code. The
lock avoiding idea is from Steven Rostedt.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
This commit is contained in:
Sebastian Andrzej Siewior 2014-05-02 21:31:50 +02:00 committed by Alibek Omarov
parent 493d266dbd
commit 4ddcb3378a
1 changed files with 13 additions and 0 deletions

View File

@ -1457,6 +1457,19 @@ void run_local_timers(void)
* the timer softirq.
*/
#ifdef CONFIG_PREEMPT_RT_FULL
#ifndef CONFIG_SMP
/*
* The spin_do_trylock() later may fail as the lock may be hold before
* the interrupt arrived. The spin-lock debugging code will raise a
* warning if the try_lock fails on UP. Since this is only an
* optimization for the FULL_NO_HZ case (not to run the timer softirq on
* an nohz_full CPU) we don't really care and shedule the softirq.
*/
raise_softirq(TIMER_SOFTIRQ);
return;
#endif
/* On RT, irq work runs from softirq */
if (irq_work_needs_cpu()) {
raise_softirq(TIMER_SOFTIRQ);