core/exec-invoke: call setpriority() after sched_setattr()
authorIvan Shapovalov <intelfx@intelfx.name>
Wed, 7 Aug 2024 08:02:45 +0000 (10:02 +0200)
committerLuca Boccassi <bluca@debian.org>
Thu, 15 Aug 2024 13:04:41 +0000 (14:04 +0100)
commitb628d4dfa61234d28ffaa648ec09c5e9972f832a
treec464c67a54a666714a566042d9551a1f0ef82ed6
parent6f57f9b8aa4084179c82c98ec654315a63532fe9
core/exec-invoke: call setpriority() after sched_setattr()

The nice value is part of struct sched_attr, and consequently invoking
sched_setattr() after setpriority() would clobber the nice value with
the default (as we are not setting it in struct sched_attr).

It would be best to combine both calls, but for now simply invoke
setpriority() after sched_setattr() to make sure Nice= remains effective
when used together with CPUSchedulingPolicy=.

(cherry picked from commit 711a157738b3dcd29a5ebc8f498eb46bfac59652)
src/core/exec-invoke.c