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

Commit cea0f8aa authored by Maria Yu's avatar Maria Yu
Browse files

sched: walt: use_cycle_counter check before rq lock held



use_cycle_counter is not necessary need held
rq lock, so check use_cycle_counter before rq
lock in sched_account_irqstart to eliminate
unnecessary rq lock and unlock.

Change-Id: Ie0f3d87b746dffbb418dd5d8b2e1892adac2ba16
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
parent eddc683b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -363,6 +363,13 @@ void sched_account_irqstart(int cpu, struct task_struct *curr, u64 wallclock)
	if (!rq->window_start || sched_disable_window_stats)
		return;

	/*
	 * We don’t have to note down an irqstart event when cycle
	 * counter is not used.
	 */
	if (!use_cycle_counter)
		return;

	if (is_idle_task(curr)) {
		/* We're here without rq->lock held, IRQ disabled */
		raw_spin_lock(&rq->lock);