public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-rt-users@vger.kernel.org>
Cc: Jim Somerville <Jim.Somerville@windriver.com>,
	Clark Williams <williams@redhat.com>,
	John Kacur <jkacur@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: [PATCH rt-tests] cyclictest: finish removal of 1 second first loops
Date: Thu, 14 Feb 2013 17:23:14 -0500	[thread overview]
Message-ID: <1360880594-20779-1-git-send-email-paul.gortmaker@windriver.com> (raw)

From: Jim Somerville <Jim.Somerville@windriver.com>

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>

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index abf3e8b..8c93ccb 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -775,17 +775,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);
 	}
 
-- 
1.8.1.2


             reply	other threads:[~2013-02-14 22:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 22:23 Paul Gortmaker [this message]
2013-02-15 14:26 ` [PATCH rt-tests] cyclictest: finish removal of 1 second first loops John Kacur

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=1360880594-20779-1-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=Jim.Somerville@windriver.com \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=williams@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox