public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "Thomas Gleixner" <tglx@kernel.org>,
	"André Almeida" <andrealmeid@igalia.com>,
	linux-kernel@vger.kernel.org,
	"Carlos O'Donell" <carlos@redhat.com>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Rich Felker" <dalias@aerifal.cx>,
	"Torvald Riegel" <triegel@redhat.com>,
	"Darren Hart" <dvhart@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Davidlohr Bueso" <dave@stgolabs.net>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>
Subject: Re: [RFC PATCH] futex: Introduce __vdso_robust_futex_unlock
Date: Fri, 13 Mar 2026 09:20:17 +0100	[thread overview]
Message-ID: <lhuh5qknnsu.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <86f1a404-905c-4d52-862b-4f93c5dae6a4@efficios.com> (Mathieu Desnoyers's message of "Thu, 12 Mar 2026 15:16:38 -0400")

* Mathieu Desnoyers:

> On 2026-03-12 15:10, Thomas Gleixner wrote:
>> On Thu, Mar 12 2026 at 10:04, Mathieu Desnoyers wrote:
>>> On 2026-03-12 09:46, André Almeida wrote:
>>>> The interface that I would propose here would be a bit more "generic" or
>>>> "flexible":
>>>>
>>>> __vdso_robust_futex_unlock(void *uaddr, int uval, struct
>>>> robust_list_head *head, unsigned int flags)
>>>
>>> I agree on adding explicit "uval" and pointer to robust list head,
>>> I'm not convinced that the rest is an improvement.
>>>
>>> This would require the caller to deal with errors, making it
>>> more complex than a simple replacement for atomic xchg/cmpxchg.
>>>
>>> "flags" could be unsupported, so the handler would have to deal with
>>> -EINVAL.
>> What's the problem with that? pthread_mutex_unlock() has a return
>> value
>> too.
>
> My aim is to use this vDSO as a replacement for atomic xchg and atomic
> cmpxchg within library code. I am trying to make the transition as
> straightforward as possible considering that this is a design bug
> fix.
>
> If adding error handling at that precise point of the libc robust mutex
> unlock code is straightforward, I don't mind internally checking flags
> and returning -EINVAL, but I'd want to hear about preference from the
> libc people on this topic beforehand.

As a deallocation operation, unlock must not fail.  We would therefore
ignore the error return value (because EINVAL can only happen for
invalid arguments), or we'd terminate the process on failure.

Thanks,
Florian


  reply	other threads:[~2026-03-13  8:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 18:54 [RFC PATCH] futex: Introduce __vdso_robust_futex_unlock Mathieu Desnoyers
2026-03-11 20:11 ` Mathieu Desnoyers
2026-03-12  8:49 ` Florian Weimer
2026-03-12 13:13   ` Mathieu Desnoyers
2026-03-12 14:12     ` Florian Weimer
2026-03-12 14:14       ` André Almeida
2026-03-12 16:09         ` Mathieu Desnoyers
2026-03-12 13:46 ` André Almeida
2026-03-12 14:04   ` Mathieu Desnoyers
2026-03-12 18:40     ` Mathieu Desnoyers
2026-03-12 18:58       ` André Almeida
2026-03-12 19:10     ` Thomas Gleixner
2026-03-12 19:16       ` Mathieu Desnoyers
2026-03-13  8:20         ` Florian Weimer [this message]
2026-03-12 20:19   ` Thomas Gleixner
2026-03-12 21:28     ` Mathieu Desnoyers
2026-03-12 22:23 ` Thomas Gleixner
2026-03-12 22:52   ` Mathieu Desnoyers
2026-03-13 12:12     ` Sebastian Andrzej Siewior
2026-03-13 12:17       ` Mathieu Desnoyers
2026-03-13 13:29         ` Sebastian Andrzej Siewior
2026-03-13 13:35           ` Mathieu Desnoyers
2026-03-16 17:12     ` Thomas Gleixner
2026-03-16 19:36       ` Mathieu Desnoyers
2026-03-16 20:27         ` Thomas Gleixner
2026-03-16 21:01           ` Mathieu Desnoyers
2026-03-16 22:19             ` Thomas Gleixner
2026-03-16 22:30               ` Mathieu Desnoyers
2026-03-16 23:29                 ` Thomas Gleixner
2026-03-20 18:13                   ` Mathieu Desnoyers
2026-03-24 21:35                     ` Thomas Gleixner
2026-03-25 14:12                       ` Mathieu Desnoyers

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=lhuh5qknnsu.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=andrealmeid@igalia.com \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=carlos@redhat.com \
    --cc=dalias@aerifal.cx \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@kernel.org \
    --cc=triegel@redhat.com \
    /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