perf bench futex: Fix hung wakeup tasks after requeueing
authorDavidlohr Bueso <dave@stgolabs.net>
Fri, 24 Apr 2015 17:00:48 +0000 (10:00 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 27 Apr 2015 16:57:49 +0000 (13:57 -0300)
commit052b0f6eaf8b1f02669884a177bc3ce463133a42
tree5384301c97a338573a97a7612105410d1c3e0dab
parentd13855ef18e1852b2c4dc86ddf5759c5b34628cb
perf bench futex: Fix hung wakeup tasks after requeueing

The futex-requeue benchmark can hang because of missing wakeups once the
benchmark is done, ie:

[Run 1]: Requeued 1024 of 1024 threads in 0.3290 ms
perf: couldn't wakeup all tasks (135/1024)

This bug, while perhaps suggesting missing wakeups in kernel futex code,
is merely a consequence of the crappy FUTEX_CMP_REQUEUE man page,
incorrectly mentioning that the number of requeued tasks is in fact
returned, not the wakeups.

This patch acknowledges this and updates the corresponding futex_wake
code around it.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Mel Gorman <mgorman@suse.de>
Link: http://lkml.kernel.org/r/1429894848.10273.44.camel@stgolabs.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/bench/futex-requeue.c