Commit 4bd01256 authored by Ingo Molnar's avatar Ingo Molnar Committed by Thomas Gleixner

tasklet: busy loop workaround

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 2b3582fb
...@@ -474,10 +474,8 @@ static inline void tasklet_unlock(struct tasklet_struct *t) ...@@ -474,10 +474,8 @@ static inline void tasklet_unlock(struct tasklet_struct *t)
clear_bit(TASKLET_STATE_RUN, &(t)->state); clear_bit(TASKLET_STATE_RUN, &(t)->state);
} }
static inline void tasklet_unlock_wait(struct tasklet_struct *t) extern void tasklet_unlock_wait(struct tasklet_struct *t);
{
while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
}
#else #else
#define tasklet_trylock(t) 1 #define tasklet_trylock(t) 1
#define tasklet_tryunlock(t) 1 #define tasklet_tryunlock(t) 1
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/delay.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/kthread.h> #include <linux/kthread.h>
...@@ -816,6 +817,25 @@ void __init softirq_init(void) ...@@ -816,6 +817,25 @@ void __init softirq_init(void)
open_softirq(HI_SOFTIRQ, tasklet_hi_action); open_softirq(HI_SOFTIRQ, tasklet_hi_action);
} }
#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)
void tasklet_unlock_wait(struct tasklet_struct *t)
{
while (test_bit(TASKLET_STATE_RUN, &(t)->state)) {
/*
* Hack for now to avoid this busy-loop:
*/
#ifdef CONFIG_PREEMPT_RT
msleep(1);
#else
barrier();
#endif
}
}
EXPORT_SYMBOL(tasklet_unlock_wait);
#endif
static int ksoftirqd(void * __data) static int ksoftirqd(void * __data)
{ {
/* Priority needs to be below hardirqs */ /* Priority needs to be below hardirqs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment