lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-de30ec47302c101c7badc8fe687641fd75e596e7@git.kernel.org>
Date:	Wed, 4 Feb 2015 06:37:46 -0800
From:	tip-bot for Nicholas Mc Guire <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	hpa@...or.com, der.herr@...r.at, peterz@...radead.org,
	linux-kernel@...r.kernel.org, tglx@...utronix.de,
	torvalds@...ux-foundation.org, mingo@...nel.org
Subject: [tip:locking/core] sched/completion: Remove unnecessary ->
 wait.lock serialization when reading completion state

Commit-ID:  de30ec47302c101c7badc8fe687641fd75e596e7
Gitweb:     http://git.kernel.org/tip/de30ec47302c101c7badc8fe687641fd75e596e7
Author:     Nicholas Mc Guire <der.herr@...r.at>
AuthorDate: Sat, 17 Jan 2015 05:05:34 +0100
Committer:  Ingo Molnar <mingo@...nel.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@...r.at>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Link: http://lkml.kernel.org/r/1421467534-22834-1-git-send-email-der.herr@hofr.at
Signed-off-by: Ingo Molnar <mingo@...nel.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ