]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit49210e00791a49fa57de61594d0f769144847e84
treebb48b64d2f133ca7ea7b3a84305b3bdb4cb03b5a
parenta8297a822a0f00243f99c241d36fa2d3c2a42b86
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