Re: [PATCH] selftests/damon/sysfs.py: clean up sh processes used for obsolete_target test

SJ Park <[email protected]>
Newsgroups dev.linux.lists.damon,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kvack.linux-mm
Message-ID <[email protected]>
Hello Hari,

On Tue, 21 Jul 2026 21:04:04 +0200 Hari Mishal <[email protected]> wrote:

> The obsolete_target test spawns three sh processes and uses their pids
> as DAMON monitoring targets.  These processes are created without their
> own stdin, so they inherit the test program's stdin, and they are never
> waited on or told to exit.  As a result, they are left running (or
> become zombies) as orphaned children after the test program exits.

Thank you for finding this problem and sharing this great patch!

> 
> Give each sh process its own dedicated stdin pipe instead of inheriting
> the test program's, and after the targets are no longer needed,
> communicate() with each process to close its stdin.  This sends EOF to
> the shell, which makes it exit, and communicate() then reaps the
> process.

Can't we use terminate() or kill() instead of communicate()?


Thanks,
SJ

[...]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.