summaryrefslogtreecommitdiff
path: root/runtime/quick_exception_handler.cc
diff options
context:
space:
mode:
author Lokesh Gidra <lokeshgidra@google.com> 2024-05-13 22:46:56 +0000
committer Lokesh Gidra <lokeshgidra@google.com> 2024-07-26 19:20:44 +0000
commitf9c33ca81785da2c490b64737a0e5e2ec70aa7fe (patch)
treefda8c0eca8dcac308a0c3d9595f00fcdb8861cf0 /runtime/quick_exception_handler.cc
parent19a4c4853ec5ae1639d63c7a590fa6995684b6d4 (diff)
Improve and cleanup post-compaction synchronization with mutators
Earlier we used to separate counters: one for synchronizing only moving-space operations during moving-space compaction by gc-thread, and another for overall SIGBUS handler, which covered both linear-alloc space as well. Also, we first stopped mutators from doing anything in SIGBUS handler, and then the GC-thread would unregister userfaultfd. Given the lower priority of GC-thread, it could cause priority inversion. However, after some recent changes related to ioctl batching, there is a possibility to reduce the complexity and avoid the priority inversion. We still use two counters but both in SIGBUS handler. The first counter is used during compaction. Afterwards we switch to the second counter before unregistering the spaces from userfaultfd. This way we let the mutators map pages (mostly zero-pages) if and when the GC-thread falls behind (due to lower priority). After both the counters are passed, it is safe to clear the spaces and data-structures. Bug: 320478828 Test: art/test/testrunner/testrunner.py --host Change-Id: Ibd7f4306b007e1965567ae667288e60852f6da53
Diffstat (limited to 'runtime/quick_exception_handler.cc')
0 files changed, 0 insertions, 0 deletions