Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b2aca38 authored by Martijn Coenen's avatar Martijn Coenen Committed by Automerger Merge Worker
Browse files

Merge "Repeat proxy limit callback only when exceeding high threshold again."...

Merge "Repeat proxy limit callback only when exceeding high threshold again." am: 7fb82c33 am: 1ccba04c am: a87d5560

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1833504

Change-Id: Ib95d73d2ae2e3fe7eadd8234a9893621e1be6723
parents 4e83d437 a87d5560
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -48,10 +48,6 @@ uint32_t BpBinder::sBinderProxyCountHighWatermark = 2500;
// Another arbitrary value a binder count needs to drop below before another callback will be called
uint32_t BpBinder::sBinderProxyCountLowWatermark = 2000;

// Once the limit has been exceeded, keep calling the limit callback for every this many new proxies
// created over the limit.
constexpr uint32_t REPEAT_LIMIT_CALLBACK_INTERVAL = 1000;

enum {
    LIMIT_REACHED_MASK = 0x80000000,        // A flag denoting that the limit has been reached
    COUNTING_VALUE_MASK = 0x7FFFFFFF,       // A mask of the remaining bits for the count value
@@ -129,7 +125,7 @@ sp<BpBinder> BpBinder::create(int32_t handle) {
            uint32_t lastLimitCallbackAt = sLastLimitCallbackMap[trackedUid];

            if (trackedValue > lastLimitCallbackAt &&
                (trackedValue - lastLimitCallbackAt > REPEAT_LIMIT_CALLBACK_INTERVAL)) {
                (trackedValue - lastLimitCallbackAt > sBinderProxyCountHighWatermark)) {
                ALOGE("Still too many binder proxy objects sent to uid %d from uid %d (%d proxies "
                      "held)",
                      getuid(), trackedUid, trackedValue);