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/inline.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/inline.c')
-rw-r--r-- | fs/ext4/inline.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 93a3408fc89b..bc5f871f0893 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c | |||
@@ -545,7 +545,7 @@ static int ext4_convert_inline_data_to_extent(struct address_space *mapping, | |||
545 | return ret; | 545 | return ret; |
546 | 546 | ||
547 | retry: | 547 | retry: |
548 | handle = ext4_journal_start(inode, needed_blocks); | 548 | handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, needed_blocks); |
549 | if (IS_ERR(handle)) { | 549 | if (IS_ERR(handle)) { |
550 | ret = PTR_ERR(handle); | 550 | ret = PTR_ERR(handle); |
551 | handle = NULL; | 551 | handle = NULL; |
@@ -657,7 +657,7 @@ int ext4_try_to_write_inline_data(struct address_space *mapping, | |||
657 | * The possible write could happen in the inode, | 657 | * The possible write could happen in the inode, |
658 | * so try to reserve the space in inode first. | 658 | * so try to reserve the space in inode first. |
659 | */ | 659 | */ |
660 | handle = ext4_journal_start(inode, 1); | 660 | handle = ext4_journal_start(inode, EXT4_HT_INODE, 1); |
661 | if (IS_ERR(handle)) { | 661 | if (IS_ERR(handle)) { |
662 | ret = PTR_ERR(handle); | 662 | ret = PTR_ERR(handle); |
663 | handle = NULL; | 663 | handle = NULL; |
@@ -853,7 +853,7 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping, | |||
853 | if (ret) | 853 | if (ret) |
854 | return ret; | 854 | return ret; |
855 | 855 | ||
856 | handle = ext4_journal_start(inode, 1); | 856 | handle = ext4_journal_start(inode, EXT4_HT_INODE, 1); |
857 | if (IS_ERR(handle)) { | 857 | if (IS_ERR(handle)) { |
858 | ret = PTR_ERR(handle); | 858 | ret = PTR_ERR(handle); |
859 | handle = NULL; | 859 | handle = NULL; |
@@ -1770,7 +1770,7 @@ void ext4_inline_data_truncate(struct inode *inode, int *has_inline) | |||
1770 | 1770 | ||
1771 | 1771 | ||
1772 | needed_blocks = ext4_writepage_trans_blocks(inode); | 1772 | needed_blocks = ext4_writepage_trans_blocks(inode); |
1773 | handle = ext4_journal_start(inode, needed_blocks); | 1773 | handle = ext4_journal_start(inode, EXT4_HT_INODE, needed_blocks); |
1774 | if (IS_ERR(handle)) | 1774 | if (IS_ERR(handle)) |
1775 | return; | 1775 | return; |
1776 | 1776 | ||
@@ -1862,7 +1862,7 @@ int ext4_convert_inline_data(struct inode *inode) | |||
1862 | if (error) | 1862 | if (error) |
1863 | return error; | 1863 | return error; |
1864 | 1864 | ||
1865 | handle = ext4_journal_start(inode, needed_blocks); | 1865 | handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, needed_blocks); |
1866 | if (IS_ERR(handle)) { | 1866 | if (IS_ERR(handle)) { |
1867 | error = PTR_ERR(handle); | 1867 | error = PTR_ERR(handle); |
1868 | goto out_free; | 1868 | goto out_free; |