]> git.baikalelectronics.ru Git - kernel.git/commit
perf bench futex: Sanitize -q option in requeue
authorDavidlohr Bueso <dave@stgolabs.net>
Mon, 29 Sep 2014 16:41:08 +0000 (09:41 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 29 Sep 2014 18:43:26 +0000 (15:43 -0300)
commit8f3bdbf7f25ce784c57c4759b09426991759876f
tree8753b39b7d2ca95b45304b14cc6e4e87f84fd0a4
parentdd71605f02db20c5095f31779381d2d960024251
perf bench futex: Sanitize -q option in requeue

When given the number of threads to requeue at once by user input,
there's always the risk of this value being larger than the total number
of threads.  This doesn't make any sense, and the kernel can easily deal
with such sort of situations, hence no big deal. We should however
prevent bogus output such as:

./perf bench --repeat 2 futex requeue -q 10
Run summary [PID 22210]: Requeuing 4 threads (from [private] 0x99ef3c to 0x99ef38), 10 at a time.

[Run 1]: Requeued 10 of 4 threads in 0.0040 ms
[Run 2]: Requeued 10 of 4 threads in 0.0030 ms
Requeued 10 of 4 threads in 0.0035 ms (+-14.29%)

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Davidlohr Bueso <dbueso@suse.de>
Link: http://lkml.kernel.org/r/1412008868-22328-2-git-send-email-dave@stgolabs.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/bench/futex-requeue.c