import realtime-tests-2.3-3.el9
This commit is contained in:
parent
123bbb1ade
commit
a733a33a84
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/rt-tests-2.1.tar.xz
|
||||
SOURCES/rt-tests-2.3.tar.xz
|
||||
|
@ -1 +1 @@
|
||||
36bdf18b18ba5a5a71ff81f102507d0b2015057d SOURCES/rt-tests-2.1.tar.xz
|
||||
8be587f02ceb1f28f91174ad19df1dc4da48f92c SOURCES/rt-tests-2.3.tar.xz
|
||||
|
30
SOURCES/rt-numa-Correct-the-comment-of-numa_initialize.patch
Normal file
30
SOURCES/rt-numa-Correct-the-comment-of-numa_initialize.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From d83bc06e1fca7250dbc3c5e7be0f55a4ea6e7ef0 Mon Sep 17 00:00:00 2001
|
||||
From: Oscar Shiang <oscar0225@livemail.tw>
|
||||
Date: Thu, 23 Dec 2021 22:01:07 +0800
|
||||
Subject: [PATCH 1/2] rt-numa: Correct the comment of numa_initialize()
|
||||
|
||||
numa_initialize() returns 0 only when numa_available() returns -1,
|
||||
which means that libnuma is unavailable.
|
||||
|
||||
The return values in the comment should be corrected to 1 if all
|
||||
functions are available and 0 when the functions are unavailable.
|
||||
|
||||
Signed-off-by: Oscar Shiang <oscar0225@livemail.tw>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
|
||||
diff --git a/src/lib/rt-numa.c b/src/lib/rt-numa.c
|
||||
index bb0121a65eca..ee5ab99684d8 100644
|
||||
--- a/src/lib/rt-numa.c
|
||||
+++ b/src/lib/rt-numa.c
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
/*
|
||||
* numa_available() must be called before any other calls to the numa library
|
||||
- * returns 0 if numa is available, or 1 if numa is not available
|
||||
+ * returns 1 if numa is available, or 0 if numa is not available
|
||||
*/
|
||||
int numa_initialize(void)
|
||||
{
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,48 @@
|
||||
From 795433f50f20ef7598db5cfe991b5386e4080d41 Mon Sep 17 00:00:00 2001
|
||||
From: Marcelo Tosatti <mtosatti@redhat.com>
|
||||
Date: Fri, 28 Jan 2022 15:39:59 -0300
|
||||
Subject: [PATCH 2/2] rt-numa: ignore runtime cpumask if -a CPULIST is
|
||||
specified
|
||||
|
||||
When using isolcpus kernel command line option, the CPUs
|
||||
specified at isolcpus= are not part of the run time environment
|
||||
cpumask.
|
||||
|
||||
This causes "cyclictest -a isolatedcpus" to fail with:
|
||||
|
||||
WARN: Couldn't setaffinity in main thread: Invalid argument
|
||||
FATAL: No allowable cpus to run on
|
||||
# /dev/cpu_dma_latency set to 0us
|
||||
|
||||
To fix this, ignore the runtime cpumask if neither "+", "!"
|
||||
are specified in the cpu list string.
|
||||
|
||||
Suggested by Sebastian Andrzej Siewior.
|
||||
|
||||
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
|
||||
|
||||
v2: fix changelog typo
|
||||
v3: simplified version (John Kacur)
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/lib/rt-numa.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/lib/rt-numa.c b/src/lib/rt-numa.c
|
||||
index ee5ab99684d8..3eead80c3b2b 100644
|
||||
--- a/src/lib/rt-numa.c
|
||||
+++ b/src/lib/rt-numa.c
|
||||
@@ -131,7 +131,8 @@ int parse_cpumask(char *str, int max_cpus, struct bitmask **cpumask)
|
||||
return 0;
|
||||
}
|
||||
|
||||
- use_current_cpuset(max_cpus, mask);
|
||||
+ if (strchr(str, '!') != NULL || strchr(str, '+') != NULL)
|
||||
+ use_current_cpuset(max_cpus, mask);
|
||||
*cpumask = mask;
|
||||
|
||||
return 0;
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 419aa72080b78210a0c8ef0c23cf56aeada1d880 Mon Sep 17 00:00:00 2001
|
||||
From: Leah Leshchinsky <lleshchi@redhat.com>
|
||||
Date: Mon, 13 Sep 2021 15:29:51 -0400
|
||||
Subject: [PATCH] rt-tests: Add missing option F to optstring
|
||||
|
||||
The cyclictest help output lists -F as the short version of the
|
||||
--fifo option, yet calling cyclictest -F produces an error
|
||||
cyclictest: invalid option --'F'".
|
||||
followed by the usage() message
|
||||
|
||||
This patch adds -F as a valid argument.
|
||||
|
||||
Signed-off-by: Leah Leshchinsky <lleshchi@redhat.com>
|
||||
-Minor Fix to the commit message
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/cyclictest/cyclictest.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
|
||||
index a08c91d..f8f7dbc 100644
|
||||
--- a/src/cyclictest/cyclictest.c
|
||||
+++ b/src/cyclictest/cyclictest.c
|
||||
@@ -1011,7 +1011,7 @@ static void process_options(int argc, char *argv[], int max_cpus)
|
||||
{"posix_timers", no_argument, NULL, OPT_POSIX_TIMERS },
|
||||
{NULL, 0, NULL, 0 },
|
||||
};
|
||||
- int c = getopt_long(argc, argv, "a::A::b:c:d:D:h:H:i:l:MNo:p:mqrRsSt::uvD:x",
|
||||
+ int c = getopt_long(argc, argv, "a::A::b:c:d:D:F:h:H:i:l:MNo:p:mqrRsSt::uvD:x",
|
||||
long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
--
|
||||
2.27.0
|
||||
|
@ -0,0 +1,65 @@
|
||||
From 4fac6f28af3aec1c88f19bf96ef73541c1ae5858 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Fri, 28 Jan 2022 12:50:22 -0500
|
||||
Subject: [PATCH 1/2] rt-tests: Fix parsing of affinity when there is a space.
|
||||
|
||||
Make sure that -a all and -a '+' are passed to parse_cpumask().
|
||||
Currently this doesn't work correctly if there is a space after -a and the
|
||||
string.
|
||||
|
||||
While we are at it, fix the message in oslat which calls
|
||||
numa_parse_cpustring_all directly to say that.
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/cyclictest/cyclictest.c | 4 +++-
|
||||
src/oslat/oslat.c | 2 +-
|
||||
src/signaltest/signaltest.c | 4 +++-
|
||||
3 files changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
|
||||
index 490aedb54c03..c9ed9e08f6e1 100644
|
||||
--- a/src/cyclictest/cyclictest.c
|
||||
+++ b/src/cyclictest/cyclictest.c
|
||||
@@ -1035,7 +1035,9 @@ static void process_options(int argc, char *argv[], int max_cpus)
|
||||
} else if (optind < argc &&
|
||||
(atoi(argv[optind]) ||
|
||||
argv[optind][0] == '0' ||
|
||||
- argv[optind][0] == '!')) {
|
||||
+ argv[optind][0] == '!' ||
|
||||
+ argv[optind][0] == '+' ||
|
||||
+ argv[optind][0] == 'a')) {
|
||||
parse_cpumask(argv[optind], max_cpus, &affinity_mask);
|
||||
setaffinity = AFFINITY_SPECIFIED;
|
||||
} else {
|
||||
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
|
||||
index 50ddc81463ea..aa0e9a79e3b4 100644
|
||||
--- a/src/oslat/oslat.c
|
||||
+++ b/src/oslat/oslat.c
|
||||
@@ -850,7 +850,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
cpu_set = numa_parse_cpustring_all(g.cpu_list);
|
||||
if (!cpu_set)
|
||||
- fatal("oslat: parse_cpumask failed.\n");
|
||||
+ fatal("oslat: numa_parse_cpustring_all failed.\n");
|
||||
n_cores = numa_bitmask_weight(cpu_set);
|
||||
|
||||
TEST(threads = calloc(1, n_cores * sizeof(threads[0])));
|
||||
diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
|
||||
index 4d89a1aba9d9..1cf03931b5bf 100644
|
||||
--- a/src/signaltest/signaltest.c
|
||||
+++ b/src/signaltest/signaltest.c
|
||||
@@ -261,7 +261,9 @@ static void process_options(int argc, char *argv[], unsigned int max_cpus)
|
||||
} else if (optind < argc &&
|
||||
(atoi(argv[optind]) ||
|
||||
argv[optind][0] == '0' ||
|
||||
- argv[optind][0] == '!')) {
|
||||
+ argv[optind][0] == '!' ||
|
||||
+ argv[optind][0] == '+' ||
|
||||
+ argv[optind][0] == 'a')) {
|
||||
parse_cpumask(argv[optind], max_cpus, &affinity_mask);
|
||||
setaffinity = AFFINITY_SPECIFIED;
|
||||
} else {
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,87 +0,0 @@
|
||||
From a933af2b82ea90a51a2600cf88cfcc5f2fba9804 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Thu, 18 Nov 2021 14:12:23 -0500
|
||||
Subject: [PATCH 2/2] rt-tests: cyclicdeadline: Fix double mount of cgroups
|
||||
|
||||
If /sys/fs/cgroup exists and it is type cgroup2, cyclicdeadline mounts it a
|
||||
second time as cgroup.
|
||||
|
||||
systemd is creating cgroup2 for logins and this can hang the machine and
|
||||
not allow logins.
|
||||
|
||||
Fix this by:
|
||||
|
||||
If /sys/fs/cgroup exists, then use it for cyclicdeadline_test.
|
||||
|
||||
If it exists but the type is not recognized, exit with an error.
|
||||
Do not simply mount it as type cgroup.
|
||||
|
||||
TODO: If the file doesn't exit but cgroups are supported in the kernel,
|
||||
the file could be created and mounted.
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/sched_deadline/cyclicdeadline.c | 39 +++++++++++++++++++++++------
|
||||
1 file changed, 32 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
|
||||
index 4860a40f5e6b..1f9a5df42d4f 100644
|
||||
--- a/src/sched_deadline/cyclicdeadline.c
|
||||
+++ b/src/sched_deadline/cyclicdeadline.c
|
||||
@@ -358,6 +358,32 @@ static int mounted(const char *path, long magic)
|
||||
#define CGROUP_PATH "/sys/fs/cgroup"
|
||||
#define CPUSET_PATH CGROUP_PATH "/cpuset"
|
||||
|
||||
+/**
|
||||
+ * cgroup_mounted - test if the path /sys/fs/cgroup exists
|
||||
+ * and is a supported type
|
||||
+ *
|
||||
+ * Returns -1 if the path does not exist
|
||||
+ * Returns 0 if the path exists but is not a cgroup type
|
||||
+ * Returns 1 if the path exists and supports cgroups
|
||||
+ */
|
||||
+static int cgroup_mounted(void)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = mounted(CGROUP_PATH, TMPFS_MAGIC);
|
||||
+ if (ret == -1)
|
||||
+ return -1; /* path doesn't exist */
|
||||
+ if (ret == 1)
|
||||
+ return 1; /* tmpfs */
|
||||
+ ret = mounted(CGROUP_PATH, CGROUP_SUPER_MAGIC);
|
||||
+ if (ret == 1)
|
||||
+ return 1; /* cgroup v1 */
|
||||
+ ret = mounted(CGROUP_PATH, CGROUP2_SUPER_MAGIC);
|
||||
+ if (ret == 1)
|
||||
+ return 1;
|
||||
+ return 0; /* path exists but type is not recognized */
|
||||
+}
|
||||
+
|
||||
static int open_cpuset(const char *path, const char *name)
|
||||
{
|
||||
char buf[MAXPATH];
|
||||
@@ -383,14 +409,13 @@ static int mount_cpuset(void)
|
||||
int fd;
|
||||
|
||||
/* Check if cgroups is already mounted. */
|
||||
- ret = mounted(CGROUP_PATH, TMPFS_MAGIC);
|
||||
- if (ret < 0)
|
||||
+ ret = cgroup_mounted();
|
||||
+ if (ret < 0) /* /sys/fs/cgroup doesn't exist */
|
||||
return ret;
|
||||
- if (!ret) {
|
||||
- ret = mount("cgroup_root", CGROUP_PATH, "tmpfs", 0, NULL);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
- }
|
||||
+
|
||||
+ if (!ret) /* /sys/fs/cgroup exists, but we don't recognize the type */
|
||||
+ return -1;
|
||||
+
|
||||
ret = stat(CPUSET_PATH, &st);
|
||||
if (ret < 0) {
|
||||
ret = mkdir(CPUSET_PATH, 0755);
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,87 +0,0 @@
|
||||
From 8100a3ae8c6abff99fb512d126055f4b603f4517 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Thu, 18 Nov 2021 13:48:10 -0500
|
||||
Subject: [PATCH 1/2] rt-tests: deadline_test: Fix double mount of cgroups
|
||||
|
||||
If /sys/fs/cgroup exists and it is type cgroup2, deadline mounts it a
|
||||
second time as cgroup.
|
||||
|
||||
systemd is creating cgroup2 for logins and this can hang the machine and
|
||||
not allow logins.
|
||||
|
||||
Fix this by:
|
||||
|
||||
If /sys/fs/cgroup exists, then use it for deadline_test.
|
||||
|
||||
If it exists but the type is not recognized, exit with an error.
|
||||
Do not simply mount it as type cgroup.
|
||||
|
||||
TODO: If the file doesn't exit but cgroups are supported in the kernel,
|
||||
the file could be created and mounted.
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/sched_deadline/deadline_test.c | 39 ++++++++++++++++++++++++------
|
||||
1 file changed, 32 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/sched_deadline/deadline_test.c b/src/sched_deadline/deadline_test.c
|
||||
index b7e1e045b57c..11d669025425 100644
|
||||
--- a/src/sched_deadline/deadline_test.c
|
||||
+++ b/src/sched_deadline/deadline_test.c
|
||||
@@ -518,6 +518,32 @@ static int mounted(const char *path, long magic)
|
||||
#define CGROUP_PATH "/sys/fs/cgroup"
|
||||
#define CPUSET_PATH CGROUP_PATH "/cpuset"
|
||||
|
||||
+/**
|
||||
+ * cgroup_mounted - test if the path /sys/fs/cgroup exists
|
||||
+ * and is a supported type
|
||||
+ *
|
||||
+ * Returns -1 if the path does not exist
|
||||
+ * Returns 0 if the path exists but is not a cgroup type
|
||||
+ * Returns 1 if the path exists and supports cgroups
|
||||
+ */
|
||||
+static int cgroup_mounted(void)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = mounted(CGROUP_PATH, TMPFS_MAGIC);
|
||||
+ if (ret == -1)
|
||||
+ return -1; /* path doesn't exist */
|
||||
+ if (ret == 1)
|
||||
+ return 1; /* tmpfs */
|
||||
+ ret = mounted(CGROUP_PATH, CGROUP_SUPER_MAGIC);
|
||||
+ if (ret == 1)
|
||||
+ return 1; /* cgroup v1 */
|
||||
+ ret = mounted(CGROUP_PATH, CGROUP2_SUPER_MAGIC);
|
||||
+ if (ret == 1)
|
||||
+ return 1;
|
||||
+ return 0; /* path exists but type is not recognized */
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* open_cpuset - open a file (usually a cpuset file)
|
||||
* @path: The path of the directory the file is in
|
||||
@@ -568,14 +594,13 @@ static int mount_cpuset(void)
|
||||
int fd;
|
||||
|
||||
/* Check if cgroups is already mounted. */
|
||||
- ret = mounted(CGROUP_PATH, TMPFS_MAGIC);
|
||||
- if (ret < 0)
|
||||
+ ret = cgroup_mounted();
|
||||
+ if (ret < 0) /* /sys/fs/cgroup doesn't exist */
|
||||
return ret;
|
||||
- if (!ret) {
|
||||
- ret = mount("cgroup_root", CGROUP_PATH, "tmpfs", 0, NULL);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
- }
|
||||
+
|
||||
+ if (!ret) /* /sys/fs/cgroup exists, but we don't recognize the type */
|
||||
+ return -1;
|
||||
+
|
||||
ret = stat(CPUSET_PATH, &st);
|
||||
if (ret < 0) {
|
||||
ret = mkdir(CPUSET_PATH, 0755);
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,34 +0,0 @@
|
||||
From 6a3dd40539c1804db8b1fe1684afa5fa111636fe Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Thu, 11 Nov 2021 08:56:54 -0500
|
||||
Subject: [PATCH] rt-tests: deadline_tests: Null check to prevent floating
|
||||
point exception
|
||||
|
||||
Fix a floating point exception that can occur if sd->nr_adjust is 0
|
||||
by checking it before performing a division by zero.
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/sched_deadline/deadline_test.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/sched_deadline/deadline_test.c b/src/sched_deadline/deadline_test.c
|
||||
index 53abd4d2ca6b..b7e1e045b57c 100644
|
||||
--- a/src/sched_deadline/deadline_test.c
|
||||
+++ b/src/sched_deadline/deadline_test.c
|
||||
@@ -2050,8 +2050,10 @@ int main(int argc, char **argv)
|
||||
printf("missed deadlines = %d\n", sd->missed_deadlines);
|
||||
printf("missed periods = %d\n", sd->missed_periods);
|
||||
printf("Total adjustments = %lld us\n", sd->total_adjust);
|
||||
- printf("# adjustments = %lld avg: %lld us\n",
|
||||
- sd->nr_adjust, sd->total_adjust / sd->nr_adjust);
|
||||
+ if (sd->nr_adjust) {
|
||||
+ printf("# adjustments = %lld avg: %lld us\n",
|
||||
+ sd->nr_adjust, sd->total_adjust / sd->nr_adjust);
|
||||
+ }
|
||||
printf("deadline : %lld us\n", sd->deadline_us);
|
||||
printf("runtime : %lld us\n", sd->runtime_us);
|
||||
printf("nr_periods : %lld\n", sd->nr_periods);
|
||||
--
|
||||
2.31.1
|
||||
|
29
SOURCES/rt-tests-oslat.8-Remove-the-argument-of-bias.patch
Normal file
29
SOURCES/rt-tests-oslat.8-Remove-the-argument-of-bias.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From d2ded8b1e863d3c7fd47e3f9a875fb9e6968ff61 Mon Sep 17 00:00:00 2001
|
||||
From: Oscar Shiang <oscar0225@livemail.tw>
|
||||
Date: Thu, 30 Dec 2021 21:41:58 +0800
|
||||
Subject: [PATCH 2/2] rt-tests: oslat.8: Remove the argument of --bias
|
||||
|
||||
The option --bias does not require an argument and the bias should
|
||||
be estimated later.
|
||||
|
||||
There is no need to provide USEC to --bias option.
|
||||
|
||||
Signed-off-by: Oscar Shiang <oscar0225@livemail.tw>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
|
||||
diff --git a/src/oslat/oslat.8 b/src/oslat/oslat.8
|
||||
index 4b28abd24425..39b36df0db3f 100644
|
||||
--- a/src/oslat/oslat.8
|
||||
+++ b/src/oslat/oslat.8
|
||||
@@ -18,7 +18,7 @@ TSC information and measuring the time frequently during the process.
|
||||
.B \-b, \-\-bucket-size=N
|
||||
Specify the number of the buckets (4-1024).
|
||||
.TP
|
||||
-.B \-B, \-\-bias=USEC
|
||||
+.B \-B, \-\-bias
|
||||
Add a bias to all the buckets using the estimated mininum.
|
||||
.TP
|
||||
.B \-c, \-\-cpu-list=CPULIST
|
||||
--
|
||||
2.27.0
|
||||
|
@ -1,217 +0,0 @@
|
||||
From 84c45a66bf077be31c9e0cf85b72896798966826 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Thu, 22 Jul 2021 16:30:13 -0400
|
||||
Subject: [PATCH 1/2] sched_deadline: Accommodate new location of HRTICK file
|
||||
in kernel
|
||||
|
||||
Newer kernels rename /sys/kernel/debug/sched_features to
|
||||
/sys/kernel/debug/sched/features
|
||||
|
||||
Modify sched_deadline tests to look for the new file and if that fails
|
||||
look for the old file name
|
||||
|
||||
These functions are based on ones in stalld, and stalld itself has
|
||||
functions based on the sched_deadline programs in rt-tests
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/sched_deadline/cyclicdeadline.c | 65 ++++++++++++++++++++++-------
|
||||
src/sched_deadline/deadline_test.c | 61 +++++++++++++++++++++------
|
||||
2 files changed, 100 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
|
||||
index 8447424273ee..4a38ec2274c9 100644
|
||||
--- a/src/sched_deadline/cyclicdeadline.c
|
||||
+++ b/src/sched_deadline/cyclicdeadline.c
|
||||
@@ -230,12 +230,53 @@ found:
|
||||
mark_fd = open(files, O_WRONLY);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Return true if file exists
|
||||
+ */
|
||||
+static int check_file_exists(char *path)
|
||||
+{
|
||||
+ int ret;
|
||||
+ struct stat st;
|
||||
+
|
||||
+ ret = !stat(path, &st);
|
||||
+
|
||||
+ return ret;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Return 0 on success
|
||||
+ */
|
||||
+
|
||||
+static int fill_sched_features(char *path)
|
||||
+{
|
||||
+ int ret;
|
||||
+ const char *debugfs;
|
||||
+
|
||||
+ debugfs = find_debugfs();
|
||||
+ if (strlen(debugfs) == 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ snprintf(path, MAX_PATH, "%s/sched/features", debugfs);
|
||||
+ ret = check_file_exists(path);
|
||||
+ if (ret)
|
||||
+ return 0;
|
||||
+
|
||||
+ snprintf(path, MAX_PATH, "%s/sched_features", debugfs);
|
||||
+ ret = check_file_exists(path);
|
||||
+ if (ret)
|
||||
+ return 0;
|
||||
+
|
||||
+ memset(path, 0, MAX_PATH);
|
||||
+
|
||||
+ return ret;
|
||||
+
|
||||
+}
|
||||
+
|
||||
static int setup_hr_tick(void)
|
||||
{
|
||||
- const char *debugfs = find_debugfs();
|
||||
- char files[strlen(debugfs) + strlen("/sched_features") + 1];
|
||||
+ char path[MAX_PATH];
|
||||
char buf[500];
|
||||
- struct stat st;
|
||||
static int set = 0;
|
||||
char *p;
|
||||
int ret;
|
||||
@@ -244,27 +285,23 @@ static int setup_hr_tick(void)
|
||||
|
||||
if (set)
|
||||
return 1;
|
||||
-
|
||||
set = 1;
|
||||
|
||||
- if (strlen(debugfs) == 0)
|
||||
- return 0;
|
||||
-
|
||||
- sprintf(files, "%s/sched_features", debugfs);
|
||||
- ret = stat(files, &st);
|
||||
- if (ret < 0)
|
||||
+ ret = fill_sched_features(path);
|
||||
+ if (ret)
|
||||
return 0;
|
||||
|
||||
- fd = open(files, O_RDWR);
|
||||
- perror(files);
|
||||
- if (fd < 0)
|
||||
+ fd = open(path, O_RDWR);
|
||||
+ if (fd < 0) {
|
||||
+ perror(path);
|
||||
return 0;
|
||||
+ }
|
||||
|
||||
len = sizeof(buf);
|
||||
|
||||
ret = read(fd, buf, len);
|
||||
if (ret < 0) {
|
||||
- perror(files);
|
||||
+ perror(path);
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
diff --git a/src/sched_deadline/deadline_test.c b/src/sched_deadline/deadline_test.c
|
||||
index 395c2370f69a..c1e890319895 100644
|
||||
--- a/src/sched_deadline/deadline_test.c
|
||||
+++ b/src/sched_deadline/deadline_test.c
|
||||
@@ -368,6 +368,49 @@ found:
|
||||
mark_fd = open(files, O_WRONLY);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Return true if file exists
|
||||
+ */
|
||||
+static int check_file_exists(char *path)
|
||||
+{
|
||||
+ int ret;
|
||||
+ struct stat st;
|
||||
+
|
||||
+ ret = !stat(path, &st);
|
||||
+
|
||||
+ return ret;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Return 0 on success
|
||||
+ */
|
||||
+
|
||||
+static int fill_sched_features(char *path)
|
||||
+{
|
||||
+ int ret;
|
||||
+ const char *debugfs;
|
||||
+
|
||||
+ debugfs = find_debugfs();
|
||||
+ if (strlen(debugfs) == 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ snprintf(path, MAX_PATH, "%s/sched/features", debugfs);
|
||||
+ ret = check_file_exists(path);
|
||||
+ if (ret)
|
||||
+ return 0;
|
||||
+
|
||||
+ snprintf(path, MAX_PATH, "%s/sched_features", debugfs);
|
||||
+ ret = check_file_exists(path);
|
||||
+ if (ret)
|
||||
+ return 0;
|
||||
+
|
||||
+ memset(path, 0, MAX_PATH);
|
||||
+
|
||||
+ return ret;
|
||||
+
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* setup_hr_tick - Enable the HRTICK in sched_features (if available)
|
||||
*
|
||||
@@ -381,10 +424,8 @@ found:
|
||||
*/
|
||||
static int setup_hr_tick(void)
|
||||
{
|
||||
- const char *debugfs = find_debugfs();
|
||||
- char files[strlen(debugfs) + strlen("/sched_features") + 1];
|
||||
+ char path[MAX_PATH];
|
||||
char buf[500];
|
||||
- struct stat st;
|
||||
static int set = 0;
|
||||
char *p;
|
||||
int ret;
|
||||
@@ -396,17 +437,13 @@ static int setup_hr_tick(void)
|
||||
|
||||
set = 1;
|
||||
|
||||
- if (strlen(debugfs) == 0)
|
||||
- return 0;
|
||||
-
|
||||
- sprintf(files, "%s/sched_features", debugfs);
|
||||
- ret = stat(files, &st);
|
||||
- if (ret < 0)
|
||||
+ ret = fill_sched_features(path);
|
||||
+ if (ret)
|
||||
return 0;
|
||||
|
||||
- fd = open(files, O_RDWR);
|
||||
+ fd = open(path, O_RDWR);
|
||||
if (fd < 0) {
|
||||
- perror(files);
|
||||
+ perror(path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -414,7 +451,7 @@ static int setup_hr_tick(void)
|
||||
|
||||
ret = read(fd, buf, len);
|
||||
if (ret < 0) {
|
||||
- perror(files);
|
||||
+ perror(path);
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,125 +0,0 @@
|
||||
From de3cdf92834bc600d5806f959e8d78d48f7f9775 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Fri, 23 Jul 2021 14:52:43 -0400
|
||||
Subject: [PATCH 2/2] sched_deadline: Use HRTICK_DL for sched_deadline tests
|
||||
|
||||
If the HRTICK_DL feature is available, use it for the sched_deadline
|
||||
tests, otherwise fall back to HRTICK
|
||||
|
||||
This code is based on changes in stalld - which in turn was based on
|
||||
these sched_deadline tests
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/sched_deadline/cyclicdeadline.c | 27 ++++++++++++++++++++++-----
|
||||
src/sched_deadline/deadline_test.c | 28 +++++++++++++++++++++++-----
|
||||
2 files changed, 45 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
|
||||
index 4a38ec2274c9..4860a40f5e6b 100644
|
||||
--- a/src/sched_deadline/cyclicdeadline.c
|
||||
+++ b/src/sched_deadline/cyclicdeadline.c
|
||||
@@ -278,6 +278,7 @@ static int setup_hr_tick(void)
|
||||
char path[MAX_PATH];
|
||||
char buf[500];
|
||||
static int set = 0;
|
||||
+ int hrtick_dl = 0;
|
||||
char *p;
|
||||
int ret;
|
||||
int len;
|
||||
@@ -311,18 +312,34 @@ static int setup_hr_tick(void)
|
||||
|
||||
ret = 1;
|
||||
|
||||
- p = strstr(buf, "HRTICK");
|
||||
- if (p + 3 >= buf) {
|
||||
+ p = strstr(buf, "HRTICK_DL");
|
||||
+ if (p && p - 3 >= buf) {
|
||||
+ hrtick_dl = 1;
|
||||
p -= 3;
|
||||
- if (strncmp(p, "NO_HRTICK", 9) == 0) {
|
||||
- ret = write(fd, "HRTICK", 6);
|
||||
- if (ret != 6)
|
||||
+ if (strncmp(p, "NO_HRTICK_DL", 12) == 0) {
|
||||
+ ret = write(fd, "HRTICK_DL", 9);
|
||||
+ if (ret != 9)
|
||||
ret = 0;
|
||||
else
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Backwards compatibility for kernel that only have HRTICK */
|
||||
+ if (!hrtick_dl) {
|
||||
+ p = strstr(buf, "HRTICK");
|
||||
+ if (p && p - 3 >= buf) {
|
||||
+ p -=3;
|
||||
+ if (strncmp(p, "NO_HRTICK", 9) == 0) {
|
||||
+ ret = write(fd, "HRTICK", 6);
|
||||
+ if (ret != 6)
|
||||
+ ret = 0;
|
||||
+ else
|
||||
+ ret = 1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
close(fd);
|
||||
return ret;
|
||||
}
|
||||
diff --git a/src/sched_deadline/deadline_test.c b/src/sched_deadline/deadline_test.c
|
||||
index c1e890319895..a48c231c1281 100644
|
||||
--- a/src/sched_deadline/deadline_test.c
|
||||
+++ b/src/sched_deadline/deadline_test.c
|
||||
@@ -427,6 +427,7 @@ static int setup_hr_tick(void)
|
||||
char path[MAX_PATH];
|
||||
char buf[500];
|
||||
static int set = 0;
|
||||
+ int hrtick_dl = 0;
|
||||
char *p;
|
||||
int ret;
|
||||
int len;
|
||||
@@ -461,18 +462,35 @@ static int setup_hr_tick(void)
|
||||
|
||||
ret = 1;
|
||||
|
||||
- p = strstr(buf, "HRTICK");
|
||||
- if (p + 3 >= buf) {
|
||||
+ p = strstr(buf, "HRTICK_DL");
|
||||
+ if (p && p - 3 >= buf) {
|
||||
+ hrtick_dl = 1;
|
||||
p -= 3;
|
||||
- if (strncmp(p, "NO_HRTICK", 9) == 0) {
|
||||
- ret = write(fd, "HRTICK", 6);
|
||||
- if (ret != 6)
|
||||
+ if (strncmp(p, "NO_HRTICK_DL", 12) == 0) {
|
||||
+ ret = write(fd, "HRTICK_DL", 9);
|
||||
+ if (ret != 9)
|
||||
ret = 0;
|
||||
else
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Backwards compatibility for kernel that only have HRTICK */
|
||||
+ if (!hrtick_dl) {
|
||||
+ p = strstr(buf, "HRTICK");
|
||||
+ if (p && p - 3 >= buf) {
|
||||
+ p -=3;
|
||||
+ if (strncmp(p, "NO_HRTICK", 9) == 0) {
|
||||
+ ret = write(fd, "HRTICK", 6);
|
||||
+ if (ret != 6)
|
||||
+ ret = 0;
|
||||
+ else
|
||||
+ ret = 1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+
|
||||
close(fd);
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
2.31.1
|
||||
|
@ -5,13 +5,13 @@ Name: realtime-tests
|
||||
# BuildRequires: numactl-devel
|
||||
# Numa argument to make: NUMA=1
|
||||
#
|
||||
Version: 2.1
|
||||
Release: 6%{?dist}
|
||||
Version: 2.3
|
||||
Release: 3%{?dist}
|
||||
License: GPLv2
|
||||
URL: https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
|
||||
Source0: https://www.kernel.org/pub/linux/utils/rt-tests/rt-tests-%{version}.tar.xz
|
||||
|
||||
ExcludeArch: s390 s390x armv7hl ppc64 ppc64le aarch64
|
||||
ExcludeArch: s390 s390x armv7hl ppc64 ppc64le aarch64 i686
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
BuildRequires: numactl-devel
|
||||
@ -20,12 +20,10 @@ Requires: bash
|
||||
Requires: bc
|
||||
|
||||
#Patches
|
||||
Patch1: sched_deadline-Accommodate-new-location-of-HRTICK-file.patch
|
||||
Patch2: sched_deadline-Use-HRTICK_DL-for-sched_deadline-tests.patch
|
||||
Patch3: rt-tests-Add-missing-option-F-to-optstring.patch
|
||||
Patch4: rt-tests-deadline_tests-Null-check-to-prevent-exception.patch
|
||||
Patch5: rt-tests-deadline_test-Fix-double-mount-of-cgroups.patch
|
||||
Patch6: rt-tests-cyclicdeadline-Fix-double-mount-of-cgroups.patch
|
||||
Patch1: rt-numa-Correct-the-comment-of-numa_initialize.patch
|
||||
Patch2: rt-tests-oslat.8-Remove-the-argument-of-bias.patch
|
||||
Patch3: rt-tests-Fix-parsing-of-affinity-when-there-is-a-spa.patch
|
||||
Patch4: rt-numa-ignore-runtime-cpumask-if-a-CPULIST-is-speci.patch
|
||||
|
||||
%description
|
||||
realtime-tests is a set of programs that test and measure various components of
|
||||
@ -38,8 +36,6 @@ latency. It also tests the functioning of priority-inheritance mutexes.
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
|
||||
%build
|
||||
%set_build_flags
|
||||
@ -90,6 +86,21 @@ latency. It also tests the functioning of priority-inheritance mutexes.
|
||||
%{_mandir}/man8/determine_maximum_mpps.8.*
|
||||
|
||||
%changelog
|
||||
* Fri Feb 4 2022 John Kacur <jkacur@redhat.com> - 2.3-3
|
||||
- Don't build unsupported i686
|
||||
Resolves: rhbz#2050375
|
||||
|
||||
* Thu Feb 3 2022 John Kacur <jkacur@redhat.com> - 2.3-2
|
||||
- Fix parsing of affinity
|
||||
- Ignore the runtime cpumask if a new cpumask is requested
|
||||
Resolves: rhbz#2050244
|
||||
|
||||
* Thu Jan 13 2022 Leah Leshchinsky <lleshchi@redhat.com> - 2.3-1
|
||||
- Update to latest upstream 2.3
|
||||
- Correct the comment of numa_initialize()
|
||||
- oslat.8: Remove the argument of --bias
|
||||
Resolves: rhbz#2012297
|
||||
|
||||
* Thu Nov 18 2021 John Kacur <jkacur@redhat.com> - 2.1-6
|
||||
- Fix potential double mount of cgroups for deadline_test
|
||||
- Fix potential double mount of cgroups for cyclicdeadline_test
|
||||
|
Loading…
Reference in New Issue
Block a user