zephyr/kernel
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Aaron Wisner 4d042d3103 kernel: add configurable striped semaphore locking
Replace the system-wide semaphore spinlock with a configurable array
of naturally aligned lock stripes. Hash each semaphore by its natural
alignment without changing the semaphore object ABI.

Default CONFIG_SEM_LOCK_STRIPES to one so SMP and uniprocessor builds
preserve existing global-lock behavior and static memory use. Use a
scalar lock unless SMP striping is explicitly enabled, so UP builds
retain zero-sized spinlocks and avoid non-portable empty-struct arrays.

Require a power-of-two stripe count so the compiler reduces stripe
selection to a bitmask. Divide by the alignment of struct k_sem before
hashing to discard redundant address bits.

Do not impose cache-line alignment or padding. Explain how spinlock
and cache-line sizes affect the stripe count needed to reduce cache
contention.

Validate upstream semaphore regressions with zero-sized uniprocessor
spinlocks and SMP configurations using one, 16, and 32 stripes.
Reject non-power-of-two stripe counts at compile time.

An internal throughput microbenchmark on a quad-core ARM Cortex-A53
SMP system observed an improvement of approximately 3.1%.

Assisted-by: Codex:GPT-5
Signed-off-by: Aaron Wisner <awiz@openai.com>
2026-08-27 22:11:20 -04:00
..
include kernel: userspace: Add z_waitq_head_locked() 2026-08-21 16:17:54 +02:00
paging kernel: mm: rename z_num_pagefaults_get to k_mem_num_* 2024-06-12 21:13:26 -04:00
smp kernel: Add private kernel header file kspinlock.h 2026-08-21 16:17:54 +02:00
sys kernel: thread_entry: fix include for TLS stack canaries 2026-08-19 18:41:05 -04:00
userspace kernel: userspace: Add z_waitq_head_locked() 2026-08-21 16:17:54 +02:00
busy_wait.c kernel: timer: Include include/zephyr/sys/clock.h 2026-07-30 07:45:05 -05:00
CMakeLists.txt kernel: move the sleep API declarations to their own header 2026-08-20 08:52:31 +02:00
compiler_stack_protect.c kernel: fix doxygen warnings exposed by adding kernel/ to docs INPUT 2026-07-01 17:05:28 -04:00
condvar.c kernel: obj_core: register object types from a single init point 2026-07-01 23:45:35 -04:00
deadline.c kernel: Update _sched_spinlock comment references 2026-08-21 16:17:54 +02:00
device.c kernel: device: restrict the device_deinit syscall to driver objects 2026-08-10 09:14:56 -07:00
dynamic.c kernel: dynamic: fix kernel stack size overflow 2026-08-21 16:20:34 +02:00
dynamic_disabled.c kernel: dynamic: declare dynamic stubs when disabled 2023-07-24 12:59:43 -04:00
events.c kernel: Update _sched_spinlock comment references 2026-08-21 16:17:54 +02:00
fatal.c sys: printk: stop locking once a fatal error is being reported 2026-08-19 17:09:07 +01:00
float.c build: namespace the generated headers with zephyr/ 2024-05-28 22:03:55 +02:00
idle.c kernel: timeout: report the no-deadline case from the idle path 2026-08-12 19:27:28 -04:00
init.c kernel: init: remove reference to legacy api 2026-08-26 18:14:02 -07:00
irq_offload.c kernel: add closing comments to config endifs 2024-03-25 18:03:31 -04:00
Kconfig kernel: add configurable striped semaphore locking 2026-08-27 22:11:20 -04:00
Kconfig.device kernel: Kconfig.device: fix CONFIG_DEVICE_DEINIT_SUPPORT help text 2026-03-08 16:36:39 +01:00
Kconfig.init kernel: Kconfig: remove prompts from SoC and Board Hooks 2026-08-27 21:26:07 +01:00
Kconfig.obj_core kernel: remove duplicate config OBJ_CORE_SEM 2026-07-27 11:45:01 -07:00
Kconfig.vm kernel: mmu: remove LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT 2026-06-23 09:11:08 -04:00
kheap.c kernel: kheap: keep static heap init as a PRE_KERNEL_1 SYS_INIT 2026-07-06 19:42:44 -04:00
mailbox.c kernel: Fix race in mbox_message_dispose() 2026-08-18 20:22:32 -04:00
main_weak.c kernel: Switch main return type from void to int 2023-04-14 07:49:41 +09:00
mem_slab.c kernel: kheap, mem_slab, mailbox: use kernel init hooks 2026-07-06 15:10:55 -04:00
mempool.c kernel: k_free() no longer calls z_waitq_head() 2026-08-21 16:17:54 +02:00
mmu.c sys: __assert: migrate users away from __ASSERT_ON 2026-08-27 12:12:11 +01:00
msg_q.c kernel: userspace: Add z_waitq_head_locked() 2026-08-21 16:17:54 +02:00
mutex.c kernel: userspace: Add z_waitq_head_locked() 2026-08-21 16:17:54 +02:00
nothread.c tracing: give k_sleep_ticks() its own trace point 2026-08-20 08:52:31 +02:00
obj_core.c kernel: obj_core: name the walk callback parameters 2026-08-17 10:26:20 +02:00
pipe.c kernel: rename the reserved 'exit' labels to 'out' 2026-08-11 17:08:24 -04:00
poll.c kernel: poll: Remove redundant timeout check 2026-08-02 11:43:59 -04:00
priority_queues.c kernel: priority queues: declare as static inlines 2024-04-22 16:40:11 -04:00
queue.c kernel: queue: skip blocking trace for no-wait get 2026-08-24 14:06:45 -07:00
sched.c kernel: userspace: Add z_waitq_head_locked() 2026-08-21 16:17:54 +02:00
scheduler.c kernel: Update _sched_spinlock comment references 2026-08-21 16:17:54 +02:00
sem.c kernel: add configurable striped semaphore locking 2026-08-27 22:11:20 -04:00
sleep.c kernel: Add and use z_swap_locked() 2026-08-21 16:17:54 +02:00
spinlock_validate.c kernel: spinlock: add z_assert_can_swap() for context-switch validation 2026-06-15 18:35:34 -04:00
stack.c kernel: stack: fix allocation size overflow 2026-08-22 19:20:09 -04:00
sys_clock_hw_cycles.c kernel: refactor sys_clock_hw_cycles_per_sec runtime support 2026-02-20 13:31:07 +01:00
system_work_q.c kernel: system_work_q: register init via kernel init hook 2026-07-06 15:10:55 -04:00
thread.c kernel: Add and use z_reschedule_locked() 2026-08-21 16:17:54 +02:00
thread_monitor.c kernel: thread_monitor: reafactor and remove duplicate code 2025-04-04 07:42:20 +02:00
timeout.c kernel: timeout: report the no-deadline case from the idle path 2026-08-12 19:27:28 -04:00
timeout_bucket.h kernel: timeout: add bucketed delta-list backend 2026-07-09 18:02:12 -04:00
timeout_list.h kernel: timeout: factor delta-list queue into a pluggable backend 2026-07-09 18:02:12 -04:00
timeout_minheap.h kernel: timeout: add min-heap backend 2026-07-09 18:02:12 -04:00
timeout_wheel.h kernel: timeout: add timer-wheel backend 2026-07-09 18:02:12 -04:00
timer.c kernel: userspace: Add z_waitq_head_locked() 2026-08-21 16:17:54 +02:00
timeslicing.c kernel: Add private kernel header file kspinlock.h 2026-08-21 16:17:54 +02:00
usage.c kernel: usage: fix unused-variable warning when THREAD_USAGE_ALL=n 2026-08-19 17:12:24 +01:00
version.c build: namespace the generated headers with zephyr/ 2024-05-28 22:03:55 +02:00
work.c toolchain: fix deprecation warning for iar 2026-08-12 13:11:27 -04:00