From: John Kacur <jkacur@redhat.com>
To: rt-users <linux-rt-users@vger.kernel.org>
Cc: Clark Williams <williams@redhat.com>,
John Kacur <jkacur@redhat.com>, Tom Rix <trix@redhat.com>
Subject: [PATCH 4/4] rt-tests: cyclictest: Don't allow OPT_SYSTEM with OPT_POSIX_TIMERS
Date: Mon, 16 Sep 2019 23:51:11 +0200 [thread overview]
Message-ID: <20190916215111.10193-4-jkacur@redhat.com> (raw)
In-Reply-To: <20190916215111.10193-1-jkacur@redhat.com>
OPT_SYSTEM means use sys_nanosleep and sys_setitimer
if you try to combine it with OPT_POSIX_TIMERS, it breaks.
cyclictest becomes unkillable with ctrl-C and only the first thread is
updated.
Fix this by issuing a warning if the user tries to combine the two
options and then use clock_nanosleep.
Reported-by: Tom Rix <trix@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/cyclictest/cyclictest.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 542e85c27a25..90449d465398 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1353,6 +1353,13 @@ static void process_options (int argc, char *argv[], int max_cpus)
}
}
+ if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) {
+ warn("The system option requires clock_nanosleep\n");
+ warn("and is not compatible with posix_timers\n");
+ warn("Using clock_nanosleep\n");
+ use_nanosleep = MODE_CLOCK_NANOSLEEP;
+ }
+
/* if smp wasn't requested, test for numa automatically */
if (!smp) {
#ifdef NUMA
--
2.20.1
prev parent reply other threads:[~2019-09-16 21:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-16 21:51 [PATCH 1/4] rt-tests: cyclictest.8: Remove invalid tracing options from the manpage John Kacur
2019-09-16 21:51 ` [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again John Kacur
2019-09-17 7:21 ` Kurt Kanzenbach
2019-09-17 14:20 ` John Kacur
2019-09-16 21:51 ` [PATCH 3/4] rt-tests: cyclictest: Fix warning: ‘cpu’ may be used uninitialized John Kacur
2019-09-16 21:51 ` John Kacur [this message]
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=20190916215111.10193-4-jkacur@redhat.com \
--to=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=trix@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).