tools/testing/selftests/damon/sysfs.py | 4 ++++ 1 file changed, 4 insertions(+)
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.
Signed-off-by: Hari Mishal <harimishal1@gmail.com>
---
v2: 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 aa03a1187489..bdb37eb1d26f 100755
--- a/tools/testing/selftests/damon/sysfs.py
+++ b/tools/testing/selftests/damon/sysfs.py
@@ -356,5 +356,9 @@ def main():
assert_ctxs_committed(kdamonds)
kdamonds.stop()
+ for proc in (proc1, proc2, proc3):
+ proc.terminate()
+ proc.communicate()
+
if __name__ == '__main__':
main()
--
2.43.0
Hello Hari, From the next time, please don't post a new version of a patch as a reply to the previous version. Post a new version as a new thread, with changelogs [1] including links to previous revisions. Also, give others sufficient time, say, one day, to add comments before posting a new version. If someone publicly asked questions to your patch, please answer the questions and keep the discussion in public until the discussion is clearly completed, before posting a new version. On Wed, 22 Jul 2026 03:23:49 +0200 Hari Mishal <harimishal1@gmail.com> wrote: > 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. Makes sense to me. Thank you for this patch. > > Signed-off-by: Hari Mishal <harimishal1@gmail.com> Reviewed-by: SJ Park <sj@kernel.org> > --- > v2: Terminate each sh process directly instead of giving it its own > stdin pipe to close, dropping the stdin=PIPE changes and shrinking > the diff. When you add changelog, please add links to the previous revisions. Finally, please use mm-new [2] as the baseline of DAMON patches from the next time. This patch is applied to damon/next [2] tree. If this patch is not added to mm.git in short term (~1 week?), I will ask mm.git maintainer (Andrew Morton) to pick this. So, no action from your side is needed for now. If it seems I also forgot doing that or you cannot wait for my action, please feel free to directly ask that to Andrew. [1] https://docs.kernel.org/process/submitting-patches.html#commentary [2] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees Thanks, SJ [...]
On Tue, 21 Jul 2026 20:38:43 -0700 SJ Park <sj@kernel.org> wrote: [...] > This patch is applied to damon/next [2] tree. If this patch is not added to > mm.git in short term (~1 week?), I will ask mm.git maintainer (Andrew Morton) > to pick this. So, no action from your side is needed for now. If it seems I > also forgot doing that or you cannot wait for my action, please feel free to > directly ask that to Andrew. We (mm community) now want to focus on making mm.git more stabilized and therefore ready for the next merge window, rather than adding more changes that are not really urgent. I agree and want to help [1] that. For the reason, unless Andre pick this first, I will request adding this to mm.git only after next -rc1 release. Let me know if you think this is really urgent. [1] https://lore.kernel.org/20260722133829.87607-1-sj@kernel.org Thanks, SJ
> From the next time, please don't post a new version of a patch as a reply to > the previous version. Post a new version as a new thread, with changelogs [1] > including links to previous revisions. > > Also, give others sufficient time, say, one day, to add comments before posting > a new version. If someone publicly asked questions to your patch, please > answer the questions and keep the discussion in public until the discussion is > clearly completed, before posting a new version. Got it! Will keep it in mind for next time. Sorry about all the confusion! :) > > 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. > > Makes sense to me. Thank you for this patch. Ofc, happy to contribute! > > > > Signed-off-by: Hari Mishal <harimishal1@gmail.com> > > Reviewed-by: SJ Park <sj@kernel.org> > > > --- > > v2: Terminate each sh process directly instead of giving it its own > > stdin pipe to close, dropping the stdin=PIPE changes and shrinking > > the diff. > > When you add changelog, please add links to the previous revisions. > > Finally, please use mm-new [2] as the baseline of DAMON patches from the next > time. > > This patch is applied to damon/next [2] tree. If this patch is not added to > mm.git in short term (~1 week?), I will ask mm.git maintainer (Andrew Morton) > to pick this. So, no action from your side is needed for now. If it seems I > also forgot doing that or you cannot wait for my action, please feel free to > directly ask that to Andrew. > I'm quite happy to wait! Thanks for your clarity. > We (mm community) now want to focus on making mm.git more stabilized and > therefore ready for the next merge window, rather than adding more changes that > are not really urgent. I agree and want to help [1] that. For the reason, > unless Andre pick this first, I will request adding this to mm.git only after > next -rc1 release. Let me know if you think this is really urgent. > > [1] https://lore.kernel.org/20260722133829.87607-1-sj@kernel.org Definitely don't think it's an urgent change. Anyone who is using a tool like damon would be able to debug this quite easily. Thanks for clarity, again. Accidentally dropped reply all AGAIN, sorry about this. Resending to make sure everything is public again. Cheers, Hari
On Wed, 22 Jul 2026 21:15:56 +0200 Hari Mishal <harimishal1@gmail.com> wrote: [...] > > We (mm community) now want to focus on making mm.git more stabilized and > > therefore ready for the next merge window, rather than adding more changes that > > are not really urgent. I agree and want to help [1] that. For the reason, > > unless Andre pick this first, I will request adding this to mm.git only after > > next -rc1 release. Let me know if you think this is really urgent. > > > > [1] https://lore.kernel.org/20260722133829.87607-1-sj@kernel.org > > Definitely don't think it's an urgent change. Anyone who is using a > tool like damon would be able to debug this quite easily. > Thanks for clarity, again. Thank you for confirming, Hari! > > Accidentally dropped reply all AGAIN, sorry about this. Resending to > make sure everything is public again. No worry, we all make mistakes and learn from those :) Thanks, SJ
© 2016 - 2026 Red Hat, Inc.