Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Rescheduling interrupts (RES)? What causes it? How is it handled in Linux kernel?

What is the difference between "RES: Rescheduling interrupts" and "LOC: Local timer interrupts"? What is responsible to fire the RES interrupt? Is LOC same as the general timer interrupt that is generated by the Timer h/w in the processor?

Also, please give some clarity on what part of the scheduler is invoked during the timer interrupt and the RES interrupt? How it happens in Linux kernel?

Thanks in advance.

like image 651
user31986 Avatar asked Aug 23 '13 07:08

user31986


People also ask

What are rescheduling interrupts?

Rescheduling interrupts are the Linux kernel's way to notify another CPU-core to schedule a thread. On SMP systems, this is done by the scheduler to spread the load across multiple CPU-cores. The scheduler tries to spread processor activity across as many cores as possible.

How interrupts are handled by the Linux kernel?

An interrupt is simply a signal that the hardware can send when it wants the processor's attention. Linux handles interrupts in much the same way that it handles signals in user space. For the most part, a driver need only register a handler for its device's interrupts, and handle them properly when they arrive.

How interrupts and exceptions are handled in Linux?

After the interrupt or exception is processed, the corresponding handler must relinquish control to the interrupted process by issuing the iret instruction, which forces the control unit to: Load the cs , eip , and eflags registers with the values saved on the stack.

What are the three types of interrupts handled by operating system kernels?

Moreover, the keyboard is not the only component that can cause interrupts. In general, there are three types of events that can cause the CPU to interrupt: Hardware interrupts, software interrupts, and exceptions. Before getting into the different types of interrupts, I'll define some terms.


1 Answers

Rescheduling interrupts are the Linux kernel's way to notify another CPU-core to schedule a thread.
On SMP systems, this is done by the scheduler to spread the load across multiple CPU-cores.

The scheduler tries to spread processor activity across as many cores as possible. The general rule of thumb is that it is preferable to have as many processes running on all the cores in lower power (lower clock frequencies) rather than have one core really busy running at full speed while other cores are sleeping.

Rescheduling interrupts are implemented using Inter-Processor Interrupts (IPI). For more details checkout this article on Rescheduling Interrupts on Linux.


Local timer interrupts are raised by the APIC for a specific CPU-core. Only that CPU-core receives the interrupts and handles them. For a brief description of its various advantages, checkout this answer.

like image 155
TheCodeArtist Avatar answered Nov 12 '22 07:11

TheCodeArtist