login
Header Space

 
 

Re: A technical question on CONTEXT (TASK) SWITCHING by the Kernel

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Thursday, August 27, 1992 - 2:34 am

torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) writes:
: >        __asm__("cmpl %%ecx,_current\n\t"\
: >                "je 1f\n\t
: 
: %ecx is set up with the task we want to switch to when we enter the
: inline assembly statement, so this is obviosuly testing whether we are
: trying to switch to the current task, in which case nothing is done. 
: Besides being an obvious optimization, I don't think the 386 allows a
: tss-jump to the current task (but not having my books around me, I can't
: check). 

On old versions of SunOS (3.x I think) not doing this cost us quite a bit
of performance.  If you dig up the old TCP mail that Van sent out about
getting to the wire speed on Sun 3/60's,  you'll see him disgustedly 
pointing out that useless context switching was costing us a chunk of
performance.

I'm curious: would it cost that much on the 386 to switch to yourself?
Or would it be cheap?  What do context switches on Linux cost?
---
Larry McVoy                     (415) 336-7627                   lm@sun.com
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: A technical question on CONTEXT (TASK) SWITCHING by the ..., Larry McVoy, (Thu Aug 27, 2:34 am)
speck-geostationary