perf bench futex: Avoid worker cacheline bouncing
authorDavidlohr Bueso <dave@stgolabs.net>
Mon, 24 Oct 2016 20:56:52 +0000 (13:56 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 25 Oct 2016 12:50:47 +0000 (09:50 -0300)
commite2e1680fda1573ebfdd6bba5d58f978044746993
treebb48b64d2f133ca7ea7b3a84305b3bdb4cb03b5a
parent76e2d2617d767c445498c4c4b1162eb2201cdd77
perf bench futex: Avoid worker cacheline bouncing

Sebastian noted that overhead for worker thread ops (throughput)
accounting was producing 'perf' to appear in the profiles, consuming a
non-trivial (i.e. 13%) amount of CPU.

This is due to cacheline bouncing due to the increment of w->ops.

We can easily fix this by just working on a local copy and updating the
actual worker once done running, and ready to show the program summary.
There is no danger of the worker being concurrent, so we can trust that
no stale value is being seen by another thread.

This also gets rid of the unnecessary cache alignment hack; its not
worth it.

Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: http://lkml.kernel.org/r/1477342613-9938-2-git-send-email-dave@stgolabs.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/bench/futex-hash.c
tools/perf/bench/futex-lock-pi.c