home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / vmsnet / internal / 1106 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  6.7 KB

  1. Path: sparky!uunet!usc!elroy.jpl.nasa.gov!ames!agate!dog.ee.lbl.gov!network.ucsd.edu!mvb.saic.com!macro32
  2. From: SYSMGR@IPG.PH.KCL.AC.UK
  3. Newsgroups: vmsnet.internals
  4. Subject: RE: VMS Memory Management/PGFLQUOTA question
  5. Message-ID: <51000F6F_00057EE8.0095DF402228FBE0$6_1@UK.AC.KCL.PH.IPG>
  6. Date: Wed, 22 JUL 92 12:10:10 BST
  7. Organization: Macro32<==>Vmsnet.Internals Gateway
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 151
  10.  
  11. > What I would like to do is reserve a large (VERY large) segment of virtual
  12. > address space for my exclusive use in an image.  We're talking a quarter of a
  13. > gigabyte or so here.
  14. >
  15. > If possible, I would like to simply reserve this address range without
  16.  actually
  17. > creating pages in it, since then I won't need to have a humongous page file
  18. > quota.  I will have to jack VIRTUALPAGECNT way up since my page tables will
  19. > have to be large enough so that I can create pages within the range as I wish,
  20. > but I can live with that.
  21.  
  22. [Rest of question deleted]
  23.  
  24. I don't really understand the rationale behind the details of the question.
  25. Why is it desired to greate a quarter-Gbyte address space that is reserved
  26. against use by system routines, but not associated with backing store? The
  27. only thing I can think of is come sort of very sparsely populated matrix,
  28. but there are better ways to code these as linked lists...
  29.  
  30. What I think might be wanted, and which is generally useful, is the way
  31. to associate your own private quarter-gigabyte file with a quarter-gigabyte
  32. VM address space, so as not to clobber the system page file. This can be
  33. done using SYS$CRMPSC. Attached to this message is a code fragment to do
  34. this (hacked out of a big program, so pardon loose ends which will be my
  35. fault. The coding looks great, I can't take credit for that though!)
  36.  
  37. Suggestion for DEC: It would be very nice indeed if a user could attach a
  38. private pagefile to a process from DCL, which would then be used instead
  39. of (or rather, in preference to) the system pagefile, until the process
  40. is deleted. Would it be very hard to do? Certainly, it's a real hassle
  41. when you buy binary code that needs lots of VM and know that if three or
  42. so users happen to run it simultaneously, your pagefile will be full...
  43. Allocating two or three disk drives per cluster node for paging isn't
  44. really an answer.
  45.  
  46.         Yours,
  47.  
  48.                 Nigel Arnot
  49.  
  50.                 NRA%ipg.ph.kcl.ac.uk@nsfnet-relay.ac.uk   (internet)
  51.                 NRA%uk.ac.kcl.ph.ipg@ukacrl.bitnet        (bitnet)
  52.  
  53. ----------------------------------------------------------------------------
  54.  
  55.         options /extend_source
  56.  
  57.         program bp
  58.  
  59.         integer*4       sys$crmpsc
  60.         integer*4       sys$deltva
  61.         integer*4       sys$dassgn
  62.         integer*4       lib$get_lun
  63.  
  64. C_______Address ranges and misc. flags for $CRMPSC
  65.         character*80    pagefilename
  66.         integer*4       inadr(2), retadr(2)
  67.         logical*4       secflags
  68.         integer*2       chan
  69.         integer*2       rmsjunk
  70.         common /rmschannel/ chan, rmsjunk
  71.         integer*4       pagecnt
  72.         integer*4       vblock
  73.         integer*4       secprot
  74.         integer*4       pfcsize
  75.  
  76. C_______User file open definitions and declarations
  77.         integer*4       pfunit                  ! FORTRAN I/O unit for pagefile
  78.         integer*4       ufo_open, ufo_create
  79.         external        ufo_open, ufo_create
  80.  
  81.         integer         imgbytes, imgpages
  82.         integer         PAGESIZE
  83.         parameter       (PAGESIZE = 512)
  84.  
  85. C_______Get image geometry and calculate storage requirements.
  86.         imcols = intin('Image x-size', imcols, 1, MAXIMSIZE)
  87.         imrows = intin('Image y-size', imcols, 1, MAXIMSIZE)
  88.         imgbytes = imcols*imrows*sizeof(pixel)
  89.         imgpages = (imgbytes+PAGESIZE-1) / PAGESIZE
  90.  
  91. C_______Get name of pagefile to use for mapped section
  92.         if (cli$present('PAGEFILE') .eq. %loc(CLI$_PRESENT)) then
  93.            call cli$get_value('PAGEFILE',pagefilename)
  94.         else
  95.            pagefilename = 'BP_PAGEFILE'
  96.         endif
  97.  
  98. C_______Now try to expand the virtual memory region (using the specified
  99. *       pagefile in place of the system one) to accomodate the data arrays.
  100.         istat = lib$get_lun(pfunit)
  101.         if (istat .ne. SS$_NORMAL) call lib$signal(%val(istat))
  102.         open (unit=pfunit, file=pagefilename, status='OLD', useropen=ufo_open)
  103.  
  104. C_______The available section flags are as follow:
  105. *       SEC$M_GBL        - Global instead of private section
  106. *       SEC$M_CRF        - Copy on reference
  107. *       SEC$M_DZRO       - Demand-zero
  108. *       SEC$M_EXPREG     - Expand region
  109. *       SEC$M_WRT        - Read/write instead of read-only section
  110. *       SEC$M_PERM       - Pages are permanent
  111. *       SEC$M_PFNMAP     - Page-frame instead of disk-file section
  112. *       SEC$M_SYSGBL     - System global instead of group global section
  113. *       SEC$M_PAGFIL     - Global page file instead of disk-file section
  114. *       SEC$M_EXECUTE    - Map pages only if caller has execute access
  115. *       SEC$M_NO_OVERMAP - Overmap existing address space
  116.         secflags = (SEC$M_EXPREG .or. SEC$M_WRT .or. SEC$M_DZRO)
  117.         pagecnt = imgpages*4
  118.         vblock = 0
  119.         pfcsize = 4
  120.         secprot = 0
  121.         istat = sys$crmpsc(inadr,retadr,        ! Section address ranges
  122.         1               %val(PSL$C_USER),       ! Access mode
  123.         2               %val(secflags),         ! Flags
  124.         3               %val(0),                ! Global section name
  125.         4               %val(0),                ! Version number of section
  126.         5               %val(0),                ! Relative page n0. in GBLSEC
  127.         6               %val(chan),             ! RMS channel for file
  128.         7               %val(pagecnt),          ! Number of pages in section
  129.         8               %val(vblock),           ! Starting virtual block in file
  130.         9               %val(secprot),          ! Protection mask for section
  131.         1               %val(pfcsize))          ! Page fault cluster size
  132.         if (istat .ne. SS$_NORMAL) call lib$signal(%val(istat))
  133.  
  134. C       ...etc. RETADR now contais the address range of the pages mapped onto
  135. C       the file.
  136.  
  137.         end
  138.  
  139. C==================================================
  140.         integer*4 function ufo_open(fab, rab, lun)
  141. C==================================================
  142. c_______Use RMS directly to open channel, using User File Open option
  143.         implicit none
  144.         include '($fabdef)/nolist'
  145.         include '($rabdef)/nolist'
  146.         record /fabdef/ fab
  147.         record /rabdef/ rab
  148.         integer*4       lun
  149.  
  150.         integer*4       channel
  151.         common /rmschannel/ channel
  152.  
  153.         integer*4       istat
  154.         integer*4       sys$open
  155.  
  156.         fab.fab$l_fop = fab.fab$l_fop .or. FAB$M_UFO
  157.         istat = sys$open(fab)
  158.         channel = fab.fab$l_stv
  159.         ufo_open = istat
  160.         end
  161.  
  162.