From: Brian Foster <bfoster@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/7] xfs: allow attach of dfops to transaction
Date: Mon, 16 Apr 2018 09:33:17 -0400 [thread overview]
Message-ID: <20180416133316.GA21136@bfoster.bfoster> (raw)
In-Reply-To: <20180415074400.GB5226@infradead.org>
On Sun, Apr 15, 2018 at 12:44:00AM -0700, Christoph Hellwig wrote:
> > diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
> > index 087fea02c389..f3aef54257d1 100644
> > --- a/fs/xfs/libxfs/xfs_defer.c
> > +++ b/fs/xfs/libxfs/xfs_defer.c
> > @@ -525,6 +525,7 @@ xfs_defer_init_op_type(
> > /* Initialize a deferred operation. */
> > void
> > xfs_defer_init(
> > + struct xfs_trans *tp,
> > struct xfs_defer_ops *dop,
> > xfs_fsblock_t *fbp)
> > {
> > @@ -532,5 +533,7 @@ xfs_defer_init(
> > *fbp = NULLFSBLOCK;
> > INIT_LIST_HEAD(&dop->dop_intake);
> > INIT_LIST_HEAD(&dop->dop_pending);
> > - trace_xfs_defer_init(NULL, dop);
> > + if (tp)
> > + tp->t_dfops = dop;
> > + trace_xfs_defer_init(tp ? tp->t_mountp : NULL, dop);
>
> there is really no oint un doing this massive change of prototypes
> everywhere just to move an assignment into xfs_defer_init. Just keep
> that assignment in the caller.
>
I was doing that in the previous versions and thought this might be more
clear in terms of ensuring new code initialized structures properly.
That said, I don't much care which approach is used so I can change it
back and (potentially) revisit when more code is switched over.
>
> But in general I'm really concerned about making the dops in the
> transaction conditional behavior. This is just going down the rathole
> of inconsistent behavior where some callers expect it in the transaction
> vs other explcitit and every time something really to defered ops is
> touched it will need a deep code audit. I'd rather switch everything
> over in a go and be done with it.
Deep code audit, eh? :/ There is no such confusion in the allocator
context because there's only one way to pass the dfops: in the
transaction. The reason for doing this is essentially to optimize the
step out of manually passing down the dfops and then immediately
refactoring all that cruft out because the needed dfops-passing
callchains currently don't exist.
The purpose of this patchset is a functional fix: defer AGFL frees to
reduce tx reservation overuse from problematic contexts. It introduces
the concept of the broader refactoring (that Dave proposed on a previous
version, IIRC) purely for the scope of the fix. For example, consider
that ->t_dfops were renamed to something like ->t_agfl_dfops for the
purpose of this patch series.
Not using the transaction means we'd have to pass dfops manually into
the allocator and deep into the btree code (via da_args and btree
cursors). I could technically do that, but it creates a bunch of ugly
code that results in the same functional logic/behavior of this patch
series as is and essentially is a waste of time.
The temporary confusion that does remain is the inconsistency that some
callchains use ->t_dfops while others do not (yet). The reason/fix for
that is mostly aesthetic/mechanical and so really shouldn't be that
confusing IMO. I certainly don't think that justifies plumbing dfops
through manually only to delete it in followup patches. We could try to
reduce that confusion by dropping the xfs_defer_init() bits and renaming
->t_dfops as noted above, but note that technically drops the other
dfops-passing callchain cleanups in the series because ->t_agfl_dfops
should only be used for AGFL fixups. That would have to go away until
->t_agfl_dfops were renamed back to ->t_dfops, but would further
separate the refactoring from the functional change without creating
unnecessary work. Thoughts?
Brian
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-04-16 13:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-10 17:46 [PATCH 0/7] xfs: defer agfl block frees Brian Foster
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 [this message]
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=20180416133316.GA21136@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=hch@infradead.org \
--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).