linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf@vger.kernel.org, linux-mm@kvack.org,
	torvalds@linux-foundation.org, daniel@iogearbox.net,
	andrii@kernel.org, martin.lau@kernel.org, peterz@infradead.org,
	vbabka@suse.cz, bigeasy@linutronix.de, rostedt@goodmis.org,
	shakeel.butt@linux.dev, mhocko@suse.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] locking/local_lock, mm: Replace localtry_ helpers with local_trylock_t type
Date: Wed, 2 Apr 2025 20:12:52 -0700	[thread overview]
Message-ID: <20250402201252.8926c547a327ce91c61fd620@linux-foundation.org> (raw)
In-Reply-To: <20250403025514.41186-1-alexei.starovoitov@gmail.com>

On Wed,  2 Apr 2025 19:55:14 -0700 Alexei Starovoitov <alexei.starovoitov@gmail.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.


  reply	other threads:[~2025-04-03  3:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03  2:55 Alexei Starovoitov
2025-04-03  3:12 ` Andrew Morton [this message]
2025-04-03  3:48   ` Alexei Starovoitov
2025-04-03  4:06     ` Andrew Morton

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=20250402201252.8926c547a327ce91c61fd620@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=martin.lau@kernel.org \
    --cc=mhocko@suse.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=shakeel.butt@linux.dev \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    /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