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

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

Merge "kernel: time: Add delay after cpu_relax() in tight loops"

parents cda15de2 79447cdf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ typedef unsigned long mm_segment_t;
 */
struct thread_info {
	unsigned long		flags;		/* low level flags */
	unsigned long		padding[7];
	mm_segment_t		addr_limit;	/* address limit */
#ifdef CONFIG_ARM64_SW_TTBR0_PAN
	u64			ttbr0;		/* saved TTBR0_EL1 */
+3 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@
#include <linux/timer.h>
#include <linux/freezer.h>
#include <linux/compat.h>
#include <linux/delay.h>

#include <linux/uaccess.h>

@@ -152,6 +153,7 @@ struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer,
			raw_spin_unlock_irqrestore(&base->cpu_base->lock, *flags);
		}
		cpu_relax();
		ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
	}
}

@@ -1067,6 +1069,7 @@ int hrtimer_cancel(struct hrtimer *timer)
		if (ret >= 0)
			return ret;
		cpu_relax();
		ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
	}
}
EXPORT_SYMBOL_GPL(hrtimer_cancel);
+1 −0
Original line number Diff line number Diff line
@@ -164,3 +164,4 @@ DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases);

extern u64 get_next_timer_interrupt(unsigned long basej, u64 basem);
void timer_clear_idle(void);
#define TIMER_LOCK_TIGHT_LOOP_DELAY_NS	350
+2 −0
Original line number Diff line number Diff line
@@ -944,6 +944,7 @@ static struct timer_base *lock_timer_base(struct timer_list *timer,
			raw_spin_unlock_irqrestore(&base->lock, *flags);
		}
		cpu_relax();
		ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
	}
}

@@ -1266,6 +1267,7 @@ int del_timer_sync(struct timer_list *timer)
		if (ret >= 0)
			return ret;
		cpu_relax();
		ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
	}
}
EXPORT_SYMBOL(del_timer_sync);