diff options
-rw-r--r-- | include/linux/sched.h | 1 | ||||
-rw-r--r-- | kernel/sched/rt.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index e132a2d24740..1c2470de8052 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1237,6 +1237,7 @@ struct sched_entity { struct sched_rt_entity { struct list_head run_list; unsigned long timeout; + unsigned long watchdog_stamp; unsigned int time_slice; int nr_cpus_allowed; diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 32a51c808128..2b0131835714 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2002,7 +2002,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; |