diff options
author | Jim Somerville <Jim.Somerville@windriver.com> | 2013-02-14 17:23:14 -0500 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2013-02-15 15:08:35 +0100 |
commit | 1b92da30837e9552aba209cbdf938877f0fd3bbf (patch) | |
tree | f2303cde4548e48ae89e7188554de2790e4da17d | |
parent | b2689a768a3fbdb8fb717719b384855440efec59 (diff) | |
download | rt-tests-1b92da30837e9552aba209cbdf938877f0fd3bbf.tar.gz |
cyclictest: finish removal of 1 second first loops
Huge latencies are observed (close to 1 second) when certain
options are used in cyclictest.
The problem was 1st introduced at commit da4956cbcaf7945554f
("use interval on first loop instead of 1 second"). It removed
the 1 second first timing loop out of the main path in cyclictest
but left it in two other paths, namely the ones triggered by
these two options:
-r --relative use relative timer instead of absolute
-s --system use sys_nanosleep and sys_setitimer
which in turn causes the huge latencies of close to 1 second to
be reported by cyclictest with certain uses of those two options.
Here we extend the original commit to remove the 1 second
hardcoded timer values from the RELTIME and ITIMER options, by
simply using the actual interval provided instead.
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
Cc: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r-- | src/cyclictest/cyclictest.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 19071f3..0a15dcb 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -774,17 +774,15 @@ void *timerthread(void *param) if (par->timermode == TIMER_ABSTIME) tspec.it_value = next; else { - tspec.it_value.tv_nsec = 0; - tspec.it_value.tv_sec = 1; + tspec.it_value = interval; } timer_settime(timer, par->timermode, &tspec, NULL); } if (par->mode == MODE_SYS_ITIMER) { - itimer.it_value.tv_sec = 1; - itimer.it_value.tv_usec = 0; itimer.it_interval.tv_sec = interval.tv_sec; itimer.it_interval.tv_usec = interval.tv_nsec / 1000; + itimer.it_value = itimer.it_interval; setitimer (ITIMER_REAL, &itimer, NULL); } |