Linux: Change minimum priority threads from SCHED_IDLE to nice 19 SCHED_BATCH.
authorCon Kolivas <kernel@kolivas.org>
Wed, 6 May 2020 08:03:37 +0000 (18:03 +1000)
committerMarge Bot <eric+marge@anholt.net>
Fri, 8 May 2020 10:14:40 +0000 (10:14 +0000)
commit78d267e6dad9dbcc9e39d7d388075d15e67ba3c3
tree25f65696659a4558c73c350f3150fb5a2da80507
parentf66bf5ba444e95e82401d8f6fd726e5ef17b3db9
Linux: Change minimum priority threads from SCHED_IDLE to nice 19 SCHED_BATCH.

SCHED_IDLE on linux can lead to extraordinarily long periods of no scheduling
leading to starvation of minimum priority threads for such an extended period
that it can eventually lead to GUI stalls. Switch to renicing the threads to
the lowest priority and use the SCHED_BATCH scheduling policy which is a hint
to the scheduler that this is latency insensitive thread instead. This change
has been confirmed to address unexpected GUI related stalls in mesa
applications across a range of different linux kernels.

Signed-off-by: Con Kolivas <kernel@kolivas.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4912>
src/util/u_queue.c