linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Lukas Herbolt <lukas@herbolt.com>
Cc: aalbersh@redhat.com, djwong@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] mkfs.xfs fix sunit size on 512e and 4kN disks.
Date: Sun, 28 Sep 2025 23:54:27 -0700	[thread overview]
Message-ID: <aNotI3z54Om5MmE1@infradead.org> (raw)
In-Reply-To: <20250926123829.2101207-2-lukas@herbolt.com>

On Fri, Sep 26, 2025 at 02:38:30PM +0200, Lukas Herbolt wrote:
> Creating of XFS on 4kN or 512e disk result in suboptimal LSU/LSUNIT.
> As of now we check if the sectorsize is bigger than XLOG_HEADER_SIZE
> and so we set lsu to blocksize. But we do not check the the size if
> lsunit can be bigger to fit the disk geometry.

As I had to walk the code to understand (again for the nth time :))
what the lsunit actually does:  it pads every log write up to that
size.  I.e. if you set a log stripe unit, that effectively becomes the
minimum I/O size for the log.  So yes, setting it to the minimum I/O
size of the device makes sense.  But maybe the commit log should be
a bit more clear about that?  (and of course our terminology should
be as well, ast least outside the user interface that we can't touch).

> Before:

You Before/after also contain changes for metadir/zoned, looks like you
upgraded to a new xfsprogs for your patch, but not the baseline.

> index 8cd4ccd7..05268cd9 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -3643,6 +3643,10 @@ check_lsunit:
>  		lsu = getnum(cli->lsu, &lopts, L_SU);
>  	else if (cfg->lsectorsize > XLOG_HEADER_SIZE)
>  		lsu = cfg->blocksize; /* lsunit matches filesystem block size */
> +		if (cfg->dsunit){
> +			cfg->lsunit = cfg->dsunit;
> +			lsu = 0;
> +		}

I don't think just picking the data stripe unit is correct here, given
that the log can also be external and on a separate device.  Instead
we'll need to duplicate the calculation based on ft.log, preferably by
factoring it into a helper.

The lsu = 0 also drop the multiple of block size check.  If that is not
a hard requirement (and I'd have to do some research where it is coming
from) we should relax the check instead of silently disabling it like
this.

  reply	other threads:[~2025-09-29  6:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-26 12:38 [PATCH] mkfs.xfs fix sunit size on 512e and 4kN disks Lukas Herbolt
2025-09-29  6:54 ` Christoph Hellwig [this message]
2025-09-29  8:59   ` lukas
2025-10-03  7:46     ` Christoph Hellwig
2025-10-07  7:13       ` [PATCH v2] " Lukas Herbolt
2025-10-08  6:06         ` Christoph Hellwig
2025-10-15  6:52 ` [PATCH] " Donald Douwsma

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=aNotI3z54Om5MmE1@infradead.org \
    --to=hch@infradead.org \
    --cc=aalbersh@redhat.com \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lukas@herbolt.com \
    /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).