lkml.org 
[lkml]   [1998]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectidle_task priority and scheduling 2.1.131
The SCHED_YIELD in 2.1.131 i386/kernel/process.c should really not help.
This because the only place that care about SCHED_YIELD is goodness and
goodness() should be never run on the idle_task. The reason for using
idle_task->counter = -4 was to allow reschedule_idle() to wakeup
immediatly a sleeping process if the current one is the idle_task (and
this not achieved for sure using SCHED_YIELD).

This patch fix the idle_task priority/counter and an APM mistake:

Index: linux/arch/i386/kernel/process.c
diff -u linux/arch/i386/kernel/process.c:1.1.1.3 linux/arch/i386/kernel/process.c:1.1.1.1.2.6
--- linux/arch/i386/kernel/process.c:1.1.1.3 Thu Dec 3 12:51:05 1998
+++ linux/arch/i386/kernel/process.c Thu Dec 3 13:48:03 1998
@@ -105,19 +105,27 @@
*/
static int cpu_idle(void *unused)
{
- unsigned long start_idle = jiffies;
+ unsigned long start_time = 0;
+ int started = 0;

/* endless idle loop with no priority at all */
+ current->priority = 0;
+ /* counter must be -4 see reschedule_idle() in sched.c */
+ current->counter = -4;
for (;;) {
- if (jiffies - start_idle > HARD_IDLE_TIMEOUT)
+ if (!started)
+ {
+ start_time = jiffies;
+ started = 1;
+ }
+ if (started && jiffies - start_time > HARD_IDLE_TIMEOUT)
hard_idle();
else {
if (boot_cpu_data.hlt_works_ok && !hlt_counter && !current->need_resched)
__asm__("hlt");
}
if (current->need_resched)
- start_idle = jiffies;
- current->policy = SCHED_YIELD;
+ started = 0;
schedule();
check_pgt_cache();
}
@@ -131,12 +139,13 @@

int cpu_idle(void *unused)
{
-
/* endless idle loop with no priority at all */
+ current->priority = 0;
+ /* counter must be -4 see reschedule_idle() in sched.c */
+ current->counter = -4;
while(1) {
if (current_cpu_data.hlt_works_ok && !hlt_counter && !current->need_resched)
__asm__("hlt");
- current->policy = SCHED_YIELD;
schedule();
check_pgt_cache();
}

Andrea Arcangeli


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.051 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site