lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230915184334.GA1650@redhat.com>
Date:   Fri, 15 Sep 2023 20:43:35 +0200
From:   Oleg Nesterov <oleg@...hat.com>
To:     Alexey Gladkov <legion@...nel.org>
Cc:     Boqun Feng <boqun.feng@...il.com>, Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Rik van Riel <riel@...riel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Waiman Long <longman@...hat.com>,
        Will Deacon <will@...nel.org>,
        "Eric W. Biederman" <ebiederm@...ssion.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/5] seqlock: introduce seqprop_lock/unlock

On 09/15, Alexey Gladkov wrote:
>
> On Wed, Sep 13, 2023 at 05:50:00PM +0200, Oleg Nesterov wrote:
> > +									\
> > +static __always_inline void						\
> > +__seqprop_##lockname##_lock(seqcount_##lockname##_t *s,			\
> > +				locktype *lock)				\
> > +{									\
> > +	__SEQ_LOCK(WARN_ON_ONCE(s->lock != lock));			\
> > +	lockbase##_lock(lock);						\
> > +}									\
> > +									\
> > +static __always_inline void						\
> > +__seqprop_##lockname##_unlock(seqcount_##lockname##_t *s,		\
> > +				locktype *lock)				\
> > +{									\
> > +	lockbase##_unlock(lock); 					\
> >  }
>
> Why are you creating a new method with an unused argument s ?

To make it consistent/symmetrical with _lock() which does
__SEQ_LOCK(WARN_ON_ONCE(s->lock != lock)). _unlock() could do the
same check as well, but somehow I decided it would be too much.

And with other "methods". Say, __seqprop_##lockname##_preemptible(s)
doesn't use 's' too.

Otherwise they both do not need the 1st seqcount_##lockname##_t *s
argument.

Oleg.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ