aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-02-08 21:59:22 -0500
committerTheodore Ts'o <tytso@mit.edu>2013-02-08 21:59:22 -0500
commit9924a92a8c217576bd2a2b1bbbb854462f1a00ae (patch)
tree5c4eaee350e38cd2854fd6029da9f2a822ee184e /fs/ext4/super.c
parent722887ddc8982ff40e40b650fbca9ae1e56259bc (diff)
ext4: pass context information to jbd2__journal_start()
So we can better understand what bits of ext4 are responsible for long-running jbd2 handles, use jbd2__journal_start() so we can pass context information for logging purposes. The recommended way for finding the longer-running handles is: T=/sys/kernel/debug/tracing EVENT=$T/events/jbd2/jbd2_handle_stats echo "interval > 5" > $EVENT/filter echo 1 > $EVENT/enable ./run-my-fs-benchmark cat $T/trace > /tmp/problem-handles This will list handles that were active for longer than 20ms. Having longer-running handles is bad, because a commit started at the wrong time could stall for those 20+ milliseconds, which could delay an fsync() or an O_SYNC operation. Here is an example line from the trace file describing a handle which lived on for 311 jiffies, or over 1.2 seconds: postmark-2917 [000] .... 196.435786: jbd2_handle_stats: dev 254,32 tid 570 type 2 line_no 2541 interval 311 sync 0 requested_blocks 1 dirtied_blocks 0 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index cb9d67fbc8f0..ef6ac59e4961 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4762,7 +4762,7 @@ static int ext4_write_dquot(struct dquot *dquot)
4762 struct inode *inode; 4762 struct inode *inode;
4763 4763
4764 inode = dquot_to_inode(dquot); 4764 inode = dquot_to_inode(dquot);
4765 handle = ext4_journal_start(inode, 4765 handle = ext4_journal_start(inode, EXT4_HT_QUOTA,
4766 EXT4_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); 4766 EXT4_QUOTA_TRANS_BLOCKS(dquot->dq_sb));
4767 if (IS_ERR(handle)) 4767 if (IS_ERR(handle))
4768 return PTR_ERR(handle); 4768 return PTR_ERR(handle);
@@ -4778,7 +4778,7 @@ static int ext4_acquire_dquot(struct dquot *dquot)
4778 int ret, err; 4778 int ret, err;
4779 handle_t *handle; 4779 handle_t *handle;
4780 4780
4781 handle = ext4_journal_start(dquot_to_inode(dquot), 4781 handle = ext4_journal_start(dquot_to_inode(dquot), EXT4_HT_QUOTA,
4782 EXT4_QUOTA_INIT_BLOCKS(dquot->dq_sb)); 4782 EXT4_QUOTA_INIT_BLOCKS(dquot->dq_sb));
4783 if (IS_ERR(handle)) 4783 if (IS_ERR(handle))
4784 return PTR_ERR(handle); 4784 return PTR_ERR(handle);
@@ -4794,7 +4794,7 @@ static int ext4_release_dquot(struct dquot *dquot)
4794 int ret, err; 4794 int ret, err;
4795 handle_t *handle; 4795 handle_t *handle;
4796 4796
4797 handle = ext4_journal_start(dquot_to_inode(dquot), 4797 handle = ext4_journal_start(dquot_to_inode(dquot), EXT4_HT_QUOTA,
4798 EXT4_QUOTA_DEL_BLOCKS(dquot->dq_sb)); 4798 EXT4_QUOTA_DEL_BLOCKS(dquot->dq_sb));
4799 if (IS_ERR(handle)) { 4799 if (IS_ERR(handle)) {
4800 /* Release dquot anyway to avoid endless cycle in dqput() */ 4800 /* Release dquot anyway to avoid endless cycle in dqput() */
@@ -4826,7 +4826,7 @@ static int ext4_write_info(struct super_block *sb, int type)
4826 handle_t *handle; 4826 handle_t *handle;
4827 4827
4828 /* Data block + inode block */ 4828 /* Data block + inode block */
4829 handle = ext4_journal_start(sb->s_root->d_inode, 2); 4829 handle = ext4_journal_start(sb->s_root->d_inode, EXT4_HT_QUOTA, 2);
4830 if (IS_ERR(handle)) 4830 if (IS_ERR(handle))
4831 return PTR_ERR(handle); 4831 return PTR_ERR(handle);
4832 ret = dquot_commit_info(sb, type); 4832 ret = dquot_commit_info(sb, type);
@@ -4972,7 +4972,7 @@ static int ext4_quota_off(struct super_block *sb, int type)
4972 4972
4973 /* Update modification times of quota files when userspace can 4973 /* Update modification times of quota files when userspace can
4974 * start looking at them */ 4974 * start looking at them */
4975 handle = ext4_journal_start(inode, 1); 4975 handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1);
4976 if (IS_ERR(handle)) 4976 if (IS_ERR(handle))
4977 goto out; 4977 goto out;
4978 inode->i_mtime = inode->i_ctime = CURRENT_TIME; 4978 inode->i_mtime = inode->i_ctime = CURRENT_TIME;