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

Commit 901863ad authored by Puja Gupta's avatar Puja Gupta Committed by Satya Durga Srinivasu Prabhala
Browse files

sched: Don't update idle_cpus_mask during core isolation



Remove code to update nohz.idle_cpus_mask from
do_isolation_work_cpu_stop(), instead update find_new_ilb() to exclude
isolated_cpus. This is done to fix the issue where cpu is not present
in nohz.idle_cpus_mask but NOHZ_TICK_STOPPED is set. As a result even
if the cpu is unisolated, task won't see the cpu as idle due to
inconsistent nohz.idle_cpus_mask.
Also restore nohz_balance_exit_idle() to upstream version.

Change-Id: Ia0dfa18ca9d55512c461801234de889a173e13da
Signed-off-by: default avatarPuja Gupta <pujag@codeaurora.org>
[markivx: Trivial conflict due to asym code in nohz_needed]
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
[satyap@codeaurora.org: trivial merge conflict resolution]
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 921708ae
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -10176,6 +10176,7 @@ static void nohz_balancer_kick(struct rq *rq)
	struct sched_domain *sd;
	int nr_busy, i, cpu = rq->cpu;
	unsigned int flags = 0;
	cpumask_t cpumask;

	if (unlikely(rq->idle_balance))
		return;
@@ -10190,7 +10191,8 @@ static void nohz_balancer_kick(struct rq *rq)
	 * None are in tickless mode and hence no need for NOHZ idle load
	 * balancing.
	 */
	if (likely(!atomic_read(&nohz.nr_cpus)))
	cpumask_andnot(&cpumask, nohz.idle_cpus_mask, cpu_isolated_mask);
	if (cpumask_empty(&cpumask))
		return;

	if (READ_ONCE(nohz.has_blocked) &&
@@ -10233,7 +10235,7 @@ static void nohz_balancer_kick(struct rq *rq)
	if (sd) {
		for_each_cpu(i, sched_domain_span(sd)) {
			if (i == cpu ||
			    !cpumask_test_cpu(i, nohz.idle_cpus_mask))
			    !cpumask_test_cpu(i, &cpumask))
				continue;

			if (sched_asym_prefer(i, cpu)) {
@@ -10669,6 +10671,14 @@ static __latent_entropy void run_rebalance_domains(struct softirq_action *h)
	enum cpu_idle_type idle = this_rq->idle_balance ?
						CPU_IDLE : CPU_NOT_IDLE;

	/*
	 * Since core isolation doesn't update nohz.idle_cpus_mask, there
	 * is a possibility this nohz kicked cpu could be isolated. Hence
	 * return if the cpu is isolated.
	 */
	if (cpu_isolated(this_rq->cpu))
		return;

	/*
	 * If this CPU has a pending nohz_balance_kick, then do the
	 * balancing on behalf of the other idle CPUs whose ticks are
+0 −1
Original line number Diff line number Diff line
@@ -1750,7 +1750,6 @@ extern const struct sched_class idle_sched_class;
extern void update_group_capacity(struct sched_domain *sd, int cpu);

extern void trigger_load_balance(struct rq *rq);
extern void nohz_balance_clear_nohz_mask(int cpu);

extern void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_mask);