Whamcloud - gitweb
b=23098 Check for slow i_alloc_sem acquiring
authorAlexander.Zarochentsev <Alexander.Zarochentsev@Sun.COM>
Wed, 29 Sep 2010 15:03:06 +0000 (19:03 +0400)
committerVitaly Fertman <vitaly.fertman@sun.com>
Mon, 4 Oct 2010 19:57:41 +0000 (23:57 +0400)
i=alex.zhuravlev
i=vitaly.fertman

lustre/obdfilter/filter.c
lustre/obdfilter/filter_io.c

index f3ddd57..6ae7c4f 100644 (file)
@@ -3183,6 +3183,7 @@ int filter_setattr_internal(struct obd_export *exp, struct dentry *dentry,
                         *fcc = oa->o_lcookie;
         }
         if (ia_valid & (ATTR_SIZE | ATTR_UID | ATTR_GID)) {
                         *fcc = oa->o_lcookie;
         }
         if (ia_valid & (ATTR_SIZE | ATTR_UID | ATTR_GID)) {
+                unsigned long now = jiffies;
                 DQUOT_INIT(inode);
                 /* Filter truncates and writes are serialized by
                  * i_alloc_sem, see the comment in
                 DQUOT_INIT(inode);
                 /* Filter truncates and writes are serialized by
                  * i_alloc_sem, see the comment in
@@ -3190,6 +3191,7 @@ int filter_setattr_internal(struct obd_export *exp, struct dentry *dentry,
                 if (ia_valid & ATTR_SIZE)
                         down_write(&inode->i_alloc_sem);
                 LOCK_INODE_MUTEX(inode);
                 if (ia_valid & ATTR_SIZE)
                         down_write(&inode->i_alloc_sem);
                 LOCK_INODE_MUTEX(inode);
+                fsfilt_check_slow(exp->exp_obd, now, "i_alloc_sem and i_mutex");
                 old_size = i_size_read(inode);
         }
 
                 old_size = i_size_read(inode);
         }
 
@@ -3386,7 +3388,9 @@ int filter_setattr(struct obd_export *exp, struct obd_info *oinfo,
          */
         if (oa->o_valid &
             (OBD_MD_FLMTIME | OBD_MD_FLATIME | OBD_MD_FLCTIME)) {
          */
         if (oa->o_valid &
             (OBD_MD_FLMTIME | OBD_MD_FLATIME | OBD_MD_FLCTIME)) {
+                unsigned long now = jiffies;
                 down_write(&dentry->d_inode->i_alloc_sem);
                 down_write(&dentry->d_inode->i_alloc_sem);
+                fsfilt_check_slow(exp->exp_obd, now, "i_alloc_sem");
                 fmd = filter_fmd_get(exp, oa->o_id, oa->o_seq);
                 if (fmd && fmd->fmd_mactime_xid < oti->oti_xid)
                         fmd->fmd_mactime_xid = oti->oti_xid;
                 fmd = filter_fmd_get(exp, oa->o_id, oa->o_seq);
                 if (fmd && fmd->fmd_mactime_xid < oti->oti_xid)
                         fmd->fmd_mactime_xid = oti->oti_xid;
@@ -4006,6 +4010,7 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa,
         struct llog_cookie *fcc = NULL;
         int rc, rc2, cleanup_phase = 0, sync = 0;
         struct iattr iattr;
         struct llog_cookie *fcc = NULL;
         int rc, rc2, cleanup_phase = 0, sync = 0;
         struct iattr iattr;
+        unsigned long now;
         ENTRY;
 
         rc = filter_auth_capa(exp, NULL, oa->o_seq,
         ENTRY;
 
         rc = filter_auth_capa(exp, NULL, oa->o_seq,
@@ -4074,8 +4079,10 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa,
          * between page lock, i_mutex & starting new journal handle.
          * (see bug 20321) -johann
          */
          * between page lock, i_mutex & starting new journal handle.
          * (see bug 20321) -johann
          */
+        now = jiffies;
         down_write(&dchild->d_inode->i_alloc_sem);
         LOCK_INODE_MUTEX(dchild->d_inode);
         down_write(&dchild->d_inode->i_alloc_sem);
         LOCK_INODE_MUTEX(dchild->d_inode);
+        fsfilt_check_slow(exp->exp_obd, now, "i_alloc_sem and i_mutex");
 
         /* VBR: version recovery check */
         rc = filter_version_get_check(exp, oti, dchild->d_inode);
 
         /* VBR: version recovery check */
         rc = filter_version_get_check(exp, oti, dchild->d_inode);
index c53c435..45bf870 100644 (file)
@@ -733,6 +733,7 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa,
          * filter truncates are serialized by i_alloc_sem, allowing
          * multiple writes or single truncate. */
         down_read(&dentry->d_inode->i_alloc_sem);
          * filter truncates are serialized by i_alloc_sem, allowing
          * multiple writes or single truncate. */
         down_read(&dentry->d_inode->i_alloc_sem);
+        fsfilt_check_slow(obd, now, "i_alloc_sem");
 
         /* Don't update inode timestamps if this write is older than a
          * setattr which modifies the timestamps. b=10150 */
 
         /* Don't update inode timestamps if this write is older than a
          * setattr which modifies the timestamps. b=10150 */