If the /ALLOCATE qualifier was specified when the memory-resident
global section was registered in the Reserved Memory Registry and
start_va_64 is aligned to a multiple of CPU-specific
pages appropriate for taking advantage of granularity hints then
granularity hints are used to map to the global section:
On a system that does not support resource affinity domains (RADs),
specifying 1 for the rad_mask argument is allowed.
Note: OpenVMS support for RADs is available only on the AlphaServer GS series systems. For more information about using RADs, refer to the HP OpenVMS Alpha Partitioning and Galaxy Guide.
The Create and Map to Global Demand-Zero Section service allows a
process to create and map to a memory-resident global demand-zero
section. If you set the SEC$M_SHMGS flag, the section is created as a
Galaxy-wide global demand-zero section in shared memory.
You must call either the $CREATE_GDZRO service or the $CRMPSC_GDZRO_64
service on each instance where the Galaxy shared memory will be
accessed.
Memory-resident or Galaxy-wide global sections contain demand-zero
allocation pages that are writable and memory resident. All pages in
these types of global section are shared by all processes that map to
the global section.
If the $CRMPSC_GDZRO_64 service specifies a global section that already
exists, the service maps to it only if it is a memory-resident global
section. All pages in the memory-resident global section are shared by
all processes that map to the global section.
The global demand-zero pages are always resident in memory and are not
backed up by any file on any disk. The global pages are not charged
against any page file quota. The process must have the rights
identifier VMS$MEM_RESIDENT_USER to create a memory-resident global
section; otherwise, the error status SS$_NOMEMRESID is returned.
The pages are always resident in memory and are not backed up by any
file on any disk. The pages are not placed into the process's working
set list when the process maps to the global section and the virtual
memory is referenced by the process. The pages are also not charged
against the process's working set quota or against any page-file quota.
Only memory-resident sections can be registered with the Reserved
Memory Registry in the SYSMAN facility. Memory for Galaxy-wide shared
sections is reserved through appropriate settings of the console
environment parameters.
If the memory-resident global section is either not registered in the
Reserved Memory Registry or if the /NOALLOCATE qualifier was specified
when the global section was registered in the Reserved Memory Registry,
invalid global PTEs are written to the global page table and invalid
PTEs are placed in the process page table. Physical memory is not
allocated until the virtual memory is referenced.
If the global section is registered in the Reserved Memory Registry,
the size of the global section need not match the reserved size. If the
global section is not registered in the Reserved Memory Registry or if
the reserved size is smaller than the size of the global section, the
error status SS$_INSFLPGS is returned if there are not enough fluid
pages in the system to satisfy the request.
If the /ALLOCATE qualifier was specified when the global section was
registered in the Reserved Memory Registry, contiguous, aligned
physical pages are preallocated during system initialization for this
global section. Valid page table entries are placed in the global page
table and in the process page table. If the reserved preallocated
memory is smaller than the size of the global section, the error
SS$_MRES_PFNSMALL is returned and the global section is not created.
If the memory-resident global section is not registered in the Reserved
Memory Registry or if the /PAGE_TABLES qualifier was specified when the
global section was registered in the Reserved Memory Registry, shared
page tables are created for the global section.
For more information about using the SYSMAN utility to create entries
to the Reserved Memory Registry, refer to the HP OpenVMS System Management Utilities Reference Manual.
Shared page tables consume the same internal OpenVMS data structures as
a global section. The system parameters GBLPAGES and GBLSECTIONS must
account for the additional global pages and the additional global
section.
To use the shared page tables associated with a memory-resident global
section, you must first create a shared page-table region (with
$CREATE_REGION_64). To map to the memory-resident global section using
the shared page tables, you must do the following:
- Specify a shared page-table region in the
region_id_64 argument.
- Set the flag SEC$M_EXPREG or provide a CPU-specific page table page
aligned virtual address in the start_va_64 argument.
- Specify a value for the section_offset_64 argument
that is an even multiple of bytes mapped by a CPU-specific page table
page or zero.
- Specify a value for the map_length_64 argument
that is an even multiple of bytes mapped by a CPU-specific page table
page or zero, or include the last page of the section.
See the description of the $CREATE_REGION_64 service for information
about calculating virtual addresses that are aligned to a CPU-specific
page table page boundary.
The memory-resident global section can be mapped with shared page
tables or private page tables. The following table lists the factors
associated with determining whether the mapping occurs with shared page
tables or with private page tables:
Global Section Created with Shared Page Tables |
Shared Page Table Region Specified by region_id_64 |
Type of Page Tables Used in Mapping |
No
|
No
|
Private
|
No
|
Yes
|
Private
|
Yes
|
No
|
Private
|
Yes
|
Yes
|
Shared
|
In general, if the flag SEC$M_EXPREG is set, the first free virtual
address within the specified region is used to map to the global
section.
If the flag SEC$M_EXPREG is set and the region_id_64
argument indicates a shared page table region, the first free virtual
address within the specified region is rounded up to a CPU-specific
page table page boundary and used to map to the global section.
If the flag SEC$M_EXPREG is set and if the /ALLOCATE qualifier was
specified with the SYSMAN command RESERVED_MEMORY ADD for the
memory-resident global section, the first free virtual address within
the specified region is rounded up to the same virtual alignment as the
physical alignment of the preallocated pages and used to map to the
global section. Granularity hints are set appropriately for each
process private PTE.
In general, if the flag SEC$M_EXPREG is clear, the virtual address in
the start_va_64 argument is used to map to the global
section.
If the flag SEC$M_EXPREG is clear, the value specified in the
start_va_64 argument can determine if the mapping is
possible and if granularity hints are used in the private page tables.
If a shared page table region is specified by the
region_id_64 argument, the virtual address specified
by the start_va_64 argument must be on an even
CPU-specific page table page boundary or an error is returned by this
service. If the region_id_64 argument does not specify
a shared page table region and /ALLOCATE was specified with the SYSMAN
command RESERVED_MEMORY ADD for this global section, granularity hints
are used only if the virtual alignment of start_va_64
is appropriate for the use of granularity hints (either 8-page,
64-page, or 512-page alignment).
Whenever granularity hints are being used within the mapping of a
memory-resident global section, if the length_64
argument is not an exact multiple of the alignment factor, lower
granularity hints factors are used as appropriate at the higher
addressed portion of the global section. If the
section_offset_64 argument is specified, a lower
granularity hint factor can be used throughout the mapping of the
global section to match the physical alignment of the first page mapped.
When you map a Galaxy shared section or a memory resident section that
has an associated shared page table section, you have the following
options for accessing data:
Table SYS-22 Shared Page Tables
Shared Page Tables |
Read Only |
Read and Write |
None created
|
Do not set the SEC$M_WRT flag in the map request.
Private page tables will always be used, even if you are specifying
a shared page table region into which to map the section.
|
Set the SEC$M_WRT flag in the map request.
Private page tables will always be used, even if you are specifying
a shared page table region into which to map the section.
|
Write access
|
Do not set the SEC$M_WRT flag in the map request.
Ensure that private page tables will be used. Do not specify a
shared page table region into which to map the section. If you do, the
error status SS$_IVSECFLG is returned.
|
Set the SEC$M_WRT flag in the map request.
The shared page table section will be used for mapping if you
specify a shared page table region into which to map the section.
|
Read access
|
Do not set the SEC$M_WRT flag in the map request. The shared page table
section will be used for mapping if you specify a shared page table
region into which to map the section.
|
Set the SEC$M_WRT flag in the map request. Ensure that private page
tables will be used. Do not specify a shared page table region into
which to map the section. If you do, the error status SS$_IVSECFLG is
returned.
|
Notes
Shared page tables for Galaxy shared sections are also implemented as
Galaxy shared sections. This implies that they allow either read access
only on all OpenVMS instances connected to this section or read and
write access on all instances. The setting of the SEC$M_READ_ONLY_SHPT
flag as requested by the first instance to create the section is used
on all instances.
Using the $CRMPSC_GDZRO_64 service always implies that the SEC$M_WRT
flag is set and that you want to map the section for writing. If you
want to use this service to create a section with shared page tables
for read only access, you must use private page tables and you cannot
specify a shared page table region into which to map the section.
|
If the condition value SS$_ACCVIO is returned by this service, a value
cannot be returned in the memory locations pointed to by the
return_va_64 and return_length_64
arguments and, if specified as a nonzero value, the
reserved_length_64 argument.
If a condition value other than SS$_ACCVIO is returned, the returned
address and returned length indicate the pages that were successfully
mapped before the error occurred. If no pages were mapped, the
return_va_64 argument contains the value --1.
If the service returns an error status value other than SS$_INSFLPGS or
SS$_MRES_PFNSMALL, a value is not returned in the
reserved_length_64 argument.
If the service returns a successful condition value or if SS$_INSFLPGS
or SS$_MRES_PFNSMALL is returned and the
reserved_length_64 argument is specified as a nonzero
address, the length in bytes of the global section as registered in the
Reserved Memory Registry is returned in the
reserved_length_64 argument.
Required Privileges
To create a global section, the process must have the following
privileges:
- SYSGBL privilege to create a system global section (if flag
SEC$M_SYSGBL is set)
- PRMGBL privilege to create a permanent global section
- VMS$MEM_RESIDENT_USER rights identifier to create a memory-resident
section
- SHMEM privilege on OpenVMS Galaxy systems to create an object in
Galaxy shared memory
Required Quota
If private page tables are used to map to the memory-resident global
section, the working set limit quota (WSQUOTA) of the process must be
sufficient to accommodate the increased size of the process page tables
required by the increase in virtual address space.
If private page tables are used to map to the memory-resident global
section, the page file quota (PGFLQUOTA) of the process must be
sufficient to accommodate the increased size of the process page tables
required by the increase in virtual address space.
Related Services
$CREATE_GDZRO, $CREATE_GPFILE, $CREATE_REGION_64, $CRMPSC,
$CRMPSC_FILE_64, $CRMPSC_GFILE_64, $CRMPSC_GPFN_64, $CRMPSC_PFN_64,
$DELETE_REGION_64, $DELTVA_64, $DGBLSC, $LCKPAG_64, $LKWSET_64,
$MGBLSC_64, $PURGE_WS, $SETPRT_64, $ULKPAG_64, $ULWSET_64, $UPDSEC_64,
$UPDSEC_64W