File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,9 @@ static inline int __task_prio(const struct task_struct *p)
163163 if (p -> sched_class == & stop_sched_class ) /* trumps deadline */
164164 return -2 ;
165165
166+ if (p -> dl_server )
167+ return -1 ; /* deadline */
168+
166169 if (rt_prio (p -> prio )) /* includes deadline */
167170 return p -> prio ; /* [-1, 99] */
168171
@@ -192,8 +195,24 @@ static inline bool prio_less(const struct task_struct *a,
192195 if (- pb < - pa )
193196 return false;
194197
195- if (pa == -1 ) /* dl_prio() doesn't work because of stop_class above */
196- return !dl_time_before (a -> dl .deadline , b -> dl .deadline );
198+ if (pa == -1 ) { /* dl_prio() doesn't work because of stop_class above */
199+ const struct sched_dl_entity * a_dl , * b_dl ;
200+
201+ a_dl = & a -> dl ;
202+ /*
203+ * Since,'a' and 'b' can be CFS tasks served by DL server,
204+ * __task_prio() can return -1 (for DL) even for those. In that
205+ * case, get to the dl_server's DL entity.
206+ */
207+ if (a -> dl_server )
208+ a_dl = a -> dl_server ;
209+
210+ b_dl = & b -> dl ;
211+ if (b -> dl_server )
212+ b_dl = b -> dl_server ;
213+
214+ return !dl_time_before (a_dl -> deadline , b_dl -> deadline );
215+ }
197216
198217 if (pa == MAX_RT_PRIO + MAX_NICE ) /* fair */
199218 return cfs_prio_less (a , b , in_fi );
You can’t perform that action at this time.
0 commit comments