From: John Spray Date: Fri, 20 Mar 2015 21:09:43 +0000 (+0000) Subject: mds: be fairer in enqueuing purges X-Git-Tag: v9.0.0~115^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3893%2Fhead;p=ceph.git mds: be fairer in enqueuing purges Don't let purges that require fewer ops skip ahead of those that require more ops. Signed-off-by: John Spray --- diff --git a/src/mds/StrayManager.cc b/src/mds/StrayManager.cc index c9423673ddc3..be702aca6f4e 100644 --- a/src/mds/StrayManager.cc +++ b/src/mds/StrayManager.cc @@ -330,11 +330,16 @@ void StrayManager::enqueue(CDentry *dn, bool trunc) } } - - // Try to purge immediately if possible, else enqueue const uint32_t ops_required = _calculate_ops_required(in, trunc); - bool consumed = _consume(dn, trunc, ops_required); + // Try to purge immediately if there is nothing in the queue, otherwise + // we will go to the back of the queue (even if there is allowance available + // to run us immediately) in order to be fair to others. + bool consumed = false; + if (ready_for_purge.empty()) { + consumed = _consume(dn, trunc, ops_required); + } + if (consumed) { dout(10) << __func__ << ": purging this dentry immediately: " << *dn << dendl;