All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: cem@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/3] xfs: speed up parent pointer operations when possible
Date: Wed, 21 Jan 2026 07:22:20 -0800	[thread overview]
Message-ID: <aXDvLIufYilqY-Ab@infradead.org> (raw)
In-Reply-To: <176897695972.202851.10720887475428645960.stgit@frogsfrogsfrogs>

On Tue, Jan 20, 2026 at 10:39:46PM -0800, Darrick J. Wong wrote:
> and fall back to the attr intent machinery if that doesn't work.  We can
> use the same helpers for regular xattrs and parent pointers.

Not just can, but do :)  This should really help with ACL inheritance
as well.

> +/* Can we bypass the attr intent mechanism for better performance? */
> +static inline bool
> +xfs_attr_can_shortcut(

This is really a could and not a can, it might still not be possible
and we bail out.  Maybe reflect that in at least the comment, if not
also the name?

> +	if (rmt_blks || !xfs_attr_can_shortcut(args->dp)) {
> +		xfs_attr_defer_add(args, XFS_ATTR_DEFER_REPLACE);
> +		return 0;
> +	}
> +
> +	args->op_flags |= XFS_DA_OP_ADDNAME | XFS_DA_OP_REPLACE;
> +
> +	error = xfs_attr_sf_removename(args);
> +	if (error)
> +		return error;
> +	if (args->attr_filter & XFS_ATTR_PARENT) {
> +		/*
> +		 * Move the new name/value to the regular name/value slots and
> +		 * zero out the new name/value slots because we don't need to
> +		 * log them for a PPTR_SET operation.
> +		 */
> +		xfs_attr_update_pptr_replace_args(args);
> +		args->new_name = NULL;
> +		args->new_namelen = 0;
> +		args->new_value = NULL;
> +		args->new_valuelen = 0;
> +	}
> +	args->op_flags &= ~XFS_DA_OP_REPLACE;
> +
> +	error = xfs_attr_try_sf_addname(args);

This mirrors what the state machine would do.  Although I wonder if
we should simply try to do the replace in one go.  But I guess I can
look into that as an incremental optimization later.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2026-01-21 15:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21  6:34 [PATCHSET 3/3] xfs: improve shortform attr performance Darrick J. Wong
2026-01-21  6:39 ` [PATCH 1/3] xfs: reduce xfs_attr_try_sf_addname parameters Darrick J. Wong
2026-01-21 15:11   ` Christoph Hellwig
2026-01-21  6:39 ` [PATCH 2/3] xfs: speed up parent pointer operations when possible Darrick J. Wong
2026-01-21 15:22   ` Christoph Hellwig [this message]
2026-01-21 18:06     ` Darrick J. Wong
2026-01-22  6:31       ` Christoph Hellwig
2026-01-21  6:40 ` [PATCH 3/3] xfs: add a method to replace shortform attrs Darrick J. Wong
2026-01-21 15:22   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2026-01-23  7:00 [PATCHSET 2/3] xfs: improve shortform attr performance Darrick J. Wong
2026-01-23  7:02 ` [PATCH 2/3] xfs: speed up parent pointer operations when possible Darrick J. Wong

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=aXDvLIufYilqY-Ab@infradead.org \
    --to=hch@infradead.org \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.