aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/journal.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-02-06 22:30:23 -0500
committerTheodore Ts'o <tytso@mit.edu>2013-02-06 22:30:23 -0500
commit9fff24aa2c5c504aadead1ff9599e813604c2e53 (patch)
tree24bbb1691ec816aed648a895882526ce361ec92f /fs/jbd2/journal.c
parent40ae3487628235e5f1eb27542cca0cdb6e5dbe16 (diff)
jbd2: track request delay statistics
Track the delay between when we first request that the commit begin and when it actually begins, so we can see how much of a gap exists. In theory, this should just be the remaining scheduling quantuum of the thread which requested the commit (assuming it was not a synchronous operation which triggered the commit request) plus scheduling overhead; however, it's possible that real time processes might get in the way of letting the kjournald thread from executing. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r--fs/jbd2/journal.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 1a80e3146a59..4ba2e81e35ac 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -533,6 +533,7 @@ int __jbd2_log_start_commit(journal_t *journal, tid_t target)
533 jbd_debug(1, "JBD2: requesting commit %d/%d\n", 533 jbd_debug(1, "JBD2: requesting commit %d/%d\n",
534 journal->j_commit_request, 534 journal->j_commit_request,
535 journal->j_commit_sequence); 535 journal->j_commit_sequence);
536 journal->j_running_transaction->t_requested = jiffies;
536 wake_up(&journal->j_wait_commit); 537 wake_up(&journal->j_wait_commit);
537 return 1; 538 return 1;
538 } else if (!tid_geq(journal->j_commit_request, target)) 539 } else if (!tid_geq(journal->j_commit_request, target))
@@ -898,13 +899,18 @@ static int jbd2_seq_info_show(struct seq_file *seq, void *v)
898 899
899 if (v != SEQ_START_TOKEN) 900 if (v != SEQ_START_TOKEN)
900 return 0; 901 return 0;
901 seq_printf(seq, "%lu transaction, each up to %u blocks\n", 902 seq_printf(seq, "%lu transactions (%lu requested), "
902 s->stats->ts_tid, 903 "each up to %u blocks\n",
903 s->journal->j_max_transaction_buffers); 904 s->stats->ts_tid, s->stats->ts_requested,
905 s->journal->j_max_transaction_buffers);
904 if (s->stats->ts_tid == 0) 906 if (s->stats->ts_tid == 0)
905 return 0; 907 return 0;
906 seq_printf(seq, "average: \n %ums waiting for transaction\n", 908 seq_printf(seq, "average: \n %ums waiting for transaction\n",
907 jiffies_to_msecs(s->stats->run.rs_wait / s->stats->ts_tid)); 909 jiffies_to_msecs(s->stats->run.rs_wait / s->stats->ts_tid));
910 seq_printf(seq, " %ums request delay\n",
911 (s->stats->ts_requested == 0) ? 0 :
912 jiffies_to_msecs(s->stats->run.rs_request_delay /
913 s->stats->ts_requested));
908 seq_printf(seq, " %ums running transaction\n", 914 seq_printf(seq, " %ums running transaction\n",
909 jiffies_to_msecs(s->stats->run.rs_running / s->stats->ts_tid)); 915 jiffies_to_msecs(s->stats->run.rs_running / s->stats->ts_tid));
910 seq_printf(seq, " %ums transaction was being locked\n", 916 seq_printf(seq, " %ums transaction was being locked\n",