Mike Galbraith wrote:One slight variation of your scheme would be to measure the average length of the CPU runs that the task does (i.e. how long it runs without voluntarily relinquishing the CPU) and not allowing them to defer the shift to the expired array if this average run length is greater than some specified value. The length of this average for each task shouldn't change with system load. (This is more or less saying that it's ok for a task to stay on the active array provided it's unlikely to delay the switch between the active and expired arrays for very long.)
Average burn time would indeed probably be a better metric, but that would require doing bookkeeping is the fast path.
Most of the infrastructure is already there and the cost of doing the extra bits required to get this metric would be extremely small. The hardest bit would be deciding on the "limit" to be applied when deciding whether to let a supposed interactive task stay on the active array.
By the way, it seems you have your own scheduler versions? If so are you interested in adding them to the collection in PlugSched?