Questions tagged [preemption]

131 questions
183
votes
5 answers

What is an uninterruptible process?

Sometimes whenever I write a program in Linux and it crashes due to a bug of some sort, it will become an uninterruptible process and continue running forever until I restart my computer (even if I log out). My questions are: What causes a process…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
67
votes
5 answers

What is preemption / What is a preemtible kernel? What is it good for?

Explained in your own words, what is preemption and what does it mean to a (linux) kernel? What are advantages and disadvantages in having a preemptible kernel?
Markus
  • 1,772
  • 1
  • 12
  • 20
36
votes
9 answers

What does it mean to say "linux kernel is preemptive"?

I read that Linux kernel is preemptive, which is different from most Unix kernels. So, what does it really mean for a kernal to be preemptive? Some analogies or examples would be better than pure theoretical explanation. ADD 1 -- 11:00 AM…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
17
votes
4 answers

Why disabling interrupts disables kernel preemption and how spin lock disables preemption

I am reading Linux Kernel Development recently, and I have a few questions related to disabling preemption. In the "Interrupt Control" section of chapter 7, it says: Moreover, disabling interrupts also disables kernel preemption. I also read from…
feirainy
  • 497
  • 1
  • 4
  • 11
12
votes
1 answer

Linux Kernel Preemption during spin_lock and mutex_lock

When a process in the kernel space is holding a spin_lock, the process cannot be preempted due to any of the following conditions : When the time-slice of the process gets exhausted When a high priority process becomes runnable When an interrupt…
nitin_cherian
  • 6,405
  • 21
  • 76
  • 127
11
votes
1 answer

What is the exact definition of 'process preemption'?

Wikipedia says: In computing, preemption is the act of temporarily interrupting a task being carried out by a computer system, without requiring its cooperation, and with the intention of resuming the task at a later time. Other sources…
LordFenerSSJ
  • 195
  • 1
  • 2
  • 10
11
votes
1 answer

Understanding link between CONFIG_SMP, Spinlocks and CONFIG_PREEMPT in latest (3.0.0 and above) Linux kernel

To give you full context my discussion begun with an observation that I am running a SMP linux (3.0.1-rt11) on ARM cortex A8 based SoC which is a uniprocessor. I was curious to know if there will be any performance advantage by disabling SMP…
Satpal Parmar
  • 361
  • 3
  • 12
10
votes
2 answers

FreeRTOS: Why to call taskYIELD_FROM_ISR() method within the isrHandler

I try to understand why the user has to call the taskYIELD_FROM_ISR() method and why it isn't automatically called by the RTOS within the xStreamBufferSendFromISR method. My question refers to the FreeRTOS_Manual p. 369. /* A stream buffer that has…
PascalS
  • 975
  • 1
  • 16
  • 40
10
votes
1 answer

Can preemptive multitasking of native code be implemented in user space on Linux?

I'm wondering if it's possible to implement preemptive multitasking of native code within a single process in user space on Linux. (That is, externally pause some running native code, save the context, swap in a different context, and resume…
Praxeolitic
  • 22,455
  • 16
  • 75
  • 126
10
votes
4 answers

How does a VxWorks scheduler get executed?

Would like to know how the scheduler gets called so that it can switch tasks. As in even if its preemptive scheduling or round robin scheduling - the scheduler should come in to picture to do any kind of task switching. Supposing a low priority task…
Ashwin
  • 393
  • 1
  • 4
  • 10
9
votes
2 answers

How does preemption on x86 architecture work?

I'm struggling to understand one thing about preemption. Citing Wikipedia: In computing, preemption (more correctly pre-emption) is the act of temporarily interrupting a task being carried out by a computer system, without requiring its…
rubix_addict
  • 1,811
  • 13
  • 27
7
votes
2 answers

What's the difference between Priority Class and QoS in Kubernetes?

In Kubernetes we can set the priority of a pod to Guaranteed, Burstable or Best-Effort base on requests and limits. Another method to assign priorities in Kubernetes is to define a priorityClass object and assign a priorityClassName to a pod. How…
6
votes
2 answers

C code - memory access / preemption

I have written a piece of code wherein a data: unsigned char buf[4096]; // data in chunks of size 4k unsigned counter[256]; I am adding up the i/p data for every 3 contiguous bytes and storing the ans. ex: temp[4096]; temp[0] = buf[0] + buf[1] +…
randy7
  • 135
  • 1
  • 6
6
votes
4 answers

Why linux disables kernel preemption after the kernel code holds a spinlock?

I am new to Linux and am reading Linux device drivers book by Rubini & Corbet. I am confused at one statement related to spinlocks; the book states If a nonpreemptive uniprocessor system ever went into a spin on a lock, it would spin forever; no…
Vishal Gandhi
  • 85
  • 1
  • 4
5
votes
2 answers

Are there any difference between "kernel preemption" and "interrupt"?

I just reading an article which says: Reasons to control the interrupt system generally boil down to needing to provide synchronization. By disabling interrupts, you can guarantee that an interrupt handler will not preempt your current code.…
sliter
  • 1,063
  • 1
  • 17
  • 34
1
2 3
8 9