[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <acc4a7fa-d423-418d-81d7-35d4416afdd0@canonical.com>
Date: Tue, 17 Oct 2023 02:25:23 -0700
From: John Johansen <john.johansen@...onical.com>
To: Sergey Senozhatsky <senozhatsky@...omium.org>
Cc: Anil Altinay <aaltinay@...gle.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
LKLM <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Tomasz Figa <tfiga@...omium.org>,
linux-security-module@...r.kernel.org,
John Johansen <john.johansen@...onical.com>
Subject: Re: [PATCH v5 3/4] apparmor: experiment with faster backoff on global
buffer
Instead of doubling hold count when contention is encounter increase
it by 8x. This makes for a faster back off, but results in buffers
being held longer.
Signed-off-by: John Johansen <john.johansen@...onical.com>
---
security/apparmor/lsm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index fd6779ff0da4..52423d88854a 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -1796,10 +1796,10 @@ static int param_set_mode(const char *val, const struct kernel_param *kp)
static void update_contention(struct aa_local_cache *cache)
{
- cache->contention += 1;
+ cache->contention += 3;
if (cache->contention > 9)
cache->contention = 9;
- cache->hold += 1 << cache->contention; /* 2, 4, 8, ... */
+ cache->hold += 1 << cache->contention; /* 8, 64, 512, ... */
}
char *aa_get_buffer(bool in_atomic)
--
2.34.1
Powered by blists - more mailing lists