Re: [PATCH 09/22] xfs: push perags through the ag reservation callouts

Dave Chinner
2021-05-13T00:30:58Z

On Tue, May 11, 2021 at 08:29:54AM -0400, Brian Foster wrote:
> On Thu, May 06, 2021 at 05:20:41PM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > We currently pass an agno from the AG reservation functions to the
> > individual feature accounting functions, which then may have to do
> > perag lookups to access per-AG state. Plumb the perag through from
> > the highest AG reservation layer to the feature callouts so they
> > don't have to look it up again.
> >
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
>
> The changes look fine, but the commit log implies we're relieving some
> lower level functions of the need to re-look up perag structs. I don't
> see one perag get/put cycle being removed here, so I suppose either that
> comes later or the commit log is a bit misleading..? Either way, with a
> minor reword of the commit log to clarify that, this otherwise looks
> fine to me.

Future patches use the the perag that is passed down through these
functions. e.g. the next series of patches that pass a perag to the
btree cursor init functions rather than the plain AG. Passing the
pag down the stack ehre means that the lower layers modified in this
patch don't need to look up the perag again.

i.e. read this "don't have to add lookups in future", not as "will
remove existing lookups right now".

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com