Messages in this thread | | | From | "Stephen C. Tweedie" <> | Date | Fri, 4 Feb 2000 20:54:03 +0000 (GMT) | Subject | Re: how does kernel get the "current" task struct? |
| |
Hi,
On Wed, 02 Feb 2000 18:12:12 -0800, Jun Sun <jsun@mvista.com> said:
> I suppose if you have a global pointer "current", you don't even need > to do "andl" instruction. (But you will need to update "current" > whenever a context switch happens, and you'll probably have a > "current" array in the CMP version.)
That's the whole problem: on SMP, with a current table, you'd have to lookup the number of the current CPU every time you wanted to access "current". Doing the stack arithmetic trick is _much_ faster than using the cpuid instruction.
--Stephen
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |