[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <875yrolm3r.ffs@tglx>
Date: Thu, 16 Dec 2021 14:23:36 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Oskolkov <posk@...gle.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: Peter Oskolkov <posk@...k.io>, Ingo Molnar <mingo@...hat.com>,
juri.lelli@...hat.com,
Vincent Guittot <vincent.guittot@...aro.org>,
dietmar.eggemann@....com, Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, mgorman@...e.de,
bristot@...hat.com,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
linux-api@...r.kernel.org, x86@...nel.org,
Paul Turner <pjt@...gle.com>, Andrei Vagin <avagin@...gle.com>,
Jann Horn <jannh@...gle.com>,
Thierry Delisle <tdelisle@...terloo.ca>
Subject: Re: [RFC][PATCH 0/3] sched: User Managed Concurrency Groups
Peter,
On Wed, Dec 15 2021 at 15:26, Peter Oskolkov wrote:
> On Wed, Dec 15, 2021 at 2:25 PM Peter Zijlstra <peterz@...radead.org> wrote:
>> > - take a userspace (spin) lock (so the steps below are all within a
>> > single critical section):
>>
>> Don't ever suggest userspace spinlocks, they're horrible crap.
>
> This can easily be a mutex, not really important (although for very
> short critical sections with only memory reads/writes, like here, spin
> locks often perform better, in our experience).
Performance may be better, but user space spinlocks have a fundamental
problem: They are prone to live locks.
That's completely independent of the length of the critical section, it
even can be empty.
There are ways to avoid that, but that needs a very careful design on
the application/library level and at the system configuration level
(priorities, affinities ...). And even then, there are trival ways to
break that, e.g. via CPU hotplug.
So no, for something of general use, they are a complete NONO. People
who think they know what they are doing have the source and can replace
them if they feel the need to do so.
Thanks,
tglx
Powered by blists - more mailing lists