2002-10-16 19:25:52

by Rik van Riel

[permalink] [raw]
Subject: [PATCH][DOC] kernelnewbies helpful hint #1

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:"[email protected]">[email protected]</a>


2002-10-16 19:29:58

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH][DOC] kernelnewbies helpful hint #1

Em Wed, Oct 16, 2002 at 05:30:04PM -0200, Rik van Riel escreveu:
> this little patch documents a point in the scheduler where many people
> seem to get confused.

Thanks a lot.

- Arnaldo