lkml.org 
[lkml]   [2000]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 2.2.18Pre Lan Performance Rocks!
Date
"Jeff V. Merkey" wrote:
> A "context" is usually assued to be a "stack". The simplest of all
> context switches is:
>
> mov x, esp
> mov esp, y

Is that your two instruction context switch? The problem is, it doesn't
transfer control anywhere. Maybe it doesn't need to. I guess you could
break your tasks up into lots of little chunks and compile each chunk
inline and use actual calls to take you off the fast path. The stack
changes are actually doing some useful work here: you might for instance
be processing a network packet whose address is on the stack. But
somehow I don't think this is your two-instruction context switch. The
only halfway flexible two-instruction context switch I can think of is:

mov esp, y
ret

where you already know the stack depth where you are so you don't have
to store it, and the task execution order is predetermined. This
switches the *two* essential ingredients of a context: control+data.
But there's a big fat AGI there and all the overhead of a jump so it
doesn't get your superscalar performance.

Now my stupid question: why on earth do you need a billion context
switches a second?

--
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:45    [W:0.163 / U:6.768 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site