<< ", objects: max " << max_objects << " current " << ob_lru.lru_get_size()
<< dendl;
- while (get_stat_clean() > 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;
// - do not wait for bytes other waiters are waiting on. this means that
// threads do not wait for each other. this effectively allows the cache
// size to balloon proportional to the data that is in flight.
- while (get_stat_dirty() + get_stat_tx() >= max_dirty + get_stat_dirty_waiting()) {
+ while (get_stat_dirty() + get_stat_tx() > 0 &&
+ (uint64_t) (get_stat_dirty() + get_stat_tx()) >=
+ max_dirty + get_stat_dirty_waiting()) {
ldout(cct, 10) << __func__ << " waiting for dirty|tx "
<< (get_stat_dirty() + get_stat_tx()) << " >= max "
<< max_dirty << " + dirty_waiting "
}
// start writeback anyway?
- if (get_stat_dirty() > target_dirty) {
+ if (get_stat_dirty() > 0 && (uint64_t) get_stat_dirty() > target_dirty) {
ldout(cct, 10) << "wait_for_write " << get_stat_dirty() << " > target "
<< target_dirty << ", nudging flusher" << dendl;
flusher_cond.Signal();
<< max_dirty << " max)"
<< dendl;
loff_t actual = get_stat_dirty() + get_stat_dirty_waiting();
- if (actual > target_dirty) {
+ if (actual > 0 && (uint64_t) actual > target_dirty) {
// flush some dirty pages
ldout(cct, 10) << "flusher "
<< get_stat_dirty() << " dirty + " << get_stat_dirty_waiting()
string name;
Mutex& lock;
- int64_t max_dirty, target_dirty, max_size, max_objects;
+ uint64_t max_dirty, target_dirty, max_size, max_objects;
utime_t max_dirty_age;
bool block_writes_upfront;
// cache sizes
- void set_max_dirty(int64_t v) {
+ void set_max_dirty(uint64_t v) {
max_dirty = v;
}
void set_target_dirty(int64_t v) {