public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 09/12] xfs: Introduce delayed logging core code
Date: Mon, 17 May 2010 15:51:01 +1000	[thread overview]
Message-ID: <20100517055101.GK8120@dastard> (raw)
In-Reply-To: <20100510121628.GD7165@dastard>

On Mon, May 10, 2010 at 10:16:28PM +1000, Dave Chinner wrote:
> On Mon, May 10, 2010 at 07:44:35AM -0400, Christoph Hellwig wrote:
> > > +		new_lv = kmem_zalloc(sizeof(*new_lv) +
> > > +				lidp->lid_size * sizeof(struct xfs_log_iovec),
> > > +				KM_SLEEP);
> > > +
> > > +		/* The allocated iovec region lies beyond the log vector. */
> > > +		new_lv->lv_iovecp = (struct xfs_log_iovec *)&new_lv[1];
> > > +		if (!ret_lv)
> > > +			ret_lv = new_lv;
> > > +		else
> > > +			lv->lv_next = new_lv;
> > > +		lv = new_lv;
> > 
> > I'd suggest already setting up lv->lv_niovecs and lv->lv_item here
> > instead of in xfs_trans_fill_log_vecs.  That way xfs_trans_fill_log_vecs
> > can be simplified to:
> > 
> > STATIC void
> > xfs_trans_fill_log_vecs(
> > 	struct xfs_trans	*tp,
> > 	struct xfs_log_vec	*log_vector)
> > {
> > 	struct xfs_log_vec	*lv;
> > 
> > 	for (lv = log_vector; lv = lv->lv_next; lv)
> > 		IOP_FORMAT(lidp->lid_item, lv->lv_iovecp);
> > }
> > 
> > Or just inlined into the caller or even xfs_log_commit_cil given how simple
> > it is now.  Moving it to xfs_log_commit_cil would also help avoiding the
> > locking imbalance where xfs_log_commit_cil is called with xc_ctx_lock
> > held but returns without it after the last patch in the series.  That
> > again might allow merging the IOP_FORMAT loop into xlog_cil_format_items.

OK, having looked into this in more detail, I agree that this makes
the code much simpler and formatting in xlog_cil_format_items()
makes sense for cleaning up the unbalanced locking.
xfs_trans_fill_log_vecs() basically goes away completely.

> > Btw, I wonder if xfs_log_commit_cil should simply move to xfs_trans.c?
> > That would avoid having to export xfs_trans_unreserve_and_mod_sb,
> > xfs_trans_free_items and xfs_trans_free from there, and only require
> > exporting xlog_cil_format_items (if we didn't move that one as well,
> > then xlog_cil_insert), while keeping things a lot more symmetric with
> > the traditional commit path.
> 
> I did find it a bit hard trying to draw the line between the trans
> subsystem and the logging subsystem because of the interactions and
> the way they changed as I developed the code and fixed bugs. I'll
> have a closer look at what you are suggesting (it seems reasonable
> just from a quick scan) and see how much it cleans up.

Unfortunately, it's still not a totally clean separation - either
way something has to be exported. I'd prefer not to export the CIL
context or the context lock outside xfs_log_cil.c, so that kind of
rules out moving xfs_log_commit_cil(). I moved a couple of things
from there back to xfs_trans_commit_cil(), but we still need
xfs_trans_item_committed() and xfs_trans_unreserve_and_mod_sb()
exported. That seems to be the cleanest I can come up with right
now...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-05-17  5:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07  5:40 [PATCH 0/12] xfs: delayed logging V5 Dave Chinner
2010-05-07  5:40 ` [PATCH 01/12] xfs: Don't reuse the same transaction ID for duplicated transactions Dave Chinner
2010-05-07  5:40 ` [PATCH 02/12] xfs: allow log ticket allocation to take allocation flags Dave Chinner
2010-05-07  5:40 ` [PATCH 03/12] xfs: modify buffer item reference counting Dave Chinner
2010-05-07  5:40 ` [PATCH 04/12] xfs: Clean up XFS_BLI_* flag namespace Dave Chinner
2010-05-07  5:40 ` [PATCH 05/12] xfs: clean up log ticket overrun debug output Dave Chinner
2010-05-07  5:40 ` [PATCH 06/12] xfs: make the log ticket ID available outside the log infrastructure Dave Chinner
2010-05-07 11:41   ` Christoph Hellwig
2010-05-07  5:40 ` [PATCH 07/12] xfs: Improve scalability of busy extent tracking Dave Chinner
2010-05-08 17:15   ` Christoph Hellwig
2010-05-07  5:40 ` [PATCH 08/12] xfs: Delayed logging design documentation Dave Chinner
2010-05-07  5:40 ` [PATCH 09/12] xfs: Introduce delayed logging core code Dave Chinner
2010-05-10 11:44   ` Christoph Hellwig
2010-05-10 12:16     ` Dave Chinner
2010-05-17  5:51       ` Dave Chinner [this message]
2010-05-17  7:34         ` Christoph Hellwig
2010-05-07  5:40 ` [PATCH 10/12] xfs: forced unmounts need to push the CIL Dave Chinner
2010-05-10 11:44   ` Christoph Hellwig
2010-05-07  5:40 ` [PATCH 11/12] xfs: enable background pushing of " Dave Chinner
2010-05-10 11:45   ` Christoph Hellwig
2010-05-07  5:41 ` [PATCH 12/12] xfs: Ensure inode allocation buffers are fully replayed Dave Chinner
2010-05-10 17:43   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2010-05-17 23:24 [PATCH 0/12] xfs: delayed logging V6 Dave Chinner
2010-05-17 23:24 ` [PATCH 09/12] xfs: Introduce delayed logging core code Dave Chinner
2010-05-21 21:06   ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100517055101.GK8120@dastard \
    --to=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox