From: Andrew Morton <akpm@linux-foundation.org>
To: Chunyu Hu <chuhu@redhat.com>
Cc: david@kernel.org, shuah@kernel.org, linux-mm@kvack.org,
ljs@kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com,
Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org,
surenb@google.com, mhocko@suse.com, ziy@nvidia.com,
baolin.wang@linux.alibaba.com, npache@redhat.com,
ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org,
lance.yang@linux.dev
Subject: Re: [PATCH v8 0/6] selftests/mm: skip several tests when thp is not available
Date: Wed, 1 Apr 2026 20:32:21 -0700 [thread overview]
Message-ID: <20260401203221.7e192497ba526afe33b9b5ae@linux-foundation.org> (raw)
In-Reply-To: <20260402014543.1671131-1-chuhu@redhat.com>
On Thu, 2 Apr 2026 09:45:37 +0800 Chunyu Hu <chuhu@redhat.com> wrote:
> There are several tests requires transprarent hugepages, when run on thp
> disabled kernel such as realtime kernel, there will be false negative.
> Mark those tests as skip when thp is not available.
Thanks, I updated mm.git's mm-unstable branch to this version.
> Changes in v8:
> - removed the patch 4 in v7 (make ksft_exit_fail_perror variable length)
> as no clean way to do it at the moment and ksft_exit_fail_msg could
> do by printing an extra strerror param.
> - patch 4 use ksft_exit_fail_msg instead of ksft_exit_fail_perror
Below is how v8 altered mm.git:
tools/testing/selftests/kselftest.h | 21 +++------------------
tools/testing/selftests/mm/vm_util.c | 6 +++---
2 files changed, 6 insertions(+), 21 deletions(-)
--- a/tools/testing/selftests/kselftest.h~b
+++ a/tools/testing/selftests/kselftest.h
@@ -43,7 +43,7 @@
* the program is aborting before finishing all tests):
*
* ksft_exit_fail_msg(fmt, ...);
- * ksft_exit_fail_perror(fmt, ...);
+ * ksft_exit_fail_perror(msg);
*
*/
#ifndef __KSELFTEST_H
@@ -417,24 +417,9 @@ static inline __noreturn __printf(1, 2)
exit(KSFT_FAIL);
}
-static inline __noreturn __printf(1, 2) void ksft_exit_fail_perror(const char *msg, ...)
+static inline __noreturn void ksft_exit_fail_perror(const char *msg)
{
- va_list args;
- char *buf = NULL;
- int saved_errno = errno;
-
- va_start(args, msg);
- if (vasprintf(&buf, msg, args) == -1) {
- va_end(args);
- ksft_exit_fail_msg("vasprintf failed: %s (%d)\n", strerror(saved_errno),
- saved_errno);
- }
- va_end(args);
-
- errno = saved_errno;
- ksft_exit_fail_msg("%s: %s (%d)\n", buf, strerror(errno), errno);
-
- free(buf);
+ ksft_exit_fail_msg("%s: %s (%d)\n", msg, strerror(errno), errno);
}
static inline __noreturn void ksft_exit_xfail(void)
--- a/tools/testing/selftests/mm/vm_util.c~b
+++ a/tools/testing/selftests/mm/vm_util.c
@@ -775,15 +775,15 @@ void write_file(const char *path, const
fd = open(path, O_WRONLY);
if (fd == -1)
- ksft_exit_fail_perror("%s open failed", path);
+ ksft_exit_fail_msg("%s open failed: %s\n", path, strerror(errno));
numwritten = write(fd, buf, buflen - 1);
saved_errno = errno;
close(fd);
errno = saved_errno;
if (numwritten < 0)
- ksft_exit_fail_perror("%s write(%.*s) failed", path, (int)(buflen - 1),
- buf);
+ ksft_exit_fail_msg("%s write(%.*s) failed: %s\n", path, (int)(buflen - 1),
+ buf, strerror(errno));
if (numwritten != buflen - 1)
ksft_exit_fail_msg("%s write(%.*s) is truncated, expected %zu bytes, got %zd bytes\n",
path, (int)(buflen - 1), buf, buflen - 1, numwritten);
_
prev parent reply other threads:[~2026-04-02 3:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 1:45 [PATCH v8 0/6] selftests/mm: skip several tests when thp is not available Chunyu Hu
2026-04-02 1:45 ` [PATCH v8 1/6] selftests/mm/guard-regions: skip collapse test when thp not enabled Chunyu Hu
2026-04-02 1:45 ` [PATCH v8 2/6] selftests/mm: soft-dirty: skip two tests when thp is not available Chunyu Hu
2026-04-02 1:45 ` [PATCH v8 3/6] selftests/mm: move write_file helper to vm_util Chunyu Hu
2026-04-02 1:45 ` [PATCH v8 4/6] selftests/mm/vm_util: robust write_file() Chunyu Hu
2026-04-02 8:05 ` David Hildenbrand (Arm)
2026-04-07 10:55 ` Lorenzo Stoakes
2026-04-02 1:45 ` [PATCH v8 5/6] selftests/mm: split_huge_page_test: skip the test when thp is not available Chunyu Hu
2026-04-02 1:45 ` [PATCH v8 6/6] selftests/mm: transhuge_stress: skip the test when thp " Chunyu Hu
2026-04-02 3:32 ` Andrew Morton [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=20260401203221.7e192497ba526afe33b9b5ae@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Liam.Howlett@oracle.com \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=chuhu@redhat.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=lance.yang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=npache@redhat.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=shuah@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=ziy@nvidia.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