xfs: CIL context doesn't need to count iovecs

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2167832

commit 593e34391faafd72102bd79c43994f32e9dd0c91
Author: Dave Chinner <dchinner@redhat.com>
Date:   Thu Apr 21 10:36:56 2022 +1000

    xfs: CIL context doesn't need to count iovecs

    Now that we account for log opheaders in the log item formatting
    code, we don't actually use the aggregated count of log iovecs in
    the CIL for anything. Remove it and the tracking code that
    calculates it.

    Signed-off-by: Dave Chinner <dchinner@redhat.com>
    Reviewed-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
    Signed-off-by: Dave Chinner <david@fromorbit.com>

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
This commit is contained in:
Bill O'Donnell 2023-05-18 11:11:05 -05:00
parent d9caa4693c
commit 5d2f8935a2
2 changed files with 6 additions and 17 deletions

View File

@ -284,22 +284,18 @@ xlog_cil_alloc_shadow_bufs(
/* /*
* Prepare the log item for insertion into the CIL. Calculate the difference in * Prepare the log item for insertion into the CIL. Calculate the difference in
* log space and vectors it will consume, and if it is a new item pin it as * log space it will consume, and if it is a new item pin it as well.
* well.
*/ */
STATIC void STATIC void
xfs_cil_prepare_item( xfs_cil_prepare_item(
struct xlog *log, struct xlog *log,
struct xfs_log_vec *lv, struct xfs_log_vec *lv,
struct xfs_log_vec *old_lv, struct xfs_log_vec *old_lv,
int *diff_len, int *diff_len)
int *diff_iovecs)
{ {
/* Account for the new LV being passed in */ /* Account for the new LV being passed in */
if (lv->lv_buf_len != XFS_LOG_VEC_ORDERED) { if (lv->lv_buf_len != XFS_LOG_VEC_ORDERED)
*diff_len += lv->lv_bytes; *diff_len += lv->lv_bytes;
*diff_iovecs += lv->lv_niovecs;
}
/* /*
* If there is no old LV, this is the first time we've seen the item in * If there is no old LV, this is the first time we've seen the item in
@ -316,7 +312,6 @@ xfs_cil_prepare_item(
ASSERT(lv->lv_buf_len != XFS_LOG_VEC_ORDERED); ASSERT(lv->lv_buf_len != XFS_LOG_VEC_ORDERED);
*diff_len -= old_lv->lv_bytes; *diff_len -= old_lv->lv_bytes;
*diff_iovecs -= old_lv->lv_niovecs;
lv->lv_item->li_lv_shadow = old_lv; lv->lv_item->li_lv_shadow = old_lv;
} }
@ -365,12 +360,10 @@ static void
xlog_cil_insert_format_items( xlog_cil_insert_format_items(
struct xlog *log, struct xlog *log,
struct xfs_trans *tp, struct xfs_trans *tp,
int *diff_len, int *diff_len)
int *diff_iovecs)
{ {
struct xfs_log_item *lip; struct xfs_log_item *lip;
/* Bail out if we didn't find a log item. */ /* Bail out if we didn't find a log item. */
if (list_empty(&tp->t_items)) { if (list_empty(&tp->t_items)) {
ASSERT(0); ASSERT(0);
@ -413,7 +406,6 @@ xlog_cil_insert_format_items(
* set the item up as though it is a new insertion so * set the item up as though it is a new insertion so
* that the space reservation accounting is correct. * that the space reservation accounting is correct.
*/ */
*diff_iovecs -= lv->lv_niovecs;
*diff_len -= lv->lv_bytes; *diff_len -= lv->lv_bytes;
/* Ensure the lv is set up according to ->iop_size */ /* Ensure the lv is set up according to ->iop_size */
@ -438,7 +430,7 @@ xlog_cil_insert_format_items(
ASSERT(IS_ALIGNED((unsigned long)lv->lv_buf, sizeof(uint64_t))); ASSERT(IS_ALIGNED((unsigned long)lv->lv_buf, sizeof(uint64_t)));
lip->li_ops->iop_format(lip, lv); lip->li_ops->iop_format(lip, lv);
insert: insert:
xfs_cil_prepare_item(log, lv, old_lv, diff_len, diff_iovecs); xfs_cil_prepare_item(log, lv, old_lv, diff_len);
} }
} }
@ -458,7 +450,6 @@ xlog_cil_insert_items(
struct xfs_cil_ctx *ctx = cil->xc_ctx; struct xfs_cil_ctx *ctx = cil->xc_ctx;
struct xfs_log_item *lip; struct xfs_log_item *lip;
int len = 0; int len = 0;
int diff_iovecs = 0;
int iclog_space; int iclog_space;
int iovhdr_res = 0, split_res = 0, ctx_res = 0; int iovhdr_res = 0, split_res = 0, ctx_res = 0;
@ -468,7 +459,7 @@ xlog_cil_insert_items(
* We can do this safely because the context can't checkpoint until we * We can do this safely because the context can't checkpoint until we
* are done so it doesn't matter exactly how we update the CIL. * are done so it doesn't matter exactly how we update the CIL.
*/ */
xlog_cil_insert_format_items(log, tp, &len, &diff_iovecs); xlog_cil_insert_format_items(log, tp, &len);
spin_lock(&cil->xc_cil_lock); spin_lock(&cil->xc_cil_lock);
@ -503,7 +494,6 @@ xlog_cil_insert_items(
} }
tp->t_ticket->t_curr_res -= len; tp->t_ticket->t_curr_res -= len;
ctx->space_used += len; ctx->space_used += len;
ctx->nvecs += diff_iovecs;
/* /*
* If we've overrun the reservation, dump the tx details before we move * If we've overrun the reservation, dump the tx details before we move

View File

@ -221,7 +221,6 @@ struct xfs_cil_ctx {
xfs_lsn_t commit_lsn; /* chkpt commit record lsn */ xfs_lsn_t commit_lsn; /* chkpt commit record lsn */
struct xlog_in_core *commit_iclog; struct xlog_in_core *commit_iclog;
struct xlog_ticket *ticket; /* chkpt ticket */ struct xlog_ticket *ticket; /* chkpt ticket */
int nvecs; /* number of regions */
int space_used; /* aggregate size of regions */ int space_used; /* aggregate size of regions */
struct list_head busy_extents; /* busy extents in chkpt */ struct list_head busy_extents; /* busy extents in chkpt */
struct xfs_log_vec *lv_chain; /* logvecs being pushed */ struct xfs_log_vec *lv_chain; /* logvecs being pushed */