]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - tools/perf/bench/futex-lock-pi.c
perf bench futex: Avoid worker cacheline bouncing
[mirror_ubuntu-artful-kernel.git] / tools / perf / bench / futex-lock-pi.c
index 936d89d3048354adea0b182d6223fb6be119d9ce..7032e4643c65f40018b0e1999e35097342d74de0 100644 (file)
@@ -75,6 +75,7 @@ static void toggle_done(int sig __maybe_unused,
 static void *workerfn(void *arg)
 {
        struct worker *w = (struct worker *) arg;
+       unsigned long ops = w->ops;
 
        pthread_mutex_lock(&thread_lock);
        threads_starting--;
@@ -103,9 +104,10 @@ static void *workerfn(void *arg)
                if (ret && !silent)
                        warn("thread %d: Could not unlock pi-lock for %p (%d)",
                             w->tid, w->futex, ret);
-               w->ops++; /* account for thread's share of work */
+               ops++; /* account for thread's share of work */
        }  while (!done);
 
+       w->ops = ops;
        return NULL;
 }