selftests-mm-fix-deadlock-for-fork-after-pthread_create-on-arm.patch removed from -mm tree
The quilt patch titled
Subject: selftests/mm: fix deadlock for fork after pthread_create on ARM
has been removed from the -mm tree. Its filename was
selftests-mm-fix-deadlock-for-fork-after-pthread_create-on-arm.patch
This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Edward Liaw <[email protected]>
Subject: selftests/mm: fix deadlock for fork after pthread_create on ARM
Date: Thu, 3 Oct 2024 21:17:11 +0000
On Android with arm, there is some synchronization needed to avoid a deadlock when forking after pthread_create.
Fixes cff294582798 ("selftests/mm: extend and rename uffd pagemap test")
Signed-off-by Edward Liaw <[email protected]>
Cc Lokesh Gidra <[email protected]>
Cc Peter Xu <[email protected]>
Cc Shuah Khan <[email protected]>
Cc <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
tools/testing/selftests/mm/uffd-unit-tests.c | 7 +++++++ 1 file changed, 7 insertions(+)
tools/testing/selftests/mm/uffd-unit-tests.c renamed from tools/testing/selftests/mm/uffd-unit-tests.c~selftests-mm-fix-deadlock-for-fork-after-pthread_create-on-arm +7 -0
@@ -241,6 +241,9 @@ static void *fork_event_consumer(void *dfork_event_args *args = data;struct uffd_msg msg = {0 }; +/* Ready for parent thread to fork */ +pthread_barrier_wait (&ready_for_fork); +/* Read until a full msg received */ while (uffd_read_msg (args->parent_uffd, &msg));
@@ -308,8 +311,12 @@ static int pagemap_test_fork(int uffd, b/* Prepare a thread to resolve EVENT_FORK */ if (with_event) { +pthread_barrier_init (&ready_for_fork,NULL ,2 );if (pthread_create (&thread,NULL , fork_event_consumer, &args))err ("pthread_create()" ); +/* Wait for child thread to start before forking */ +pthread_barrier_wait (&ready_for_fork); +pthread_barrier_destroy (&ready_for_fork); } child =fork ();
_
Patches currently in -mm which might be from [email protected] are