Making a SCHED_FIFO process monopolize the processor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
    I know this is in the border line with off-topic, since my question
is not exactly about how to develop for the kernel but about how the
kernel works. Please forgive me if my question is not appropriate.

I want to know if it's possible to create a real-time process with
SCHED_FIFO policy that starts running and never lets any other process
run again.

I had read that processes in SCHED_FIFO usually run until a) they block
themselves by calling some syscall (for example, an I/O request), b)
they are preempted by some higher priority process or c) they decide to
yield the processor. So I thought that technically it would be possible
to create a process that "takes over" the processor from all the other
processes: Just create a SCHED_FIFO process that loops infinitely.

However, when I tried this it didn't work. Someone told me about
sched_rt_runtime_us and sched_rt_period_us, which acted like a
protection for this cases. So I tried both setting sched_rt_runtime_us
to -1 and setting both values to the same number, but it didn't work
either: I can switch to another terminal, execute top and see the
process running.

I've tried everything both in Linux 2.6.27-16-server and
2.6.32-22-generic, the first on a VM with one core and the second on my
computer with two cores (when I tried this one I created two real-time
processes instead of one).

What am I doing wrong? Is there some option in the kernel I have to
enable/disable?

Thanks,

-- 
Pablo Antonio (AKA crazy2k)
http://www.pablo-a.com.ar/

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux