On Thu, 26 Oct 2006, Nick Piggin wrote:
> 'time_slice' should be static, and it should be named better, and you
> may as well also put the "task has expired but not rescheduled" part
> in there too. That is part of the same logical op (which is to resched
> the task when it finishes timeslice).
This way?
Index: linux-2.6.19-rc3/kernel/sched.c
===================================================================
--- linux-2.6.19-rc3.orig/kernel/sched.c 2006-10-26 11:04:43.000000000 -0500
+++ linux-2.6.19-rc3/kernel/sched.c 2006-10-26 11:11:20.458202627 -0500
@@ -3044,8 +3044,13 @@ void account_steal_time(struct task_stru
cpustat->steal = cputime64_add(cpustat->steal, tmp);
}
-void time_slice(struct rq *rq, struct task_struct *p)
+static void task_running_tick(struct rq *rq, struct task_struct *p)
{
+ if (p->array != rq->active) {
+ /* Task has expired but was not scheduled yet */
+ set_tsk_need_resched(p);
+ return;
+ }
spin_lock(&rq->lock);
/*
* The task was running during this tick - update the
@@ -3135,14 +3140,8 @@ void scheduler_tick(void)
if (p == rq->idle)
/* Task on the idle queue */
wake_priority_sleeper(rq);
- else {
- /* Task on cpu queue */
- if (p->array != rq->active)
- /* Task has expired but was not scheduled yet */
- set_tsk_need_resched(p);
- else
- time_slice(rq, p);
- }
+ else
+ task_running_tick(rq, p);
#ifdef CONFIG_SMP
update_load(rq);
if (jiffies >= __get_cpu_var(next_balance))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]