Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209984
b: refs/heads/master
c: 3b93c7a
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Dave Chinner committed Aug 24, 2010
1 parent 074cf67 commit b4f162b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a44f13edf0ebb4e41942d0f16ca80489dcf6659d
refs/heads/master: 3b93c7aaefc05ee2a75e2726929b01a321402984
34 changes: 26 additions & 8 deletions trunk/fs/xfs/xfs_log_cil.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,10 @@ xlog_cil_insert(
static void
xlog_cil_format_items(
struct log *log,
struct xfs_log_vec *log_vector,
struct xlog_ticket *ticket,
xfs_lsn_t *start_lsn)
struct xfs_log_vec *log_vector)
{
struct xfs_log_vec *lv;

if (start_lsn)
*start_lsn = log->l_cilp->xc_ctx->sequence;

ASSERT(log_vector);
for (lv = log_vector; lv; lv = lv->lv_next) {
void *ptr;
Expand All @@ -302,9 +297,24 @@ xlog_cil_format_items(
ptr += vec->i_len;
}
ASSERT(ptr == lv->lv_buf + lv->lv_buf_len);
}
}

static void
xlog_cil_insert_items(
struct log *log,
struct xfs_log_vec *log_vector,
struct xlog_ticket *ticket,
xfs_lsn_t *start_lsn)
{
struct xfs_log_vec *lv;

if (start_lsn)
*start_lsn = log->l_cilp->xc_ctx->sequence;

ASSERT(log_vector);
for (lv = log_vector; lv; lv = lv->lv_next)
xlog_cil_insert(log, ticket, lv->lv_item, lv);
}
}

static void
Expand Down Expand Up @@ -612,9 +622,17 @@ xfs_log_commit_cil(
return XFS_ERROR(EIO);
}

/*
* do all the hard work of formatting items (including memory
* allocation) outside the CIL context lock. This prevents stalling CIL
* pushes when we are low on memory and a transaction commit spends a
* lot of time in memory reclaim.
*/
xlog_cil_format_items(log, log_vector);

/* lock out background commit */
down_read(&log->l_cilp->xc_ctx_lock);
xlog_cil_format_items(log, log_vector, tp->t_ticket, commit_lsn);
xlog_cil_insert_items(log, log_vector, tp->t_ticket, commit_lsn);

/* check we didn't blow the reservation */
if (tp->t_ticket->t_curr_res < 0)
Expand Down

0 comments on commit b4f162b

Please sign in to comment.