From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>, eguan@redhat.com
Subject: Re: [PATCH] xfs: revert "xfs: factor rmap btree size into the indlen calculations"
Date: Mon, 25 Sep 2017 07:33:10 -0400 [thread overview]
Message-ID: <20170925113309.GA12869@bfoster.bfoster> (raw)
In-Reply-To: <20170923071142.GM5728@magnolia>
On Sat, Sep 23, 2017 at 12:11:42AM -0700, Darrick J. Wong wrote:
> In commit fd26a88093ba we added a worst case estimate for rmapbt blocks
> needed to satisfy the block mapping request. Since then, we added the
> ability to reserve enough space in each AG such that we should never run
> out of blocks to grow the rmapbt, which makes this calculation
> unnecessary. Revert the commit because it makes the extra delalloc
> indlen accounting unnecessary and incorrect.
>
> Reported-by: Eryu Guan <eguan@redhat.com>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_bmap.c | 17 ++---------------
> 1 file changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 459f4b4f0..044a363 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -49,7 +49,6 @@
> #include "xfs_rmap.h"
> #include "xfs_ag_resv.h"
> #include "xfs_refcount.h"
> -#include "xfs_rmap_btree.h"
> #include "xfs_icache.h"
>
>
> @@ -192,12 +191,8 @@ xfs_bmap_worst_indlen(
> int maxrecs; /* maximum record count at this level */
> xfs_mount_t *mp; /* mount structure */
> xfs_filblks_t rval; /* return value */
> - xfs_filblks_t orig_len;
>
> mp = ip->i_mount;
> -
> - /* Calculate the worst-case size of the bmbt. */
> - orig_len = len;
> maxrecs = mp->m_bmap_dmxr[0];
> for (level = 0, rval = 0;
> level < XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK);
> @@ -205,20 +200,12 @@ xfs_bmap_worst_indlen(
> len += maxrecs - 1;
> do_div(len, maxrecs);
> rval += len;
> - if (len == 1) {
> - rval += XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) -
> + if (len == 1)
> + return rval + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) -
> level - 1;
> - break;
> - }
> if (level == 0)
> maxrecs = mp->m_bmap_dmxr[1];
> }
> -
> - /* Calculate the worst-case size of the rmapbt. */
> - if (xfs_sb_version_hasrmapbt(&mp->m_sb))
> - rval += 1 + xfs_rmapbt_calc_size(mp, orig_len) +
> - mp->m_rmap_maxlevels;
> -
> return rval;
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-09-25 11:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-23 7:11 [PATCH] xfs: revert "xfs: factor rmap btree size into the indlen calculations" Darrick J. Wong
2017-09-25 11:33 ` Brian Foster [this message]
2017-09-26 14:43 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2017-09-02 17:06 Darrick J. Wong
2017-09-03 7:43 ` Christoph Hellwig
2017-09-03 15:40 ` Darrick J. Wong
2017-09-06 17:34 ` Brian Foster
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=20170925113309.GA12869@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=eguan@redhat.com \
--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).