aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 6c9e7c8735bf..a24d6d5d83f6 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1254,6 +1254,12 @@ static void sched_avg_update(struct rq *rq)
1254 s64 period = sched_avg_period(); 1254 s64 period = sched_avg_period();
1255 1255
1256 while ((s64)(rq->clock - rq->age_stamp) > period) { 1256 while ((s64)(rq->clock - rq->age_stamp) > period) {
1257 /*
1258 * Inline assembly required to prevent the compiler
1259 * optimising this loop into a divmod call.
1260 * See __iter_div_u64_rem() for another example of this.
1261 */
1262 asm("" : "+rm" (rq->age_stamp));
1257 rq->age_stamp += period; 1263 rq->age_stamp += period;
1258 rq->rt_avg /= 2; 1264 rq->rt_avg /= 2;
1259 } 1265 }