lkml.org 
[lkml]   [2002]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] [sched] yield-fixes 2.5.3-pre5

the patch below fixes two yield()-usage bugs introduced by the new
scheduler. In the first O(1) scheduler iterations i've added TASK_YIELDED,
which made the setting of p->state unnecessery before calling yield(). But
later i cleaned up yield() further, again enabling the yielding of
non-running tasks. But the places which need to set p->state were not
reverted to the pre-TASK_YIELDED behavior.

the bug was seen live by Arjan van de Ven (in the 2.4 kernel), it causes
'stuck' shells under heavy IO and VM load.

Ingo

--- linux/fs/buffer.c.orig Fri Jan 25 12:40:11 2002
+++ linux/fs/buffer.c Fri Jan 25 12:40:18 2002
@@ -724,6 +724,7 @@
wakeup_bdflush();
try_to_free_pages(zone, GFP_NOFS, 0);
run_task_queue(&tq_disk);
+ __set_current_state(TASK_RUNNING);
yield();
}

--- linux/mm/page_alloc.c.orig Fri Jan 25 12:43:42 2002
+++ linux/mm/page_alloc.c Fri Jan 25 12:43:50 2002
@@ -394,6 +394,7 @@
return NULL;

/* Yield for kswapd, and try again */
+ __set_current_state(TASK_RUNNING);
yield();
goto rebalance;
}

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

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