[patch] [sched] yield-fixes 2.5.3-pre5

From: Ingo Molnar (mingo@elte.hu)
Date: Fri Jan 25 2002 - 09:23:39 EST


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/



This archive was generated by hypermail 2b29 : Thu Jan 31 2002 - 21:00:31 EST