Re: [PATCH 06/43] xfs: generalize the freespace and reserved blocks handling

Darrick J. Wong
2025-02-07T04:28:40Z

On Fri, Feb 07, 2025 at 05:21:55AM +0100, Christoph Hellwig wrote:
> On Thu, Feb 06, 2025 at 01:29:42PM -0800, Darrick J. Wong wrote:
> > > Use helpers to access the freespace counters everywhere intead of
> > > poking through the abstraction by using the percpu_count helpers
> > > directly. This also switches the flooring of the frextents counter
> > > to 0 in statfs for the rthinherit case to a manual min_t call to match
> > > the handling of the fdblocks counter for normal file systems.
> >
> > It might've been nice to split the m_resblk and the freecounter wrapping
> > into two smaller patches, but I can also see that it makes sense to do
> > both together.
>
> So you want separate patches for the percpu counters and reservations?
> I could look into that, but I'm not sure it really helps understanding
> the logic.

Yeah, it would more help the part of my brain that reviews mechanical
changes by storing up to about 4 X -> Y transitions and making sure
that's the only thing I see in the patch. Once I go above 4 my brain
fills up and I have to start paging like Windows 95.

> But thinking about it we should probably have one array
> of structures with the percpu counters and reservations anyway, so
> if I redo this anyway I might be able to split it up a little more.

Might be useful, particularly if it gets the two counters away from each
other on a busy filesystem.

--D