diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-09 18:56:17 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-09 18:56:17 -0600 |
commit | c262f37c6a0ba64d39414b45fd54d172c50762c8 (patch) | |
tree | b0ba414cf714e7ccc26a4ae7b5913237937af98b /lib/containers | |
parent | 68eb7a16b9759646619a7d9dec2b62fa9d0c30cf (diff) | |
parent | d87587a0e1d689ea1964a7de62b1e4faed120421 (diff) |
Merge branch 'lukeshu/misc'
Diffstat (limited to 'lib/containers')
-rw-r--r-- | lib/containers/arcache.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/containers/arcache.go b/lib/containers/arcache.go index 29ec030..deb80f0 100644 --- a/lib/containers/arcache.go +++ b/lib/containers/arcache.go @@ -504,9 +504,12 @@ func (c *arCache[K, V]) Acquire(ctx context.Context, k K) *V { switch { case c.liveByName[k] != nil: // cache-hit entry = c.liveByName[k] - if entry.List != &c.frequentPinned { - // Move to frequentPinned (unless it's already - // there; in which case, don't bother). + // Move to frequentPinned, unless: + // + // - it's already there; in which case, don't bother + // - it's in recentPinned; don't count "nested" uses + // as "frequent" uses. + if entry.List != &c.frequentPinned && entry.List != &c.recentPinned { entry.List.Delete(entry) c.frequentPinned.Store(entry) } |