* [PATCH] KVM: selftests: access_tracking_perf_test: bump number of NUMA nodes to 32
@ 2026-06-12 15:00 Maxim Levitsky
2026-06-12 15:08 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Maxim Levitsky @ 2026-06-12 15:00 UTC (permalink / raw)
To: kvm
Cc: Shuah Khan, Paolo Bonzini, linux-kernel, linux-kselftest,
Maxim Levitsky
It's rare to find a system that has more than 4 sockets,
but a system can have more than 4 NUMA nodes if each socket
exposes its chiplets as separate NUMA nodes.
In particular, our CI caught a failure in this test on a system with
two sockets, each containing an 'AMD EPYC 7601 32-Core Processor'.
Bump the limit to 32, just in case.
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
tools/testing/selftests/kvm/include/lru_gen_util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/include/lru_gen_util.h b/tools/testing/selftests/kvm/include/lru_gen_util.h
index d32ff5d8ffd0..49c8139d398c 100644
--- a/tools/testing/selftests/kvm/include/lru_gen_util.h
+++ b/tools/testing/selftests/kvm/include/lru_gen_util.h
@@ -14,7 +14,7 @@
#include "test_util.h"
#define MAX_NR_GENS 16 /* MAX_NR_GENS in include/linux/mmzone.h */
-#define MAX_NR_NODES 4 /* Maximum number of nodes supported by the test */
+#define MAX_NR_NODES 32 /* Maximum number of nodes supported by the test */
#define LRU_GEN_DEBUGFS "/sys/kernel/debug/lru_gen"
#define LRU_GEN_ENABLED_PATH "/sys/kernel/mm/lru_gen/enabled"
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: selftests: access_tracking_perf_test: bump number of NUMA nodes to 32
2026-06-12 15:00 [PATCH] KVM: selftests: access_tracking_perf_test: bump number of NUMA nodes to 32 Maxim Levitsky
@ 2026-06-12 15:08 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-06-12 15:08 UTC (permalink / raw)
To: Maxim Levitsky; +Cc: kvm
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [Medium] Incorrect type for `asprintf` return value defeats error checking and causes undefined behavior/crash if allocation fails.
--
commit c131ebf5598f598f5bdd7d212b93b7da852ad82f
Author: Maxim Levitsky <mlevitsk@redhat.com>
KVM: selftests: access_tracking_perf_test: bump number of NUMA nodes to 32
It's rare to find a system that has more than 4 sockets, but a system can
have more than 4 NUMA nodes if each socket exposes its chiplets as separate
NUMA nodes. Bump the limit to 32, just in case.
> diff --git a/tools/testing/selftests/kvm/include/lru_gen_util.h b/tools/testing/selftests/kvm/include/lru_gen_util.h
> index d32ff5d8ffd05..49c8139d398ca 100644
> --- a/tools/testing/selftests/kvm/include/lru_gen_util.h
> +++ b/tools/testing/selftests/kvm/include/lru_gen_util.h
> @@ -14,7 +14,7 @@
> #include "test_util.h"
>
> #define MAX_NR_GENS 16 /* MAX_NR_GENS in include/linux/mmzone.h */
> -#define MAX_NR_NODES 4 /* Maximum number of nodes supported by the test */
> +#define MAX_NR_NODES 32 /* Maximum number of nodes supported by the test */
[Severity: Medium]
This is a pre-existing issue, but does run_aging_impl() in
tools/testing/selftests/kvm/lib/lru_gen_util.c mishandle the return value of
asprintf() when creating the aging command?
tools/testing/selftests/kvm/lib/lru_gen_util.c:run_aging_impl() {
...
FILE *f = fopen(LRU_GEN_DEBUGFS, "w");
char *command;
size_t sz;
TEST_ASSERT(f, "fopen(%s) failed", LRU_GEN_DEBUGFS);
sz = asprintf(&command, "+ %lu %d %d 1 %d\n",
memcg_id, node_id, max_gen, force_scan);
TEST_ASSERT(sz > 0, "creating aging command failed");
...
}
asprintf() returns an int which is -1 on failure. Because it is assigned
to the size_t sz variable, -1 wraps around to SIZE_MAX. The error check
TEST_ASSERT(sz > 0, ...) will incorrectly pass, and the code will then call
fwrite() with an undefined command pointer and SIZE_MAX size, resulting in a
segmentation fault rather than a graceful test failure.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260612150038.1277394-1-mlevitsk@redhat.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-12 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 15:00 [PATCH] KVM: selftests: access_tracking_perf_test: bump number of NUMA nodes to 32 Maxim Levitsky
2026-06-12 15:08 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox