4 ms·
> Appendix: How impatient are interrupts? > I did also play around with this stuff on arm64 a bit, and I was wondering: At what points do interrupts actually g
by toast0 5y ago
> Appendix: How impatient are interrupts?
> I did also play around with this stuff on arm64 a bit, and I was wondering: At what points do interrupts actually get delivered? Does an incoming interrupt force the CPU to drop everything immediately, or do inflight operations finish first? This gets particularly interesting on phones that contain two or three different types of CPUs mixed together.
I think most CPUs won't interrupt an instruction, the interrupt handling will start when the current instruction finishes; faults would be different, and detailed timing is important: pipelining might mean you need the interrupt to come N cycles before the end of the instruction to trigger. Some processors have instructions that delay interrupt handling: for example, on x86, if you set the stack segment, the next instruction will execute, even if an interrupt came in (unless there was a delayed interrupt from the previous instruction), this is intended so that you can set the stack pointer on the new segment, but it was presumably easier to unconditionally delay than to delay only if the next instruction matches the pattern.
- atq2119 5y agoThe interesting question is: what happens in modern out of order cores? There can be hundreds of instructions in flight, including long dependency chains of loads. It's probably not too difficult (using cache misses) to construct a scenario where completing the currently inflight instructions might take a few microseconds. Exactly where interrupts are inserted there matters.