home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 22220 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  8.2 KB

  1. Path: sparky!uunet!charon.amdahl.com!amdahl!rtech!pacbell.com!ames!elroy.jpl.nasa.gov!sdd.hp.com!crash!cmkrnl!jeh
  2. From: jeh@cmkrnl.com
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Image activations, page faults and disk I/O
  5. Message-ID: <1993Jan27.163409.1298@cmkrnl.com>
  6. Date: 27 Jan 93 16:34:09 PST
  7. References: <1993Jan26.155208.131143@mswe.dnet.ms.philips.nl>
  8. Organization: Kernel Mode Systems, San Diego, CA
  9. Lines: 155
  10.  
  11. In article <1993Jan26.155208.131143@mswe.dnet.ms.philips.nl>, hdavids@mswe.dnet.ms.philips.nl (Henk Davids) writes:
  12. > Image activations under VMS are expensive. What's worse is that the
  13. > repeated activation of the same image by the same process does not get
  14. > cheaper on successive calls. 
  15.  
  16. Yes it does, if the image is installed /shared, and if the shareable pages
  17. defined by the image are still on the free page list. 
  18.  
  19. > Likewise, multiple activations of a
  20. > particular image by many processes are probably just as expensive.
  21.  
  22. No.  If the image is installed shared, you get "global valid faults" when
  23. multiple processes map the same (shareable) page within the image.  These are
  24. soft faults. 
  25.  
  26. >  But the actual code pages of the image still have to be read from disk.
  27.  
  28. only if they're not on the free list, and also not in someone else's working
  29. set. 
  30.  
  31. > When you INSTALL an entry in the Known Files list with the /SHARE
  32. > qualifier, a global section will be created for every pure code
  33. > section in the image file.  
  34.  
  35. Actually a global section is created for *every* section (not just "pure code",
  36. by which I assume you mean "shareable, read-only").  The "impure data" image
  37. sections become writable, copy-on-reference global sections.  The *definition*
  38. of the section is still "global" even though the pages it defines won't be
  39. shared.  (This is a subtle point which just about everyone gets wrong...)
  40.  
  41. > Presumably, the image activator should
  42. > then map process pages to these global sections. However, that does
  43. > not explain all the disk accesses that I see. 
  44.  
  45. Well, I see fewer "pages read" from MONITOR PAGE when I install an image.  Bear
  46. in mind that almost every image has some private, writable, non-demand-zero 
  47. code sections.  For instance, storage allocated by .ADDRESS and .ASCID 
  48. directives, which have to be fixed up at activation time, and which therefore
  49. can't be shared.  In a non-trivial image you will never get rid of all the
  50. reads from the image file.  
  51.  
  52. > So, the question is: does the image activator in this release of VMS really
  53. > use these global sections? 
  54.  
  55. Yes, it really does.  This is easy to demonstrate (at least on a system with
  56. enough memory for it to do any good):  Use MONITOR PAGE to watch the number and
  57. types of page faults and see what happens with, say, the DIRECTORY command
  58. before and after you install it /shared.  (I pick on DIRECTORY.EXE because it
  59. doesn't need to be installed with privileges.)
  60.  
  61. > At image rundown, the pages that were mapped to shareable, read-only sections
  62. > are moved to the free list.  Normally process pages that are added to the 
  63. > free list can be reused, if they have not yet been used for something else. I
  64. > suspect that image rundown removes the connection between the process
  65. > and the image pages 
  66.  
  67. It removes the connection between the process and the image, yes.   But
  68. shareable, read-only pages released to the free list are moved to the *end* of
  69. the free list, where they won't get reused soon. (And, at image rundown,
  70. copy-on-reference pages are released to the *top* of the free list, so they get
  71. reused before the "maybe still useful to someone" pages that are nearer the
  72. end.)  The connection between the global section and these pages persists until
  73. the pages reach the top of the free list and are used for something else. 
  74.  
  75. If the shared (or shareable) image is activated again before the pages are
  76. used for something else, faults to these pages are resolved simply by pulling
  77. those pages back off the free page list.  
  78.  
  79. > because even on an empty VMS system the hard page faults keep the disk busy. 
  80.  
  81. Copy-on-reference pages being faulted in.  
  82.  
  83. > Why would image rundown go to such trouble? [removing the 
  84. > connection between the process and the image pages]
  85.  
  86. First because it isn't much trouble; and second because it *has* to.  Remember
  87. that the connection is via the process page table entries.  These correspond
  88. one-for-one with pages in virtual address space.  The next image you run is
  89. going to use the *same* virtual address space (normally starting at 200 hex),
  90. and hence will use the same PTEs, so you can't possibly keep pointers to a
  91. previous image's pages in them. 
  92.  
  93. Again, once a global, shareable page is released from everyone's working set,
  94. the connection between the *global* page table entry (which assists in 
  95. resolving faults to pages defined by global sections) and the physical page
  96. on the free page list *is* retained.  
  97.  
  98. > Another suggestion: failing a general solution, perhaps DEC could
  99. > provide a DCL image in which al lot of these images have been combined
  100. > into one in future versions of VMS, for those of us that have plenty
  101. > of memory, but not that much bandwidth for page faults? I'm thinking
  102. > especially of popular images like SET, DIRECTORY, COPY, RENAME, DELETE
  103. > etc.
  104.  
  105. I don't see the point of this.  Images don't get faulted in all at once. Let's
  106. say that one person is doing a DIRECTORY, another a COPY, and another a DELETE.
  107.  
  108.  - If they're separate images,  each process faults in the image-specific
  109. stuff (different for each process) and the common RTL routines (shared). 
  110.  
  111.  - If they're the same image, each process faults in the function-specific
  112. stuff (different for each process) and the common RTL routines (shared). 
  113.  
  114. What's the difference?  
  115.  
  116. The only difference you'd see in the behavior would be fewer global section
  117. table entries used.  Possibly. 
  118.  
  119. > Yet another puzzle: why would image rundown have to deallocate all
  120. > your pages in P0 space? Couldn't it just leave the working-set intact,
  121. > so that multiple activations of the same image could re-use what was
  122. > left over?
  123.  
  124. There are two reasons.  
  125.  
  126. One:  A working set list entry is meaningless without a corresponding virtual
  127. page number.  In fact, the high bits of the WSLE *are* the virtual page number.
  128. This is necessary because you have to be able to find the virtual page number
  129. (and from there, the address of the corresponding process page table entry)
  130. from a working set list entry.  Now, the same virtual addresses that the "old"
  131. image used are going to be re-used for the next image.  Hence there's no sense
  132. in keeping old working set list entries around.  A physical page can't be part
  133. of a process working set unless the image the process is running defines the 
  134. contents and attributes of the page.  
  135.  
  136. Two:  It wouldn't be any better than what VMS does now! Remember, the pages
  137. that can be shared are already being cached at the end of the free page list,
  138. and faults to these can be resolved quickly.... unless they "boil" up to the
  139. top of the FPL and get re-used for something else.  
  140.  
  141. I suspect that what you're looking for is a way to prevent them from being
  142. re-used for something else. (This is essentially what TURBO does.)  That's
  143. fine, if you have enough memory to hold all the shareable read-only pages for
  144. every image that is run on the system!  In most systems, though, you are going
  145. to want to re-use those pages eventually:  You want the pages defined by images
  146. that are activated often to stay near the bottom of the FPL so they probably
  147. won't get re-used... 
  148.  
  149. ...and that's exactly what the existing mechanism does. 
  150.  
  151. If you aren't seeing a reduction in "page reads" and an increase in "free page
  152. list faults" and "global valid faults" from installing often-used images
  153. /shared, you probably don't have enough spare memory to allow the mechanism to
  154. work effectively.  
  155.  
  156. > Suggestions, solutions (and flames :) are welcome.
  157.  
  158. I suggest you read the "paging dynamics" and "image activation and rundown"
  159. descriptions in the IDSM again.  
  160.  
  161.     --- Jamie Hanrahan, Kernel Mode Systems, San Diego CA
  162. drivers, internals, networks, applications, and training for VMS and Windows NT
  163. uucp 'g' protocol guru and release coordinator, VMSnet (DECUS uucp) W.G., and 
  164. Chair, Programming and Internals Working Group, U.S. DECUS VMS Systems SIG 
  165. Internet:  jeh@cmkrnl.com, or hanrahan@eisner.decus.org  Uucp: uunet!cmkrnl!jeh
  166.