Questions tagged [preemption]
131 questions
1
vote
1 answer
How to force an interrupt on function execution that is taking too long within a scheduled tick
I have written this scheduler, but I am not able to make it "kill" that input function f when f takes more than the input recurring time interval.
If that f was a process instead of a thread, then this thing I am looking for could be some sort of…

TPPZ
- 4,447
- 10
- 61
- 106
1
vote
1 answer
linux 2.6 scheduling and preemption - preempt_count use
A little discussion before the question. Linux 2.4 kernel is non preemtive, so if there is a need for context-switch when we are proccecing a system call in the kernel mode, we only do set_need_resched to raise a flag and then when we go back to…

Ilya.K.
- 291
- 1
- 13
1
vote
2 answers
Can a runnable be preempted during its execution on AUTOSAR or OSEK?
In Autosar, runnables are mapped to tasks. Tasks can be preempted due to the priority.
Where is the point of preemption? Does the preemption happen between runnables?
Is a runnable atomic execution or it can be preempted during its execution?

Jian
- 11
- 3
1
vote
1 answer
when is RT_PREEMPT patch released for Linux kernel 4.11
When is RT_PREEMPT patch released for linux kernel 4.11, the newest stable Linux Kernel?
I know I can enable CONFIG_PREEMPT in the mainline Linux Kernel but what are the differences between this mainline PREEMPT and the RT_PREEMPT patch?
Does…

winston
- 123
- 4
1
vote
1 answer
Anylogic getRemainingTime and Functions
I am building a fairly simple model in Anylogic, and need to use the delay function 'getRemainingTime' and some functions in the 'queue' block: priority-based queueing, preemption and timeout. I have been unable to find a tutorial or examples online…

Mohit Shukla
- 11
- 2
1
vote
1 answer
what happens if copy_to_user is in RW lock?
I implemented copy_to_user() inside read-write lock. My question is what if there is a page fault when executing the copy_to_user, will it get serviced even the lock is not released? If not, how can I achieve this? Any idea would be very…

damingzi
- 676
- 10
- 28
1
vote
1 answer
How to set a time limit on a function with a secure area
I'm trying to develop a program to time limit the execution of a function. In the code below I have a function named Inc which does a lot of iterations (simulated by the infinite loop). The first part of each iteration is quite long, followed by a…

kunigami
- 3,046
- 4
- 26
- 42
1
vote
2 answers
Using perf to figure out when and why process enters uninterruptible sleep
I am playing with perf to learn how can one figure out why process enters "D" (uninterruptible sleep) state.
I am using perf command:
perf record -g -p 4710 -e sched:sched_stat_iowait,sched:sched_stat_blocked sleep 60
where 4710 is pid of my…

Marko Kevac
- 2,902
- 30
- 47
1
vote
1 answer
How to save state when preempted on a Google preemptible instance?
I need to be able to save the state of a Centos-based Google Compute instance when it first receives a preemption signal. The documentation very clearly indicates that a "ACPI G2 Soft Off" signal is sent 30 seconds before a preemptible shutdown. …

Nigel R Murray
- 11
- 2
1
vote
1 answer
Check whether a preemption had occurred in Linux between two points of the code
I have an application (a simple C code) running on top of Linux kernel. I am measuring time between two points of the code. I would like to know whether any other process or the scheduler itself has preempted my application between these two points.…

Ginu Jacob
- 1,588
- 2
- 19
- 35
1
vote
1 answer
Callback of Matlab Timer
The program below contains a timer object definition followed by its start command. Then the program continues executing other statements.
My question is whether TimerFcn will be called exactly after 0.01 sec, or will it wait until the for-loop…

user3521355
- 11
- 1
1
vote
1 answer
Preemptive Kernel Design
I've always thought kernels to be non-preemptable. That is, the kernel code runs to completion, with scheduling taking place only when returning to userspace. I am now curious about the changes need to be made when designing a preemptable kernel.…

Euren
- 19
- 1
1
vote
1 answer
How the scheduling or preemption of Linux kernel thread works?
As I know linux kernel threads do not have their own address space as compare to user space threads/process. Kernel threads do not context switch into user space but kernel threads are schedulable and preemptable. So my question is that if the…

Ritesh
- 91
- 2
- 10
1
vote
2 answers
forced preemption on windows (occurs or not here)
Sorry for my weak english, by preemption I mean forced context
(process) switch applied to my process.
My question is :
If I write and run my own program game in such way that it does 20 millisecond period work, then 5 millisecond sleep, and then…

grunge fightr
- 1,360
- 2
- 19
- 38
1
vote
0 answers
Preventing process context switching on Android
Now this may seem a bit extreme. I am curious if there would be a way to prevent an application's process from being pre-empted by the Android OS. I have time critical testing in C++ which can varying in results depending if the OS gives the context…

mrantifreeze
- 65
- 1
- 7