linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Christian Brauner <brauner@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Jan Kara <jack@suse.com>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] super: massage wait event mechanism
Date: Mon, 27 Nov 2023 17:46:37 +0100	[thread overview]
Message-ID: <20231127164637.GA2398@lst.de> (raw)
In-Reply-To: <20231127-vfs-super-massage-wait-v1-1-9ab277bfd01a@kernel.org>

On Mon, Nov 27, 2023 at 12:51:30PM +0100, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
> ---
>  fs/super.c | 51 ++++++++++++++-------------------------------------
>  1 file changed, 14 insertions(+), 37 deletions(-)
> 
> diff --git a/fs/super.c b/fs/super.c
> index aa4e5c11ee32..f3227b22879d 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -81,16 +81,13 @@ static inline void super_unlock_shared(struct super_block *sb)
>  	super_unlock(sb, false);
>  }
>  
> +static bool super_load_flags(const struct super_block *sb, unsigned int flags)
>  {
>  	/*
>  	 * Pairs with smp_store_release() in super_wake() and ensures
> +	 * that we see @flags after we're woken.
>  	 */
> +	return smp_load_acquire(&sb->s_flags) & flags;

I find the name for this helper very confusing.  Yes, eventually it
is clear that the load maps to a load instruction with acquire semantics
here, but it's a really unusual naming I think.  Unfortunately I can't
offer a better one either.

Otherwise this looks good except for the fact that I really hate
code using smp_load_acquire / smp_store_release directly because of
all the mental load it causes.

  parent reply	other threads:[~2023-11-27 16:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 11:51 [PATCH 0/2] super: small tweaks Christian Brauner
2023-11-27 11:51 ` [PATCH 1/2] super: massage wait event mechanism Christian Brauner
2023-11-27 13:59   ` Christoph Hellwig
2023-11-27 14:52     ` Christian Brauner
2023-11-27 14:54       ` Christoph Hellwig
2023-11-27 16:46   ` Christoph Hellwig [this message]
2023-11-28 15:56     ` Christian Brauner
2023-11-27 11:51 ` [PATCH 2/2] super: don't bother with WARN_ON_ONCE() Christian Brauner
2023-11-27 13:59   ` Christoph Hellwig
2023-11-27 14:53     ` Christian Brauner
2023-11-27 16:48       ` Christoph Hellwig

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=20231127164637.GA2398@lst.de \
    --to=hch@lst.de \
    --cc=brauner@kernel.org \
    --cc=jack@suse.com \
    --cc=linux-fsdevel@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).