Difference between CONFIG_RT_GROUP_SCHED and PREEMPT_RT?
Asked Answered
C

1

2

I am just getting started on real time Linux systems, and two different methods seem to be available:

  1. Configuring the CONFIG_RT_GROUP_SCHED parameter in a "normal" Linux kernel
  2. Applying the PREEMPT_RT patch to a "normal" Linux kernel

I do not seem to be able to grasp the difference between the two. Do they offer alternative solutions to the same problem? Are they even at the same logical level?

Thank you in advance.

Cheka answered 16/7, 2020 at 10:39 Comment(0)
M
2

CONFIG_RT_GROUP_SCHED reserves a certain fraction of CPU time to the processes in each group. The scheduling interval, processes in each group, and amount of CPU time are all configurable.

Group Sched

The PREEMPT_RT patch makes normally non-preemptible code, like spinlocks and interrupt handlers, preemptible by higher priority events. This reduces latency for realtime processing.

RT Patch

So the two are completely different. You could apply either or both depending on your needs. Note that using either one without a good reason is like premature optimization of code. It will reduce performance of general code in order to improve performance of its specific requirement (latency or CPU allocation).

Marchal answered 16/7, 2020 at 14:48 Comment(3)
after reading the first manual, I am wondering, why is rt scheduling based on groups? Why is it not process-based? (sorry for the lame questions, just trying to learn)Cheka
Perfectly valid to have one process per group. More flexible to allow multiple.Marchal
I'm not sure if this was already the case in 2016, but at least in kernels 5.4 and 5.10 RT_GROUPS_SCHED depends on !PREEMPT_RT, so they can't both be selected at the same time.Pennebaker

© 2022 - 2024 — McMap. All rights reserved.