[PATCH][DOC] kernelnewbies helpful hint #1

Rik van Riel (riel@conectiva.com.br)
Wed, 16 Oct 2002 17:30:04 -0200 (BRST)


Hi,

this little patch documents a point in the scheduler where many people
seem to get confused.

===== kernel/sched.c 1.140 vs edited =====
--- 1.140/kernel/sched.c Mon Oct 14 10:30:06 2002
+++ edited/kernel/sched.c Wed Oct 16 17:28:29 2002
@@ -1035,6 +1035,12 @@

prepare_arch_switch(rq, next);
prev = context_switch(prev, next);
+ /*
+ * Kernelnewbies hint: at this point the current process
+ * has switched from prev to next. Prev is sitting on the
+ * run queue and next unlocks the runqueue, either here or
+ * in ret_from_fork (for newly forked processes).
+ */
barrier();
rq = this_rq();
finish_arch_switch(rq, prev);

Rik

-- 
Bravely reimplemented by the knights who say "NIH".
http://www.surriel.com/		http://distro.conectiva.com/
Current spamtrap:  <a href=mailto:"october@surriel.com">october@surriel.com</a>

- 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/