]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cohort_lru: keep strict discard, but from LRU wip-posix-lru
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 26 Nov 2025 23:17:02 +0000 (18:17 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 24 Feb 2026 18:25:28 +0000 (13:25 -0500)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/common/cohort_lru.h

index 5ceb99094640f07ed98c1b18f62a5150bc0170cc..b8bc1eb143678fac0319f6b46a4f1d88fd1994bc 100644 (file)
@@ -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();