From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: Nikolay Borisov <nborisov@suse.com>,
linux-xfs@vger.kernel.org, darrick.wong@oracle.com
Subject: Re: [PATCH 2/3] xfs: Rename __xfs_buf_submit to xfs_buf_submit
Date: Wed, 14 Aug 2019 20:14:17 +1000 [thread overview]
Message-ID: <20190814101417.GL6129@dread.disaster.area> (raw)
In-Reply-To: <20190813115658.GB37069@bfoster>
On Tue, Aug 13, 2019 at 07:56:58AM -0400, Brian Foster wrote:
> On Tue, Aug 13, 2019 at 12:03:05PM +0300, Nikolay Borisov wrote:
> > Since xfs_buf_submit no longer has any callers just rename its __
> > prefixed counterpart.
> >
> > Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> > ---
>
> Now we have a primary submission interface that allows combinations of
> XBF_ASYNC and waiting or not while the underlying mechanisms are not so
> flexible. It looks like the current factoring exists to support delwri
> queues where we never wait in buffer submission regardless of async
> state because we are batching the submission/wait across multiple
> buffers. But what happens if a caller passes an async buffer with wait
> == true? I/O completion only completes ->b_iowait if XBF_ASYNC is clear.
>
> I find this rather confusing because now a caller needs to know about
> implementation details to use the function properly. That's already true
> of __xfs_buf_submit(), but that's partly why it's named as an "internal"
> function. I think we ultimately need the interface flexibility so the
> delwri case can continue to work. One option could be to update
> xfs_buf_submit() such that we never wait on an XBF_ASYNC buffer and add
> an assert to flag wait == true as invalid, but TBH I'm not convinced
> this is any simpler than the current interface where most callers simply
> only need to care about the flag. Maybe others have thoughts...
Yeah, we slpit the code u plike this intentionally to separate out
the different ways of submitting IO so that we didn't end up using
invalid methods, like ASYNC + wait, which would lead to hangs
waiting for IO that has already completed.
I much prefer the code as it stands now - it may be slightly more
verbose, but it's simple to understand and hard to use
incorrectly....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-08-14 10:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 9:03 [PATCH 0/3] Minor cleanups Nikolay Borisov
2019-08-13 9:03 ` [PATCH 1/3] xfs: Use __xfs_buf_submit everywhere Nikolay Borisov
2019-08-13 11:55 ` Brian Foster
2019-08-13 12:06 ` Nikolay Borisov
2019-08-13 12:15 ` Nikolay Borisov
2019-08-13 9:03 ` [PATCH 2/3] xfs: Rename __xfs_buf_submit to xfs_buf_submit Nikolay Borisov
2019-08-13 11:56 ` Brian Foster
2019-08-14 10:14 ` Dave Chinner [this message]
2019-08-13 9:03 ` [PATCH 3/3] xfs: Opencode and remove DEFINE_SINGLE_BUF_MAP Nikolay Borisov
2019-08-13 11:57 ` Brian Foster
2019-08-14 10:23 ` Dave Chinner
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=20190814101417.GL6129@dread.disaster.area \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=nborisov@suse.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;
as well as URLs for NNTP newsgroup(s).