diff options
author | 2022-10-25 00:32:26 +0000 | |
---|---|---|
committer | 2023-01-06 01:13:45 +0000 | |
commit | fe9b34f845e8e439b4ae47ae999ef2cfdbd66462 (patch) | |
tree | c6e201ab86ea6b59307bf3783624a97fc716a580 /runtime/entrypoints_order_test.cc | |
parent | 62354d1bab1df7673ce4b5eacd0679ca006842a4 (diff) |
Revert^6 "Thread suspension cleanup and deadlock fix"
This reverts commit 0db9605ec8bd3158f4f0107a511dd09a889c9341.
PS1: Identical to aosp/2255904
PS2: Detect and report excessive waiting for a suspend-friendly state.
Add internal timeout to 129-ThreadGetId, so that we can print more
state information on exit.
We explicitly avoid suspending the HeapTaskDaemon to retrieve its
stack trace. Fix a race that allowed this to happen anyway (with
very low probability).
Includes a slightly nontrivial rebase.
PS3: Address a couple of minor comments.
PS4: Reformatted, as suggested by the upload script, except for
tls_ptr_sized_values, where it seemed too likely to cause
unnecessary merge conflicts.
PS5: SuspendAllInternal does not hold mutator lock, but may take a
long time with suspend_all_count_ = 1. Another thread waiting
for suspend_all_count_ could sleep many times. Explicitly wait
on a condition variable instead. This intentionally has a low
kMaxSuspendRetries so that we can see whether it is hit in
presubmit.
PS6: Adjust kMaxSuspendRetries to a bit lower than the PS3/PS4
version, but much higher than the PS5 debug version.
Test: Build and boot AOSP, Treehugger
Bug: 240742796
Bug: 203363895
Bug: 238032384
Bug: 253671779
Change-Id: I58d63f494a7454e00473b23864f8952abed7bf6f
Diffstat (limited to 'runtime/entrypoints_order_test.cc')
-rw-r--r-- | runtime/entrypoints_order_test.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/runtime/entrypoints_order_test.cc b/runtime/entrypoints_order_test.cc index 50fa0ab0fb..ff8d050037 100644 --- a/runtime/entrypoints_order_test.cc +++ b/runtime/entrypoints_order_test.cc @@ -111,13 +111,14 @@ class EntrypointsOrderTest : public CommonArtTest { sizeof(void*)); EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, last_no_thread_suspension_cause, checkpoint_function, sizeof(void*)); - EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, checkpoint_function, active_suspend_barriers, - sizeof(void*)); - EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, active_suspend_barriers, thread_local_start, - sizeof(Thread::tls_ptr_sized_values::active_suspend_barriers)); - EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_start, thread_local_pos, sizeof(void*)); + EXPECT_OFFSET_DIFFP( + Thread, tlsPtr_, checkpoint_function, active_suspendall_barrier, sizeof(void*)); + EXPECT_OFFSET_DIFFP( + Thread, tlsPtr_, active_suspendall_barrier, active_suspend1_barriers, sizeof(void*)); + EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, active_suspend1_barriers, thread_local_pos, sizeof(void*)); EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_pos, thread_local_end, sizeof(void*)); - EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_end, thread_local_limit, sizeof(void*)); + EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_end, thread_local_start, sizeof(void*)); + EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_start, thread_local_limit, sizeof(void*)); EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_limit, thread_local_objects, sizeof(void*)); EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_objects, jni_entrypoints, sizeof(size_t)); |