From 3b1eafcabb6139133b5ff0bd79cb1cd35e28ceb7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 24 Oct 2014 11:05:53 -0700 Subject: [PATCH] Revert "Fix read performance regression in ObjectCacher" This reverts commit 65be257e9295619b960b49f6aa80ecdf8ea4d16a. Too late for giant. Signed-off-by: Sage Weil --- src/osdc/ObjectCacher.cc | 8 ++------ src/osdc/ObjectCacher.h | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 2579cb3797ded..93cede5b7b802 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -950,14 +950,14 @@ void ObjectCacher::flush(loff_t amount) } -void ObjectCacher::trim(uint64_t extra_space) +void ObjectCacher::trim() { assert(lock.is_locked()); ldout(cct, 10) << "trim start: bytes: max " << max_size << " clean " << get_stat_clean() << ", objects: max " << max_objects << " current " << ob_lru.lru_get_size() << dendl; - while (get_stat_clean() > 0 && (uint64_t) (get_stat_clean() + get_stat_rx() + extra_space) > max_size) { + while (get_stat_clean() > 0 && (uint64_t) get_stat_clean() > max_size) { BufferHead *bh = static_cast(bh_lru_rest.lru_expire()); if (!bh) break; @@ -1115,10 +1115,6 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish, ++bh_it) { loff_t clean = get_stat_clean() + get_stat_rx() + bh_it->second->length(); - if (get_stat_rx() > 0 && static_cast(clean) > max_size) { - trim(bh_it->second->length()); - } - clean = get_stat_clean() + get_stat_rx() + bh_it->second->length(); if (get_stat_rx() > 0 && static_cast(clean) > max_size) { // cache is full -- wait for rx's to complete ldout(cct, 10) << "readx missed, waiting on cache to free " diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index 871c8eb2de1d9..9685ee3838bed 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -435,7 +435,7 @@ class ObjectCacher { void bh_read(BufferHead *bh); void bh_write(BufferHead *bh); - void trim(uint64_t extra_space = 0); + void trim(); void flush(loff_t amount=0); /** -- 2.39.5