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

Commit 7bd4f1b7 authored by Jeevan Shriram's avatar Jeevan Shriram Committed by Satya Durga Srinivasu Prabhala
Browse files

sched: use wake_q length only when WALT is enabled



Upstream commit aa8b37ba ("FROMLIST: sched/fair: Use wake_q
length as a hint for wake_wide") that is being carried in msm-5.4
kernel caused CRC checks failures when GKI boot image is used for
verification as the commit adds extra argument to select_task_rq().
Fix this issue by wrapping extra argument under CONFIG_SCHED_WALT.

Change-Id: Ie41a36a334efbcd2030f7c3caee31883ee84718e
Signed-off-by: default avatarJeevan Shriram <jshriram@codeaurora.org>
parent 3ddd3c6e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2187,15 +2187,19 @@ static int select_fallback_rq(int cpu, struct task_struct *p, bool allow_iso)
 */
static inline
int select_task_rq(struct task_struct *p, int cpu, int sd_flags, int wake_flags,
		  int sibling_count_hint)
		  __attribute__((unused))int sibling_count_hint)
{
	bool allow_isolated = (p->flags & PF_KTHREAD);

	lockdep_assert_held(&p->pi_lock);

	if (p->nr_cpus_allowed > 1)
#ifdef CONFIG_SCHED_WALT
		cpu = p->sched_class->select_task_rq(p, cpu, sd_flags, wake_flags,
						     sibling_count_hint);
#else
		cpu = p->sched_class->select_task_rq(p, cpu, sd_flags, wake_flags);
#endif
	else
		cpu = cpumask_any(p->cpus_ptr);

@@ -3624,7 +3628,11 @@ void sched_exec(void)
		return;

	raw_spin_lock_irqsave(&p->pi_lock, flags);
#ifdef CONFIG_SCHED_WALT
	dest_cpu = p->sched_class->select_task_rq(p, task_cpu(p), SD_BALANCE_EXEC, 0, 1);
#else
	dest_cpu = p->sched_class->select_task_rq(p, task_cpu(p), SD_BALANCE_EXEC, 0);
#endif
	if (dest_cpu == smp_processor_id())
		goto unlock;

+4 −0
Original line number Diff line number Diff line
@@ -1602,8 +1602,12 @@ static void yield_task_dl(struct rq *rq)
static int find_later_rq(struct task_struct *task);

static int
#ifdef CONFIG_SCHED_WALT
select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags,
		  int sibling_count_hint)
#else
select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
#endif
{
	struct task_struct *curr;
	struct rq *rq;
+17 −0
Original line number Diff line number Diff line
@@ -7218,8 +7218,12 @@ int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu,
 * preempt must be disabled.
 */
static int
#ifdef CONFIG_SCHED_WALT
select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags,
		    int sibling_count_hint)
#else
select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags)
#endif
{
	struct sched_domain *tmp, *sd = NULL;
	int cpu = smp_processor_id();
@@ -7229,8 +7233,12 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f

	if (sched_energy_enabled()) {
		rcu_read_lock();
#ifdef CONFIG_SCHED_WALT
		new_cpu = find_energy_efficient_cpu(p, prev_cpu, sync,
						    sibling_count_hint);
#else
		new_cpu = find_energy_efficient_cpu(p, prev_cpu, sync, 1);
#endif
		if (unlikely(new_cpu < 0))
			new_cpu = prev_cpu;
		rcu_read_unlock();
@@ -7241,15 +7249,24 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
		record_wakee(p);

		if (sched_energy_enabled()) {
#ifdef CONFIG_SCHED_WALT
			new_cpu = find_energy_efficient_cpu(p, prev_cpu, sync,
							    sibling_count_hint);
#else
			new_cpu = find_energy_efficient_cpu(p, prev_cpu, sync, 1);
#endif
			if (new_cpu >= 0)
				return new_cpu;
			new_cpu = prev_cpu;
		}

#ifdef CONFIG_SCHED_WALT
		want_affine = !wake_wide(p, sibling_count_hint) &&
			      cpumask_test_cpu(cpu, p->cpus_ptr);
#else
		want_affine = !wake_wide(p, 1) &&
			      cpumask_test_cpu(cpu, p->cpus_ptr);
#endif
	}

	rcu_read_lock();
+4 −0
Original line number Diff line number Diff line
@@ -364,8 +364,12 @@ void cpu_startup_entry(enum cpuhp_state state)

#ifdef CONFIG_SMP
static int
#ifdef CONFIG_SCHED_WALT
select_task_rq_idle(struct task_struct *p, int cpu, int sd_flag, int flags,
		    int sibling_count_hint)
#else
select_task_rq_idle(struct task_struct *p, int cpu, int sd_flag, int flags)
#endif
{
	return task_cpu(p); /* IDLE tasks as never migrated */
}
+4 −0
Original line number Diff line number Diff line
@@ -1521,8 +1521,12 @@ task_may_not_preempt(struct task_struct *task, int cpu)
}

static int
#ifdef CONFIG_SCHED_WALT
select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags,
		 int sibling_count_hint)
#else
select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags)
#endif
{
	struct task_struct *curr;
	struct rq *rq;
Loading