Patch "selftests/bpf: Fix massive output from test_maps" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests/bpf: Fix massive output from test_maps

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-bpf-fix-massive-output-from-test_maps.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9475f1df000ed113eea210f2605ed6e0f3fa93b0
Author: Jesper Dangaard Brouer <brouer@xxxxxxxxxx>
Date:   Wed Aug 26 10:17:36 2020 +0200

    selftests/bpf: Fix massive output from test_maps
    
    [ Upstream commit fa4505675e093e895b7ec49a76d44f6b5ad9602e ]
    
    When stdout output from the selftests tool 'test_maps' gets redirected
    into e.g file or pipe, then the output lines increase a lot (from 21
    to 33949 lines).  This is caused by the printf that happens before the
    fork() call, and there are user-space buffered printf data that seems
    to be duplicated into the forked process.
    
    To fix this fflush() stdout before the fork loop in __run_parallel().
    
    Fixes: 1a97cf1fe503 ("selftests/bpf: speedup test_maps")
    Signed-off-by: Jesper Dangaard Brouer <brouer@xxxxxxxxxx>
    Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/bpf/159842985651.1050885.2154399297503372406.stgit@firesoul
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c
index 9b552c0fc47db..4e202217fae10 100644
--- a/tools/testing/selftests/bpf/test_maps.c
+++ b/tools/testing/selftests/bpf/test_maps.c
@@ -1017,6 +1017,8 @@ static void __run_parallel(int tasks, void (*fn)(int task, void *data),
 	pid_t pid[tasks];
 	int i;
 
+	fflush(stdout);
+
 	for (i = 0; i < tasks; i++) {
 		pid[i] = fork();
 		if (pid[i] == 0) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux