From: Matt Benjamin Date: Wed, 26 Nov 2025 23:17:02 +0000 (-0500) Subject: cohort_lru: keep strict discard, but from LRU X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Fwip-posix-lru;p=ceph-ci.git cohort_lru: keep strict discard, but from LRU Signed-off-by: Matt Benjamin --- diff --git a/src/common/cohort_lru.h b/src/common/cohort_lru.h index 5ceb9909464..b8bc1eb1436 100644 --- a/src/common/cohort_lru.h +++ b/src/common/cohort_lru.h @@ -240,11 +240,14 @@ namespace cohort { } else { lane.q.erase(it); } + lane.q.push_front(*o); /* hiwat check */ - if (lane.q.size() > lane_hiwat) { - tdo = o; - } else { - lane.q.push_front(*o); + if (lane.q.size() > lane_hiwat) { + /* discard the actual lane LRU immediately */ + Object* o2 = &(lane.q.back()); + Object::Queue::iterator it = Object::Queue::s_iterator_to(*o2); + lane.q.erase(it); + tdo = o2; } } lane.lock.unlock();