Skip to content

Commit 918247c

Browse files
author
Darrick J. Wong
committed
xfs: report "max_resp" used for min log size computation
Move the tracepoint that computes the size of the transaction used to compute the minimum log size into xfs_log_get_max_trans_res so that we only have to compute this stuff once. Leave xfs_log_get_max_trans_res as a non-static function so that xfs_db can call it to report the results of the userspace computation of the same value to diagnose mkfs/kernel misinteractions. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 52d8ea4 commit 918247c

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

fs/xfs/libxfs/xfs_log_rlimit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ xfs_log_get_max_trans_res(
7676
*max_resp = resv.tr_attrsetm; /* struct copy */
7777
max_resp->tr_logres = attr_space;
7878
}
79+
trace_xfs_log_get_max_trans_res(mp, max_resp);
7980
}
8081

8182
/*

fs/xfs/xfs_trace.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,6 +3534,25 @@ DEFINE_EVENT(xfs_trans_resv_class, name, \
35343534
DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc);
35353535
DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc_minlogsize);
35363536

3537+
TRACE_EVENT(xfs_log_get_max_trans_res,
3538+
TP_PROTO(struct xfs_mount *mp, const struct xfs_trans_res *res),
3539+
TP_ARGS(mp, res),
3540+
TP_STRUCT__entry(
3541+
__field(dev_t, dev)
3542+
__field(uint, logres)
3543+
__field(int, logcount)
3544+
),
3545+
TP_fast_assign(
3546+
__entry->dev = mp->m_super->s_dev;
3547+
__entry->logres = res->tr_logres;
3548+
__entry->logcount = res->tr_logcount;
3549+
),
3550+
TP_printk("dev %d:%d logres %u logcount %d",
3551+
MAJOR(__entry->dev), MINOR(__entry->dev),
3552+
__entry->logres,
3553+
__entry->logcount)
3554+
);
3555+
35373556
DECLARE_EVENT_CLASS(xfs_trans_class,
35383557
TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
35393558
TP_ARGS(tp, caller_ip),

fs/xfs/xfs_trans.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ static void
3232
xfs_trans_trace_reservations(
3333
struct xfs_mount *mp)
3434
{
35-
struct xfs_trans_res resv;
3635
struct xfs_trans_res *res;
3736
struct xfs_trans_res *end_res;
3837
int i;
@@ -41,8 +40,6 @@ xfs_trans_trace_reservations(
4140
end_res = (struct xfs_trans_res *)(M_RES(mp) + 1);
4241
for (i = 0; res < end_res; i++, res++)
4342
trace_xfs_trans_resv_calc(mp, i, res);
44-
xfs_log_get_max_trans_res(mp, &resv);
45-
trace_xfs_trans_resv_calc(mp, -1, &resv);
4643
}
4744
#else
4845
# define xfs_trans_trace_reservations(mp)

0 commit comments

Comments
 (0)