From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 978C6198 for ; Mon, 27 Nov 2023 08:46:42 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 8ECA867373; Mon, 27 Nov 2023 17:46:38 +0100 (CET) Date: Mon, 27 Nov 2023 17:46:37 +0100 From: Christoph Hellwig To: Christian Brauner Cc: Christoph Hellwig , Jan Kara , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/2] super: massage wait event mechanism Message-ID: <20231127164637.GA2398@lst.de> References: <20231127-vfs-super-massage-wait-v1-0-9ab277bfd01a@kernel.org> <20231127-vfs-super-massage-wait-v1-1-9ab277bfd01a@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231127-vfs-super-massage-wait-v1-1-9ab277bfd01a@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Nov 27, 2023 at 12:51:30PM +0100, Christian Brauner wrote: > Signed-off-by: Christian Brauner > --- > 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.