[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241018171734.2315053-2-edliaw@google.com>
Date: Fri, 18 Oct 2024 17:17:22 +0000
From: Edward Liaw <edliaw@...gle.com>
To: linux-kselftest@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
Shuah Khan <shuah@...nel.org>, Edward Liaw <edliaw@...gle.com>, Peter Xu <peterx@...hat.com>
Cc: linux-kernel@...r.kernel.org, kernel-team@...roid.com, linux-mm@...ck.org,
Ryan Roberts <ryan.roberts@....com>
Subject: [PATCH 1/3] Revert "selftests/mm: fix deadlock for fork after
pthread_create on ARM"
This reverts commit e142cc87ac4ec618f2ccf5f68aedcd6e28a59d9d.
fork_event_consumer may be called by other tests that do not initialize
the pthread_barrier, so this approach is not correct. The subsequent
patch will revert to using atomic_bool instead.
Fixes: e142cc87ac4e ("fix deadlock for fork after pthread_create on ARM")
CC: Ryan Roberts <ryan.roberts@....com>
Signed-off-by: Edward Liaw <edliaw@...gle.com>
---
tools/testing/selftests/mm/uffd-unit-tests.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c
index c8a3b1c7edff..3db2296ac631 100644
--- a/tools/testing/selftests/mm/uffd-unit-tests.c
+++ b/tools/testing/selftests/mm/uffd-unit-tests.c
@@ -241,9 +241,6 @@ static void *fork_event_consumer(void *data)
fork_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));
@@ -311,12 +308,8 @@ static int pagemap_test_fork(int uffd, bool with_event, bool test_pin)
/* 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();
--
2.47.0.105.g07ac214952-goog
Powered by blists - more mailing lists