[PATCH RESEND 2 0/1] sched/syscalls: Allow setting niceness using sched_param struct

Michael C. Pratt
2024-11-11T07:02:28Z

Dear Linus and devs,

I don't want to take much of your time, this is a very simple patch.
I am concerned that it is being ignored without a good reason.
This is my third time sending it, the first being within the merge window
for 6.12 which I was hoping this would be included in.

This patch is a short and safe way to expand the current ABI regarding
the ability to set a process priority at the moment of process creation.
For example, there currently is no way to set a process priority
for normal processes made with the posix_spawn*() family of functions.

Since it is unsafe to directly change the static priority
for non-RT processes, the niceness value is modified instead
in order to result in the same effective priority as what is requested.
Any requested priority outside the effect of the niceness range is invalid.

Peter had responded with a concern that the value passed in
to sched_priority should be the niceness value itself in this case,
however, for the functions used to query the accepted range,
sched_get_priority_max() and sched_get_priority_min(),
as defined by POSIX, a negative value indicates failure.
This would also be inconsistent with other usage of the value.
Therefore, I believe this remains to be the correct way to implement it.
I replied as such and got no reply back.

I still think I have a good idea here, but for whatever reason,
this being in my opinion one of the simplest and most sensible patches
that I have tried to send so far, is being met with
mostly dead silence or misunderstanding of the situation...
So I am opening up the conversation to a wider audience.

Thanks for reading