From e2ee52879e9de260abbf5eacbdabbd71973a6a83 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 3 Jan 2014 12:51:15 -0800 Subject: [PATCH] osdc/ObjectCacher: back off less during flush In cce990efc8f2a58c8d0fa11c234ddf2242b1b856 we added a limit to avoid holding the lock for too long. However, if we back off, we currently wait for a full second, which is probably a bit much--we really just want to give other threads a chance. Backport: emperor Signed-off-by: Sage Weil --- src/osdc/ObjectCacher.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 81335b7957f3..d518c6efaaed 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -1457,6 +1457,12 @@ void ObjectCacher::flusher_entry() ldout(cct, 10) << "flusher flushing aged dirty bh " << *bh << dendl; bh_write(bh); } + if (!max) { + // back off the lock to avoid starving other threads + lock.Unlock(); + lock.Lock(); + continue; + } } if (flusher_stop) break; -- 2.47.3