From: Dave Chinner <david@fromorbit.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@infradead.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
Stefan Roesch <shr@fb.com>
Subject: Re: [PATCH] fs: allow inode time modification with IOCB_NOWAIT
Date: Sun, 3 Jul 2022 10:06:48 +1000 [thread overview]
Message-ID: <20220703000648.GA3237952@dread.disaster.area> (raw)
In-Reply-To: <5cfdd462-d21b-cb62-3ad3-3ecd8cbc0a31@kernel.dk>
On Sat, Jul 02, 2022 at 09:45:23AM -0600, Jens Axboe wrote:
> On 7/2/22 12:05 AM, Christoph Hellwig wrote:
> > On Fri, Jul 01, 2022 at 02:09:32PM -0600, Jens Axboe wrote:
> >> generic/471 complains because it expects any write done with RWF_NOWAIT
> >> to succeed as long as the blocks for the write are already instantiated.
> >> This isn't necessarily a correct assumption, as there are other conditions
> >> that can cause an RWF_NOWAIT write to fail with -EAGAIN even if the range
> >> is already there.
> >>
> >> Since the risk of blocking off this path is minor, just allow inode
> >> time updates with IOCB_NOWAIT set. Then we can later decide if we should
> >> catch this further down the stack.
> >
> > I think this is broken. Please just drop the test, the non-blocking
> > behavior here makes a lot of sense. At least for XFS, the update
> > will end up allocating and commit a transaction which involves memory
> > allocation, a blocking lock and possibly waiting for lock space.
>
> I'm fine with that, I've made my opinions on that test case clear in
> previous emails. I'll drop the patch for now.
>
> I will say though that even in low memory testing, I never saw XFS block
> off the inode time update. So at least we have room for future
> improvements here, it's wasteful to return -EAGAIN here when the vast
> majority of time updates don't end up blocking.
It's not low memory testing that you should be concerned about -
it's when the journal runs out of space that you'll get long,
unbound latencies waiting for timestamp updates. Waiting for journal
space to become available could, in the worst case, entail waiting
for tens of thousands of small random metadata IOs to be submitted
and completed....
> One issue there too is that, by default, XFS uses a high granularity
> threshold for when the time should be updated, making the problem worse.
That's not an XFS issue - we're just following the VFS rules for
when mtime needs to be changed. If you want to avoid frequent
transactional (on-disk) mtime updates, then use the lazytime mount
option to limit on-disk mtime updates to once per day.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2022-07-03 0:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 20:09 [PATCH] fs: allow inode time modification with IOCB_NOWAIT Jens Axboe
2022-07-02 6:05 ` Christoph Hellwig
2022-07-02 15:45 ` Jens Axboe
2022-07-03 0:06 ` Dave Chinner [this message]
2022-07-03 12:45 ` Jens Axboe
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=20220703000648.GA3237952@dread.disaster.area \
--to=david@fromorbit.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=shr@fb.com \
--cc=viro@zeniv.linux.org.uk \
/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).