diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-02-08 21:59:22 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-02-08 21:59:22 -0500 |
commit | 9924a92a8c217576bd2a2b1bbbb854462f1a00ae (patch) | |
tree | 5c4eaee350e38cd2854fd6029da9f2a822ee184e /fs/ext4/ioctl.c | |
parent | 722887ddc8982ff40e40b650fbca9ae1e56259bc (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/ioctl.c')
-rw-r--r-- | fs/ext4/ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 4784ac244fc6..31f4f56a32d6 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -104,7 +104,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
104 | } else if (oldflags & EXT4_EOFBLOCKS_FL) | 104 | } else if (oldflags & EXT4_EOFBLOCKS_FL) |
105 | ext4_truncate(inode); | 105 | ext4_truncate(inode); |
106 | 106 | ||
107 | handle = ext4_journal_start(inode, 1); | 107 | handle = ext4_journal_start(inode, EXT4_HT_INODE, 1); |
108 | if (IS_ERR(handle)) { | 108 | if (IS_ERR(handle)) { |
109 | err = PTR_ERR(handle); | 109 | err = PTR_ERR(handle); |
110 | goto flags_out; | 110 | goto flags_out; |
@@ -173,7 +173,7 @@ flags_out: | |||
173 | } | 173 | } |
174 | 174 | ||
175 | mutex_lock(&inode->i_mutex); | 175 | mutex_lock(&inode->i_mutex); |
176 | handle = ext4_journal_start(inode, 1); | 176 | handle = ext4_journal_start(inode, EXT4_HT_INODE, 1); |
177 | if (IS_ERR(handle)) { | 177 | if (IS_ERR(handle)) { |
178 | err = PTR_ERR(handle); | 178 | err = PTR_ERR(handle); |
179 | goto unlock_out; | 179 | goto unlock_out; |