Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 16 Oct 2002 15:25:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 16 Oct 2002 15:25:52 -0400 Received: from 2-136.ctame701-1.telepar.net.br ([200.193.160.136]:15577 "EHLO 2-136.ctame701-1.telepar.net.br") by vger.kernel.org with ESMTP id ; Wed, 16 Oct 2002 15:24:30 -0400 Date: Wed, 16 Oct 2002 17:30:04 -0200 (BRST) From: Rik van Riel X-X-Sender: riel@imladris.surriel.com To: Arnaldo Carvalho de Melo cc: Kernel Mailing List Subject: [PATCH][DOC] kernelnewbies helpful hint #1 Message-ID: X-spambait: aardvark@kernelnewbies.org X-spammeplease: aardvark@nl.linux.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1097 Lines: 34 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: october@surriel.com - 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/