11-Feb-2013

Easy calculator for initial VHPT_SIZE value

On Itanium, the Virtual Hash Page Table is an intermediate cache of address translations that sits between the TLB and physical address translation by walking the page tables. The default value in SYSGEN is 1, which allows for 1024 addresses to be cached.

If you have large application with poor locality of reference, increasing VHPT_SIZE could be beneficial.

Here's a DCL command procedure to calculate a good starting value for SYSGEN parameter VHPT_SIZE:


$! VHPT.COM - see EOF for comments.
$       old_verify = 'f$verify (0)'
$       status = 1
$       say := write sys$output
$       required_privs = "world"
$       old_privs = f$setprv (required_privs)
$       if .not. f$privilege (required_privs)
$       then
$           say "Required privs: " + required_privs
$           status = 38
$           goto exit
$       endif
$       if f$getsyi ("arch_name") .nes. "IA64"
$       then
$           say "This is an IA64 specific command procedure"
$           status = 44
$           goto exit
$       endif
$       have_math = f$type (math) .eqs. "STRING"
$       page_size = f$getsyi ("page_size")
$       context = ""
$       max = -1
$loop:
$       pid = f$pid (context)
$       if pid .eqs. ""
$       then
$           goto end_loop
$       endif
$       test = f$getjpi (pid, "virtpeak") * 512 / page_size * 32 / 1024
$!                   pagelet size-----------^                 ^    ^
$!                   VHPT entry size--------------------------^    ^
$!                   convert to K for VHPT_SIZE--------------------^
$       if test .gt. max
$       then
$           max = test
$       endif
$       goto loop
$end_loop:
$       if have_math
$       then
$           math a = 2 ^ ceil (log (max) / log (2))
$           max = f$element (0, ".", a)
$           rounded = ""
$       else
$           rounded = " rounded up to the nearest power of 2"
$       endif
$       say "Good starting point for VHPT_SIZE is ''max'" + rounded
$exit:
$       set noon
$       junk = f$setprv (old_privs)
$       exit (status + 0*f$verify (old_verify))
$!++
$!
$! DESCRIPTION
$!
$!      This code figures out a good starting point for the VHPT_SIZE SYSGEN
$!      parameter, based on largest peak virtual address size running on this
$!      system.  The maths from this come from BRUDEN OSSG, specifically
$!      this article by Bruce Ellis:
$!
$!              http://brudenossg.com/doc_lib/VMS_VHPT.pdf
$!
$!      This command procedure just makes the calculations more convenient.
$!
$! AUTHOR
$!
$!      James F. Duff
$!
$! DATE WRITTEN
$!
$!      10-Feb-2013
$!
$! MODIFICATION HISTORY
$!
$!      10-Feb-2013     Jim Duff
$!      Original version of module.
$!
$!--

Posted at February 11, 2013 11:00 AM
Tag Set:

Comments are closed