linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 0/7] xfs: defer agfl block frees
Date: Tue, 10 Apr 2018 13:46:24 -0400	[thread overview]
Message-ID: <20180410174631.4915-1-bfoster@redhat.com> (raw)

Hi all,

Here's a non-rfc version of the defer AGFL frees patches. As a quick
summary, the purpose of this series is to reduce per-tx log reservation
consumption of the block allocation code. Under certain conditions, the
pre-allocation AGFL fix up code can end up performing multiple block
free operations that can result in multiple btree shape changes before
the originally requested allocation even begins. This leads to log
reservation overrun problems because the number of AGFL block frees
required for a particular transaction cannot be determined in advance.
Therefore, process frees of AGFL blocks using deferred operations in the
same way that data blocks are freed.

In conjunction, clean up some of the disparate dfops callchain plumbing
by allowing a transaction to carry a pointer to an associated dop
structure. This eliminates the need to plumb xfs_defer_ops through yet
another callchain for the purpose of deferring AGFL frees. It also
facilitates cleanups of similar codepaths where dfops is already passed
around separately from the transaction that will ultimately log the
associated intents.

There aren't that many code changes since rfcv2. The series has been
rebased to for-next and the assignment of ->t_dfops occurs within
xfs_defer_init() rather than being open-coded. Also, the series has seen
more testing and drops some of the related test code from the rfc.

Thoughts, reviews, flames appreciated.

Brian

v1:
- Rebased to for-next.
- Attach dfops to tp via xfs_defer_init().
- Fix up xfs_defer_finish() to restore original pointer.
- Dropped debug/test patches.
rfcv2: https://marc.info/?l=linux-xfs&m=151681946702093&w=2
- Use transaction to carry deferred ops struct to allocation context.
- Remove dfops param from dir interfaces where possible.
- Defer AGFL block frees from more contexts.
- Define runtime stat for transaction regrant and logcount patch (to be
  potentially removed).
rfcv1: https://marc.info/?l=linux-xfs&m=151267309423883&w=2

Brian Foster (7):
  xfs: create agfl block free helper function
  xfs: allow attach of dfops to transaction
  xfs: defer agfl block frees when dfops is available
  xfs: defer agfl block frees from deferred ops processing context
  xfs: defer agfl frees from inode inactivation
  xfs: defer frees from common inode allocation paths
  xfs: defer agfl frees from directory op transactions

 fs/xfs/libxfs/xfs_alloc.c       | 82 +++++++++++++++++++++++++++++++++++------
 fs/xfs/libxfs/xfs_alloc.h       |  2 +
 fs/xfs/libxfs/xfs_attr.c        | 18 ++++-----
 fs/xfs/libxfs/xfs_attr_remote.c |  6 +--
 fs/xfs/libxfs/xfs_bmap.c        |  4 +-
 fs/xfs/libxfs/xfs_defer.c       | 17 ++++++++-
 fs/xfs/libxfs/xfs_defer.h       |  4 +-
 fs/xfs/libxfs/xfs_dir2.c        | 16 ++++----
 fs/xfs/libxfs/xfs_dir2.h        |  9 ++---
 fs/xfs/libxfs/xfs_ialloc.c      |  6 +--
 fs/xfs/libxfs/xfs_ialloc.h      |  1 -
 fs/xfs/libxfs/xfs_refcount.c    |  2 +-
 fs/xfs/xfs_bmap_util.c          | 12 +++---
 fs/xfs/xfs_dquot.c              |  2 +-
 fs/xfs/xfs_inode.c              | 76 +++++++++++++++++++-------------------
 fs/xfs/xfs_inode.h              |  3 +-
 fs/xfs/xfs_iomap.c              |  6 +--
 fs/xfs/xfs_log_recover.c        |  2 +-
 fs/xfs/xfs_reflink.c            |  8 ++--
 fs/xfs/xfs_rtalloc.c            |  2 +-
 fs/xfs/xfs_symlink.c            |  6 +--
 fs/xfs/xfs_trace.h              |  2 +
 fs/xfs/xfs_trans.c              | 11 ++++--
 fs/xfs/xfs_trans.h              |  1 +
 fs/xfs/xfs_trans_extfree.c      | 70 +++++++++++++++++++++++++++++++++++
 25 files changed, 259 insertions(+), 109 deletions(-)

-- 
2.13.6


             reply	other threads:[~2018-04-10 17:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 17:46 Brian Foster [this message]
2018-04-10 17:46 ` [PATCH 1/7] xfs: create agfl block free helper function Brian Foster
2018-04-15  7:38   ` Christoph Hellwig
2018-04-10 17:46 ` [PATCH 2/7] xfs: allow attach of dfops to transaction Brian Foster
2018-04-15  7:44   ` Christoph Hellwig
2018-04-16 13:33     ` Brian Foster
2018-04-10 17:46 ` [PATCH 3/7] xfs: defer agfl block frees when dfops is available Brian Foster
2018-04-15  7:46   ` Christoph Hellwig
2018-04-16 13:42     ` Brian Foster
2018-04-10 17:46 ` [PATCH 4/7] xfs: defer agfl block frees from deferred ops processing context Brian Foster
2018-04-10 17:46 ` [PATCH 5/7] xfs: defer agfl frees from inode inactivation Brian Foster
2018-04-10 17:46 ` [PATCH 6/7] xfs: defer frees from common inode allocation paths Brian Foster
2018-04-10 17:46 ` [PATCH 7/7] xfs: defer agfl frees from directory op transactions Brian Foster

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=20180410174631.4915-1-bfoster@redhat.com \
    --to=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;
as well as URLs for NNTP newsgroup(s).