Revert "Fix read performance regression in ObjectCacher"

This reverts commit 65be257e92.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2014-10-24 11:16:25 -07:00
parent 3ef6fd1d0f
commit b808cdfaa8
2 changed files with 3 additions and 7 deletions

View File

@ -955,14 +955,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<BufferHead*>(bh_lru_rest.lru_expire());
if (!bh)
break;
@ -1134,10 +1134,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<uint64_t>(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<uint64_t>(clean) > max_size) {
// cache is full -- wait for rx's to complete
ldout(cct, 10) << "readx missed, waiting on cache to free "

View File

@ -449,7 +449,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);
/**