Skip to contentSkip to conversation

sched: fix the wrong time slice value for SCHED_FIFO tasks

PATCH In review Miao Xie 2 participants 2 messages Mar 7, 2008

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

PATCH 1/1 sched: fix the wrong time slice value for SCHED_FIFO tasks

Function sys_sched_rr_get_interval returns wrong time slice value for SCHED_FIFO tasks. The time slice for SCHED_FIFO tasks should be 0.

---
 kernel/sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched.c +1 -1
index dcd553c..870044d 100644
@@ -5100,7 +5100,7 @@ long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
 	time_slice = 0;
 	if (p->policy == SCHED_RR) {
 		time_slice = DEF_TIMESLICE;
-	} else {
+	} else if (p->policy != SCHED_FIFO) {
 		struct sched_entity *se = &p->se;
 		unsigned long flags;
 		struct rq *rq;
Signature · 1 line
1.5.4.rc3
#1 lore raw
Quoted 4 lines · Miao Xie

Function sys_sched_rr_get_interval returns wrong time slice value for SCHED_FIFO tasks. The time slice for SCHED_FIFO tasks should be 0.

good catch - applied.

Ingo