diff options
author | Josh Durgin <josh.durgin@inktank.com> | 2013-10-01 10:24:10 -0700 |
---|---|---|
committer | Josh Durgin <josh.durgin@inktank.com> | 2013-10-01 10:24:10 -0700 |
commit | c415d46e019d7f790261c580a20f96dde498371f (patch) | |
tree | 66a9ff1ee9dedff1ebb71cb663cc42c7a222b0c9 | |
parent | bf4234c0bea7733a2f58ebfb03c782e2e82bd494 (diff) | |
parent | cce990efc8f2a58c8d0fa11c234ddf2242b1b856 (diff) | |
download | ceph-c415d46e019d7f790261c580a20f96dde498371f.tar.gz |
Merge pull request #668 from liewegas/wip-cache-stall
osdc/ObjectCacher: limit writeback IOs generated while holding lock
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r-- | src/osdc/ObjectCacher.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 590b5d473a8..81335b7957f 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -11,6 +11,8 @@ #include "include/assert.h" +#define MAX_FLUSH_UNDER_LOCK 20 ///< max bh's we start writeback on while holding the lock + /*** ObjectCacher::BufferHead ***/ @@ -1448,8 +1450,10 @@ void ObjectCacher::flusher_entry() utime_t cutoff = ceph_clock_now(cct); cutoff -= max_dirty_age; BufferHead *bh = 0; + int max = MAX_FLUSH_UNDER_LOCK; while ((bh = static_cast<BufferHead*>(bh_lru_dirty.lru_get_next_expire())) != 0 && - bh->last_write < cutoff) { + bh->last_write < cutoff && + --max > 0) { ldout(cct, 10) << "flusher flushing aged dirty bh " << *bh << dendl; bh_write(bh); } |