Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1389258

[tip:perf/core] perf bench futex: Simplify wrapper for LOCK_PI

From tip-bot for Davidlohr Bueso <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:perf/core] perf bench futex: Simplify wrapper for LOCK_PI
Date 2016-04-27 17:40 +0200
Message-ID <rszJi-3tA-71@gated-at.bofh.it> (permalink)
References <rqdjP-27E-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  73b1794e252b0476cc6e46461c7612cbaa88be45
Gitweb:     http://git.kernel.org/tip/73b1794e252b0476cc6e46461c7612cbaa88be45
Author:     Davidlohr Bueso <dave@stgolabs.net>
AuthorDate: Wed, 20 Apr 2016 20:14:07 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 25 Apr 2016 20:24:26 -0300

perf bench futex: Simplify wrapper for LOCK_PI

Given that the 'val' parameter is ignored for FUTEX_LOCK_PI, get rid of
the bogus deadlock detection flag in the wrapper code and avoid the
extra argument, making it resemble its unlock counterpart. And if
nothing else, we already only pass 0 anyway.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Davidlohr Bueso <dbueso@suse.de>
Link: http://lkml.kernel.org/r/1461208447-29328-1-git-send-email-dave@stgolabs.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/bench/futex-lock-pi.c | 2 +-
 tools/perf/bench/futex.h         | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c
index 6a18ce2..6952db6 100644
--- a/tools/perf/bench/futex-lock-pi.c
+++ b/tools/perf/bench/futex-lock-pi.c
@@ -83,7 +83,7 @@ static void *workerfn(void *arg)
 	do {
 		int ret;
 	again:
-		ret = futex_lock_pi(w->futex, NULL, 0, futex_flag);
+		ret = futex_lock_pi(w->futex, NULL, futex_flag);
 
 		if (ret) { /* handle lock acquisition */
 			if (!silent)
diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
index d44de9f..b2e06d1 100644
--- a/tools/perf/bench/futex.h
+++ b/tools/perf/bench/futex.h
@@ -57,13 +57,11 @@ futex_wake(u_int32_t *uaddr, int nr_wake, int opflags)
 
 /**
  * futex_lock_pi() - block on uaddr as a PI mutex
- * @detect:	whether (1) or not (0) to perform deadlock detection
  */
 static inline int
-futex_lock_pi(u_int32_t *uaddr, struct timespec *timeout, int detect,
-	      int opflags)
+futex_lock_pi(u_int32_t *uaddr, struct timespec *timeout, int opflags)
 {
-	return futex(uaddr, FUTEX_LOCK_PI, detect, timeout, NULL, 0, opflags);
+	return futex(uaddr, FUTEX_LOCK_PI, 0, timeout, NULL, 0, opflags);
 }
 
 /**

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] perf/bench-futex: Simplify wrapper for LOCK_PI Davidlohr Bueso <dave@stgolabs.net> - 2016-04-21 05:20 +0200
  Re: [PATCH] perf/bench-futex: Simplify wrapper for LOCK_PI Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-26 01:30 +0200
  [tip:perf/core] perf bench futex: Simplify wrapper for LOCK_PI tip-bot for Davidlohr Bueso <tipbot@zytor.com> - 2016-04-27 17:40 +0200

csiph-web