[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decram

Title:DECram
Notice:DECram Notesfile. See note 2.0 for the Kit location
Moderator:AXEL::FOLEY
Created:Mon Sep 23 1991
Last Modified:Tue Apr 15 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:136
Total number of notes:520

134.0. "HITRATE for MDA0 is erroneous" by CSC32::MARSHALL () Tue Feb 11 1997 22:35



 Hi,

  Could someone explain why the hitrate for DECram device MDA0, as reported
 by @SYS$STARTUP:RAMDISK$STARTUP HITRATE, is totally erroneous? 

    Thanks,
    
    Greg Marshall
    --------------------------------------------------------------------
  Customer says that the statistic seemed reasonable for a period of time
 but now appears wrong. He has supplied the following info:

  Config:

  OpenVMS/Alpha v6.2-1H2
  DECram v2.2B

  Sample output from each node, which includes:

  - Output from HITRATE display
  - One of four SYS$STARTUP:RAMDISK$nodename.DAT files (all four
    are exactly the same ... just double checked them all with DIF).

 $ SYSMAN
SYSMAN> set env /node=(EMJVX0, EMJVX1, EMJVX2, EMJVX3)
SYSMAN> do @sys$startup:ramdisk$startup hitrate
%SYSMAN-I-OUTPUT, command execution on node EMJVX0
Current RAMdisk hit rate = 4294967272%          Created: 11-JAN-1997
17:33:50.62

SYS$SYSDEVICE operation count = 11451082,   RAMdisk operation count= 32344817

%RAMdisk-S-HITRATE,  RAMdisk HITRATE completed successfully
%SYSMAN-I-OUTPUT, command execution on node EMJVX1

Current RAMdisk hit rate = 4294967289%          Created: 11-JAN-1997
18:00:10.78

SYS$SYSDEVICE operation count = 9326662,   RAMdisk operation count= 39391873

%RAMdisk-S-HITRATE,  RAMdisk HITRATE completed successfully
%SYSMAN-I-OUTPUT, command execution on node EMJVX2

Current RAMdisk hit rate = 4294967227%          Created: 18-JAN-1997
17:23:26.34

SYS$SYSDEVICE operation count = 6192256,   RAMdisk operation count= 22774372

%RAMdisk-S-HITRATE,  RAMdisk HITRATE completed successfully
%SYSMAN-I-OUTPUT, command execution on node EMJVX3

Current RAMdisk hit rate = 4294967221%          Created: 18-JAN-1997
15:19:07.00

SYS$SYSDEVICE operation count = 6036882,   RAMdisk operation count= 21879205

%RAMdisk-S-HITRATE,  RAMdisk HITRATE completed successfully


! Name:         RAMDISK$EMJVX3.DAT
! Description:
!
! This is  the data file used by RAMDISK$STARTUP.COM during a CREATE or a
! SIZE function to build a read-only RAMdisk.
!
! The data file  must be named SYS$STARTUP:RAMDISK$node.DAT where node is
! your system's nodename.
!
! **** The files listed here are just an example.   You need to determine
! **** which files on your system should be moved to the RAMdisk. Consult
! **** the DECram documentation for more details.
!
! The data file is  used to identify which directories and files you wish
! to copy to the RAMdisk  and  use from that location.  Define the system
! logical  from  the  origin  of the  files  followed  by  the  filename.
! Wildcards are NOT allowed.
!
! If any of the files copied were  installed  on  the physical disk, they
! are de-installed and installed on the RAMdisk so  image activations and
! hard faults occur on the RAMdisk.
!
! CAUTION:   Images such as DCLTABLES.EXE should never be  moved  to  the
! RAMdisk  because  some  processes  (for  example,  SMISERVER) will have! already started using the physical disk version by the time you get the
! RAMdisk loaded and running.
!
! There are also  two  parameters  examined  by the procedure.  These are
! "minimum_free_memory" and "extra_disk_blocks".  The "extra_disk_blocks"
! allows you to specify how  much  free  space  you  need on the RAMdisk.
! Extra space on the disk would  allow  you  to manually add files to the
! RAMdisk.  The "minimum_free_memory" parameter ensures the  RAMdisk will
! not be  created  unless it  will leave at  least  that amount  of  free
! page(let)s in memory.  If you do not wish to  specify these parameters,
! simply set them to zero.
!

! Here are the user defined parameters:
! minimum_free_memory is expressed in pagelets on OpenVMS AXP

minimum_free_memory=1000
extra_disk_blocks=0
sys$system:backup.exe
sys$system:copy.exe
sys$system:dcl.exe
sys$system:delete.exe
sys$system:directory.exe
sys$system:loginout.exe
sys$system:mail.exe
sys$system:mail_server.exe
sys$system:mom.exe
sys$system:netserver.exe
sys$system:queman.exe
sys$system:rename.exe
sys$system:rundet.exe
sys$system:search.exe
sys$system:set.exe
sys$system:setp0.exe
sys$system:show.exe
sys$system:submit.exe
sys$system:sysgen.exe
sys$system:tpu.exe
sys$system:type.exe
sys$system:vue$master.exe
sys$library:BASRTL_D56_TV.EXE
sys$library:BASRTL_TV_SUPPORT.EXE
sys$library:cddshr.exe
!sys$library:CMA$TIS_SHR.EXE    ! Don't put into RAM - INSTALL problem
sys$library:CONVSHR.EXE
!sys$library:dcltables.exe      ** do not put this file on the RAMdisk
sys$library:DEC$BASRTL.EXE
!sys$library:DECC$SHR.EXE       ! Don't put into RAM - INSTALL problem
sys$library:debugshr.exe
SYS$LIBRARY:SYNRTL.EXE
SYS$LIBRARY:SYNRTLSRT.EXE
!
!sys$library:DPML$SHR.EXE       ! Don't put into RAM - INSTALL problem
sys$library:FDLSHR.EXE
!sys$library:LBRSHR.EXE         ! Don't put into RAM - INSTALL problem
!sys$library:LIBOTS.EXE         ! Don't put into RAM - INSTALL problem
sys$library:LIBOTS2.EXE
!sys$library:LIBRTL.EXE         ! Don't put into RAM - INSTALL problem
sys$library:LIBRTL_D56_TV.EXE
sys$library:MTHRTL_D53_TV.EXE
sys$library:NCSSHR.EXEsys$library:mailshr.exe
sys$library:nm_mailshr.exe
!sys$library:secureshrp.exe     ! Don't put into RAM - INSTALL problem
sys$library:SORTSHR.EXE
sys$library:TIE$SHARE.EXE
!
sys$message:dblmf.exe
! Leave this  marker  here.  It is used to cleanly locate the end of this
! data file so several routines can use it.

end_of_file  
T.RTitleUserPersonal
Name
DateLines
134.132bit overflowGIDDAY::GILLINGSa crucible of informative mistakesWed Feb 12 1997 05:2166
  Greg,

    The code to calculate this statistic is as follows:

$  sysdisk_ops = f$getdvi("sys$sysdevice","opcnt")
$  ramdisk_ops = f$getdvi("RAMdisk","opcnt")
$  open/read/error=error$ statsfile RAMdisk:[000000]RAMdisk$stats.dat
$  read/error=error$ statsfile sysdisk_ops_creation
$  read/error=error$ statsfile ramdisk_ops_creation
$  read/error=error$ statsfile create_date
$  close/error=error$ statsfile
$  sysdisk_ops = sysdisk_ops - sysdisk_ops_creation
$  ramdisk_ops = ramdisk_ops - ramdisk_ops_creation
$  say ""
$  say f$fao("Current RAMdisk hit rate = !UL%            Created: !AS",-
       ramdisk_ops*100/(sysdisk_ops+ramdisk_ops),create_date)
$  say ""
$  say -
   f$fao("SYS$SYSDEVICE operation count = !UL,   RAMdisk operation count= !UL",-
   sysdisk_ops,ramdisk_ops)

    According to your note, the values are:

$ sysdisk_ops=11451082
$ ramdisk_ops=32344817

    The largest positive value expressible as a signed 32 bit integer is
  2147483647, but the intermediate result of "ramdisk_ops*100" should be
  3234481700. Since DCL doesn't signal an overflow, the result is (hex)
  %XC0CA4624 which is interpreted as -1060485596. This value is then divided
  by 43795899, yielding -24. However, the formatting is "%UL" which interprets
  the result as unsigned, hence 4294967289%.

    Now, the calculation could have been expressed as:

	ramdisk_ops/((sysdisk_ops+ramdisk_ops)/100)

    which, in this case would have yielded the correct answer of 73, but
    would result in reduced accuracy for small values and a divide by zero
    error for very small values (ie: sysdisk_ops+ramdisk_ops < 100). Even if
    the code were changed, the calculation would eventually fail since 
    other values could exceed the limits of 32 bit arithmetic. Indeed, the
    counters themselves would eventually wrap around, also resulting in
    odd behaviour. OpenVMS is sometimes just too reliable for it's own good ;-)

    If the customer is very concerned about this, they could change the code
    from:

$  say f$fao("Current RAMdisk hit rate = !UL%            Created: !AS",-
       ramdisk_ops*100/(sysdisk_ops+ramdisk_ops),create_date)

    to:

$ IF ramdisk_ops < 20000000  ! actually 21474837 but why push it?
$ THEN
$  say f$fao("Current RAMdisk hit rate = !UL%            Created: !AS",-
       ramdisk_ops*100/(sysdisk_ops+ramdisk_ops),create_date)
$ ELSE
$  say f$fao("Current RAMdisk hit rate = !UL%            Created: !AS",-
       ramdisk_ops/((sysdisk_ops+ramdisk_ops)/100),create_date)
$ ENDIF

    Note that the change would need to be propogated into any new versions
    of the file created by reinstallation or upgrade of the product.

						John Gillings, Sydney CSC