home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / linux / 9182 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  1.4 KB

  1. Path: sparky!uunet!sun-barr!news2me.ebay.sun.com!exodus.Eng.Sun.COM!appserv.Eng.Sun.COM!slovax.Eng.Sun.COM!lm
  2. From: lm@slovax.Eng.Sun.COM (Larry McVoy)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: A technical question on CONTEXT (TASK) SWITCHING by the Kernel
  5. Date: 27 Aug 1992 06:34:46 GMT
  6. Organization: Sun Microsystems, Inc.  Mt. View, Ca.
  7. Lines: 21
  8. Message-ID: <l9ots6INNpk5@appserv.Eng.Sun.COM>
  9. References: <1992Aug21.072548.10633@klaava.Helsinki.FI>
  10. NNTP-Posting-Host: slovax
  11.  
  12. torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) writes:
  13. : >        __asm__("cmpl %%ecx,_current\n\t"\
  14. : >                "je 1f\n\t
  15. : %ecx is set up with the task we want to switch to when we enter the
  16. : inline assembly statement, so this is obviosuly testing whether we are
  17. : trying to switch to the current task, in which case nothing is done. 
  18. : Besides being an obvious optimization, I don't think the 386 allows a
  19. : tss-jump to the current task (but not having my books around me, I can't
  20. : check). 
  21.  
  22. On old versions of SunOS (3.x I think) not doing this cost us quite a bit
  23. of performance.  If you dig up the old TCP mail that Van sent out about
  24. getting to the wire speed on Sun 3/60's,  you'll see him disgustedly 
  25. pointing out that useless context switching was costing us a chunk of
  26. performance.
  27.  
  28. I'm curious: would it cost that much on the 386 to switch to yourself?
  29. Or would it be cheap?  What do context switches on Linux cost?
  30. ---
  31. Larry McVoy            (415) 336-7627             lm@sun.com
  32.