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

Commit 1c65a072 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: Improve the scheduler"

parents 0ca506d2 4dfac456
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -783,6 +783,10 @@ static inline void dequeue_task(struct rq *rq, struct task_struct *p, int flags)
		sched_info_dequeued(rq, p);

	p->sched_class->dequeue_task(rq, p, flags);
#ifdef CONFIG_SCHED_WALT
	if (p == rq->ed_task)
		early_detection_notify(rq, ktime_get_ns());
#endif
	trace_sched_enq_deq_task(p, 0, cpumask_bits(&p->cpus_allowed)[0]);
}

+8 −1
Original line number Diff line number Diff line
@@ -313,6 +313,11 @@ void clear_ed_task(struct task_struct *p, struct rq *rq)
		rq->ed_task = NULL;
}

static inline bool is_ed_task(struct task_struct *p, u64 wallclock)
{
	return (wallclock - p->last_wake_ts >= EARLY_DETECTION_DURATION);
}

bool early_detection_notify(struct rq *rq, u64 wallclock)
{
	struct task_struct *p;
@@ -327,7 +332,7 @@ bool early_detection_notify(struct rq *rq, u64 wallclock)
		if (!loop_max)
			break;

		if (wallclock - p->last_wake_ts >= EARLY_DETECTION_DURATION) {
		if (is_ed_task(p, wallclock)) {
			rq->ed_task = p;
			return 1;
		}
@@ -828,6 +833,8 @@ void fixup_busy_time(struct task_struct *p, int new_cpu)
	if (p == src_rq->ed_task) {
		src_rq->ed_task = NULL;
		dest_rq->ed_task = p;
	} else if (is_ed_task(p, wallclock)) {
		dest_rq->ed_task = p;
	}

done: