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

Commit b95016e2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched/deadline: Add basic HMP extensions"

parents a59b8ea0 7560dad2
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1682,7 +1682,13 @@ static void update_history(struct rq *rq, struct task_struct *p,
	}

	p->ravg.sum = 0;
	if (p->on_rq)

	/*
	 * A throttled deadline sched class task gets dequeued without
	 * changing p->on_rq. Since the dequeue decrements hmp stats
	 * avoid decrementing it here again.
	 */
	if (p->on_rq && (!task_has_dl_policy(p) || !p->dl.dl_throttled))
		p->sched_class->dec_hmp_sched_stats(rq, p);

	avg = div64_u64(sum, sched_ravg_hist_size);
@@ -1698,7 +1704,7 @@ static void update_history(struct rq *rq, struct task_struct *p,

	p->ravg.demand = demand;

	if (p->on_rq)
	if (p->on_rq && (!task_has_dl_policy(p) || !p->dl.dl_throttled))
		p->sched_class->inc_hmp_sched_stats(rq, p);

done:
+30 −0
Original line number Diff line number Diff line
@@ -725,6 +725,30 @@ static inline void dec_dl_deadline(struct dl_rq *dl_rq, u64 deadline) {}

#endif /* CONFIG_SMP */

#ifdef CONFIG_SCHED_HMP

static void
inc_hmp_sched_stats_dl(struct rq *rq, struct task_struct *p)
{
	inc_cumulative_runnable_avg(&rq->hmp_stats, p);
}

static void
dec_hmp_sched_stats_dl(struct rq *rq, struct task_struct *p)
{
	dec_cumulative_runnable_avg(&rq->hmp_stats, p);
}

#else	/* CONFIG_SCHED_HMP */

static inline void
inc_hmp_sched_stats_dl(struct rq *rq, struct task_struct *p) { }

static inline void
dec_hmp_sched_stats_dl(struct rq *rq, struct task_struct *p) { }

#endif	/* CONFIG_SCHED_HMP */

static inline
void inc_dl_tasks(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq)
{
@@ -734,6 +758,7 @@ void inc_dl_tasks(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq)
	WARN_ON(!dl_prio(prio));
	dl_rq->dl_nr_running++;
	add_nr_running(rq_of_dl_rq(dl_rq), 1);
	inc_hmp_sched_stats_dl(rq_of_dl_rq(dl_rq), dl_task_of(dl_se));

	inc_dl_deadline(dl_rq, deadline);
	inc_dl_migration(dl_se, dl_rq);
@@ -748,6 +773,7 @@ void dec_dl_tasks(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq)
	WARN_ON(!dl_rq->dl_nr_running);
	dl_rq->dl_nr_running--;
	sub_nr_running(rq_of_dl_rq(dl_rq), 1);
	dec_hmp_sched_stats_dl(rq_of_dl_rq(dl_rq), dl_task_of(dl_se));

	dec_dl_deadline(dl_rq, dl_se->deadline);
	dec_dl_migration(dl_se, dl_rq);
@@ -1686,4 +1712,8 @@ const struct sched_class dl_sched_class = {
	.switched_to		= switched_to_dl,

	.update_curr		= update_curr_dl,
#ifdef CONFIG_SCHED_HMP
	.inc_hmp_sched_stats	= inc_hmp_sched_stats_dl,
	.dec_hmp_sched_stats	= dec_hmp_sched_stats_dl,
#endif
};