From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/6] xfs: don't stall cowblocks scan if we can't take locks
Date: Mon, 18 Jan 2021 11:37:18 -0800 [thread overview]
Message-ID: <20210118193718.GI3134581@magnolia> (raw)
In-Reply-To: <20210118173412.GA3134885@infradead.org>
On Mon, Jan 18, 2021 at 05:34:12PM +0000, Christoph Hellwig wrote:
> On Thu, Jan 14, 2021 at 01:54:53PM -0800, Darrick J. Wong wrote:
> > On Wed, Jan 13, 2021 at 03:43:57PM +0100, Christoph Hellwig wrote:
> > > On Mon, Jan 11, 2021 at 03:22:52PM -0800, Darrick J. Wong wrote:
> > > > From: Darrick J. Wong <djwong@kernel.org>
> > > >
> > > > Don't stall the cowblocks scan on a locked inode if we possibly can.
> > > > We'd much rather the background scanner keep moving.
> > >
> > > Wouldn't it make more sense to move the logic to ignore the -EAGAIN
> > > for not-sync calls into xfs_inode_walk_ag?
> >
> > I'm not sure what you're asking here? _free_cowblocks only returns
> > EAGAIN for sync calls. Locking failure for a not-sync call results in a
> > return 0, which means that _walk_ag just moves on to the next inode.
>
> What I mean is:
>
> - always return -EAGAIN when taking the locks fails
> - don't exit early on -EAGAIN in xfs_inode_walk at least for sync
> calls, although thinking loud I see no good reason to exit early
> even for non-sync invocations
Ah, I see, you're asking why don't I make xfs_inode_walk responsible for
deciding what to do about EAGAIN, instead of open-coding that in the
->execute function. That would be a nice cleanup since the walk
function already has special casing for EFSCORRUPTED.
If I read you correctly, the relevant part of xfs_inode_walk becomes:
error = execute(batch[i]...);
xfs_irele(batch[i]);
if (error == -EAGAIN) {
if (args->flags & EOF_SYNC)
skipped++;
continue;
}
and the relevant part of xfs_inode_free_eofblocks becomes:
if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL))
return -EAGAIN;
I think that would work, and afaict it won't cause any serious problems
with the deferred inactivation series.
--D
next prev parent reply other threads:[~2021-01-18 19:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-11 23:22 [PATCHSET v2 0/6] xfs: try harder to reclaim space when we run out Darrick J. Wong
2021-01-11 23:22 ` [PATCH 1/6] xfs: hide most of the incore inode walk interface Darrick J. Wong
2021-01-13 14:34 ` Christoph Hellwig
2021-01-18 19:50 ` Darrick J. Wong
2021-01-11 23:22 ` [PATCH 2/6] xfs: refactor messy xfs_inode_free_quota_* functions Darrick J. Wong
2021-01-13 14:37 ` Christoph Hellwig
2021-01-11 23:22 ` [PATCH 3/6] xfs: don't stall cowblocks scan if we can't take locks Darrick J. Wong
2021-01-13 14:43 ` Christoph Hellwig
2021-01-14 21:54 ` Darrick J. Wong
2021-01-18 17:34 ` Christoph Hellwig
2021-01-18 19:37 ` Darrick J. Wong [this message]
2021-01-18 19:39 ` Christoph Hellwig
2021-01-18 19:44 ` Darrick J. Wong
2021-01-18 19:51 ` Christoph Hellwig
2021-01-11 23:22 ` [PATCH 4/6] xfs: xfs_inode_free_quota_blocks should scan project quota Darrick J. Wong
2021-01-13 14:45 ` Christoph Hellwig
2021-01-11 23:23 ` [PATCH 5/6] xfs: flush speculative space allocations when we run out of quota Darrick J. Wong
2021-01-12 1:22 ` Dave Chinner
2021-01-12 1:31 ` Darrick J. Wong
2021-01-12 1:40 ` Dave Chinner
2021-01-12 2:18 ` Darrick J. Wong
2021-01-14 22:10 ` Darrick J. Wong
2021-01-11 23:23 ` [PATCH 6/6] xfs: flush speculative space allocations when we run out of space Darrick J. Wong
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=20210118193718.GI3134581@magnolia \
--to=djwong@kernel.org \
--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).