]> git.karo-electronics.de Git - linux-beck.git/commitdiff
perf bench futex: Simplify wrapper for LOCK_PI
authorDavidlohr Bueso <dave@stgolabs.net>
Thu, 21 Apr 2016 03:14:07 +0000 (20:14 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 25 Apr 2016 23:24:26 +0000 (20:24 -0300)
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
tools/perf/bench/futex.h

index 6a18ce21f8659baba96dd5c36f3460919906caba..6952db65508abced08317b18e8262cc72881b32b 100644 (file)
@@ -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)
index d44de9f44281b11cbd7fa9740424b8b33acb4e93..b2e06d1190d0766694c97f7f0b808717442af604 100644 (file)
@@ -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);
 }
 
 /**