All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH vz10] ms/selftests/sched_ext: flush stdout before test to avoid log spam
@ 2026-08-31 22:44 Eva Kurchatova
  2026-09-02 15:15 ` Konstantin Khorenko
  2026-09-02 15:15 ` Konstantin Khorenko
  0 siblings, 2 replies; 3+ messages in thread
From: Eva Kurchatova @ 2026-08-31 22:44 UTC (permalink / raw)
  To: khorenko; +Cc: devel

From: Emil Tsalapatis <etsal@meta.com>

The sched_ext selftests runner runs each test in the same process,
with each test possibly forking multiple times. When the main runner
has not flushed its stdout, the children inherit the buffered output
for previous tests and emit it during exit. This causes log spam.

Make sure stdout/stderr is fully flushed before each test.

Cc: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Started by hand, the runner writes 12 MB for its 23 tests, the preamble
of each repeated about five thousand times, against 8 KB with this
applied. run_kselftest.sh starts every test under stdbuf --output=L,
so a run through it never shows the duplication.

(cherry picked from commit 579a3297b268f0281644ead7ff574a2b4bc64d3c)

https://virtuozzo.atlassian.net/browse/VSTOR-143426
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 tools/testing/selftests/sched_ext/runner.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/testing/selftests/sched_ext/runner.c b/tools/testing/selftests/sched_ext/runner.c
index aa2d7d32dda9..5748d2c69903 100644
--- a/tools/testing/selftests/sched_ext/runner.c
+++ b/tools/testing/selftests/sched_ext/runner.c
@@ -46,6 +46,14 @@ static void print_test_preamble(const struct scx_test *test, bool quiet)
 	if (!quiet)
 		printf("DESCRIPTION: %s\n", test->description);
 	printf("OUTPUT:\n");
+
+	/*
+	 * The tests may fork with the preamble buffered
+	 * in the children's stdout. Flush before the test
+	 * to avoid printing the message multiple times.
+	 */
+	fflush(stdout);
+	fflush(stderr);
 }
 
 static const char *status_to_result(enum scx_test_status status)
-- 
2.55.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Devel] [PATCH vz10] ms/selftests/sched_ext: flush stdout before test to avoid log spam
  2026-08-31 22:44 [Devel] [PATCH vz10] ms/selftests/sched_ext: flush stdout before test to avoid log spam Eva Kurchatova
@ 2026-09-02 15:15 ` Konstantin Khorenko
  2026-09-02 15:15 ` Konstantin Khorenko
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin Khorenko @ 2026-09-02 15:15 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

On Tue, 01 Sep 2026 01:44:27 +0300, Eva Kurchatova <eva.kurchatova@virtuozzo.com> wrote:
> The sched_ext selftests runner runs each test in the same process,
> with each test possibly forking multiple times. When the main runner
> has not flushed its stdout, the children inherit the buffered output
> for previous tests and emit it during exit. This causes log spam.
> 
> Make sure stdout/stderr is fully flushed before each test.
> 
> [...]

Reviewed-by: Konstantin Khorenko <khorenko@virtuozzo.com>

-- 
Konstantin Khorenko <khorenko@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Devel] [PATCH vz10] ms/selftests/sched_ext: flush stdout before test to avoid log spam
  2026-08-31 22:44 [Devel] [PATCH vz10] ms/selftests/sched_ext: flush stdout before test to avoid log spam Eva Kurchatova
  2026-09-02 15:15 ` Konstantin Khorenko
@ 2026-09-02 15:15 ` Konstantin Khorenko
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin Khorenko @ 2026-09-02 15:15 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

On Tue, 01 Sep 2026 01:44:27 +0300, Eva Kurchatova wrote:
> ms/selftests/sched_ext: flush stdout before test to avoid log spam

Applied to branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz, after rh10-6.12.0-211.39.1.16.12.vz10, thanks!

[1/1] ms/selftests/sched_ext: flush stdout before test to avoid log spam
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/703719181554

-- 
Konstantin Khorenko <khorenko@virtuozzo.com>

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-02 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-31 22:44 [Devel] [PATCH vz10] ms/selftests/sched_ext: flush stdout before test to avoid log spam Eva Kurchatova
2026-09-02 15:15 ` Konstantin Khorenko
2026-09-02 15:15 ` Konstantin Khorenko

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.