* [PATCH] selftests/acct: Make the busy loop sink volatile
@ 2026-12-01 18:08 Sasha Levin
2026-12-01 18:17 ` + selftests-acct-make-the-busy-loop-sink-volatile.patch added to mm-nonmm-unstable branch Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2026-12-01 18:08 UTC (permalink / raw)
To: Andrew Morton, Shuah Khan
Cc: Sasha Levin, Yiyang Chen, Balbir Singh, linux-kselftest,
linux-kernel, Nathan Chancellor, llvm
burn_cpu_for_ns() stores the result of its busy loop in busy_sink, which
nothing reads. clang 23 warns about that:
taskstats_fill_stats_tgid.c:31:22: warning: variable 'busy_sink' set but not used [-Wunused-but-set-global]
Make busy_sink volatile, so that the store has to happen.
Fixes: 20e4b31f8e83 ("selftests/acct: add taskstats TGID retention test")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/acct/taskstats_fill_stats_tgid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/acct/taskstats_fill_stats_tgid.c b/tools/testing/selftests/acct/taskstats_fill_stats_tgid.c
index 9a4c1554dee36..cd43b18c9a948 100644
--- a/tools/testing/selftests/acct/taskstats_fill_stats_tgid.c
+++ b/tools/testing/selftests/acct/taskstats_fill_stats_tgid.c
@@ -28,7 +28,7 @@ struct worker_ctx {
bool release;
};
-static unsigned long busy_sink;
+static volatile unsigned long busy_sink;
static uint64_t timespec_diff_ns(const struct timespec *start,
const struct timespec *end)
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* + selftests-acct-make-the-busy-loop-sink-volatile.patch added to mm-nonmm-unstable branch
2026-12-01 18:08 [PATCH] selftests/acct: Make the busy loop sink volatile Sasha Levin
@ 2026-12-01 18:17 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2026-12-01 18:17 UTC (permalink / raw)
To: mm-commits, shuah, nathan, cyyzero16, balbirs, sashal, akpm
The patch titled
Subject: selftests/acct: make the busy loop sink volatile
has been added to the -mm mm-nonmm-unstable branch. Its filename is
selftests-acct-make-the-busy-loop-sink-volatile.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-acct-make-the-busy-loop-sink-volatile.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Sasha Levin <sashal@kernel.org>
Subject: selftests/acct: make the busy loop sink volatile
Date: Tue, 1 Dec 2026 13:08:50 -0500
burn_cpu_for_ns() stores the result of its busy loop in busy_sink, which
nothing reads. clang 23 warns about that:
taskstats_fill_stats_tgid.c:31:22: warning: variable 'busy_sink' set but not used [-Wunused-but-set-global]
Make busy_sink volatile, so that the store has to happen.
Link: https://patch.msgid.link/20261201180855.740952-2-sashal@kernel.org
Fixes: 20e4b31f8e83 ("selftests/acct: add taskstats TGID retention test")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Yiyang Chen <cyyzero16@gmail.com>
Cc: Balbir Singh <balbirs@nvidia.com>
Cc: Nathan Chancellor <nathan@kernel.org>
tools/testing/selftests/acct/taskstats_fill_stats_tgid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/testing/selftests/acct/taskstats_fill_stats_tgid.c~selftests-acct-make-the-busy-loop-sink-volatile
+++ a/tools/testing/selftests/acct/taskstats_fill_stats_tgid.c
@@ -28,7 +28,7 @@ struct worker_ctx {
bool release;
};
-static unsigned long busy_sink;
+static volatile unsigned long busy_sink;
static uint64_t timespec_diff_ns(const struct timespec *start,
const struct timespec *end)
_
Patches currently in -mm which might be from sashal@kernel.org are
selftests-proc-cast-the-procmap_query-address-through-uintptr_t.patch
selftests-mm-fix-pointer-width-warnings-on-32-bit-architectures.patch
selftests-mm-uffd-wp-mremap-keep-the-thp-sizes-in-unsigned-long.patch
kselftest-alloc_tag-use-the-ll64-types-on-powerpc64.patch
selftests-proc-search-the-kernel-headers-before-the-tools-copies.patch
selftests-prctl-select-the-tests-by-arch-alone.patch
selftests-prctl-skip-the-anonymous-vma-naming-test-when-unsupported.patch
selftests-kexec-select-tests-using-the-target-compiler.patch
selftests-size-use-nolibc-startup-and-syscall-wrappers.patch
selftests-acct-make-the-busy-loop-sink-volatile.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-01 18:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 18:08 [PATCH] selftests/acct: Make the busy loop sink volatile Sasha Levin
2026-12-01 18:17 ` + selftests-acct-make-the-busy-loop-sink-volatile.patch added to mm-nonmm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.