diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-09-30 00:32:42 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-09-30 00:32:42 -0400 |
commit | 296c355cd6443d89fa251885a8d78778fe111dc4 (patch) | |
tree | 5cf7c8b115617dc3829a16a5969894d37b73173c /fs/ext4/super.c | |
parent | 90576c0b9a0b5323fc4bd7f23f49be0d234f36d1 (diff) |
ext4: Use tracepoints for mb_history trace file
The /proc/fs/ext4/<dev>/mb_history was maintained manually, and had a
number of problems: it required a largish amount of memory to be
allocated for each ext4 filesystem, and the s_mb_history_lock
introduced a CPU contention problem.
By ripping out the mb_history code and replacing it with ftrace
tracepoints, and we get more functionality: timestamps, event
filtering, the ability to correlate mballoc history with other ext4
tracepoints, etc.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e5b206a043a5..12e726a7073f 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -50,13 +50,6 @@ | |||
50 | #define CREATE_TRACE_POINTS | 50 | #define CREATE_TRACE_POINTS |
51 | #include <trace/events/ext4.h> | 51 | #include <trace/events/ext4.h> |
52 | 52 | ||
53 | static int default_mb_history_length = 1000; | ||
54 | |||
55 | module_param_named(default_mb_history_length, default_mb_history_length, | ||
56 | int, 0644); | ||
57 | MODULE_PARM_DESC(default_mb_history_length, | ||
58 | "Default number of entries saved for mb_history"); | ||
59 | |||
60 | struct proc_dir_entry *ext4_proc_root; | 53 | struct proc_dir_entry *ext4_proc_root; |
61 | static struct kset *ext4_kset; | 54 | static struct kset *ext4_kset; |
62 | 55 | ||
@@ -1079,7 +1072,7 @@ enum { | |||
1079 | Opt_journal_update, Opt_journal_dev, | 1072 | Opt_journal_update, Opt_journal_dev, |
1080 | Opt_journal_checksum, Opt_journal_async_commit, | 1073 | Opt_journal_checksum, Opt_journal_async_commit, |
1081 | Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback, | 1074 | Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback, |
1082 | Opt_data_err_abort, Opt_data_err_ignore, Opt_mb_history_length, | 1075 | Opt_data_err_abort, Opt_data_err_ignore, |
1083 | Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, | 1076 | Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, |
1084 | Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, | 1077 | Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, |
1085 | Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err, Opt_resize, | 1078 | Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err, Opt_resize, |
@@ -1126,7 +1119,6 @@ static const match_table_t tokens = { | |||
1126 | {Opt_data_writeback, "data=writeback"}, | 1119 | {Opt_data_writeback, "data=writeback"}, |
1127 | {Opt_data_err_abort, "data_err=abort"}, | 1120 | {Opt_data_err_abort, "data_err=abort"}, |
1128 | {Opt_data_err_ignore, "data_err=ignore"}, | 1121 | {Opt_data_err_ignore, "data_err=ignore"}, |
1129 | {Opt_mb_history_length, "mb_history_length=%u"}, | ||
1130 | {Opt_offusrjquota, "usrjquota="}, | 1122 | {Opt_offusrjquota, "usrjquota="}, |
1131 | {Opt_usrjquota, "usrjquota=%s"}, | 1123 | {Opt_usrjquota, "usrjquota=%s"}, |
1132 | {Opt_offgrpjquota, "grpjquota="}, | 1124 | {Opt_offgrpjquota, "grpjquota="}, |
@@ -1367,13 +1359,6 @@ static int parse_options(char *options, struct super_block *sb, | |||
1367 | case Opt_data_err_ignore: | 1359 | case Opt_data_err_ignore: |
1368 | clear_opt(sbi->s_mount_opt, DATA_ERR_ABORT); | 1360 | clear_opt(sbi->s_mount_opt, DATA_ERR_ABORT); |
1369 | break; | 1361 | break; |
1370 | case Opt_mb_history_length: | ||
1371 | if (match_int(&args[0], &option)) | ||
1372 | return 0; | ||
1373 | if (option < 0) | ||
1374 | return 0; | ||
1375 | sbi->s_mb_history_max = option; | ||
1376 | break; | ||
1377 | #ifdef CONFIG_QUOTA | 1362 | #ifdef CONFIG_QUOTA |
1378 | case Opt_usrjquota: | 1363 | case Opt_usrjquota: |
1379 | qtype = USRQUOTA; | 1364 | qtype = USRQUOTA; |
@@ -2435,7 +2420,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
2435 | sbi->s_commit_interval = JBD2_DEFAULT_MAX_COMMIT_AGE * HZ; | 2420 | sbi->s_commit_interval = JBD2_DEFAULT_MAX_COMMIT_AGE * HZ; |
2436 | sbi->s_min_batch_time = EXT4_DEF_MIN_BATCH_TIME; | 2421 | sbi->s_min_batch_time = EXT4_DEF_MIN_BATCH_TIME; |
2437 | sbi->s_max_batch_time = EXT4_DEF_MAX_BATCH_TIME; | 2422 | sbi->s_max_batch_time = EXT4_DEF_MAX_BATCH_TIME; |
2438 | sbi->s_mb_history_max = default_mb_history_length; | ||
2439 | 2423 | ||
2440 | set_opt(sbi->s_mount_opt, BARRIER); | 2424 | set_opt(sbi->s_mount_opt, BARRIER); |
2441 | 2425 | ||