实时内核的有限优先级感知锁定
Bounded Priority-Aware Locking for Real-Time Kernels
AI总结:
提出一种批处理优先级锁(BPL),通过按请求顺序分组等待任务并在组内按优先级选择下一个锁持有者,在保持FIFO锁等待时间上限的同时,降低高优先级任务的平均延迟。
摘要:
实时多核系统需要对共享资源的访问延迟有界。这些资源包括内核,它有许多可能由一种或多种不同同步原语保护的非抢占临界区。虽然FIFO锁等原语限制了进入临界区的等待时间,但它们不区分竞争共享资源访问的各个任务的重要性。为了解决这个问题,我们考虑一种优先级感知的自旋锁,它在保持锁等待时间最坏情况界限的同时,减少更重要任务的平均延迟。我们提出了一种批处理优先级锁(BPL),它首先根据锁请求的顺序对等待任务进行分组,然后根据等待组内的优先级确定下一个锁持有者。我们将BPL与替代锁方法进行比较,表明在多达64核的模拟中以及在实际RTOS的8核机器上的工作实现中,高优先级任务的平均等待时间减少了。BPL是严格优先级和FIFO顺序之间的折衷。虽然严格优先级可能导致饥饿,从而产生无界的锁获取延迟,但BPL具有与FIFO相同的等待界限,但对高优先级任务有好处。尽管其复杂性高于简单的自旋锁,但在工作系统中,其常见情况下的执行开销被证明是低廉的。我们认为,在需要可预测性的系统中,这是一个可接受的代价。
英文摘要:
A real-time multicore system requires delay bounds on access to shared resources. These resources include the kernel, which has potentially many non-preemptible critical sections guarded by one or more different synchronization primitives. While primitives such as FIFO locks bound the waiting time to enter a critical section, they do not distinguish the importance of individual tasks competing for shared resource access. To address this, we consider a priority-aware spinlock, which reduces the average delay of more important tasks while maintaining a worst-case bound on lock waiting time. We propose a Batched Priority Lock (BPL) that first groups waiting tasks based on the order of their lock requests, and then determines the next lock holder according to priority within the waiting group. We compare BPL to alternative lock approaches, showing that the average waiting time is reduced for higher priority tasks, in simulations up to 64 cores, and for a working implementation on an 8-core machine with a real RTOS. BPL is a compromise between strict priority and FIFO ordering. While strict priorities may lead to starvation and, hence, unbounded lock acquisition delays, BPL has the same waiting bound as FIFO, but with benefits to higher priority tasks. Although its complexity is greater than that of a simple spinlock, its common case execution overhead is shown to be inexpensive in a working system. We believe this is an acceptable cost in systems that require predictability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。