linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carlos Maiolino <cem@kernel.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs_repair: estimate per-AG btree slack better
Date: Fri, 5 May 2023 16:02:31 +0200	[thread overview]
Message-ID: <20230505140231.v37vpbsvbbs6ootv@andromeda> (raw)
In-Reply-To: <20230503150703.GH15420@frogsfrogsfrogs>

On Wed, May 03, 2023 at 08:07:03AM -0700, Darrick J. Wong wrote:
> On Wed, May 03, 2023 at 10:48:32AM +0200, Carlos Maiolino wrote:
> > On Tue, May 02, 2023 at 08:38:16AM -0700, Darrick J. Wong wrote:
> > > On Tue, May 02, 2023 at 12:49:44PM +0200, Carlos Maiolino wrote:
> > > > Hi.
> > > >
> > > > On Thu, Apr 27, 2023 at 03:45:21PM -0700, Darrick J. Wong wrote:
> > > > > From: Darrick J. Wong <djwong@kernel.org>
> > > > >
> > > > > The slack calculation for per-AG btrees is a bit inaccurate because it
> > > > > only disables slack space in the new btrees when the amount of free
> > > > > space in the AG (not counting the btrees) is less than 3/32ths of the
> > > > > AG.  In other words, it assumes that the btrees will fit in less than 9
> > > > > percent of the space.
> > > > .
> > > > .
> > > > .
> > > > >
> > > > > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > > >
> > > > This looks fine, with a small caveat below...
> > > >
> > > > .
> > > > .
> > > > .
> > > >
> > > > > +
> > > > > +static xfs_extlen_t
> > > > > +estimate_allocbt_blocks(
> > > > > +	struct xfs_perag	*pag,
> > > > > +	unsigned int		nr_extents)
> > > > > +{
> > > > > +	return libxfs_allocbt_calc_size(pag->pag_mount, nr_extents) * 2;
> > > > > +}
> > > >
> > > > Forgive my ignorance here, but what's the reason of the magic number? It seems
> > > > to me by multiplying by 2 here, you are considering a split of every single
> > > > leaf for the calculated btree size, but I'm not sure if that's the intention,
> > > > could you please confirm or correct me? :)
> > >
> > > Ah, I should document that better...
> > >
> > > 	/* Account for space consumed by both free space btrees */
> > > 	return libxfs_allocbt_calc_size(...) * 2;
> >
> > Thanks, can I update your patch with the above comment, or do you want to send
> > it again?
> 
> You can add it, if that'll save time.  I don't have any other changes
> pending for that patch.

Ok, won't take much of my time and will prevent you to need to send it again.

> 
> --D
> 
> > >
> > > --D
> > >
> > > > Other than that, the patch looks good
> > > >
> > > > Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> > > >
> > > > --
> > > > Carlos Maiolino
> >
> > --
> > Carlos Maiolino

-- 
Carlos Maiolino

      reply	other threads:[~2023-05-05 14:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Hmm9qc69j-CLafwLwR_VDVUXW-MimDNdKcP5ObJjM17LI9tD3CdNoGjfMsJyj--ppTa-5tg4DwbNhhnKZyZ1Eg==@protonmail.internalid>
2023-04-27 22:45 ` [PATCH] xfs_repair: estimate per-AG btree slack better Darrick J. Wong
2023-05-02 10:49   ` Carlos Maiolino
2023-05-02 15:38     ` Darrick J. Wong
2023-05-03  8:48       ` Carlos Maiolino
2023-05-03 15:07         ` Darrick J. Wong
2023-05-05 14:02           ` Carlos Maiolino [this message]

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=20230505140231.v37vpbsvbbs6ootv@andromeda \
    --to=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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).