I'm trying to make a process non preemptable. I've changed the scheduler policy to SCHED_FIFO
and set the rtprio
to 99. As soon as the process starts, in absence of IO interrupts, do I have the assurance that the process won't be preempted by other process? The rtprio=99 is the highest priority or there's still some process of the kernel with a higher priority? And finally, how can I know if a process has been preempted or not during its execution?
Asked
Active
Viewed 779 times
0

Box Box Box Box
- 5,094
- 10
- 49
- 67

user1430869
- 35
- 1
- 4
1 Answers
0
It does have other process can preempt the highest rt process. Example, the processes which are created by stop_machine()
for hot-removing CPUS, modifying kernel code text.
You can get the information from /proc/$PID/sched to determine whether a process has been preempted or not. cat /proc/$PID/sched
nr_switches : 4197
nr_voluntary_switches : 4140
nr_involuntary_switches : 57
If nr_switches
is changed, the process has been preempted

Lai Jiangshan
- 1,420
- 1
- 13
- 23