home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / vms / 18293 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  4.8 KB

  1. Path: sparky!uunet!usc!news.service.uci.edu!network.ucsd.edu!news!nosc!crash!cmkrnl!jeh
  2. From: jeh@cmkrnl.com
  3. Newsgroups: comp.os.vms
  4. Subject: Re: TUNING - QUANTUM SYSGEM parameter
  5. Message-ID: <1992Nov20.120509.896@cmkrnl.com>
  6. Date: 20 Nov 92 12:05:09 PST
  7. References: <27A0322A_00174E60.00963CCA9D4FA020$626_2@UK.AC.KCL.PH.IPG> <1992Nov19.134754.25572@ncsa.uiuc.edu>
  8. Organization: Kernel Mode Consulting, San Diego, CA
  9. Lines: 82
  10.  
  11. In article <1992Nov19.134754.25572@ncsa.uiuc.edu>,
  12.  jsue@ncsa.uiuc.edu (Jeffrey L. Sue) writes:
  13. > I have been to courses, and many DECUS sessions where Patrick O'Malley
  14. > discusses tuning quantum.  What should be kept in mind when reducing
  15. > QUANTUM is that it may seemd to improve *trivial* performance, it reduces
  16. > "throughput".  This means that in the same amount of wall-clock time,
  17. > you get less "total" work completed.  This is a trade-off.
  18. > Other factors to consider are:  whenever a context switch takes place,
  19. > the on-cpu instruction cache is invalidated.  Thus the more often you
  20. > context switch (smaller quantum), the more often the cache will become
  21. > invalidated.  Therefore your job will get less done because it must rebuild
  22. > the cpu's instruction cache everytime it becomes the CUR processes, and it
  23. > is doing this more often.  (note:  the CPU cache is a hardware cache, not
  24. > one of the XQP (ACP_*) caches - which are for the file system.)
  25.  
  26. A process context switch also invalidates the per-process half of the 
  27. translation buffer (a cache for page table entries).  And, of course, 
  28. the regular old memory cache, while not invalidated by a context switch,
  29. will suffer a short-term reduction of hit rate after each context switch
  30. (since the new process typically won't be referring to very many of the
  31. same physical addresses as the old one did). 
  32.  
  33.     However...
  34.  
  35. This "context switches are expensive, so you'd better not reduce quantum by a
  36. lot" theory has been around since the 780 days.  I've never seen any hard 
  37. data one way or another, so I decided to run some tests, as part of the
  38. research for my "VMS Scheduling Myths" talk at DECUS.  
  39.  
  40. THe test was with a small compute-bound program designed to take advantage of
  41. the memory cache and translation buffer.  (In fact, it reliably shows the size
  42. of the translation buffer, and I adjusted it to stay within the translation 
  43. buffer size of each machine that I tested.)
  44.  
  45. This image was run in two separate processes at the same base priority.   The
  46. program reports its throughput (measured in array references per wall-clock
  47. tick) every few seconds.  Priority adjustment was disabled by patching all of
  48. the boost values to 0. 
  49.  
  50. Result:  There *must* be a throughput penalty for a context switch, but it's
  51. so small that it can't be measured, even on a MicroVAX II.  Tests on a
  52. MicroVAX 3600, VAXstation 3100/76, VAXstation 4000/VLC, VAXstation 4000
  53. Model 60, and VAXserver 3100 Model 80, were equally inconclusive.  
  54.  
  55. I discussed these results with Pat O'Malley.  We decided that what must be
  56. happening is that it just doesn't take very long to reload the instruction 
  57. cache, translation buffer, and RAM cache with stuff that's relevant to the
  58. new process.   
  59.  
  60. In my copious free time :-), I am investigating replacing the interval timer
  61. ("hardware clock") interrupts on a MicroVAX 3600 with interrupts from a
  62. DRV11-B or similar general-purpose interface.  This will allow adjustment of
  63. the intervals between clock ticks to values much smaller than 0.01 second, so
  64. that I can see what happens when quantum is set to 0.001 seconds, or even
  65. shorter. The goal is to find the point where the context switch overhead DOES
  66. start to noticeably affect throughput.  
  67.  
  68. > I have played with quantum and found that on the smaller processors it
  69. > made a big difference in the performance of "trivial" response, like for
  70. > MAIL, DIRECTORY, DELETE, TYPE, etc..  
  71.  
  72. Note that this effect will only be seen if you have more than one process
  73. competing for the CPU at the same normal priority level (0-15). 
  74.  
  75. > However, on the faster processors
  76. > today, rarely do these activities even use a quantum before they give up
  77. > the cpu voluntarily for a wait-state (I/O completion, LEF, etc.).  Also,
  78. > in the cases where I lowered quantum,  the longer-running operations tended
  79. > to take more time - 
  80.  
  81. No offense, but I would be interested in hearing about some quantitative
  82. measurements with programs with known compute-intensive,
  83. memory-reference-intensive behavior, rather than your "feel" of how the system
  84. behaved. 
  85.  
  86.     --- Jamie Hanrahan, Kernel Mode Consulting, San Diego CA
  87. drivers, internals, networks, applications, and training for VMS and Windows-NT
  88. uucp 'g' protocol guru and release coordinator, VMSnet (DECUS uucp) W.G., and 
  89. Chair, VMS Programming and Internals Working Group, U.S. DECUS VAX Systems SIG 
  90. Internet:  jeh@cmkrnl.com, hanrahan@eisner.decus.org, or jeh@crash.cts.com
  91. Uucp:  ...{crash,eisner,uunet}!cmkrnl!jeh
  92.