lkml.org 
[lkml]   [2021]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch 30/63] locking/spinlock: Provide RT variant
Date
On 7/30/21 9:50 AM, Thomas Gleixner wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
>
> Provide the actual locking functions which make use of the general and
> spinlock specific rtmutex code.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> kernel/locking/Makefile | 1
> kernel/locking/spinlock_rt.c | 128 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 129 insertions(+)
> create mode 100644 kernel/locking/spinlock_rt.c
> ---
> --- a/kernel/locking/Makefile
> +++ b/kernel/locking/Makefile
> @@ -25,6 +25,7 @@ obj-$(CONFIG_LOCK_SPIN_ON_OWNER) += osq_
> obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
> obj-$(CONFIG_QUEUED_SPINLOCKS) += qspinlock.o
> obj-$(CONFIG_RT_MUTEXES) += rtmutex_api.o
> +obj-$(CONFIG_PREEMPT_RT) += spinlock_rt.o
> obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o
> obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
> obj-$(CONFIG_QUEUED_RWLOCKS) += qrwlock.o
> --- /dev/null
> +++ b/kernel/locking/spinlock_rt.c
> @@ -0,0 +1,128 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * PREEMPT_RT substitution for spin/rw_locks
> + *
> + * spin_lock and rw_lock on RT are based on rtmutex with a few twists to
> + * resemble the non RT semantics
> + *
> + * - Contrary to a plain rtmutex, spin_lock and rw_lock are state
> + * preserving. The task state is saved before blocking on the underlying
> + * rtmutex and restored when the lock has been acquired. Regular wakeups
> + * during that time are redirected to the saved state so no wake up is
> + * missed.
> + *
> + * - Non RT spin/rw_locks disable preemption and evtl. interrupts.

"evtl."?

Cheers,
Longman

\
 
 \ /
  Last update: 2021-08-05 01:35    [W:1.083 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site