diff options
author | Clark Williams <williams@redhat.com> | 2016-02-23 08:50:36 -0600 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2016-02-23 08:57:42 -0600 |
commit | 713bea873d31168d512e1ff8275ea5cdedb1e4b5 (patch) | |
tree | e14d550d21dd3bd88352f73ebe5e6e1363dce2fe | |
parent | 5431e0a187b67044a541e6dd32d87d6dec1e9171 (diff) | |
download | rt-linux-713bea873d31168d512e1ff8275ea5cdedb1e4b5.tar.gz |
swork: move simple workqueues to swork and adapt to latest swait changes
Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r-- | include/linux/completion.h | 10 | ||||
-rw-r--r-- | include/linux/swork.h (renamed from include/linux/work-simple.h) | 0 | ||||
-rw-r--r-- | kernel/sched/Makefile | 2 | ||||
-rw-r--r-- | kernel/sched/completion.c | 10 | ||||
-rw-r--r-- | kernel/sched/swork.c (renamed from kernel/sched/work-simple.c) | 10 |
5 files changed, 16 insertions, 16 deletions
diff --git a/include/linux/completion.h b/include/linux/completion.h index 3fe8d14c98c06b..4b1b46b78b9807 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -7,7 +7,7 @@ * Atomic wait-for-completion handler data structures. * See kernel/sched/completion.c for details. */ -#include <linux/wait-simple.h> +#include <linux/swait.h> /* * struct completion - structure used to maintain state for a "completion" @@ -23,11 +23,11 @@ */ struct completion { unsigned int done; - struct swait_head wait; + struct swait_queue_head wait; }; #define COMPLETION_INITIALIZER(work) \ - { 0, SWAIT_HEAD_INITIALIZER((work).wait) } + { 0, __SWAIT_QUEUE_HEAD_INITIALIZER((work).wait) } #define COMPLETION_INITIALIZER_ONSTACK(work) \ ({ init_completion(&work); work; }) @@ -72,11 +72,11 @@ struct completion { static inline void init_completion(struct completion *x) { x->done = 0; - init_swait_head(&x->wait); + init_swait_queue_head(&x->wait); } /** - * reinit_completion - reinitialize a completion structure +* reinit_completion - reinitialize a completion structure * @x: pointer to completion structure that is to be reinitialized * * This inline function should be used to reinitialize a completion structure so it can diff --git a/include/linux/work-simple.h b/include/linux/swork.h index f175fa9a60169f..f175fa9a60169f 100644 --- a/include/linux/work-simple.h +++ b/include/linux/swork.h diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile index debedbee5692ee..01b9994b367afd 100644 --- a/kernel/sched/Makefile +++ b/kernel/sched/Makefile @@ -13,7 +13,7 @@ endif obj-y += core.o loadavg.o clock.o cputime.o obj-y += idle_task.o fair.o rt.o deadline.o stop_task.o -obj-y += wait.o swait.o work-simple.o completion.o idle.o +obj-y += wait.o swait.o swork.o completion.o idle.o obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o obj-$(CONFIG_SCHEDSTATS) += stats.o diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c index 45ebcffd9feb08..b020159888e8a1 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -32,7 +32,7 @@ void complete(struct completion *x) raw_spin_lock_irqsave(&x->wait.lock, flags); x->done++; - __swait_wake_locked(&x->wait, TASK_NORMAL, 1); + swake_up_locked(&x->wait); raw_spin_unlock_irqrestore(&x->wait.lock, flags); } EXPORT_SYMBOL(complete); @@ -52,7 +52,7 @@ void complete_all(struct completion *x) raw_spin_lock_irqsave(&x->wait.lock, flags); x->done += UINT_MAX/2; - __swait_wake_locked(&x->wait, TASK_NORMAL, 0); + swake_up_locked(&x->wait); raw_spin_unlock_irqrestore(&x->wait.lock, flags); } EXPORT_SYMBOL(complete_all); @@ -62,9 +62,9 @@ do_wait_for_common(struct completion *x, long (*action)(long), long timeout, int state) { if (!x->done) { - DEFINE_SWAITER(wait); + DECLARE_SWAITQUEUE(wait); - swait_prepare_locked(&x->wait, &wait); + __prepare_to_swait(&x->wait, &wait); do { if (signal_pending_state(state, current)) { timeout = -ERESTARTSYS; @@ -75,7 +75,7 @@ do_wait_for_common(struct completion *x, timeout = action(timeout); raw_spin_lock_irq(&x->wait.lock); } while (!x->done && timeout); - swait_finish_locked(&x->wait, &wait); + __finish_swait(&x->wait, &wait); if (!x->done) return timeout; } diff --git a/kernel/sched/work-simple.c b/kernel/sched/swork.c index e57a0522573f82..1950f40ca72581 100644 --- a/kernel/sched/work-simple.c +++ b/kernel/sched/swork.c @@ -5,8 +5,8 @@ * PREEMPT_RT_FULL safe. The callbacks are executed in kthread context. */ -#include <linux/wait-simple.h> -#include <linux/work-simple.h> +#include <linux/swait.h> +#include <linux/swork.h> #include <linux/kthread.h> #include <linux/slab.h> #include <linux/spinlock.h> @@ -19,7 +19,7 @@ static struct sworker *glob_worker; struct sworker { struct list_head events; - struct swait_head wq; + struct swait_queue_head wq; raw_spinlock_t lock; @@ -80,7 +80,7 @@ static struct sworker *swork_create(void) INIT_LIST_HEAD(&worker->events); raw_spin_lock_init(&worker->lock); - init_swait_head(&worker->wq); + init_swait_queue_head(&worker->wq); worker->task = kthread_run(swork_kthread, worker, "kswork"); if (IS_ERR(worker->task)) { @@ -117,7 +117,7 @@ bool swork_queue(struct swork_event *sev) list_add_tail(&sev->item, &glob_worker->events); raw_spin_unlock_irqrestore(&glob_worker->lock, flags); - swait_wake(&glob_worker->wq); + swake_up(&glob_worker->wq); return true; } EXPORT_SYMBOL_GPL(swork_queue); |