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

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

Merge "sched/walt: Avoid taking rq lock for every IRQ update"

parents eaca14d7 74b84e8a
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -424,22 +424,27 @@ void sched_account_irqtime(int cpu, struct task_struct *curr,
				 u64 delta, u64 wallclock)
{
	struct rq *rq = cpu_rq(cpu);
	unsigned long flags, nr_windows;
	unsigned long nr_windows;
	u64 cur_jiffies_ts;

	raw_spin_lock_irqsave(&rq->lock, flags);

	/*
	 * cputime (wallclock) uses sched_clock so use the same here for
	 * consistency.
	 * We called with interrupts disabled. Take the rq lock only
	 * if we are in idle context in which case update_task_ravg()
	 * call is needed.
	 */
	if (is_idle_task(curr)) {
		raw_spin_lock(&rq->lock);
		/*
		 * cputime (wallclock) uses sched_clock so use the same here
		 * for consistency.
		 */
		delta += sched_clock() - wallclock;
	cur_jiffies_ts = get_jiffies_64();

	if (is_idle_task(curr))
		update_task_ravg(curr, rq, IRQ_UPDATE, sched_ktime_clock(),
				 delta);
		raw_spin_unlock(&rq->lock);
	}

	cur_jiffies_ts = get_jiffies_64();
	nr_windows = cur_jiffies_ts - rq->irqload_ts;

	if (nr_windows) {
@@ -457,7 +462,6 @@ void sched_account_irqtime(int cpu, struct task_struct *curr,

	rq->cur_irqload += delta;
	rq->irqload_ts = cur_jiffies_ts;
	raw_spin_unlock_irqrestore(&rq->lock, flags);
}

/*