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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250402210609.8277eb512a78dcc4fa3702b3@linux-foundation.org>
Date: Wed, 2 Apr 2025 21:06:09 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: bpf <bpf@...r.kernel.org>, linux-mm <linux-mm@...ck.org>, Linus Torvalds
 <torvalds@...ux-foundation.org>, Daniel Borkmann <daniel@...earbox.net>,
 Andrii Nakryiko <andrii@...nel.org>, Martin KaFai Lau
 <martin.lau@...nel.org>, Peter Zijlstra <peterz@...radead.org>, Vlastimil
 Babka <vbabka@...e.cz>, Sebastian Sewior <bigeasy@...utronix.de>, Steven
 Rostedt <rostedt@...dmis.org>, Shakeel Butt <shakeel.butt@...ux.dev>,
 Michal Hocko <mhocko@...e.com>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] locking/local_lock, mm: Replace localtry_ helpers
 with local_trylock_t type

On Wed, 2 Apr 2025 20:48:39 -0700 Alexei Starovoitov <alexei.starovoitov@...il.com> wrote:

> On Wed, Apr 2, 2025 at 8:12 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
> >
> > On Wed,  2 Apr 2025 19:55:14 -0700 Alexei Starovoitov <alexei.starovoitov@...il.com> wrote:
> >
> > > Partially revert commit 0aaddfb06882 ("locking/local_lock: Introduce localtry_lock_t").
> > > Remove localtry_*() helpers, since localtry_lock() name might
> > > be misinterpreted as "try lock".
> > >
> >
> > So many macros grumble.
> >
> > +#define local_trylock_init(lock)       __local_trylock_init(lock)
> > +#define local_trylock(lock)            __local_trylock(lock)
> > +#define local_trylock_irqsave(lock, flags)                     \
> > +#define __local_trylock_init(lock) __local_lock_init(lock.llock)
> > +#define __local_lock_acquire(lock)                                     \
> > +#define __local_trylock(lock)                                  \
> > +#define __local_trylock_irqsave(lock, flags)                   \
> > +#define __local_lock_release(lock)                                     \
> > +#define __local_unlock(lock)                                   \
> > +#define __local_unlock_irq(lock)                               \
> > +#define __local_unlock_irqrestore(lock, flags)                 \
> > +#define __local_lock_nested_bh(lock)                           \
> > +#define __local_unlock_nested_bh(lock)                         \
> > +#define __local_trylock_init(l)                        __local_lock_init(l)
> > +#define __local_trylock(lock)                                  \
> > +#define __local_trylock_irqsave(lock, flags)                   \
> >
> > I expect many of these could have been implemented as static inlines.
> >
> > Oh well, that's a separate project for someone sometime.
> 
> They need to be macroses otherwise _Generic() trick won't work.

Ah.

> Thanks for applying v3.
> 
> Do you want to take "mm/page_alloc: Avoid second trylock of zone->lock"
> fix as well ?

Added, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ