Hi all:<div><br></div><div>I want to know whether inter-processor interrupt at X86 is reliable and its response time is bounded, such as <em style="font-weight:bold;font-style:normal;font-family:arial,sans-serif;line-height:16px;background-color:rgb(255,255,255)">smp_send_reschedule and resched_cpu. </em></div>
<div><br></div><div><font face="arial, sans-serif"><span style="line-height:16px">For example, we have two cores and ticked-based scheduler, e.g., P-Fair, does scheduling at each tick. Here, we assume that the last cpu, which arrives at each tick, is responsible to call the scheduler, e.g., CPU1 in this example. When CPU0 arrives at t, it finds out it is not the last guy and it has nothing to do. So, the kernel may iterate next sched _class and pick up a process to run, e.g., init process and return to user space. When CPU1 arrives at t, it does some calculations, select two processes and put them on the top active queues on two CPUs. Since CPU1 is in kernel mode, I set current need_resched to force it call schedule(). The question is the expected context switch at CPU0 is </span></font><span style="font-family:arial,sans-serif;line-height:16px">sometimes</span><span style="font-family:arial,sans-serif;line-height:16px"> </span><font face="arial, sans-serif"><span style="line-height:16px">at (t+1) instead of at t(r), even though CPU1 sends an IPI to CPU0 at t' by using </span></font><em style="font-weight:bold;font-style:normal;font-family:arial,sans-serif;line-height:16px;background-color:rgb(255,255,255)">resched_cpu(0)</em><font face="arial, sans-serif"><span style="line-height:16px">. Since CPU0 may be in user space at t', how it responds a IPI in x86 architecture and its responds time( t(r) - t' ) is bounded or not. Based on my tracing info, the context switch at CPU0, which is supposed to occur at t(r), occurs at t+1. I guess it is possible CPU0 automatically call schedule() when it returns back to user space from a tick-interrupt handler (t+1). At t', is that possible CPU0 ignore this IPI from CPU1 or it delays this IPI and response it at unpredictable time? </span></font></div>
<div><span style="line-height:16px;font-family:arial,sans-serif"> </span></div><div><font face="arial, sans-serif"><span style="line-height:16px"><br></span></font></div><div><font face="arial, sans-serif"><span style="line-height:16px">CPU0 |t| t' t(r) |t+1|</span></font></div>
<div><font face="arial, sans-serif"><span style="line-height:16px"> /|\</span></font></div><div><font face="arial, sans-serif"><span style="line-height:16px"> |</span></font></div>
<div><font face="arial, sans-serif"><span style="line-height:16px"> | </span></font></div><div><font face="arial, sans-serif"><span style="line-height:16px">CPU1 |t| | |t+1|</span></font></div>
<div><font face="arial, sans-serif"><span style="line-height:16px"> ready</span></font></div><div><font face="arial, sans-serif"><span style="line-height:16px"><br></span></font></div><div><font face="arial, sans-serif"><span style="line-height:16px"><br>
</span></font></div><div><font face="arial, sans-serif"><span style="line-height:16px">Thanks.</span></font></div>