]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up some selftests
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jul 2024 09:23:12 +0000 (11:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jul 2024 09:23:12 +0000 (11:23 +0200)
12 files changed:
queue-4.19/selftests-mm-compaction_test-fix-bogus-test-success-.patch
queue-4.19/selftests-mm-log-a-consistent-test-name-for-check_co.patch [deleted file]
queue-4.19/series
queue-5.10/selftests-mm-compaction_test-fix-bogus-test-success-.patch
queue-5.10/selftests-mm-log-a-consistent-test-name-for-check_co.patch [deleted file]
queue-5.10/series
queue-5.15/selftests-mm-compaction_test-fix-bogus-test-success-.patch
queue-5.15/selftests-mm-log-a-consistent-test-name-for-check_co.patch [deleted file]
queue-5.15/series
queue-5.4/selftests-mm-compaction_test-fix-bogus-test-success-.patch
queue-5.4/selftests-mm-log-a-consistent-test-name-for-check_co.patch [deleted file]
queue-5.4/series

index 09b56869cb68e6477c6238d4f32c196c487341b8..3fadb912f3cca7d7d492034cb792b55371a07ad5 100644 (file)
@@ -1,4 +1,4 @@
-From 448bd11b77ad8b8520508415817b5f31c21f5d61 Mon Sep 17 00:00:00 2001
+From 7942fb2584daa8140ea8680021b03bf0b9c9a0d4 Mon Sep 17 00:00:00 2001
 From: Sasha Levin <sashal@kernel.org>
 Date: Tue, 21 May 2024 13:13:56 +0530
 Subject: selftests/mm: compaction_test: fix bogus test success on Aarch64
@@ -50,12 +50,11 @@ Cc: Sri Jayaramappa <sjayaram@akamai.com>
 Cc: <stable@vger.kernel.org>
 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- tools/testing/selftests/vm/compaction_test.c | 20 +++++++++++++-------
- 1 file changed, 13 insertions(+), 7 deletions(-)
+ tools/testing/selftests/vm/compaction_test.c |   16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
 
-diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
-index 6be4b70a26592..b5587a751664a 100644
 --- a/tools/testing/selftests/vm/compaction_test.c
 +++ b/tools/testing/selftests/vm/compaction_test.c
 @@ -81,12 +81,13 @@ int prereq(void)
@@ -75,7 +74,7 @@ index 6be4b70a26592..b5587a751664a 100644
  
        /* We want to test with 80% of available memory. Else, OOM killer comes
           in to play */
-@@ -135,7 +136,12 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
+@@ -134,7 +135,12 @@ int check_compaction(unsigned long mem_f
  
        /* We should have been able to request at least 1/3 rd of the memory in
           huge pages */
@@ -89,21 +88,12 @@ index 6be4b70a26592..b5587a751664a 100644
  
        lseek(fd, 0, SEEK_SET);
  
-@@ -146,11 +152,11 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-               goto close_fd;
+@@ -146,7 +152,7 @@ int check_compaction(unsigned long mem_f
        }
  
--      ksft_print_msg("Number of huge pages allocated = %d\n",
--                     atoi(nr_hugepages));
-+      ksft_print_msg("Number of huge pages allocated = %lu\n",
-+                     nr_hugepages_ul);
        if (compaction_index > 3) {
 -              ksft_print_msg("ERROR: Less that 1/%d of memory is available\n"
 +              ksft_print_msg("ERROR: Less than 1/%d of memory is available\n"
                               "as huge pages\n", compaction_index);
+               ksft_test_result_fail("No of huge pages allocated = %d\n", (atoi(nr_hugepages)));
                goto close_fd;
-       }
--- 
-2.43.0
-
diff --git a/queue-4.19/selftests-mm-log-a-consistent-test-name-for-check_co.patch b/queue-4.19/selftests-mm-log-a-consistent-test-name-for-check_co.patch
deleted file mode 100644 (file)
index f64dbf6..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-From b0347c3007a19e5326f323611d0f7bdf5186e523 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 9 Feb 2024 14:30:04 +0000
-Subject: selftests/mm: log a consistent test name for check_compaction
-
-From: Mark Brown <broonie@kernel.org>
-
-[ Upstream commit f3b7568c49420d2dcd251032c9ca1e069ec8a6c9 ]
-
-Every test result report in the compaction test prints a distinct log
-messae, and some of the reports print a name that varies at runtime.  This
-causes problems for automation since a lot of automation software uses the
-printed string as the name of the test, if the name varies from run to run
-and from pass to fail then the automation software can't identify that a
-test changed result or that the same tests are being run.
-
-Refactor the logging to use a consistent name when printing the result of
-the test, printing the existing messages as diagnostic information instead
-so they are still available for people trying to interpret the results.
-
-Link: https://lkml.kernel.org/r/20240209-kselftest-mm-cleanup-v1-2-a3c0386496b5@kernel.org
-Signed-off-by: Mark Brown <broonie@kernel.org>
-Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
-Cc: Ryan Roberts <ryan.roberts@arm.com>
-Cc: Shuah Khan <shuah@kernel.org>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Stable-dep-of: d4202e66a4b1 ("selftests/mm: compaction_test: fix bogus test success on Aarch64")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/testing/selftests/vm/compaction_test.c | 35 +++++++++++---------
- 1 file changed, 19 insertions(+), 16 deletions(-)
-
-diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
-index 43f5044b23c57..6be4b70a26592 100644
---- a/tools/testing/selftests/vm/compaction_test.c
-+++ b/tools/testing/selftests/vm/compaction_test.c
-@@ -94,14 +94,15 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK);
-       if (fd < 0) {
--              ksft_test_result_fail("Failed to open /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
--              return -1;
-+              ksft_print_msg("Failed to open /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-+              ret = -1;
-+              goto out;
-       }
-       if (read(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) <= 0) {
--              ksft_test_result_fail("Failed to read from /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to read from /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -109,8 +110,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       /* Start with the initial condition of 0 huge pages*/
-       if (write(fd, "0", sizeof(char)) != sizeof(char)) {
--              ksft_test_result_fail("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -119,16 +120,16 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       /* Request a large number of huge pages. The Kernel will allocate
-          as much as it can */
-       if (write(fd, "100000", (6*sizeof(char))) != (6*sizeof(char))) {
--              ksft_test_result_fail("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-       lseek(fd, 0, SEEK_SET);
-       if (read(fd, nr_hugepages, sizeof(nr_hugepages)) <= 0) {
--              ksft_test_result_fail("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -140,24 +141,26 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages))
-           != strlen(initial_nr_hugepages)) {
--              ksft_test_result_fail("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-+      ksft_print_msg("Number of huge pages allocated = %d\n",
-+                     atoi(nr_hugepages));
-+
-       if (compaction_index > 3) {
-               ksft_print_msg("ERROR: Less that 1/%d of memory is available\n"
-                              "as huge pages\n", compaction_index);
--              ksft_test_result_fail("No of huge pages allocated = %d\n", (atoi(nr_hugepages)));
-               goto close_fd;
-       }
--      ksft_test_result_pass("Memory compaction succeeded. No of huge pages allocated = %d\n",
--                            (atoi(nr_hugepages)));
-       ret = 0;
-  close_fd:
-       close(fd);
-+ out:
-+      ksft_test_result(ret == 0, "check_compaction\n");
-       return ret;
- }
--- 
-2.43.0
-
index beebcb68571ba90ba5017bf36062d2af2c6bcabb..d8f9c2ee0f321b7f96f7bb4f9c39c0614ca34c02 100644 (file)
@@ -21,7 +21,6 @@ serial-sc16is7xx-fix-bug-in-sc16is7xx_set_baud-when-.patch
 media-mc-mark-the-media-devnode-as-registered-from-t.patch
 selftests-mm-compaction_test-fix-incorrect-write-of-.patch
 selftests-mm-conform-test-to-tap-format-output.patch
-selftests-mm-log-a-consistent-test-name-for-check_co.patch
 selftests-mm-compaction_test-fix-bogus-test-success-.patch
 nilfs2-remove-check-for-pageerror.patch
 nilfs2-return-the-mapped-address-from-nilfs_get_page.patch
index a6597b546ca64ad66da2ee3ad731d99506cd298f..21491704b97f11ee15c268106cfecb806a585616 100644 (file)
@@ -1,4 +1,4 @@
-From 9d8d252585ec1b5418abb31badaf842030dc7eec Mon Sep 17 00:00:00 2001
+From 7942fb2584daa8140ea8680021b03bf0b9c9a0d4 Mon Sep 17 00:00:00 2001
 From: Sasha Levin <sashal@kernel.org>
 Date: Tue, 21 May 2024 13:13:56 +0530
 Subject: selftests/mm: compaction_test: fix bogus test success on Aarch64
@@ -50,12 +50,11 @@ Cc: Sri Jayaramappa <sjayaram@akamai.com>
 Cc: <stable@vger.kernel.org>
 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- tools/testing/selftests/vm/compaction_test.c | 20 +++++++++++++-------
- 1 file changed, 13 insertions(+), 7 deletions(-)
+ tools/testing/selftests/vm/compaction_test.c |   16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
 
-diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
-index 6aa6460b854ea..309b3750e57e1 100644
 --- a/tools/testing/selftests/vm/compaction_test.c
 +++ b/tools/testing/selftests/vm/compaction_test.c
 @@ -82,12 +82,13 @@ int prereq(void)
@@ -75,7 +74,7 @@ index 6aa6460b854ea..309b3750e57e1 100644
  
        /* We want to test with 80% of available memory. Else, OOM killer comes
           in to play */
-@@ -136,7 +137,12 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
+@@ -135,7 +136,12 @@ int check_compaction(unsigned long mem_f
  
        /* We should have been able to request at least 1/3 rd of the memory in
           huge pages */
@@ -89,21 +88,12 @@ index 6aa6460b854ea..309b3750e57e1 100644
  
        lseek(fd, 0, SEEK_SET);
  
-@@ -147,11 +153,11 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-               goto close_fd;
+@@ -147,7 +153,7 @@ int check_compaction(unsigned long mem_f
        }
  
--      ksft_print_msg("Number of huge pages allocated = %d\n",
--                     atoi(nr_hugepages));
-+      ksft_print_msg("Number of huge pages allocated = %lu\n",
-+                     nr_hugepages_ul);
        if (compaction_index > 3) {
 -              ksft_print_msg("ERROR: Less that 1/%d of memory is available\n"
 +              ksft_print_msg("ERROR: Less than 1/%d of memory is available\n"
                               "as huge pages\n", compaction_index);
+               ksft_test_result_fail("No of huge pages allocated = %d\n", (atoi(nr_hugepages)));
                goto close_fd;
-       }
--- 
-2.43.0
-
diff --git a/queue-5.10/selftests-mm-log-a-consistent-test-name-for-check_co.patch b/queue-5.10/selftests-mm-log-a-consistent-test-name-for-check_co.patch
deleted file mode 100644 (file)
index 159c5fd..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-From 6ba5b2b42f336d4ea9dfb04eac54464007ab588c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 9 Feb 2024 14:30:04 +0000
-Subject: selftests/mm: log a consistent test name for check_compaction
-
-From: Mark Brown <broonie@kernel.org>
-
-[ Upstream commit f3b7568c49420d2dcd251032c9ca1e069ec8a6c9 ]
-
-Every test result report in the compaction test prints a distinct log
-messae, and some of the reports print a name that varies at runtime.  This
-causes problems for automation since a lot of automation software uses the
-printed string as the name of the test, if the name varies from run to run
-and from pass to fail then the automation software can't identify that a
-test changed result or that the same tests are being run.
-
-Refactor the logging to use a consistent name when printing the result of
-the test, printing the existing messages as diagnostic information instead
-so they are still available for people trying to interpret the results.
-
-Link: https://lkml.kernel.org/r/20240209-kselftest-mm-cleanup-v1-2-a3c0386496b5@kernel.org
-Signed-off-by: Mark Brown <broonie@kernel.org>
-Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
-Cc: Ryan Roberts <ryan.roberts@arm.com>
-Cc: Shuah Khan <shuah@kernel.org>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Stable-dep-of: d4202e66a4b1 ("selftests/mm: compaction_test: fix bogus test success on Aarch64")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/testing/selftests/vm/compaction_test.c | 35 +++++++++++---------
- 1 file changed, 19 insertions(+), 16 deletions(-)
-
-diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
-index f81931c1f8386..6aa6460b854ea 100644
---- a/tools/testing/selftests/vm/compaction_test.c
-+++ b/tools/testing/selftests/vm/compaction_test.c
-@@ -95,14 +95,15 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK);
-       if (fd < 0) {
--              ksft_test_result_fail("Failed to open /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
--              return -1;
-+              ksft_print_msg("Failed to open /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-+              ret = -1;
-+              goto out;
-       }
-       if (read(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) <= 0) {
--              ksft_test_result_fail("Failed to read from /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to read from /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -110,8 +111,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       /* Start with the initial condition of 0 huge pages*/
-       if (write(fd, "0", sizeof(char)) != sizeof(char)) {
--              ksft_test_result_fail("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -120,16 +121,16 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       /* Request a large number of huge pages. The Kernel will allocate
-          as much as it can */
-       if (write(fd, "100000", (6*sizeof(char))) != (6*sizeof(char))) {
--              ksft_test_result_fail("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-       lseek(fd, 0, SEEK_SET);
-       if (read(fd, nr_hugepages, sizeof(nr_hugepages)) <= 0) {
--              ksft_test_result_fail("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -141,24 +142,26 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages))
-           != strlen(initial_nr_hugepages)) {
--              ksft_test_result_fail("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-+      ksft_print_msg("Number of huge pages allocated = %d\n",
-+                     atoi(nr_hugepages));
-+
-       if (compaction_index > 3) {
-               ksft_print_msg("ERROR: Less that 1/%d of memory is available\n"
-                              "as huge pages\n", compaction_index);
--              ksft_test_result_fail("No of huge pages allocated = %d\n", (atoi(nr_hugepages)));
-               goto close_fd;
-       }
--      ksft_test_result_pass("Memory compaction succeeded. No of huge pages allocated = %d\n",
--                            (atoi(nr_hugepages)));
-       ret = 0;
-  close_fd:
-       close(fd);
-+ out:
-+      ksft_test_result(ret == 0, "check_compaction\n");
-       return ret;
- }
--- 
-2.43.0
-
index dd79fce31b6cec51a26a99e4d4a930c76cea4ffe..8a03fdd4be0b752b3ca904231ada3141bec997aa 100644 (file)
@@ -33,7 +33,6 @@ serial-sc16is7xx-fix-bug-in-sc16is7xx_set_baud-when-.patch
 mmc-davinci-don-t-strip-remove-function-when-driver-.patch
 selftests-mm-compaction_test-fix-incorrect-write-of-.patch
 selftests-mm-conform-test-to-tap-format-output.patch
-selftests-mm-log-a-consistent-test-name-for-check_co.patch
 selftests-mm-compaction_test-fix-bogus-test-success-.patch
 s390-cpacf-get-rid-of-register-asm.patch
 s390-cpacf-split-and-rework-cpacf-query-functions.patch
index 8d6212a730af281fac62467364ff4caff17e3129..21491704b97f11ee15c268106cfecb806a585616 100644 (file)
@@ -50,12 +50,11 @@ Cc: Sri Jayaramappa <sjayaram@akamai.com>
 Cc: <stable@vger.kernel.org>
 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- tools/testing/selftests/vm/compaction_test.c | 20 +++++++++++++-------
- 1 file changed, 13 insertions(+), 7 deletions(-)
+ tools/testing/selftests/vm/compaction_test.c |   16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
 
-diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
-index 6aa6460b854ea..309b3750e57e1 100644
 --- a/tools/testing/selftests/vm/compaction_test.c
 +++ b/tools/testing/selftests/vm/compaction_test.c
 @@ -82,12 +82,13 @@ int prereq(void)
@@ -75,7 +74,7 @@ index 6aa6460b854ea..309b3750e57e1 100644
  
        /* We want to test with 80% of available memory. Else, OOM killer comes
           in to play */
-@@ -136,7 +137,12 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
+@@ -135,7 +136,12 @@ int check_compaction(unsigned long mem_f
  
        /* We should have been able to request at least 1/3 rd of the memory in
           huge pages */
@@ -89,21 +88,12 @@ index 6aa6460b854ea..309b3750e57e1 100644
  
        lseek(fd, 0, SEEK_SET);
  
-@@ -147,11 +153,11 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-               goto close_fd;
+@@ -147,7 +153,7 @@ int check_compaction(unsigned long mem_f
        }
  
--      ksft_print_msg("Number of huge pages allocated = %d\n",
--                     atoi(nr_hugepages));
-+      ksft_print_msg("Number of huge pages allocated = %lu\n",
-+                     nr_hugepages_ul);
        if (compaction_index > 3) {
 -              ksft_print_msg("ERROR: Less that 1/%d of memory is available\n"
 +              ksft_print_msg("ERROR: Less than 1/%d of memory is available\n"
                               "as huge pages\n", compaction_index);
+               ksft_test_result_fail("No of huge pages allocated = %d\n", (atoi(nr_hugepages)));
                goto close_fd;
-       }
--- 
-2.43.0
-
diff --git a/queue-5.15/selftests-mm-log-a-consistent-test-name-for-check_co.patch b/queue-5.15/selftests-mm-log-a-consistent-test-name-for-check_co.patch
deleted file mode 100644 (file)
index 7f00463..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-From 853c0f059d7a91d4bd850040a0da0512dbfeedda Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 9 Feb 2024 14:30:04 +0000
-Subject: selftests/mm: log a consistent test name for check_compaction
-
-From: Mark Brown <broonie@kernel.org>
-
-[ Upstream commit f3b7568c49420d2dcd251032c9ca1e069ec8a6c9 ]
-
-Every test result report in the compaction test prints a distinct log
-messae, and some of the reports print a name that varies at runtime.  This
-causes problems for automation since a lot of automation software uses the
-printed string as the name of the test, if the name varies from run to run
-and from pass to fail then the automation software can't identify that a
-test changed result or that the same tests are being run.
-
-Refactor the logging to use a consistent name when printing the result of
-the test, printing the existing messages as diagnostic information instead
-so they are still available for people trying to interpret the results.
-
-Link: https://lkml.kernel.org/r/20240209-kselftest-mm-cleanup-v1-2-a3c0386496b5@kernel.org
-Signed-off-by: Mark Brown <broonie@kernel.org>
-Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
-Cc: Ryan Roberts <ryan.roberts@arm.com>
-Cc: Shuah Khan <shuah@kernel.org>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Stable-dep-of: d4202e66a4b1 ("selftests/mm: compaction_test: fix bogus test success on Aarch64")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/testing/selftests/vm/compaction_test.c | 35 +++++++++++---------
- 1 file changed, 19 insertions(+), 16 deletions(-)
-
-diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
-index f81931c1f8386..6aa6460b854ea 100644
---- a/tools/testing/selftests/vm/compaction_test.c
-+++ b/tools/testing/selftests/vm/compaction_test.c
-@@ -95,14 +95,15 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK);
-       if (fd < 0) {
--              ksft_test_result_fail("Failed to open /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
--              return -1;
-+              ksft_print_msg("Failed to open /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-+              ret = -1;
-+              goto out;
-       }
-       if (read(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) <= 0) {
--              ksft_test_result_fail("Failed to read from /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to read from /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -110,8 +111,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       /* Start with the initial condition of 0 huge pages*/
-       if (write(fd, "0", sizeof(char)) != sizeof(char)) {
--              ksft_test_result_fail("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -120,16 +121,16 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       /* Request a large number of huge pages. The Kernel will allocate
-          as much as it can */
-       if (write(fd, "100000", (6*sizeof(char))) != (6*sizeof(char))) {
--              ksft_test_result_fail("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-       lseek(fd, 0, SEEK_SET);
-       if (read(fd, nr_hugepages, sizeof(nr_hugepages)) <= 0) {
--              ksft_test_result_fail("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -141,24 +142,26 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages))
-           != strlen(initial_nr_hugepages)) {
--              ksft_test_result_fail("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-+      ksft_print_msg("Number of huge pages allocated = %d\n",
-+                     atoi(nr_hugepages));
-+
-       if (compaction_index > 3) {
-               ksft_print_msg("ERROR: Less that 1/%d of memory is available\n"
-                              "as huge pages\n", compaction_index);
--              ksft_test_result_fail("No of huge pages allocated = %d\n", (atoi(nr_hugepages)));
-               goto close_fd;
-       }
--      ksft_test_result_pass("Memory compaction succeeded. No of huge pages allocated = %d\n",
--                            (atoi(nr_hugepages)));
-       ret = 0;
-  close_fd:
-       close(fd);
-+ out:
-+      ksft_test_result(ret == 0, "check_compaction\n");
-       return ret;
- }
--- 
-2.43.0
-
index 7839e5bab4ecb318a73c5a96ae968d97d3d83be2..a58af1e5d8af228940e81f1af7de09675c3e7936 100644 (file)
@@ -64,7 +64,6 @@ cma-factor-out-minimum-alignment-requirement.patch
 mm-cma-drop-incorrect-alignment-check-in-cma_init_re.patch
 selftests-mm-compaction_test-fix-incorrect-write-of-.patch
 selftests-mm-conform-test-to-tap-format-output.patch
-selftests-mm-log-a-consistent-test-name-for-check_co.patch
 selftests-mm-compaction_test-fix-bogus-test-success-.patch
 wifi-ath10k-fix-qcom_rproc_common-dependency.patch
 btrfs-fix-leak-of-qgroup-extent-records-after-transa.patch
index 097b6f9fcaddd6eea9c396711f3cf21730354099..3fadb912f3cca7d7d492034cb792b55371a07ad5 100644 (file)
@@ -1,4 +1,4 @@
-From 7fb9fe70fa9377ba39c88b68f9d22245c005f2cd Mon Sep 17 00:00:00 2001
+From 7942fb2584daa8140ea8680021b03bf0b9c9a0d4 Mon Sep 17 00:00:00 2001
 From: Sasha Levin <sashal@kernel.org>
 Date: Tue, 21 May 2024 13:13:56 +0530
 Subject: selftests/mm: compaction_test: fix bogus test success on Aarch64
@@ -50,12 +50,11 @@ Cc: Sri Jayaramappa <sjayaram@akamai.com>
 Cc: <stable@vger.kernel.org>
 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- tools/testing/selftests/vm/compaction_test.c | 20 +++++++++++++-------
- 1 file changed, 13 insertions(+), 7 deletions(-)
+ tools/testing/selftests/vm/compaction_test.c |   16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
 
-diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
-index 6be4b70a26592..b5587a751664a 100644
 --- a/tools/testing/selftests/vm/compaction_test.c
 +++ b/tools/testing/selftests/vm/compaction_test.c
 @@ -81,12 +81,13 @@ int prereq(void)
@@ -75,7 +74,7 @@ index 6be4b70a26592..b5587a751664a 100644
  
        /* We want to test with 80% of available memory. Else, OOM killer comes
           in to play */
-@@ -135,7 +136,12 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
+@@ -134,7 +135,12 @@ int check_compaction(unsigned long mem_f
  
        /* We should have been able to request at least 1/3 rd of the memory in
           huge pages */
@@ -89,21 +88,12 @@ index 6be4b70a26592..b5587a751664a 100644
  
        lseek(fd, 0, SEEK_SET);
  
-@@ -146,11 +152,11 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-               goto close_fd;
+@@ -146,7 +152,7 @@ int check_compaction(unsigned long mem_f
        }
  
--      ksft_print_msg("Number of huge pages allocated = %d\n",
--                     atoi(nr_hugepages));
-+      ksft_print_msg("Number of huge pages allocated = %lu\n",
-+                     nr_hugepages_ul);
        if (compaction_index > 3) {
 -              ksft_print_msg("ERROR: Less that 1/%d of memory is available\n"
 +              ksft_print_msg("ERROR: Less than 1/%d of memory is available\n"
                               "as huge pages\n", compaction_index);
+               ksft_test_result_fail("No of huge pages allocated = %d\n", (atoi(nr_hugepages)));
                goto close_fd;
-       }
--- 
-2.43.0
-
diff --git a/queue-5.4/selftests-mm-log-a-consistent-test-name-for-check_co.patch b/queue-5.4/selftests-mm-log-a-consistent-test-name-for-check_co.patch
deleted file mode 100644 (file)
index 0169621..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-From b97247d12bfda0ea6dc5ebf3ac5f13750ab1f72c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 9 Feb 2024 14:30:04 +0000
-Subject: selftests/mm: log a consistent test name for check_compaction
-
-From: Mark Brown <broonie@kernel.org>
-
-[ Upstream commit f3b7568c49420d2dcd251032c9ca1e069ec8a6c9 ]
-
-Every test result report in the compaction test prints a distinct log
-messae, and some of the reports print a name that varies at runtime.  This
-causes problems for automation since a lot of automation software uses the
-printed string as the name of the test, if the name varies from run to run
-and from pass to fail then the automation software can't identify that a
-test changed result or that the same tests are being run.
-
-Refactor the logging to use a consistent name when printing the result of
-the test, printing the existing messages as diagnostic information instead
-so they are still available for people trying to interpret the results.
-
-Link: https://lkml.kernel.org/r/20240209-kselftest-mm-cleanup-v1-2-a3c0386496b5@kernel.org
-Signed-off-by: Mark Brown <broonie@kernel.org>
-Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
-Cc: Ryan Roberts <ryan.roberts@arm.com>
-Cc: Shuah Khan <shuah@kernel.org>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Stable-dep-of: d4202e66a4b1 ("selftests/mm: compaction_test: fix bogus test success on Aarch64")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- tools/testing/selftests/vm/compaction_test.c | 35 +++++++++++---------
- 1 file changed, 19 insertions(+), 16 deletions(-)
-
-diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
-index 43f5044b23c57..6be4b70a26592 100644
---- a/tools/testing/selftests/vm/compaction_test.c
-+++ b/tools/testing/selftests/vm/compaction_test.c
-@@ -94,14 +94,15 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK);
-       if (fd < 0) {
--              ksft_test_result_fail("Failed to open /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
--              return -1;
-+              ksft_print_msg("Failed to open /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-+              ret = -1;
-+              goto out;
-       }
-       if (read(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) <= 0) {
--              ksft_test_result_fail("Failed to read from /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to read from /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -109,8 +110,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       /* Start with the initial condition of 0 huge pages*/
-       if (write(fd, "0", sizeof(char)) != sizeof(char)) {
--              ksft_test_result_fail("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write 0 to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -119,16 +120,16 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       /* Request a large number of huge pages. The Kernel will allocate
-          as much as it can */
-       if (write(fd, "100000", (6*sizeof(char))) != (6*sizeof(char))) {
--              ksft_test_result_fail("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-       lseek(fd, 0, SEEK_SET);
-       if (read(fd, nr_hugepages, sizeof(nr_hugepages)) <= 0) {
--              ksft_test_result_fail("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to re-read from /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-@@ -140,24 +141,26 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
-       if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages))
-           != strlen(initial_nr_hugepages)) {
--              ksft_test_result_fail("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n",
--                                    strerror(errno));
-+              ksft_print_msg("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n",
-+                             strerror(errno));
-               goto close_fd;
-       }
-+      ksft_print_msg("Number of huge pages allocated = %d\n",
-+                     atoi(nr_hugepages));
-+
-       if (compaction_index > 3) {
-               ksft_print_msg("ERROR: Less that 1/%d of memory is available\n"
-                              "as huge pages\n", compaction_index);
--              ksft_test_result_fail("No of huge pages allocated = %d\n", (atoi(nr_hugepages)));
-               goto close_fd;
-       }
--      ksft_test_result_pass("Memory compaction succeeded. No of huge pages allocated = %d\n",
--                            (atoi(nr_hugepages)));
-       ret = 0;
-  close_fd:
-       close(fd);
-+ out:
-+      ksft_test_result(ret == 0, "check_compaction\n");
-       return ret;
- }
--- 
-2.43.0
-
index bc60a3c64d2cf8325e1538c8a439bc337b03fdb9..5794e13729e821b909f5afe437446ef3576dcfcc 100644 (file)
@@ -33,7 +33,6 @@ serial-sc16is7xx-replace-hardcoded-divisor-value-wit.patch
 serial-sc16is7xx-fix-bug-in-sc16is7xx_set_baud-when-.patch
 selftests-mm-compaction_test-fix-incorrect-write-of-.patch
 selftests-mm-conform-test-to-tap-format-output.patch
-selftests-mm-log-a-consistent-test-name-for-check_co.patch
 selftests-mm-compaction_test-fix-bogus-test-success-.patch
 s390-cpacf-get-rid-of-register-asm.patch
 s390-cpacf-split-and-rework-cpacf-query-functions.patch