Skip to contentSkip to conversation

Question : sched_rt.c : Loss of stats?? requeue_task_rt() does not call update_curr_rt() which updates stats

DISCUSSION Mitchell Erblich 2 participants 2 messages Aug 9, 2007

lore
Share & tools
lore
#0 lore raw

sched_rt.c : requeue_task_rt()

The comment states the problem requeue no dequeue.
Put task to the end of the run list without the overhead of dequeue followed by enqueue.

dequeue_task_rt() updates stats. Where without calling it will skip the stat update.

Thus, shouldn't requeue_task_rt() call
update_curr_rt(rq); ???

Mitchell Erblich.

#1 lore raw
Quoted 11 lines · Mitchell Erblich

sched_rt.c : requeue_task_rt()

The comment states the problem requeue no dequeue.
Put task to the end of the run list without the overhead of dequeue followed by enqueue.

dequeue_task_rt() updates stats. Where without calling it will skip the stat update.

Thus, shouldn't requeue_task_rt() call
update_curr_rt(rq); ???

No. As update_curr_rt() suggests it's only about collecting runtime statistics, namely
(a) the longest interval of time a given task was consuming a CPU (i.e. == 'current') and
(b) the total amount of time it was running.

To this goal, it would be enough to call it only in put_prev_task_rt().. I recall, we do it in dequeue_task_rt() to catch a case of SCHED_RR/FIFO --> SCHED_NORMAL transition (e.g. in sched_setscheduler()).. so that may make accounting a bit less precise for (a).

Signature · 2 lines
Best regards,
Dmitry Adamushko