From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH RFC 2/2] xfs: don't log dirty ranges for ordered buffers
Date: Tue, 15 Aug 2017 10:25:40 +1000 [thread overview]
Message-ID: <20170815002540.GC21024@dastard> (raw)
In-Reply-To: <20170814165451.43788-3-bfoster@redhat.com>
On Mon, Aug 14, 2017 at 12:54:51PM -0400, Brian Foster wrote:
> Ordered buffers are attached to transactions and pushed through the
> logging infrastructure just like normal buffers with the exception
> that they are not actually written to the log. Therefore, we don't
> need to log dirty ranges of ordered buffers. xfs_trans_log_buf() is
> called on ordered buffers to set up all of the dirty state on the
> transaction, buffer and log item and prepare the buffer for I/O.
>
> Now that xfs_trans_dirty_buf() is available, call it from
> xfs_trans_ordered_buf() so the latter is now mutually exclusive with
> xfs_trans_log_buf(). This reflects the implementation of ordered
> buffers and helps eliminate confusion over the need to log ranges of
> ordered buffers just to set up internal log state.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
> ---
> fs/xfs/libxfs/xfs_btree.c | 3 ++-
> fs/xfs/libxfs/xfs_ialloc.c | 2 --
> fs/xfs/xfs_trans_buf.c | 25 +++++++++++++------------
> 3 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index e0bcc4a..9c97896 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -4466,7 +4466,8 @@ xfs_btree_block_change_owner(
> if (bp) {
> if (cur->bc_tp) {
> xfs_trans_ordered_buf(cur->bc_tp, bp);
> - xfs_btree_log_block(cur, bp, XFS_BB_OWNER);
> + /*xfs_trans_buf_set_type(cur->bc_tp, bp,
> + XFS_BLFT_BTREE_BUF);*/
Not sure we need this - a owner change is a rare once-off operation
(e.g. defrag) and so typically we don't need to keep the btree
blocks cached for next reuse.
i.e. the logging of the btree block would do this to reset the age
of the buffer in the LRU as we're expecting it to be used again
soon. e.g. next allocation to that file, next allocation from an AG,
next allocation of an inode, etc.
xfs_btree_block_change_owner() just isn't one of those "likely to
use again shortly" type operations, so I think you can just get rid
of it...
Otherwise the patches look good.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2017-08-15 0:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-14 16:54 [PATCH RFC 0/2] xfs: refactor ordered buffer logging code Brian Foster
2017-08-14 16:54 ` [PATCH RFC 1/2] xfs: refactor buffer logging into buffer dirtying helper Brian Foster
2017-08-16 17:16 ` Darrick J. Wong
2017-08-14 16:54 ` [PATCH RFC 2/2] xfs: don't log dirty ranges for ordered buffers Brian Foster
2017-08-15 0:25 ` Dave Chinner [this message]
2017-08-16 17:15 ` Darrick J. Wong
2017-08-17 11:06 ` Brian Foster
2017-08-14 20:20 ` [PATCH RFC 0/2] xfs: refactor ordered buffer logging code Allison Henderson
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=20170815002540.GC21024@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/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