[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43ssw4ghx52wpw2klzyi35ioc4fr5g2givcc7sdxcyndytghsd@z4j6vdwvmn4d>
Date: Wed, 17 May 2023 09:03:10 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
"Paul E . McKenney" <paulmck@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
"H . Peter Anvin" <hpa@...or.com>, Paul Turner <pjt@...gle.com>,
linux-api@...r.kernel.org, Christian Brauner <brauner@...nel.org>,
Florian Weimer <fw@...eb.enyo.de>, David.Laight@...LAB.COM,
carlos@...hat.com, Peter Oskolkov <posk@...k.io>,
Alexander Mikhalitsyn <alexander@...alicyn.com>,
Chris Kennelly <ckennelly@...gle.com>,
Ingo Molnar <mingo@...hat.com>,
Darren Hart <dvhart@...radead.org>,
Andr� Almeida <andrealmeid@...lia.com>,
libc-alpha@...rceware.org, Steven Rostedt <rostedt@...dmis.org>,
Jonathan Corbet <corbet@....net>,
Florian Weimer <fweimer@...hat.com>
Subject: Re: [RFC PATCH 1/4] rseq: Add sched_state field to struct rseq
On Wed, 17 May 2023, Mathieu Desnoyers wrote:
>Expose the "on-cpu" state for each thread through struct rseq to allow
>adaptative mutexes to decide more accurately between busy-waiting and
>calling sys_futex() to release the CPU, based on the on-cpu state of the
>mutex owner.
Oh yeah moving the spin stuff out of the kernel is much nicer.
>It is only provided as an optimization hint, because there is no
>guarantee that the page containing this field is in the page cache, and
>therefore the scheduler may very well fail to clear the on-cpu state on
>preemption. This is expected to be rare though, and is resolved as soon
>as the task returns to user-space.
>
>The goal is to improve use-cases where the duration of the critical
>sections for a given lock follows a multi-modal distribution, preventing
>statistical guesses from doing a good job at choosing between busy-wait
>and futex wait behavior.
>
>Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
>Cc: Peter Zijlstra (Intel) <peterz@...radead.org>
>Cc: Jonathan Corbet <corbet@....net>
>Cc: Steven Rostedt (Google) <rostedt@...dmis.org>
>Cc: Carlos O'Donell <carlos@...hat.com>
>Cc: Florian Weimer <fweimer@...hat.com>
>Cc: libc-alpha@...rceware.org
>---
> include/linux/sched.h | 12 ++++++++++++
> include/uapi/linux/rseq.h | 17 +++++++++++++++++
> kernel/rseq.c | 14 ++++++++++++++
> 3 files changed, 43 insertions(+)
Ie: previous efforts
kernel/futex.c | 675 ++++++++++++++++++++++++++++++++++++++------
kernel/futex.c | 572 ++++++++++++++++++++++++++++++++++++-------------
Thanks,
Davidlohr
Powered by blists - more mailing lists