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/resize.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/resize.c')
-rw-r--r-- | fs/ext4/resize.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 8eefb636beb8..c7f4d7584669 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c | |||
@@ -466,7 +466,7 @@ static int setup_new_flex_group_blocks(struct super_block *sb, | |||
466 | meta_bg = EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_META_BG); | 466 | meta_bg = EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_META_BG); |
467 | 467 | ||
468 | /* This transaction may be extended/restarted along the way */ | 468 | /* This transaction may be extended/restarted along the way */ |
469 | handle = ext4_journal_start_sb(sb, EXT4_MAX_TRANS_DATA); | 469 | handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, EXT4_MAX_TRANS_DATA); |
470 | if (IS_ERR(handle)) | 470 | if (IS_ERR(handle)) |
471 | return PTR_ERR(handle); | 471 | return PTR_ERR(handle); |
472 | 472 | ||
@@ -1031,7 +1031,7 @@ static void update_backups(struct super_block *sb, int blk_off, char *data, | |||
1031 | handle_t *handle; | 1031 | handle_t *handle; |
1032 | int err = 0, err2; | 1032 | int err = 0, err2; |
1033 | 1033 | ||
1034 | handle = ext4_journal_start_sb(sb, EXT4_MAX_TRANS_DATA); | 1034 | handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, EXT4_MAX_TRANS_DATA); |
1035 | if (IS_ERR(handle)) { | 1035 | if (IS_ERR(handle)) { |
1036 | group = 1; | 1036 | group = 1; |
1037 | err = PTR_ERR(handle); | 1037 | err = PTR_ERR(handle); |
@@ -1412,7 +1412,7 @@ static int ext4_flex_group_add(struct super_block *sb, | |||
1412 | * modify each of the reserved GDT dindirect blocks. | 1412 | * modify each of the reserved GDT dindirect blocks. |
1413 | */ | 1413 | */ |
1414 | credit = flex_gd->count * 4 + reserved_gdb; | 1414 | credit = flex_gd->count * 4 + reserved_gdb; |
1415 | handle = ext4_journal_start_sb(sb, credit); | 1415 | handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, credit); |
1416 | if (IS_ERR(handle)) { | 1416 | if (IS_ERR(handle)) { |
1417 | err = PTR_ERR(handle); | 1417 | err = PTR_ERR(handle); |
1418 | goto exit; | 1418 | goto exit; |
@@ -1624,7 +1624,7 @@ static int ext4_group_extend_no_check(struct super_block *sb, | |||
1624 | /* We will update the superblock, one block bitmap, and | 1624 | /* We will update the superblock, one block bitmap, and |
1625 | * one group descriptor via ext4_group_add_blocks(). | 1625 | * one group descriptor via ext4_group_add_blocks(). |
1626 | */ | 1626 | */ |
1627 | handle = ext4_journal_start_sb(sb, 3); | 1627 | handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, 3); |
1628 | if (IS_ERR(handle)) { | 1628 | if (IS_ERR(handle)) { |
1629 | err = PTR_ERR(handle); | 1629 | err = PTR_ERR(handle); |
1630 | ext4_warning(sb, "error %d on journal start", err); | 1630 | ext4_warning(sb, "error %d on journal start", err); |
@@ -1788,7 +1788,7 @@ static int ext4_convert_meta_bg(struct super_block *sb, struct inode *inode) | |||
1788 | credits += 3; /* block bitmap, bg descriptor, resize inode */ | 1788 | credits += 3; /* block bitmap, bg descriptor, resize inode */ |
1789 | } | 1789 | } |
1790 | 1790 | ||
1791 | handle = ext4_journal_start_sb(sb, credits); | 1791 | handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, credits); |
1792 | if (IS_ERR(handle)) | 1792 | if (IS_ERR(handle)) |
1793 | return PTR_ERR(handle); | 1793 | return PTR_ERR(handle); |
1794 | 1794 | ||