diff options
| author | Vincent Guittot <vincent.guittot@linaro.org> | 2025-01-11 10:14:09 +0100 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2025-01-13 14:10:22 +0100 |
| commit | 2cf9ac40073ddb6a70dd5ef94f1cf45501b696ed (patch) | |
| tree | a1c4667937958bfe730f48ba1298c03eb6cdbaa7 /kernel/sched/syscalls.c | |
| parent | sched: Fix race between yield_to() and try_to_wake_up() (diff) | |
| download | linux-2cf9ac40073ddb6a70dd5ef94f1cf45501b696ed.tar.gz linux-2cf9ac40073ddb6a70dd5ef94f1cf45501b696ed.zip | |
sched/fair: Encapsulate set custom slice in a __setparam_fair() function
Similarly to dl, create a __setparam_fair() function to set parameters
related to fair class and move it in the fair.c file.
No functional changes expected
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Phil Auld <pauld@redhat.com>
Link: https://lore.kernel.org/r/20250110144656.484601-1-vincent.guittot@linaro.org
Diffstat (limited to 'kernel/sched/syscalls.c')
| -rw-r--r-- | kernel/sched/syscalls.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c index 943406c4ee86..149e2c8036d3 100644 --- a/kernel/sched/syscalls.c +++ b/kernel/sched/syscalls.c @@ -300,20 +300,10 @@ static void __setscheduler_params(struct task_struct *p, p->policy = policy; - if (dl_policy(policy)) { + if (dl_policy(policy)) __setparam_dl(p, attr); - } else if (fair_policy(policy)) { - p->static_prio = NICE_TO_PRIO(attr->sched_nice); - if (attr->sched_runtime) { - p->se.custom_slice = 1; - p->se.slice = clamp_t(u64, attr->sched_runtime, - NSEC_PER_MSEC/10, /* HZ=1000 * 10 */ - NSEC_PER_MSEC*100); /* HZ=100 / 10 */ - } else { - p->se.custom_slice = 0; - p->se.slice = sysctl_sched_base_slice; - } - } + else if (fair_policy(policy)) + __setparam_fair(p, attr); /* rt-policy tasks do not have a timerslack */ if (rt_or_dl_task_policy(p)) { |
