All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] btrfs: Expose BTRFS commit stats through sysfs
@ 2022-06-21 21:52 Ioannis Angelakopoulos
  2022-06-21 21:52 ` [PATCH v3 1/2] btrfs: Add the capability of getting commit stats in BTRFS Ioannis Angelakopoulos
  2022-06-21 21:52 ` [PATCH v3 2/2] btrfs: Expose the BTRFS commit stats through sysfs Ioannis Angelakopoulos
  0 siblings, 2 replies; 4+ messages in thread
From: Ioannis Angelakopoulos @ 2022-06-21 21:52 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

With this patch series we add the capability to BTRFS to expose some
commit stats through sysfs that might be useful for performance monitoring
and debugging purposes.

Specifically, through SYSFS we expose the following data:
  1) A counter for the commits that occurred so far.
  2) The duration in ms of the last commit.
  3) The maximum commit duration in ms seen so far.
  4) The total duration in ms of the commits seen so far.

The user also has the capability to reset the maximum commit duration
back to zero, again through SYSFS.

Changes from v2:

1) Only the maximum duration can now be zeroed out through sysfs to
prevent loss of data if multiple threads try to reset the commit stats
simultaneously
2) Removed the lock that protected the concurrent resetting and updating
of the commit stats, since only the maximum commit duration can be
cleared out now (any races can be ignored for this stat).
3) Added div_u64 when converting from ns to ms, to also support 32-bit
4) Made the output from sysfs easier to use with "grep"

Changes from v1:

1) Edited out unnecessary comments
2) Made the memory allocation of "btrfs_commit_stats" under "fs_info" in
fs/btrfs/ctree.h static instead of dynamic
3) Transferred the conversion from ns to ms at the point where commit
stats get printed in sysfs, for better precision
4) Changed the lock that protects the update of the commit stats from
"trans_lock" to "super_lock"
5) Changed the printing of the commits stats in sysfs to conform with
the sysfs output

Ioannis Angelakopoulos (2):
  btrfs: Add the capability of getting commit stats in BTRFS
  btrfs: Expose the BTRFS commit stats through sysfs

 fs/btrfs/ctree.h       | 14 +++++++++++++
 fs/btrfs/sysfs.c       | 45 ++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/transaction.c | 22 +++++++++++++++++++++
 3 files changed, 81 insertions(+)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-22  6:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-21 21:52 [PATCH v3 0/2] btrfs: Expose BTRFS commit stats through sysfs Ioannis Angelakopoulos
2022-06-21 21:52 ` [PATCH v3 1/2] btrfs: Add the capability of getting commit stats in BTRFS Ioannis Angelakopoulos
2022-06-21 21:52 ` [PATCH v3 2/2] btrfs: Expose the BTRFS commit stats through sysfs Ioannis Angelakopoulos
2022-06-22  6:32   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.