On Fri, Feb 23, 2024 at 06:18:55PM +0100, Christoph Hellwig wrote: > On Fri, Feb 23, 2024 at 09:09:53AM -0800, Darrick J. Wong wrote: > > > - lcounter = (long long)mp->m_resblks_avail + delta; > > > - if (lcounter >= 0) { > > > - mp->m_resblks_avail = lcounter; > > > + xfs_warn_once(mp, > > > +"Reserve blocks depleted! Consider increasing reserve pool size."); > > > > Hmm. This message gets logged if the __percpu_counter_compare above > > returns a negative value and we don't have a reserve pool. I think > > that's a change from the current code, where running out of m_frextents > > returns ENOSPC without generating (misleading) log messages about the > > reserve pool. > > Yes, I'll need to fix that up. > > > without all the reserve pool machinery that fdblocks has. The original > > code to implement m_frextents did exactly that, but Dave really wanted > > me to optimize this for icache footprint[1] so we ended up with (IMO) > > harder to understand xfs_mod_freecounter. > > FYI, I have uses for reserved frextents a bit down the road, so > I'll make use of that. Without that splitting them would seem nicer > to me. Oh, ok. I agree that keeping the combined function makes more sense if you'll be adding a reserve pool for rtextents. --D