From: Hari Mishal <[email protected]> The obsolete_target test spawns three sh processes and uses their pids as DAMON monitoring targets. These processes are never terminated or waited on, so they are left running (or become zombies) as orphaned children after the test program exits.
Terminate each process and communicate() with it after the targets are no longer needed, so it exits and gets reaped instead of being leaked. Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Hari Mishal <[email protected]> Reviewed-by: SJ Park <[email protected]> Signed-off-by: SJ Park <[email protected]> --- Changes from v2 - v2: https://lore.kernel.org/[email protected] - Collect R-b: from SJ. - Rebase to latest mm-new. Changes from v1 - v1: https://lore.kernel.org/[email protected] - Terminate each sh process directly instead of giving it its own stdin pipe to close, dropping the stdin=PIPE changes and shrinking the diff. tools/testing/selftests/damon/sysfs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/damon/sysfs.py b/tools/testing/selftests/damon/sysfs.py index 3ffa054b63867..88a26422ff44c 100755 --- a/tools/testing/selftests/damon/sysfs.py +++ b/tools/testing/selftests/damon/sysfs.py @@ -385,6 +385,10 @@ def main(): assert_ctxs_committed(kdamonds) kdamonds.stop() + for proc in (proc1, proc2, proc3): + proc.terminate() + proc.communicate() + test_memcg_filter_memcg_path_staging() if __name__ == '__main__': -- 2.47.3

