RTEMS | Draft: SMP: Add FMLP-Short and FMLP-Long locking protocols (!882)

Karthikey Kadati (@karthikey_kadati) gitlab at rtems.org
Wed Dec 24 09:24:14 UTC 2025



Karthikey Kadati created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/882

Project:Branches: karthikey_kadati/rtems:feature-fmlp-port to rtems/rtos/rtems:main
Author:   Karthikey Kadati




This MR introduces the Flexible Multiprocessor Locking Protocol (FMLP) into the RTEMS 7 SMP SuperCore. It implements both the FMLP-Short (busy-wait) and FMLP-Long (suspension) variants. This addresses a significant gap in predictable multiprocessor resource sharing as documented in the TU Dortmund research.

**Technical Details** The implementation modernizes the research patch by Junjie Shi et al. (2020) to align with current RTEMS 7 architecture.

* **SuperCore Logic**: Logic for `FMLPS_Control` (Short) and `FMLPL_Control` (Long) has been added to `cpukit/score`.

**Locking Mechanisms:**

* **FMLP-Short**: Implements priority ceiling enforcement for non-preemptive busy-waiting.
* **FMLP-Long**: Implements priority inheritance and boosting mechanisms for suspension-based locking.

**Wait Discipline:** Both variants utilize a FIFO wait-queue discipline, departing from standard priority-sorted queues to ensure predictable multiprocessor behavior.

**SMP Safety:** All operations are updated to use the modern `Thread_queue_Context` to ensure atomic state transitions.

**API and Observability**

* **Classic API**: Extended the Semaphore Manager attributes to include `RTEMS_FLEXIBLE_MULTIPROCESSOR_LOCKING_SHORT` and `RTEMS_FLEXIBLE_MULTIPROCESSOR_LOCKING_LONG`.
* **Monitor**: Updated `cpukit/libmisc/monitor/mon-sema.c` to identify and display these new semaphore types correctly.

**Verification** Testing was performed on the SIS Simulator (SPARC/LEON3) with a 2-CPU SMP configuration.

* **spfmlp01**: Validates FMLP-Long (suspension, priority inheritance, deadlock-free release).
* **spfmlp02**: Validates FMLP-Short (busy-wait, priority ceiling enforcement).

Updates #4612

Signed-off-by: Karthikey D Kadati karthikey3608 at gmail.com

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/882
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20251224/182d9881/attachment.htm>


More information about the bugs mailing list