From: Sage Weil Date: Wed, 18 May 2011 04:29:33 +0000 (-0700) Subject: mds: do not shift to EXCL or MIX while rdlocked X-Git-Tag: v0.28.2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0aa18f32e8347c4615505d3c662ca2c118d993fe;p=ceph.git mds: do not shift to EXCL or MIX while rdlocked There was an old change in file_eval() that was allowing us to switch from SYNC to MIX or EXCL while there were rdlocks, which either caused lots of lock thrashing or could (I think) hang things up completely. This was from ea10a672, an ancient fix for something related that appears to have taken out the rdlocked check by accident. In my tests (one writer, one stat-er), this took things from long stalls (up to 20 seconds) to very responsive stats. Yay! Fixes: #791 Signed-off-by: Sage Weil --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 3c7c19099a6..faf63106a8c 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3693,7 +3693,7 @@ void Locker::file_eval(ScatterLock *lock, bool *need_issue) // * -> excl? else if (lock->get_state() != LOCK_EXCL && - //!lock->is_rdlocked() && + !lock->is_rdlocked() && //!lock->is_waiter_for(SimpleLock::WAIT_WR) && ((wanted & (CEPH_CAP_GWR|CEPH_CAP_GBUFFER)) || (in->inode.is_dir() && !in->has_subtree_root_dirfrag())) && @@ -3705,7 +3705,7 @@ void Locker::file_eval(ScatterLock *lock, bool *need_issue) // * -> mixed? else if (lock->get_state() != LOCK_MIX && - //!lock->is_rdlocked() && + !lock->is_rdlocked() && //!lock->is_waiter_for(SimpleLock::WAIT_WR) && (lock->get_scatter_wanted() || (in->multiple_nonstale_caps() && (wanted & CEPH_CAP_GWR)))) {