Click here to Skip to main content
15,911,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a very basic doubt with respect to timer tick and multicore(SMP) scheduling in linux. My understanding in uniprocessor with single core is , based on system timer tick(10ms or 100ms)will interrupt the cpu and current running process will be saved and kernel scheduler will take control and will schedule other process if needed otherwise the interrupted process will continue to run.

How this timer tick will play a role in multicore cpu's. Since in /proc/interrupts i see only single timer interrupt is there how this will interrupt all the cores once the timer say 10ms expires? Say for example in 4 core cpus sine all 4 cores will be parallely executing 4 different processs or threads, how each core will be interrupted and rescheduling of other process will takes place in all the cores? If only one core is handling the timer interrupt how processes running on other cores will be interrupted once the time slice has been elapsed? could some one clarify. Thanks!

What I have tried:

Please see the sample output of /proc/interrupts

cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
0: 950901695 0 0 0 IO-APIC-edge timer
1: 13 0 0 0 IO-APIC-edge i8042
6: 96 10989 470 0 IO-APIC-edge floppy
7: 0 0 0 0 IO-APIC-edge parport0
8: 1 0 0 0 IO-APIC-edge rtc
9: 0 0 0 0 IO-APIC-level acpi
12: 109 1787 0 0 IO-APIC-edge i8042
15: 99 84813914 0 0 IO-APIC-edge ide1
51: 17371 0 46689970 0 IO-APIC-level ioc0

Here i can see only one timer interrupt. And only one core is handling the interrupt? So how proceses running on other cores will be interrupted after the time slice expires?
Posted
Updated 20-Mar-16 2:17am

1 solution

Quote:
Since in /proc/interrupts i see only single timer interrupt is there how this will interrupt all the cores once the timer say 10ms expires?
Simple, it don't.
The interrupt don't stop all cores. It launch the kernel scheduler on 1 core and the scheduler is switching tasks on other cores as needed.
 
Share this answer
 
Comments
chandrAN2& 21-Mar-16 22:19pm    
Thanks for your reply. Any books which you recommend to understand on this Multicore(linux) related topics or any articles.
Patrice T 22-Mar-16 1:28am    
Sorry, not my specialty. Try Google

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900