Re: [PATCH 1/2] super: massage wait event mechanism

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 27, 2023 at 05:46:37PM +0100, Christoph Hellwig wrote:
> On Mon, Nov 27, 2023 at 12:51:30PM +0100, Christian Brauner wrote:
> > Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
> > ---
> >  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.

I'll just drop the load from the middle then.

> 
> 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.

Hm, it's pretty common in our code in so many places...




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux