diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-07-14 11:15:25 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-10-14 14:17:11 -0700 |
commit | e86a2b6118f2b221b41529e8ac784229459e1c0b (patch) | |
tree | 26cc9ddf41fb7c735af3545e2f51979d9cc9efda /fs/xfs/xfs_trace.h | |
parent | a7da613603a4e7b3e6949973fdeb7994586a2809 (diff) |
xfs: allow inode-based btrees to reserve space in the data devicereserve-rt-metadata-space_2022-10-14
Create a new space reservation scheme so that btree metadata for the
realtime volume can reserve space in the data device to avoid space
underruns.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_trace.h')
-rw-r--r-- | fs/xfs/xfs_trace.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index e6a7b6325f05..7e21c93fe8c1 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -4970,6 +4970,51 @@ DEFINE_IMETA_DIR_EVENT(xfs_imeta_dir_created); DEFINE_IMETA_DIR_EVENT(xfs_imeta_dir_unlinked); DEFINE_IMETA_DIR_EVENT(xfs_imeta_dir_link); +/* metadata inode space reservations */ + +DECLARE_EVENT_CLASS(xfs_imeta_resv_class, + TP_PROTO(struct xfs_inode *ip, xfs_filblks_t len), + TP_ARGS(ip, len), + TP_STRUCT__entry( + __field(dev_t, dev) + __field(xfs_ino_t, ino) + __field(unsigned long long, freeblks) + __field(unsigned long long, reserved) + __field(unsigned long long, asked) + __field(unsigned long long, used) + __field(unsigned long long, len) + ), + TP_fast_assign( + struct xfs_mount *mp = ip->i_mount; + + __entry->dev = mp->m_super->s_dev; + __entry->ino = ip->i_ino; + __entry->freeblks = percpu_counter_sum(&mp->m_fdblocks); + __entry->reserved = ip->i_delayed_blks; + __entry->asked = ip->i_meta_resv_asked; + __entry->used = ip->i_nblocks; + __entry->len = len; + ), + TP_printk("dev %d:%d ino 0x%llx freeblks %llu resv %llu ask %llu used %llu len %llu", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, + __entry->freeblks, + __entry->reserved, + __entry->asked, + __entry->used, + __entry->len) +) +#define DEFINE_IMETA_RESV_EVENT(name) \ +DEFINE_EVENT(xfs_imeta_resv_class, name, \ + TP_PROTO(struct xfs_inode *ip, xfs_filblks_t len), \ + TP_ARGS(ip, len)) +DEFINE_IMETA_RESV_EVENT(xfs_imeta_resv_init); +DEFINE_IMETA_RESV_EVENT(xfs_imeta_resv_free); +DEFINE_IMETA_RESV_EVENT(xfs_imeta_resv_alloc_extent); +DEFINE_IMETA_RESV_EVENT(xfs_imeta_resv_free_extent); +DEFINE_IMETA_RESV_EVENT(xfs_imeta_resv_critical); +DEFINE_INODE_ERROR_EVENT(xfs_imeta_resv_init_error); + #endif /* _TRACE_XFS_H */ #undef TRACE_INCLUDE_PATH |