aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/jbd2.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r--include/linux/jbd2.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index d861ffd49821..685640036e81 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -395,6 +395,16 @@ struct handle_s
395}; 395};
396 396
397 397
398/*
399 * Some stats for checkpoint phase
400 */
401struct transaction_chp_stats_s {
402 unsigned long cs_chp_time;
403 unsigned long cs_forced_to_close;
404 unsigned long cs_written;
405 unsigned long cs_dropped;
406};
407
398/* The transaction_t type is the guts of the journaling mechanism. It 408/* The transaction_t type is the guts of the journaling mechanism. It
399 * tracks a compound transaction through its various states: 409 * tracks a compound transaction through its various states:
400 * 410 *
@@ -532,6 +542,21 @@ struct transaction_s
532 spinlock_t t_handle_lock; 542 spinlock_t t_handle_lock;
533 543
534 /* 544 /*
545 * Longest time some handle had to wait for running transaction
546 */
547 unsigned long t_max_wait;
548
549 /*
550 * When transaction started
551 */
552 unsigned long t_start;
553
554 /*
555 * Checkpointing stats [j_checkpoint_sem]
556 */
557 struct transaction_chp_stats_s t_chp_stats;
558
559 /*
535 * Number of outstanding updates running on this transaction 560 * Number of outstanding updates running on this transaction
536 * [t_handle_lock] 561 * [t_handle_lock]
537 */ 562 */
@@ -562,6 +587,39 @@ struct transaction_s
562 587
563}; 588};
564 589
590struct transaction_run_stats_s {
591 unsigned long rs_wait;
592 unsigned long rs_running;
593 unsigned long rs_locked;
594 unsigned long rs_flushing;
595 unsigned long rs_logging;
596
597 unsigned long rs_handle_count;
598 unsigned long rs_blocks;
599 unsigned long rs_blocks_logged;
600};
601
602struct transaction_stats_s {
603 int ts_type;
604 unsigned long ts_tid;
605 union {
606 struct transaction_run_stats_s run;
607 struct transaction_chp_stats_s chp;
608 } u;
609};
610
611#define JBD2_STATS_RUN 1
612#define JBD2_STATS_CHECKPOINT 2
613
614static inline unsigned long
615jbd2_time_diff(unsigned long start, unsigned long end)
616{
617 if (end >= start)
618 return end - start;
619
620 return end + (MAX_JIFFY_OFFSET - start);
621}
622
565/** 623/**
566 * struct journal_s - The journal_s type is the concrete type associated with 624 * struct journal_s - The journal_s type is the concrete type associated with
567 * journal_t. 625 * journal_t.
@@ -623,6 +681,12 @@ struct transaction_s
623 * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the 681 * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the
624 * number that will fit in j_blocksize 682 * number that will fit in j_blocksize
625 * @j_last_sync_writer: most recent pid which did a synchronous write 683 * @j_last_sync_writer: most recent pid which did a synchronous write
684 * @j_history: Buffer storing the transactions statistics history
685 * @j_history_max: Maximum number of transactions in the statistics history
686 * @j_history_cur: Current number of transactions in the statistics history
687 * @j_history_lock: Protect the transactions statistics history
688 * @j_proc_entry: procfs entry for the jbd statistics directory
689 * @j_stats: Overall statistics
626 * @j_private: An opaque pointer to fs-private information. 690 * @j_private: An opaque pointer to fs-private information.
627 */ 691 */
628 692
@@ -815,6 +879,19 @@ struct journal_s
815 pid_t j_last_sync_writer; 879 pid_t j_last_sync_writer;
816 880
817 /* 881 /*
882 * Journal statistics
883 */
884 struct transaction_stats_s *j_history;
885 int j_history_max;
886 int j_history_cur;
887 /*
888 * Protect the transactions statistics history
889 */
890 spinlock_t j_history_lock;
891 struct proc_dir_entry *j_proc_entry;
892 struct transaction_stats_s j_stats;
893
894 /*
818 * An opaque pointer to fs-private information. ext3 puts its 895 * An opaque pointer to fs-private information. ext3 puts its
819 * superblock pointer here 896 * superblock pointer here
820 */ 897 */