Re: [PATCH 21/43] xfs: don't call xfs_can_free_eofblocks from ->release for zoned inodes

Darrick J. Wong
2024-12-13T17:13:53Z

On Fri, Dec 13, 2024 at 06:28:41AM +0100, Christoph Hellwig wrote:
> On Thu, Dec 12, 2024 at 02:15:23PM -0800, Darrick J. Wong wrote:
> > On Wed, Dec 11, 2024 at 09:54:46AM +0100, Christoph Hellwig wrote:
> > > Zoned file systems require out of place writes and thus can't support
> > > post-EOF speculative preallocations. Avoid the pointless ilock critical
> > > section to find out that none can be freed.
> >
> > I wonder if this is true of alwayscow inodes in general, not just zoned
> > inodes?
>
> Maybe I'm missing something, but AFAICS always_cow still generates
> preallocations in xfs_buffered_write_iomap_begin. It probably shouldn't.

For non-zoned alwayscow I think it's trying to generate preallocations
in the cow fork to reduce fragmentation of the bmbt since we don't have
to write in the linear order.

Unless... you're talking about preallocations in the data fork?

> Btw, the always_cow code as intended as the common support code for
> zoned and atomic msync style atomic writes, which always require hard
> out of place writes. It turns out it doesn't actually do that right
> now (see the bounce buffering patch reviewed earlier), which makes it
> a bit of an oddball. I'd personally love to kill it once the zoned
> code lands, as just running the zoned mode on a regular device actually
> gives you a good way to test always out of place write semantics,
> which ended up diverging a bit from the earlier version after it hit
> the hard reality of hardware actually enforcing out of place writes.

Which patch is the bounce buffering patch?

/me hands himself another cup of coffee

--D