From 39ada8d8acf9231815196b0b2a62b0f814653dff865c3319476ec819d4c91e9d Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Tue, 18 Apr 2023 08:26:35 +0000 Subject: [PATCH] - Update to version 2.5: https://lore.kernel.org/linux-rt-users/20230120205220.26218-1-jkacur@redhat.com/T/#u - Drop upstreamed patches: * 0001-cyclictest-Fix-threads-being-affined-even-when-a-isn.patch * 0002-rt-tests-Remove-arbitrary-num-of-threads-limits.patch * 0003-rt-tests-hackbench-Add-error-checking-to-connect-and.patch * 0004-rt-tests-hwlatdetect-Update-to-integer-division.patch OBS-URL: https://build.opensuse.org/package/show/benchmark/rt-tests?expand=0&rev=30 --- ...hreads-being-affined-even-when-a-isn.patch | 121 ------------------ ...move-arbitrary-num-of-threads-limits.patch | 75 ----------- ...ch-Add-error-checking-to-connect-and.patch | 43 ------- ...latdetect-Update-to-integer-division.patch | 41 ------ rt-tests-2.4.tar.gz | 3 - rt-tests-2.5.tar.gz | 3 + rt-tests.changes | 11 ++ rt-tests.spec | 8 +- 8 files changed, 16 insertions(+), 289 deletions(-) delete mode 100644 0001-cyclictest-Fix-threads-being-affined-even-when-a-isn.patch delete mode 100644 0002-rt-tests-Remove-arbitrary-num-of-threads-limits.patch delete mode 100644 0003-rt-tests-hackbench-Add-error-checking-to-connect-and.patch delete mode 100644 0004-rt-tests-hwlatdetect-Update-to-integer-division.patch delete mode 100644 rt-tests-2.4.tar.gz create mode 100644 rt-tests-2.5.tar.gz diff --git a/0001-cyclictest-Fix-threads-being-affined-even-when-a-isn.patch b/0001-cyclictest-Fix-threads-being-affined-even-when-a-isn.patch deleted file mode 100644 index 913fa21..0000000 --- a/0001-cyclictest-Fix-threads-being-affined-even-when-a-isn.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 67ceae02e2cae95a2de5f371544dc551e7b86ca6 Mon Sep 17 00:00:00 2001 -From: John Stultz -Date: Thu, 28 Jul 2022 20:22:36 +0000 -Subject: [PATCH 1/4] cyclictest: Fix threads being affined even when -a isn't - set - -Using cyclictest without specifying affinity via -a, I was -noticing a strange issue where the rt threads where not -migrating when being blocked. - -After lots of debugging in the kernel, I found its actually an -issue with cyclictest. - -When using -t there is no behavioral difference between specifying --a or not specifying -a. - -This can be confirmed by adding printf messages around the -pthread_setaffinity_np() call in the threadtest function. - -Currently: - -root@localhost:~/rt-tests# ./cyclictest -t -a -q -D1 -Affining thread 0 to cpu: 0 -Affining thread 1 to cpu: 1 -Affining thread 2 to cpu: 2 -Affining thread 3 to cpu: 3 -Affining thread 4 to cpu: 4 -Affining thread 5 to cpu: 5 -Affining thread 7 to cpu: 7 -Affining thread 6 to cpu: 6 -T: 0 (15034) P: 0 I:1000 C: 1000 Min: 82 Act: 184 Avg: 180 Max: 705 -... - -root@localhost:~/rt-tests# ./cyclictest -t -q -D1 -Affining thread 0 to cpu: 0 -Affining thread 1 to cpu: 1 -Affining thread 2 to cpu: 2 -Affining thread 3 to cpu: 3 -Affining thread 4 to cpu: 4 -Affining thread 5 to cpu: 5 -Affining thread 6 to cpu: 6 -Affining thread 7 to cpu: 7 -T: 0 (15044) P: 0 I:1000 C: 1000 Min: 74 Act: 144 Avg: 162 Max: 860 -.. - -This issue seems to come from the logic in process_options(): - /* if smp wasn't requested, test for numa automatically */ - if (!smp) { - numa = numa_initialize(); - if (setaffinity == AFFINITY_UNSPECIFIED) - setaffinity = AFFINITY_USEALL; - } - -Here, by setting setaffinity = AFFINITY_USEALL, we effectively -pin each thread to its respective cpu, same as the "-a" option. - -This was most recently introduced in commit bdb8350f1b0b -("Revert "cyclictest: Use affinity_mask for steering -thread placement""). - -This seems erronious to me, so I wanted to share this patch -which removes the overriding AFFINITY_UNSPECIFIED with -AFFINITY_USEALL by default. Also, some additional tweaks to -preserve the existing numa allocation affinity. - -With this patch, we no longer call pthread_setaffinity_np() in the -"./cyclictest -t -q -D1" case. - -Cc: John Kacur -Cc: Connor O'Brien -Cc: Qais Yousef -Signed-off-by: John Stultz -Signed-off-by: John Kacur - -[ upstream status: 2d910eecf10cd806e22abeb1d96189f87ef74d91 ] - -Signed-off-by: Petr Vorel ---- - src/cyclictest/cyclictest.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c -index decea78..82759d1 100644 ---- a/src/cyclictest/cyclictest.c -+++ b/src/cyclictest/cyclictest.c -@@ -1270,8 +1270,6 @@ static void process_options(int argc, char *argv[], int max_cpus) - /* if smp wasn't requested, test for numa automatically */ - if (!smp) { - numa = numa_initialize(); -- if (setaffinity == AFFINITY_UNSPECIFIED) -- setaffinity = AFFINITY_USEALL; - } - - if (option_affinity) { -@@ -2043,9 +2041,13 @@ int main(int argc, char **argv) - void *stack; - void *currstk; - size_t stksize; -+ int node_cpu = cpu; -+ -+ if (node_cpu == -1) -+ node_cpu = cpu_for_thread_ua(i, max_cpus); - - /* find the memory node associated with the cpu i */ -- node = rt_numa_numa_node_of_cpu(cpu); -+ node = rt_numa_numa_node_of_cpu(node_cpu); - - /* get the stack size set for this thread */ - if (pthread_attr_getstack(&attr, &currstk, &stksize)) -@@ -2056,7 +2058,7 @@ int main(int argc, char **argv) - stksize = PTHREAD_STACK_MIN * 2; - - /* allocate memory for a stack on appropriate node */ -- stack = rt_numa_numa_alloc_onnode(stksize, node, cpu); -+ stack = rt_numa_numa_alloc_onnode(stksize, node, node_cpu); - - /* touch the stack pages to pre-fault them in */ - memset(stack, 0, stksize); --- -2.38.1 - diff --git a/0002-rt-tests-Remove-arbitrary-num-of-threads-limits.patch b/0002-rt-tests-Remove-arbitrary-num-of-threads-limits.patch deleted file mode 100644 index 46c36df..0000000 --- a/0002-rt-tests-Remove-arbitrary-num-of-threads-limits.patch +++ /dev/null @@ -1,75 +0,0 @@ -From ce8792449b1284971f1f90b7b2de8fea7153676f Mon Sep 17 00:00:00 2001 -From: John Kacur -Date: Thu, 6 Oct 2022 16:00:44 -0400 -Subject: [PATCH 2/4] rt-tests: Remove arbitrary num of threads limits - -Remove the arbitrary limit to the number of threads in pmqtest, -ptsematest, sigwaittest and svsematest. - -Signed-off-by: John Kacur - -[ upstream status: d356a6ae3cbf3cf4ec7fe130bfa4a8e392b910e6 ] - -Signed-off-by: Petr Vorel ---- - src/pmqtest/pmqtest.c | 2 +- - src/ptsematest/ptsematest.c | 2 +- - src/sigwaittest/sigwaittest.c | 2 +- - src/svsematest/svsematest.c | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c -index 6ad0a92..9e14278 100644 ---- a/src/pmqtest/pmqtest.c -+++ b/src/pmqtest/pmqtest.c -@@ -393,7 +393,7 @@ static void process_options(int argc, char *argv[]) - } - } - -- if (num_threads < 0 || num_threads > 255) -+ if (num_threads < 0) - error = 1; - - if (priority < 0 || priority > 99) -diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c -index e000c30..a9d6c69 100644 ---- a/src/ptsematest/ptsematest.c -+++ b/src/ptsematest/ptsematest.c -@@ -299,7 +299,7 @@ static void process_options(int argc, char *argv[]) - } - } - -- if (num_threads < 0 || num_threads > 255) -+ if (num_threads < 0) - error = 1; - - if (priority < 0 || priority > 99) -diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c -index d0d79df..728176a 100644 ---- a/src/sigwaittest/sigwaittest.c -+++ b/src/sigwaittest/sigwaittest.c -@@ -369,7 +369,7 @@ static void process_options(int argc, char *argv[]) - if (duration < 0) - error = 1; - -- if (num_threads < 1 || num_threads > 255) -+ if (num_threads < 1) - error = 1; - - if (priority < 0 || priority > 99) -diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c -index 22ea7bc..243b137 100644 ---- a/src/svsematest/svsematest.c -+++ b/src/svsematest/svsematest.c -@@ -398,7 +398,7 @@ static void process_options(int argc, char *argv[]) - if (duration < 0) - error = 0; - -- if (num_threads < 1 || num_threads > 255) -+ if (num_threads < 1) - error = 1; - - if (priority < 0 || priority > 99) --- -2.38.1 - diff --git a/0003-rt-tests-hackbench-Add-error-checking-to-connect-and.patch b/0003-rt-tests-hackbench-Add-error-checking-to-connect-and.patch deleted file mode 100644 index 6a826ae..0000000 --- a/0003-rt-tests-hackbench-Add-error-checking-to-connect-and.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 7cd6289fbebfc436e0f157f1fd2731a684b3af95 Mon Sep 17 00:00:00 2001 -From: John Kacur -Date: Tue, 1 Nov 2022 09:30:40 -0400 -Subject: [PATCH 3/4] rt-tests: hackbench: Add error checking to connect and - getsockname - -Add error checking around the calls connect and getsockname - -Signed-off-by: John Kacur - -[ upstream status: c7768aae2e6d9e5440a3f4dc62d6e03f05df80f4 ] - -Signed-off-by: Petr Vorel ---- - src/hackbench/hackbench.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c -index 18c9284..8c6d835 100644 ---- a/src/hackbench/hackbench.c -+++ b/src/hackbench/hackbench.c -@@ -130,14 +130,16 @@ static int inet_socketpair(int fds[2]) - - if (bind(s1, &sin, len) < 0) - barf("bind"); -- getsockname(s1, &sin, &len); -+ if (getsockname(s1, &sin, &len) < 0) -+ barf("getsockname"); - if (listen(s1, 10) < 0) - barf("listen"); - if (ioctl(s2, FIONBIO, &ul) < 0) - barf("ioctl"); - if (ioctl(s1, FIONBIO, &ul) < 0) - barf("ioctl"); -- connect(s2, &sin, len); -+ if (connect(s2, &sin, len) < 0) -+ barf("connect"); - if ((fds[0] = accept(s1, &sin, &len)) < 0) - barf("accept"); - ul = 0; --- -2.38.1 - diff --git a/0004-rt-tests-hwlatdetect-Update-to-integer-division.patch b/0004-rt-tests-hwlatdetect-Update-to-integer-division.patch deleted file mode 100644 index 43bb2e7..0000000 --- a/0004-rt-tests-hwlatdetect-Update-to-integer-division.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 4d5e69dc656f063e8832a4e3bf6f4734f6e1fbc6 Mon Sep 17 00:00:00 2001 -From: Leah Leshchinsky -Date: Thu, 10 Nov 2022 10:35:27 -0500 -Subject: [PATCH 4/4] rt-tests: hwlatdetect: Update to integer division - -In Python 3, "/" is a float division operator, as opposed to Python 2, -which defaults to integer division. This results in an error when -calculating width, which assumes an integer. - -Update width division to integer division with the "//" operator. - -Signed-off-by: Leah Leshchinsky -Signed-off-by: John Kacur - -[ upstream status: 1eaa7feae3225ae82d00d2e1f02986e34c31a38d ] - -Signed-off-by: Petr Vorel ---- - src/hwlatdetect/hwlatdetect.py | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py -index 9ef50f8..bef1af2 100755 ---- a/src/hwlatdetect/hwlatdetect.py -+++ b/src/hwlatdetect/hwlatdetect.py -@@ -454,9 +454,10 @@ if __name__ == '__main__': - - if args.window: - w = microseconds(args.window) -+ width = w//2 - if w < int(detect.get("width")): -- debug("shrinking width to %d for new window of %d" % (w/2, w)) -- detect.set("width", w/2) -+ debug("shrinking width to %d for new window of %d" % (width, w)) -+ detect.set("width", width) - debug("window parameter = %d" % w) - detect.set("window", w) - debug("window for sampling set to %dus" % w) --- -2.38.1 - diff --git a/rt-tests-2.4.tar.gz b/rt-tests-2.4.tar.gz deleted file mode 100644 index 2833215..0000000 --- a/rt-tests-2.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cae49f7984da099d05d465d09039c7f0f06fcb3476c3f5c38ad37c72c1c1f711 -size 151194 diff --git a/rt-tests-2.5.tar.gz b/rt-tests-2.5.tar.gz new file mode 100644 index 0000000..a9f2c3c --- /dev/null +++ b/rt-tests-2.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f3377601dcb6fbb63c84a65ac568d62d886c075144f3b5906c32b52775dd9c5 +size 151638 diff --git a/rt-tests.changes b/rt-tests.changes index 609c243..4aee04f 100644 --- a/rt-tests.changes +++ b/rt-tests.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Apr 18 08:23:24 UTC 2023 - Martin Pluskal + +- Update to version 2.5: + https://lore.kernel.org/linux-rt-users/20230120205220.26218-1-jkacur@redhat.com/T/#u +- Drop upstreamed patches: + * 0001-cyclictest-Fix-threads-being-affined-even-when-a-isn.patch + * 0002-rt-tests-Remove-arbitrary-num-of-threads-limits.patch + * 0003-rt-tests-hackbench-Add-error-checking-to-connect-and.patch + * 0004-rt-tests-hwlatdetect-Update-to-integer-division.patch + ------------------------------------------------------------------- Fri Nov 25 09:19:51 UTC 2022 - Martin Pluskal diff --git a/rt-tests.spec b/rt-tests.spec index 65a2141..af6559d 100644 --- a/rt-tests.spec +++ b/rt-tests.spec @@ -1,7 +1,7 @@ # # spec file for package rt-tests # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,17 +17,13 @@ Name: rt-tests -Version: 2.4 +Version: 2.5 Release: 0 Summary: Realtime Kernel Testsuite License: GPL-2.0-only Group: System/Benchmark URL: https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git Source0: https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/snapshot/rt-tests-%{version}.tar.gz -Patch1: 0001-cyclictest-Fix-threads-being-affined-even-when-a-isn.patch -Patch2: 0002-rt-tests-Remove-arbitrary-num-of-threads-limits.patch -Patch3: 0003-rt-tests-hackbench-Add-error-checking-to-connect-and.patch -Patch4: 0004-rt-tests-hwlatdetect-Update-to-integer-division.patch BuildRequires: libnuma-devel BuildRequires: python-rpm-macros BuildRequires: python3-base