[compiler-rt] [scudo] Disable ring buffer in Trusty (PR #69280)

Andrei Homescu via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 20:18:04 PDT 2023


https://github.com/ahomescu created https://github.com/llvm/llvm-project/pull/69280

The allocation ringbuffer has a size of 32768 entries by default,
totalling over a megabyte. In addition, a recent change moved
this buffer from .bss to being dynamically allocated, which means
it counts against the min_heap setting in the app manifest.
Upstreamed from https://r.android.com/2395872 and
https://r.android.com/2480217.


>From 3fd8266710ba76862cc5eab3d6b91cf919bc3252 Mon Sep 17 00:00:00 2001
From: Marco Nelissen <marcone at google.com>
Date: Thu, 19 Jan 2023 12:43:31 -0800
Subject: [PATCH] [scudo] Disable ring buffer in Trusty

The allocation ringbuffer has a size of 32768 entries by default,
totalling over a megabyte. In addition, a recent change moved
this buffer from .bss to being dynamically allocated, which means
it counts against the min_heap setting in the app manifest.
Upstreamed from https://r.android.com/2395872 and
https://r.android.com/2480217.
---
 compiler-rt/lib/scudo/standalone/flags.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/lib/scudo/standalone/flags.inc b/compiler-rt/lib/scudo/standalone/flags.inc
index 60aeb1f1df570ac..1a6d90a3e9c8cd4 100644
--- a/compiler-rt/lib/scudo/standalone/flags.inc
+++ b/compiler-rt/lib/scudo/standalone/flags.inc
@@ -46,5 +46,5 @@ SCUDO_FLAG(int, release_to_os_interval_ms, SCUDO_ANDROID ? INT32_MIN : 5000,
            "Interval (in milliseconds) at which to attempt release of unused "
            "memory to the OS. Negative values disable the feature.")
 
-SCUDO_FLAG(int, allocation_ring_buffer_size, 32768,
+SCUDO_FLAG(int, allocation_ring_buffer_size, SCUDO_TRUSTY ? 0 : 32768,
            "Entries to keep in the allocation ring buffer for scudo.")



More information about the llvm-commits mailing list