Re: [RESEND PATCH] sched/syscalls: Allow setting niceness using sched_param struct
From: Peter Zijlstra
Date: Mon Sep 16 2024 - 07:13:38 EST
On Mon, Sep 16, 2024 at 05:08:49AM +0000, Michael Pratt wrote:
> From userspace, spawning a new process with, for example,
> posix_spawn(), only allows the user to work with
> the scheduling priority value defined by POSIX
> in the sched_param struct.
>
> However, sched_setparam() and similar syscalls lead to
> __sched_setscheduler() which rejects any new value
> for the priority other than 0 for non-RT schedule classes,
> a behavior kept since Linux 2.6 or earlier.
Right, and the current behaviour is entirely in-line with the POSIX
specs.
I realize this might be a pain, but why should be change this spec
conforming and very long standing behaviour?
Worse, you're proposing a nice ABI that is entirely different from the
normal [-20,19] range.
Why do you feel this is the best way forward? Would not adding
POSIX_SPAWN_SETSCHEDATTR be a more future proof mechanism?