]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: touch onode in cache LRU explicitly.
authorIgor Fedotov <igor.fedotov@croit.io>
Fri, 13 Jan 2023 12:04:48 +0000 (15:04 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Fri, 13 Jan 2023 12:05:42 +0000 (15:05 +0300)
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
src/os/bluestore/BlueStore.cc

index 390f286774aed3b5f0dda378a6cdef124945ff01..a39c94aa52a04637486925c209cb5251c7d0c1fb 100644 (file)
@@ -1155,13 +1155,22 @@ struct LruOnodeCacheShard : public BlueStore::OnodeCacheShard {
          ceph_assert(num);
          --num;
          o->clear_cached();
+         dout(20) << __func__ << " " << this << " " << o->oid << " removed"
+                   << dendl;
           // remove will also decrement nref
           o->c->onode_space._remove(o->oid);
         }
       } else if (o->exists) {
         // move onode within LRU
-        _rm(o);
-        _add(o, 1);
+        lru.erase(lru.iterator_to(*o));
+        lru.push_front(*o);
+        if (o->cache_age_bin != age_bins.front()) {
+          *(o->cache_age_bin) -= 1;
+          o->cache_age_bin = age_bins.front();
+          *(o->cache_age_bin) += 1;
+        }
+        dout(20) << __func__ << " " << this << " " << o->oid << " touched"
+                 << dendl;
       }
     }
     ocs->lock.unlock();