From: Peter Zijlstra <peterz@infradead.org>
To: "André Almeida" <andrealmeid@igalia.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Darren Hart <dvhart@infradead.org>,
Davidlohr Bueso <dave@stgolabs.net>,
Arnd Bergmann <arnd@arndb.de>,
sonicadvance1@gmail.com, linux-kernel@vger.kernel.org,
kernel-dev@igalia.com, linux-api@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>,
Vinicius Peixoto <vpeixoto@lkcamp.dev>,
fweimer@redhat.com,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH v3 0/3] futex: Create set_robust_list2
Date: Thu, 19 Dec 2024 18:13:44 +0100 [thread overview]
Message-ID: <20241219171344.GA26279@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <a9b1dde0-7c29-41c3-99be-4749281e25ea@igalia.com>
On Thu, Dec 19, 2024 at 11:28:27AM -0300, André Almeida wrote:
> Em 17/12/2024 17:31, Peter Zijlstra escreveu:
> > On Tue, Dec 17, 2024 at 02:49:55PM -0300, André Almeida wrote:
> > > This patch adds a new robust_list() syscall. The current syscall
> > > can't be expanded to cover the following use case, so a new one is
> > > needed. This new syscall allows users to set multiple robust lists per
> > > process and to have either 32bit or 64bit pointers in the list.
> >
> > Last time a whole list of short comings of the current robust scheme
> > were laid bare. I feel we should address all that if we're going to
> > create a new scheme.
> >
>
> Are you talking about [1] or is there something else?
>
> [1] https://lore.kernel.org/lkml/87jzdjxjj8.fsf@oldenburg3.str.redhat.com/
Correct, that thread.
So at the very least I think we should enforce natural alignment of the
robust entry -- this ensures the whole object is always on a single
page. This should then allow emulators (like QEMU) to convert things
back to native address space.
Additionally, I think we can replace the LIST_LIMIT -- whoes purpose is
to mitigate the danger of loops -- with the kernel simply destroying the
list while it iterates it. That way it cannot be caught in loops, no
matter what userspace did.
That then leaves the whole munmap() race -- and I'm not really sure what
to do about that one. I did outline two option, but they're both quite
terrible.
The mmap()/munmap() code would need to serialize against list_op_pending
without incurring undue overhead in the common case.
Ideally we make the whole thing using RSEQ such that list_op_pending
becomes atomic vs preemption -- but I've not thought that through.
prev parent reply other threads:[~2024-12-19 17:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 17:49 [PATCH v3 0/3] futex: Create set_robust_list2 André Almeida
2024-12-17 17:49 ` [PATCH v3 1/3] futex: Use explicit sizes for compat_exit_robust_list André Almeida
2024-12-17 17:49 ` [PATCH v3 2/3] futex: Create set_robust_list2 André Almeida
2024-12-17 17:49 ` [PATCH v3 3/3] futex: Wire up set_robust_list2 syscall André Almeida
2024-12-17 19:24 ` Arnd Bergmann
2024-12-17 20:31 ` [PATCH v3 0/3] futex: Create set_robust_list2 Peter Zijlstra
2024-12-19 14:28 ` André Almeida
2024-12-19 17:13 ` Peter Zijlstra [this message]
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=20241219171344.GA26279@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=andrealmeid@igalia.com \
--cc=arnd@arndb.de \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=fweimer@redhat.com \
--cc=kernel-dev@igalia.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=sonicadvance1@gmail.com \
--cc=tglx@linutronix.de \
--cc=vpeixoto@lkcamp.dev \
/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;
as well as URLs for NNTP newsgroup(s).