sascha at ps.nvbi.de
Sun Feb 24 15:48:08 EST 2013
>>> Why the hell the preempt cant be toggled on/off from user space is a
>>> mystery - its just a timer on an IRQ why cant I simply turn the timer
>> You are sure you understand, what preempt is about?
> To me (an old bald man who remembers 8088 CPUs) preemption is to enter
> the kernel on a hardware timer interrupt allowing the scheduler to do
> its thing without a process making an explicit kernel call.
This is preemptive multitasking, yes. Linux uses preemptive multitasking
since the beginning, and it can't be disabled. What preemption in
context of this kernel configuration means, is that even kernel threads
can be preempted by higher priority tasks. So disabling the preemption
option would most likely increase your problems.
>> Why do you think,
>> that preempt harms you application?
> I am driving LED signs with a user space application. For some parts of
> my code I need to generate small accurate amounts of time for a pulse on
> a GPIO pin. Most of the time this works well except when an IRQ comes
> in or even worse preemption allows the kernel to do its scheduler logic
> during my timing code causes it schedule the process back in late.
Had no time to read your post on lkml, but maybe a look at man 2
sched_setscheduler and searching around for process priorities in linux
would help you. There are some options to set real time priority for
user space threads, which you would need in addition, as far as I
understand it. I never played around with it, so I couldn't help you
with details about this.
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me
More information about the linux-rpi-kernel