From: tip-bot for Nicholas Mc Guire <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, der.herr@hofr.at, peterz@infradead.org,
linux-kernel@vger.kernel.org, tglx@linutronix.de,
torvalds@linux-foundation.org, mingo@kernel.org
Subject: [tip:locking/core] sched/completion: Remove unnecessary -> wait.lock serialization when reading completion state
Date: Wed, 4 Feb 2015 06:37:46 -0800 [thread overview]
Message-ID: <tip-de30ec47302c101c7badc8fe687641fd75e596e7@git.kernel.org> (raw)
In-Reply-To: <1421467534-22834-1-git-send-email-der.herr@hofr.at>
Commit-ID: de30ec47302c101c7badc8fe687641fd75e596e7
Gitweb: http://git.kernel.org/tip/de30ec47302c101c7badc8fe687641fd75e596e7
Author: Nicholas Mc Guire <der.herr@hofr.at>
AuthorDate: Sat, 17 Jan 2015 05:05:34 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 4 Feb 2015 07:57:36 +0100
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>
---
kernel/sched/completion.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/kernel/sched/completion.c b/kernel/sched/completion.c
index 607f852..9d1fe32d 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);
prev parent reply other threads:[~2015-02-04 14:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-17 4:05 [PATCH] locks should not be needed for reading completion state Nicholas Mc Guire
2015-02-04 14:37 ` tip-bot for Nicholas Mc Guire [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-de30ec47302c101c7badc8fe687641fd75e596e7@git.kernel.org \
--to=tipbot@zytor.com \
--cc=der.herr@hofr.at \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.