←back to thread

218 points chmaynard | 1 comments | | HN request time: 0s | source
Show context
amelius ◴[] No.41886918[source]
> A higher level of preemption enables the system to respond more quickly to events; whether an event is the movement of a mouse or an "imminent meltdown" signal from a nuclear reactor, faster response tends to be more gratifying. But a higher level of preemption can hurt the overall throughput of the system; workloads with a lot of long-running, CPU-intensive tasks tend to benefit from being disturbed as little as possible. More frequent preemption can also lead to higher lock contention. That is why the different modes exist; the optimal preemption mode will vary for different workloads.

Why isn't the level of preemption a property of the specific event, rather than of some global mode? Some events need to be handled with less latency than others.

replies(7): >>41887042 #>>41887125 #>>41887151 #>>41887348 #>>41887690 #>>41888316 #>>41889749 #
btilly ◴[] No.41887151[source]
You need CPU time to evaluate the priority of the event. This can't happen until after you've interrupted whatever process is currently on the CPU. And so the highest possible priority an event can happen is limited by how short a time slice a program gets before it has to go through a context switch.

To stand ready to reliably respond to any one kind of event with low latency, every CPU intensive program must suffer a performance penalty all the time. And this is true no matter how rare those events may be.

replies(3): >>41887336 #>>41887387 #>>41887493 #
zeusk ◴[] No.41887336[source]
That is not true of quite a few multi-core systems. A lot of them, especially those that really care about performance will strap all interrupts to core 0 and only interrupt other cores via IPI when necessary.
replies(2): >>41888253 #>>41889577 #
btilly ◴[] No.41889577[source]
This strategy minimizes the impact by making one core less necessary. But it does not eliminate it.
replies(1): >>41890033 #
1. zeusk ◴[] No.41890033[source]
Sure which is a perfectly fine trade off; almost all recent CPUs have enough multicore capacity that make this trade favorable.