sched/rt: Avoid updating RT entry timeout twice within one tick period
[firefly-linux-kernel-4.4.55.git] / kernel / sched / rt.c
index 29bda5bdf2a57d14e0f2ca71830569cdd5313bfa..2f69ca997826337bfd83b8f47199cf6e6c544b90 100644 (file)
@@ -1988,7 +1988,11 @@ static void watchdog(struct rq *rq, struct task_struct *p)
        if (soft != RLIM_INFINITY) {
                unsigned long next;
 
-               p->rt.timeout++;
+               if (p->rt.watchdog_stamp != jiffies) {
+                       p->rt.timeout++;
+                       p->rt.watchdog_stamp = jiffies;
+               }
+
                next = DIV_ROUND_UP(min(soft, hard), USEC_PER_SEC/HZ);
                if (p->rt.timeout > next)
                        p->cputime_expires.sched_exp = p->se.sum_exec_runtime;