lkml.org 
[lkml]   [2017]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v1 3/8] sched/cpufreq_schedutil: make worker kthread be SCHED_DEADLINE
On 05-07-17, 09:59, Juri Lelli wrote:
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index f2494d1fc8ef..ba6227625f24 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -424,7 +424,16 @@ static void sugov_policy_free(struct sugov_policy *sg_policy)
> static int sugov_kthread_create(struct sugov_policy *sg_policy)
> {
> struct task_struct *thread;
> - struct sched_param param = { .sched_priority = MAX_USER_RT_PRIO / 2 };
> + struct sched_attr attr = {
> + .size = sizeof(struct sched_attr),
> + .sched_policy = SCHED_DEADLINE,
> + .sched_flags = SCHED_FLAG_SPECIAL,
> + .sched_nice = 0,
> + .sched_priority = 0,
> + .sched_runtime = 0,
> + .sched_deadline = 0,
> + .sched_period = 0,
> + };
> struct cpufreq_policy *policy = sg_policy->policy;
> int ret;
>
> @@ -442,10 +451,10 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
> return PTR_ERR(thread);
> }
>
> - ret = sched_setscheduler_nocheck(thread, SCHED_FIFO, &param);
> + ret = sched_setattr_nocheck(thread, &attr);
> if (ret) {
> kthread_stop(thread);
> - pr_warn("%s: failed to set SCHED_FIFO\n", __func__);
> + pr_warn("%s: failed to set SCHED_DEADLINE\n", __func__);
> return ret;
> }

Acked-by: Viresh Kumar <viresh.kumar@linaro.org> (schedutil)

--
viresh

\
 
 \ /
  Last update: 2017-07-07 09:22    [W:0.280 / U:0.572 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site