home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!news2me.ebay.sun.com!exodus.Eng.Sun.COM!appserv.Eng.Sun.COM!slovax.Eng.Sun.COM!lm
- From: lm@slovax.Eng.Sun.COM (Larry McVoy)
- Newsgroups: comp.os.linux
- Subject: Re: A technical question on CONTEXT (TASK) SWITCHING by the Kernel
- Date: 27 Aug 1992 06:34:46 GMT
- Organization: Sun Microsystems, Inc. Mt. View, Ca.
- Lines: 21
- Message-ID: <l9ots6INNpk5@appserv.Eng.Sun.COM>
- References: <1992Aug21.072548.10633@klaava.Helsinki.FI>
- NNTP-Posting-Host: slovax
-
- 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
-