import rt-tests-2.3-1.el8

This commit is contained in:
CentOS Sources 2022-01-19 21:24:56 +00:00 committed by Stepan Oksanichenko
parent 76f8ea87db
commit a93c90a687
9 changed files with 71 additions and 253 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/rt-tests-2.1.tar.xz
SOURCES/rt-tests-2.3.tar.xz

View File

@ -1 +1 @@
36bdf18b18ba5a5a71ff81f102507d0b2015057d SOURCES/rt-tests-2.1.tar.xz
8be587f02ceb1f28f91174ad19df1dc4da48f92c SOURCES/rt-tests-2.3.tar.xz

View 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View 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

View File

@ -5,8 +5,8 @@ Name: rt-tests
# BuildRequires: numactl-devel
# Numa argument to make: NUMA=1
#
Version: 2.1
Release: 4%{?dist}
Version: 2.3
Release: 1%{?dist}
License: GPLv2
Group: Development/Tools
URL: git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
@ -21,10 +21,8 @@ BuildRequires: python3-devel
Requires: bash bc
#Patches
Patch1: rt-tests-Add-missing-option-F-to-optstring.patch
Patch2: rt-tests-deadline_tests-Null-check-to-prevent-exception.patch
Patch3: rt-tests-deadline_test-Fix-double-mount-of-cgroups.patch
Patch4: 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
%description
rt-tests is a set of programs that test and measure various components of
@ -35,8 +33,6 @@ latency. It also tests the functioning of priority-inheritance mutexes.
%setup -q -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
%set_build_flags
@ -91,6 +87,12 @@ rm -rf ${build_root}
%{_mandir}/man8/determine_maximum_mpps.8.*
%changelog
* 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#2012292
* Fri Nov 19 2021 John Kacur <jkacur@redhat.com> - 2.1-4
- Fix potential double mount of cgroups for deadline_test
- Fix potential double mount of cgroups for cyclicdeadline