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

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

Merge "sched: fix misalignment between requested and actual windows"

parents 88efb4d9 7ebd479a
Loading
Loading
Loading
Loading
+10 −3
Original line number Original line Diff line number Diff line
@@ -1596,18 +1596,23 @@ static inline void mark_task_starting(struct task_struct *p)
	p->ravg.flags |= PREV_WINDOW_CONTRIB;
	p->ravg.flags |= PREV_WINDOW_CONTRIB;
}
}


static int update_alignment;

static inline void set_window_start(struct rq *rq)
static inline void set_window_start(struct rq *rq)
{
{
	int cpu = cpu_of(rq);
	int cpu = cpu_of(rq);
	struct rq *sync_rq = cpu_rq(sync_cpu);
	struct rq *sync_rq = cpu_rq(sync_cpu);


	if (cpu == sync_cpu && !update_alignment) {
		sched_init_jiffy = get_jiffies_64();
		sched_clock_at_init_jiffy = sched_clock();
	}

	if (rq->window_start || !sched_enable_hmp)
	if (rq->window_start || !sched_enable_hmp)
		return;
		return;


	if (cpu == sync_cpu) {
	if (cpu == sync_cpu) {
		rq->window_start = sched_clock();
		rq->window_start = sched_clock_at_init_jiffy;
		sched_init_jiffy = get_jiffies_64();
		sched_clock_at_init_jiffy = rq->window_start;
	} else {
	} else {
		raw_spin_unlock(&rq->lock);
		raw_spin_unlock(&rq->lock);
		double_rq_lock(rq, sync_rq);
		double_rq_lock(rq, sync_rq);
@@ -1719,6 +1724,8 @@ int sched_set_window(u64 window_start, unsigned int window_size)
		 (window_size * TICK_NSEC <  MIN_SCHED_RAVG_WINDOW))
		 (window_size * TICK_NSEC <  MIN_SCHED_RAVG_WINDOW))
			return -EINVAL;
			return -EINVAL;


	update_alignment = 1;

	local_irq_save(flags);
	local_irq_save(flags);


	now = get_jiffies_64();
	now = get_jiffies_64();