public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	Dave Chinner <david@fromorbit.com>,
	xfs <linux-xfs@vger.kernel.org>
Subject: Re: xfs_clear_incompat_log_features considered harmful?
Date: Wed, 31 Jan 2024 20:33:28 -0800	[thread overview]
Message-ID: <ZbsfGOqov--AFdBh@infradead.org> (raw)
In-Reply-To: <20240131230043.GA6180@frogsfrogsfrogs>

On Wed, Jan 31, 2024 at 03:00:43PM -0800, Darrick J. Wong wrote:
> Hi everyone,
> 
> Christoph spied the xfs_swapext_can_use_without_log_assistance
> function[0] in the atomic file updates patchset[1] and wondered why we
> go through this inverted-bitmask dance to avoid setting the
> XFS_SB_FEAT_INCOMPAT_LOG_SWAPEXT feature.
> 
> (The same principles apply to xfs_attri_can_use_without_log_assistance
> from the since-merged LARP series.)

xfs_attri_can_use_without_log_assistance actually is new in your
patch stack.

Not that my biggest issue is that this check actually is broken.
The point of the compat,incompat,log_incompat features is that they
move away from a linear version model where a new version implies all
previous version to one where we have a bit designating exactly what
is supported.  Optimizing away the need to set a bit just because other
bits are sit brings back this linear versining in a sneaky, undocumented
and dangerous way.

> The reason for this dance is that xfs_add_incompat_log_feature is an
> expensive operation -- it forces the log, pushes the AIL, and then if
> nobody's beaten us to it, sets the feature bit and issues a synchronous
> write of the primary superblock.  That could be a one-time cost
> amortized over the life of the filesystem,

Yes.

> Given that this set/clear dance imposes continuous runtime costs on all
> the users, I want to remove xfs_clear_incompat_log_features.  Log
> incompat bits get set once, and they never go away.  This eliminates the
> need for the rwsem, all the extra incompat-clearing bits in the log
> code, and fixes the performance problems I see.

I mostly agree.  I don't think we have to strictly say they don't
go away, but makign them go away should be explicit and we should
only do that if someone has a clear use case for it.

> Going forward, I'd make mkfs set the log incompat features during a
> fresh format if any of the currently-undefined feature bits are set,
> which means that they'll be enabled by default on any filesystem with
> directory parent pointers and/or metadata directories.  I'd also add
> mkfs -l options so that sysadmins can turn it on at format time.

Yes.

> We can discuss whether we want to allow people to set the log incompat
> features at runtime -- allowing it at least for recent filesystems (e.g.
> v5 + rmap) is easier for users, but only if we decide that we don't
> really care about the "recover with old Knoppix" surprise.  If we decide
> against online upgrades, we /could/ at least allow upgrades via
> xfs_admin like we have for bigtime/inobtcnt.  Or we could decide that
> new functionality requires a reformat.

I think a runtime add (for recent enough file systems) would be really
useful.  But it should be an explicit opt-in and not a silent upgrade,
which avoids any surprices with reocvery tools.

> Thoughts?  I vote for removing xfs_clear_incompat_log_features and
> letting people turn on log incompat features at runtime.

Please do!

  reply	other threads:[~2024-02-01  4:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 23:00 xfs_clear_incompat_log_features considered harmful? Darrick J. Wong
2024-02-01  4:33 ` Christoph Hellwig [this message]
2024-02-05  1:09 ` Dave Chinner
2024-02-05  6:45   ` Christoph Hellwig
2024-02-06  5:23     ` Darrick J. Wong
2024-02-09  6:33       ` Christoph Hellwig
2024-02-06  5:30   ` Darrick J. Wong
2024-02-07  0:14     ` Dave Chinner

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=ZbsfGOqov--AFdBh@infradead.org \
    --to=hch@infradead.org \
    --cc=david@fromorbit.com \
    --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