mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
tools/rtla: Replace setting prio with nice for SCHED_OTHER
commit 14f08c976ffe0d2117c6199c32663df1cbc45c65 upstream.
Since the sched_priority for SCHED_OTHER is always 0, it makes no
sence to set it.
Setting nice for SCHED_OTHER seems more meaningful.
Link: https://lkml.kernel.org/r/20240207065142.1753909-1-limingming3@lixiang.com
Cc: stable@vger.kernel.org
Fixes: b1696371d8 ("rtla: Helper functions for rtla")
Signed-off-by: limingming3 <limingming3@lixiang.com>
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d627693e5a
commit
771b74ce92
@@ -478,13 +478,13 @@ int parse_prio(char *arg, struct sched_attr *sched_param)
|
||||
if (prio == INVALID_VAL)
|
||||
return -1;
|
||||
|
||||
if (prio < sched_get_priority_min(SCHED_OTHER))
|
||||
if (prio < MIN_NICE)
|
||||
return -1;
|
||||
if (prio > sched_get_priority_max(SCHED_OTHER))
|
||||
if (prio > MAX_NICE)
|
||||
return -1;
|
||||
|
||||
sched_param->sched_policy = SCHED_OTHER;
|
||||
sched_param->sched_priority = prio;
|
||||
sched_param->sched_nice = prio;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
#define BUFF_U64_STR_SIZE 24
|
||||
#define MAX_PATH 1024
|
||||
#define MAX_NICE 20
|
||||
#define MIN_NICE -19
|
||||
|
||||
#define container_of(ptr, type, member)({ \
|
||||
const typeof(((type *)0)->member) *__mptr = (ptr); \
|
||||
|
||||
Reference in New Issue
Block a user