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

Commit 1ccba04c 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." am: 7fb82c33

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

Change-Id: I85923b115c3aa3edb75b1c73e7995fd443d9d8ad
parents 74591d6c 7fb82c33
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);