Hi ,
I need your help to solve below confusion.
1. I know that spin_lock_irqsave, disables premption and local_irq.
2. There is some below piece of kernel code running on Quad core Machine.
spin_lock_irqsave(&lock, flags);
some_large_critical_section //sleep of 5 minutes
//I know there should be as small as possible task in critical section
// treat this as an example only
spin_lock_irqrestore();
3. One of the CPU core tries to execute this code and so acquires the lock.
4. Now, second core is also goes to execute same piece of code and so will keep spinning for lock
Now, the question is
Will EVER second CPU core get chance to execute another task ?
Ever if timeslice is over for the current task ?
What if scheduler code is running on CPU core-3 and sees that
timeslice for
task running on CPU core-2 has expired ?
I guess timeslice expire case is not as same as preemption. Or may be I am terribly wrong.
Please help,
Thanks,
Viral