Subject: rcutiny: Use simple waitqueue From: Thomas Gleixner Date: Mon, 03 Dec 2012 16:25:21 +0100 Simple waitqueues can be handled from interrupt disabled contexts. Signed-off-by: Thomas Gleixner --- kernel/rcutiny_plugin.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) Index: linux-stable/kernel/rcutiny_plugin.h =================================================================== --- linux-stable.orig/kernel/rcutiny_plugin.h +++ linux-stable/kernel/rcutiny_plugin.h @@ -26,6 +26,7 @@ #include #include #include +#include /* Global control variables for rcupdate callback mechanism. */ struct rcu_ctrlblk { @@ -260,7 +261,7 @@ static void show_tiny_preempt_stats(stru /* Controls for rcu_kthread() kthread. */ static struct task_struct *rcu_kthread_task; -static DECLARE_WAIT_QUEUE_HEAD(rcu_kthread_wq); +static DEFINE_SWAIT_HEAD(rcu_kthread_wq); static unsigned long have_rcu_kthread_work; /* @@ -710,7 +711,7 @@ void synchronize_rcu(void) } EXPORT_SYMBOL_GPL(synchronize_rcu); -static DECLARE_WAIT_QUEUE_HEAD(sync_rcu_preempt_exp_wq); +static DEFINE_SWAIT_HEAD(sync_rcu_preempt_exp_wq); static unsigned long sync_rcu_preempt_exp_count; static DEFINE_MUTEX(sync_rcu_preempt_exp_mutex); @@ -732,7 +733,7 @@ static int rcu_preempted_readers_exp(voi */ static void rcu_report_exp_done(void) { - wake_up(&sync_rcu_preempt_exp_wq); + swait_wake(&sync_rcu_preempt_exp_wq); } /* @@ -784,8 +785,8 @@ void synchronize_rcu_expedited(void) } else { rcu_initiate_boost(); local_irq_restore(flags); - wait_event(sync_rcu_preempt_exp_wq, - !rcu_preempted_readers_exp()); + swait_event(sync_rcu_preempt_exp_wq, + !rcu_preempted_readers_exp()); } /* Clean up and exit. */ @@ -855,7 +856,7 @@ static void invoke_rcu_callbacks(void) { have_rcu_kthread_work = 1; if (rcu_kthread_task != NULL) - wake_up(&rcu_kthread_wq); + swait_wake(&rcu_kthread_wq); } #ifdef CONFIG_RCU_TRACE @@ -885,8 +886,8 @@ static int rcu_kthread(void *arg) unsigned long flags; for (;;) { - wait_event_interruptible(rcu_kthread_wq, - have_rcu_kthread_work != 0); + swait_event_interruptible(rcu_kthread_wq, + have_rcu_kthread_work != 0); morework = rcu_boost(); local_irq_save(flags); work = have_rcu_kthread_work;