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

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

Merge "sched/fair: Optimize the tick path active migration"

parents b50f6322 939013b8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -12587,6 +12587,7 @@ void check_for_migration(struct rq *rq, struct task_struct *p)
	int active_balance;
	int new_cpu = -1;
	int prev_cpu = task_cpu(p);
	int ret;

	if (rq->misfit_task_load) {
		if (rq->curr->state != TASK_RUNNING ||
@@ -12606,9 +12607,13 @@ void check_for_migration(struct rq *rq, struct task_struct *p)
			if (active_balance) {
				mark_reserved(new_cpu);
				raw_spin_unlock(&migration_lock);
				stop_one_cpu_nowait(prev_cpu,
				ret = stop_one_cpu_nowait(prev_cpu,
					active_load_balance_cpu_stop, rq,
					&rq->active_balance_work);
				if (!ret)
					clear_reserved(new_cpu);
				else
					wake_up_if_idle(new_cpu);
				return;
			}
		} else {
+4 −2
Original line number Diff line number Diff line
@@ -60,7 +60,8 @@ static noinline int __cpuidle cpu_idle_poll(void)
	stop_critical_timings();

	while (!tif_need_resched() &&
		(cpu_idle_force_poll || tick_check_broadcast_expired()))
		(cpu_idle_force_poll || tick_check_broadcast_expired() ||
		is_reserved(smp_processor_id())))
		cpu_relax();
	start_critical_timings();
	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
@@ -256,7 +257,8 @@ static void do_idle(void)
		 * broadcast device expired for us, we don't want to go deep
		 * idle as we know that the IPI is going to arrive right away.
		 */
		if (cpu_idle_force_poll || tick_check_broadcast_expired()) {
		if (cpu_idle_force_poll || tick_check_broadcast_expired() ||
				is_reserved(smp_processor_id())) {
			tick_nohz_idle_restart_tick();
			cpu_idle_poll();
		} else {