You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -262,7 +262,7 @@ Now it is time to build the kernel:
262
262
$ sudo dpkg -r linux-image-${PREEMPT_RT_VER_FULL}
263
263
```
264
264
265
-
The advantage of the Debian package is that you can distribute and remove it more easily than the direct installation.
265
+
The advantage of the Debian package is that you can distribute and remove it more easily than the direct installation. The generation of the debug version might take much longer than the release version. Just be patient!
266
266
267
267
- Alternatively you can build and **install it directly** without creating a Debian package first
268
268
@@ -302,9 +302,27 @@ In this context `rtprio` is the maximum real-time priority allowed for non-privi
302
302
303
303
### 1.4 Set real-time schedule
304
304
305
-
The real-time schedule of a process can be set from the command line with `chrt` as discussed [here](https://askubuntu.com/questions/51283/how-to-run-a-program-with-sched-rr-policy-from-command-line).
305
+
The real-time schedule of a process can be set from the command line with `chrt` as discussed [here](https://askubuntu.com/questions/51283/how-to-run-a-program-with-sched-rr-policy-from-command-line) or from within the process as discussed in the [chapter on real-time programming](./RealTimeProgramming.md). For a [systemd service](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html) (for the basics refer also to [this tutorial](https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6)) you can either set a priority to the service itself by specifying `CPUSchedulingPolicy=fifo` and `CPUSchedulingPriority=90` as described [here](https://superuser.com/a/403386) or specify a maximum priority that the process can be set to through the parameter `LimitRTPRIO` inside the corresponding service file, e.g. `/etc/systemd/system/my.service`:
306
306
307
+
```
308
+
[Unit]
309
+
Description=My service
310
+
311
+
[Service]
312
+
Environment=SOME_VAR=some_value
313
+
ExecStart=./path/to/my/process
314
+
KillMode=process
315
+
KillSignal=SIGINT
316
+
# This allows the process to set the priority from inside the program to this maximum value
317
+
LimitRTPRIO=99
318
+
Type=simple
319
+
User=my_user
320
+
321
+
[Install]
322
+
WantedBy=multi-user.target
323
+
```
307
324
325
+
In the case of `LimitRTPRIO` make sure to set the priority and scheduling process from inside the code and check the return values as well as with `htop` to make sure it was set successfully.
0 commit comments