]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: collect commit stats, count, duration
authorIoannis Angelakopoulos <iangelak@fb.com>
Tue, 14 Jun 2022 22:22:32 +0000 (15:22 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:37 +0000 (17:45 +0200)
commit0384203bc0157f990b181882d1ca2afc3dd597fa
treed75a9f1023629ed1337c3bdf45d2a38118c5302d
parent7aec2abd79117ed2bf18cbd4db7d72896ed730cb
btrfs: collect commit stats, count, duration

Track several stats about transaction commit, to be later exported via
sysfs:

- number of commits so far
- duration of the last commit in ns
- maximum commit duration seen so far in ns
- total duration for all commits so far in ns

The update of the commit stats occurs after the commit thread has gone
through all the logic that checks if there is another thread committing
at the same time. This means that we only account for actual commit work
in the commit stats we report and not the time the thread spends waiting
until it is ready to do the commit work.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Ioannis Angelakopoulos <iangelak@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/transaction.c