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

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

Merge "sched: do not set window until sched_clock is fully initialized"

parents 5223a005 c5c90f60
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1973,6 +1973,7 @@ extern u64 sched_clock_cpu(int cpu);


extern void sched_clock_init(void);
extern int sched_clock_initialized(void);

#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
static inline void sched_clock_tick(void)
+2 −1
Original line number Diff line number Diff line
@@ -1900,7 +1900,8 @@ static inline void set_window_start(struct rq *rq)
	int cpu = cpu_of(rq);
	struct rq *sync_rq = cpu_rq(sync_cpu);

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

	if (cpu == sync_cpu) {
+8 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ struct clock_data {

static struct hrtimer sched_clock_timer;
static int irqtime = -1;
static int initialized;

core_param(irqtime, irqtime, int, 0400);

@@ -178,6 +179,11 @@ unsigned long long notrace sched_clock(void)
	return sched_clock_func();
}

int sched_clock_initialized(void)
{
	return initialized;
}

void __init sched_clock_postinit(void)
{
	/*
@@ -196,6 +202,8 @@ void __init sched_clock_postinit(void)
	hrtimer_init(&sched_clock_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	sched_clock_timer.function = sched_clock_poll;
	hrtimer_start(&sched_clock_timer, cd.wrap_kt, HRTIMER_MODE_REL);

	initialized = 1;
}

static int sched_clock_suspend(void)