All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/bench-futex: Simplify wrapper for LOCK_PI
@ 2016-04-21  3:14 Davidlohr Bueso
  2016-04-25 23:24 ` Arnaldo Carvalho de Melo
  2016-04-27 15:33 ` [tip:perf/core] perf bench futex: " tip-bot for Davidlohr Bueso
  0 siblings, 2 replies; 3+ messages in thread
From: Davidlohr Bueso @ 2016-04-21  3:14 UTC (permalink / raw)
  To: acme; +Cc: dave, linux-kernel, Davidlohr Bueso

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>
---
 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 6a18ce21f865..6952db65508a 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 aca900fdc788..f0501edba0e7 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);
 }
 
 /**
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/bench-futex: Simplify wrapper for LOCK_PI
  2016-04-21  3:14 [PATCH] perf/bench-futex: Simplify wrapper for LOCK_PI Davidlohr Bueso
@ 2016-04-25 23:24 ` Arnaldo Carvalho de Melo
  2016-04-27 15:33 ` [tip:perf/core] perf bench futex: " tip-bot for Davidlohr Bueso
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-25 23:24 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: linux-kernel, Davidlohr Bueso

Em Wed, Apr 20, 2016 at 08:14:07PM -0700, Davidlohr Bueso escreveu:
> 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.

Thanks, applied.

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf bench futex: Simplify wrapper for LOCK_PI
  2016-04-21  3:14 [PATCH] perf/bench-futex: Simplify wrapper for LOCK_PI Davidlohr Bueso
  2016-04-25 23:24 ` Arnaldo Carvalho de Melo
@ 2016-04-27 15:33 ` tip-bot for Davidlohr Bueso
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Davidlohr Bueso @ 2016-04-27 15:33 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: hpa, linux-kernel, tglx, dbueso, acme, mingo, dave

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);
 }
 
 /**

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-27 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-21  3:14 [PATCH] perf/bench-futex: Simplify wrapper for LOCK_PI Davidlohr Bueso
2016-04-25 23:24 ` Arnaldo Carvalho de Melo
2016-04-27 15:33 ` [tip:perf/core] perf bench futex: " tip-bot for Davidlohr Bueso

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.