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

Commit 5b42fe0b authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: fix compilation errors with !SCHED_HMP



Accessing p->grp in __migrate_task() and detach_task()
breaks compilation when SCHED_HMP is not defined. Add a
wrapper to check if a task belongs to related thread
group or not.

Change-Id: I558f9a6c7b5f9bd4a21b5021b8eb80bace69bc32
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent c78c31e7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8260,7 +8260,7 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
		goto fail;

	/* No need for rcu_read_lock() here. Protected by pi->lock */
	check_groups = rcu_access_pointer(p->grp) != NULL;
	check_groups = is_task_in_related_thread_group(p);

	/*
	 * If we're not on a rq, the next wake-up will ensure we're
+1 −1
Original line number Diff line number Diff line
@@ -7407,7 +7407,7 @@ static void detach_task(struct task_struct *p, struct lb_env *env)
	p->on_rq = TASK_ON_RQ_MIGRATING;
	double_lock_balance(env->src_rq, env->dst_rq);
	set_task_cpu(p, env->dst_cpu);
	if (rcu_access_pointer(p->grp))
	if (is_task_in_related_thread_group(p))
		env->flags |= LBF_MOVED_RELATED_THREAD_GROUP_TASK;
	double_unlock_balance(env->src_rq, env->dst_rq);
}
+10 −0
Original line number Diff line number Diff line
@@ -1196,6 +1196,11 @@ struct related_thread_group *task_related_thread_group(struct task_struct *p)
	return rcu_dereference(p->grp);
}

static inline int is_task_in_related_thread_group(struct task_struct *p)
{
	return rcu_access_pointer(p->grp) != NULL;
}

#else	/* CONFIG_SCHED_HMP */

struct hmp_sched_stats;
@@ -1250,6 +1255,11 @@ struct related_thread_group *task_related_thread_group(struct task_struct *p)
	return NULL;
}

static inline int is_task_in_related_thread_group(struct task_struct *p)
{
	return 0;
}

static inline u32 task_load(struct task_struct *p) { return 0; }

static inline int update_preferred_cluster(struct related_thread_group *grp,