diff options
author | Nicholas Mc Guire <der.herr@hofr.at> | 2015-01-17 05:05:34 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-02-04 07:57:36 +0100 |
commit | de30ec47302c101c7badc8fe687641fd75e596e7 (patch) | |
tree | 15bf011b77ed7850f5b46c85f9940737252ef9fc /kernel/sched | |
parent | locking/mutex: Explicitly mark task as running after wakeup (diff) | |
download | linux-de30ec47302c101c7badc8fe687641fd75e596e7.tar.xz linux-de30ec47302c101c7badc8fe687641fd75e596e7.zip |
sched/completion: Remove unnecessary ->wait.lock serialization when reading completion state
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1421467534-22834-1-git-send-email-der.herr@hofr.at
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/completion.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c index 607f852b4d04..9d1fe32da232 100644 --- a/kernel/sched/completion.c +++ b/kernel/sched/completion.c @@ -288,13 +288,6 @@ EXPORT_SYMBOL(try_wait_for_completion); */ bool completion_done(struct completion *x) { - unsigned long flags; - int ret = 1; - - spin_lock_irqsave(&x->wait.lock, flags); - if (!x->done) - ret = 0; - spin_unlock_irqrestore(&x->wait.lock, flags); - return ret; + return !!ACCESS_ONCE(x->done); } EXPORT_SYMBOL(completion_done); |