summaryrefslogtreecommitdiff
path: root/runtime/linear_alloc.h
diff options
context:
space:
mode:
author Lokesh Gidra <lokeshgidra@google.com> 2022-11-30 06:45:28 +0000
committer Lokesh Gidra <lokeshgidra@google.com> 2022-12-05 18:17:40 +0000
commit49f034785005e53ca51d2af7985e41e4be3d802d (patch)
tree6961a925bcfdf1a89fa2b22201a7bdd16bff70a7 /runtime/linear_alloc.h
parent5ac8b698c560e631b0a0e38aaed1445d488da826 (diff)
Maintain pre-zygote fork linear-alloc pages as shared-clean
Userfaultfd tends to dirty all the pages of the space it is used on. However, we want to maintain the shared-clean trait of the pages allocated in zygote process prior to first fork. This CL separates the pre-zygote fork arenas from the userfaultfd visited ones, thereby reataining the former's shared-clean trait. Bug: 160737021 Test: module install and enable uffd GC Change-Id: Iddffb2c8d2d234ce7b20c069d86341dda5443a9b
Diffstat (limited to 'runtime/linear_alloc.h')
-rw-r--r--runtime/linear_alloc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/linear_alloc.h b/runtime/linear_alloc.h
index ad1e349632..c40af8ad46 100644
--- a/runtime/linear_alloc.h
+++ b/runtime/linear_alloc.h
@@ -90,6 +90,9 @@ class LinearAlloc {
size_t GetUsedMemory() const REQUIRES(!lock_);
ArenaPool* GetArenaPool() REQUIRES(!lock_);
+ // Force arena allocator to ask for a new arena on next allocation. This
+ // is to preserve private/shared clean pages across zygote fork.
+ void SetupForPostZygoteFork(Thread* self) REQUIRES(!lock_);
// Return true if the linear alloc contains an address.
bool Contains(void* ptr) const REQUIRES(!lock_);