]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/ObjectCacher: back off less during flush
authorSage Weil <sage@inktank.com>
Fri, 3 Jan 2014 20:51:15 +0000 (12:51 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Wed, 9 Apr 2014 23:21:49 +0000 (16:21 -0700)
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 <sage@inktank.com>
(cherry picked from commit e2ee52879e9de260abbf5eacbdabbd71973a6a83)

src/osdc/ObjectCacher.cc

index 9450a27de36206790c3a9391cea783d057f3d761..4d832a55a1183b8b85aedacbf9d40c7fcffb4451 100644 (file)
@@ -1456,6 +1456,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;