From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/3] perf_event_open02: make do_work() run for specified time
Date: Fri, 22 Nov 2019 14:33:43 +0100 [thread overview]
Message-ID: <20191122133343.GD19146@rei.lan> (raw)
In-Reply-To: <219b1b89de51fda28a0af02f6b15e6da8c73ab7c.1574363475.git.jstancek@redhat.com>
Hi!
> do_work() runtime varies a lot, because it's based on a fixed
> number of iterations. Use a timer and measure how many iterations
> are needed to run for specified time. We don't need fine accuracy,
> just some coarse runtime across all systems. verify() function is
> using larger value to get more precision for "ratio" calculation.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> .../syscalls/perf_event_open/perf_event_open02.c | 52 +++++++++++++++++++---
> 1 file changed, 45 insertions(+), 7 deletions(-)
>
> Notes for v2
> --------------
>
> Problem with v1 is that it hangs on -rt kernel. With FIFO scheduling
> signal handler never runs and there's nothing to stop do_work().
> Adding sched_yield() to periodically call in do_work() is problem too,
> because test spends more time in kernel and it breaks the expectation
> for 'ratio'.
>
> So in v2, use timer only to estimate number of (100 thousands) loops
> needed to run for specified time. Actual test will use the estimated
> number (or multiple of it).
>
> Tested with: 5.3.0-0.rc6.git0.1.fc31.x86_64
> 4.18.0-143.el8.x86_64
> 4.18.0-147.rt24.93.el8.x86_64
Looks good, acked.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2019-11-22 13:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-18 14:59 [LTP] [PATCH 0/3] perf_event_open02 tweaks Jan Stancek
2019-11-18 14:59 ` [LTP] [PATCH 1/3] perf_event_open02: migrate to newlib Jan Stancek
2019-11-20 12:29 ` Cyril Hrubis
2019-11-21 8:45 ` Jan Stancek
2019-11-18 14:59 ` [LTP] [PATCH 2/3] perf_event_open02: make do_work() run for specified time Jan Stancek
2019-11-20 12:33 ` Cyril Hrubis
2019-11-21 8:48 ` Jan Stancek
2019-11-21 19:21 ` [LTP] [PATCH v2 " Jan Stancek
2019-11-22 13:33 ` Cyril Hrubis [this message]
2019-11-25 14:54 ` Jan Stancek
2019-11-18 14:59 ` [LTP] [PATCH 3/3] perf_event_open02: workaround for Pentium4 Jan Stancek
2019-11-20 13:44 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191122133343.GD19146@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.