Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Sep 1999 18:44:30 -0700
From:      Arun Sharma <adsharma@home.com>
To:        freebsd-smp@freebsd.org
Subject:   Context switch code structure
Message-ID:  <19990920184430.A16551@home.com>

next in thread | raw e-mail | index | archive | help
After the recent change to move the "chooseproc" logic from assembly to
C, I wondered if the code should be restructured in a different way.

Right now, it approximately looks like:

<context switch out>
proc = chooseproc
<switch to proc>

Now, if one day FreeBSD achieves fine grained locking and there are 
multiple CPUs in the kernel mode, which means certain conditions can
change over time, underneath the current process.

Specifically, if the current process is the most eligible process after
context switching out, then we switch to the same process wasting a bunch
of CPU cycles. Are there any guarantees that this can't happen ?

If not, would it make sense to restructure the algorithm to do:

proc = chooseproc
switch(current, proc)

	-Arun


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990920184430.A16551>