selftests-mm-migration-properly-cleanup-forked-processes.patch removed from -mm tree
The quilt patch titled
Subject: selftests/mm: migration: properly cleanup fork()ed processes
has been removed from the -mm tree. Its filename was
selftests-mm-migration-properly-cleanup-forked-processes.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: "Mike Rapoport (Microsoft)" <[email protected]>
Subject: selftests/mm: migration: properly cleanup fork()ed processes
Date: Mon, 11 May 2026 19:27:48 +0300
Several migration test use fork() to create worker processes. These processes are later killed, but nothing collects their exit status and they remain as zombies in the system.
Add a helper function that kills the worker processes, waitpid()s for them and verifies the exit status.
Replace the loops that call kill() for each process with a call to that helper.
---
tools/testing/selftests/mm/migration.c | 47 +++++++++++++++++------ 1 file changed, 35 insertions(+), 12 deletions(-)
tools/testing/selftests/mm/migration.c renamed from tools/testing/selftests/mm/migration.c~selftests-mm-migration-properly-cleanup-forked-processes +35 -12
@@ -67,6 +67,29 @@ FIXTURE_TEARDOWN(migration)free (self->pids); } +static bool kill_children (FIXTURE_DATA (migration) * self) +{ +bool err = false; +pid_t pid; +int i; + +for (i =0 ; i < self->nthreads; i++) { +int status =0 ; + + pid = self->pids[i]; +if (pid <0 ) +continue ; +if (kill (pid,SIGTERM )) + err = true; +if (pid !=waitpid (pid, &status,0 )) + err = true; +if (!WIFSIGNALED (status) ||WTERMSIG (status) !=SIGTERM ) + err = true; + } + +return !err; +} +int migrate (uint64_t *ptr,int n1,int n2) {int ret, tmp;
@@ -151,7 +174,7 @@ TEST_F_TIMEOUT(migration, shared_anon, 2 {pid_t pid;uint64_t *ptr; -int i; +int i, err; ptr =mmap (NULL ,TWOMEG ,PROT_READ |PROT_WRITE ,MAP_SHARED |MAP_ANONYMOUS ,-1 ,0 );
@@ -171,9 +194,9 @@ TEST_F_TIMEOUT(migration, shared_anon, 2 } } -ASSERT_EQ (migrate (ptr, self->n1, self->n2),0 ); -for (i =0 ; i < self->nthreads; i++) -ASSERT_EQ (kill (self->pids[i],SIGTERM ),0 ); + err =migrate (ptr, self->n1, self->n2); +ASSERT_EQ (kill_children (self), true); +ASSERT_EQ (err,0 ); }/*
@@ -217,7 +240,7 @@ TEST_F_TIMEOUT(migration, shared_anon_thuint64_t pmdsize;pid_t pid;uint64_t *ptr; -int i; +int i, err;if (!thp_is_enabled ())SKIP (return,"Transparent Hugepages not available" );
@@ -247,9 +270,9 @@ TEST_F_TIMEOUT(migration, shared_anon_th } } -ASSERT_EQ (migrate (ptr, self->n1, self->n2),0 ); -for (i =0 ; i < self->nthreads; i++) -ASSERT_EQ (kill (self->pids[i],SIGTERM ),0 ); + err =migrate (ptr, self->n1, self->n2); +ASSERT_EQ (kill_children (self), true); +ASSERT_EQ (err,0 ); }/*
@@ -287,7 +310,7 @@ TEST_F_TIMEOUT(migration, shared_anon_htunsigned long hugepage_size;pid_t pid;uint64_t *ptr; -int i; +int i, err; hugepage_size =default_huge_page_size ();if (!hugepage_size)
@@ -311,9 +334,9 @@ TEST_F_TIMEOUT(migration, shared_anon_ht } } -ASSERT_EQ (migrate (ptr, self->n1, self->n2),0 ); -for (i =0 ; i < self->nthreads; i++) -ASSERT_EQ (kill (self->pids[i],SIGTERM ),0 ); + err =migrate (ptr, self->n1, self->n2); +ASSERT_EQ (kill_children (self), true); +ASSERT_EQ (err,0 ); }TEST_HARNESS_MAIN
_
Patches currently in -mm which might be from [email protected] are