]> Pileus Git - ~andy/linux/blobdiff - kernel/sched/core.c
sched/deadline: Fix overflow to handle period==0 and deadline!=0
[~andy/linux] / kernel / sched / core.c
index b46131ef6aab0ac48149482a03f8354330adf188..24914488da4156500cf7cdf8b96c298cdb44119e 100644 (file)
@@ -1952,7 +1952,7 @@ static int dl_overflow(struct task_struct *p, int policy,
 {
 
        struct dl_bw *dl_b = dl_bw_of(task_cpu(p));
-       u64 period = attr->sched_period;
+       u64 period = attr->sched_period ?: attr->sched_deadline;
        u64 runtime = attr->sched_runtime;
        u64 new_bw = dl_policy(policy) ? to_ratio(period, runtime) : 0;
        int cpus, err = -1;