Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cca5e2f4 authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

cpufreq: schedutil: Move worker threads back to Real Time



As there are no other DEADLINE class tasks in system, move schedutil
worker threads back to Real Time (SCHED_FIFO) just like previous Kernels.

Change-Id: I1a31bac548493d3c8a22b69b3652c09b1bab4dcd
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent a9f61565
Loading
Loading
Loading
Loading
+3 −16
Original line number Diff line number Diff line
@@ -991,20 +991,7 @@ 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_attr attr = {
		.size		= sizeof(struct sched_attr),
		.sched_policy	= SCHED_DEADLINE,
		.sched_flags	= SCHED_FLAG_SUGOV,
		.sched_nice	= 0,
		.sched_priority	= 0,
		/*
		 * Fake (unused) bandwidth; workaround to "fix"
		 * priority inheritance.
		 */
		.sched_runtime	=  1000000,
		.sched_deadline = 10000000,
		.sched_period	= 10000000,
	};
	struct sched_param param = { .sched_priority = MAX_USER_RT_PRIO / 2 };
	struct cpufreq_policy *policy = sg_policy->policy;
	int ret;

@@ -1022,10 +1009,10 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
		return PTR_ERR(thread);
	}

	ret = sched_setattr_nocheck(thread, &attr);
	ret = sched_setscheduler_nocheck(thread, SCHED_FIFO, &param);
	if (ret) {
		kthread_stop(thread);
		pr_warn("%s: failed to set SCHED_DEADLINE\n", __func__);
		pr_warn("%s: failed to set SCHED_FIFO\n", __func__);
		return ret;
	}