Updated: 11 December 1998 |
OpenVMS Programming Concepts Manual
Previous | Contents | Index |
Fast I/O and Fast Path are two optional features that can provide improved I/O performance. Performance improvement is achieved by reducing the CPU cost per I/O request, and improving symmetric multiprocessing (SMP) scaling of I/O operations. The CPU cost per I/O is reduced by optimizing code for high-volume I/O and by using better SMP CPU memory cache. SMP scaling of I/O is increased by reducing the number of spinlocks taken per I/O and by substituting finer-granularity spinlocks for global spinlocks.
The improvements follow a division that already exists between the device-independent and device-dependent layers in the OpenVMS I/O subsystem. The device-independent overhead is addressed by Fast I/O, which is a set of system services that can substitute for certain $QIO operations. Using these services requires some coding changes in existing applications, but the changes are usually modest and well contained. The device-dependent overhead is addressed by Fast Path, which is an optional performance feature that creates a "fast path" to the device. It requires no application changes.
Fast I/O and Fast Path can be used independently. However, together
they can provide a reduction in CPU cost per I/O on uniprocessor and on
multiprocessor systems.
11.22.1 Fast I/O
Fast I/O is a set of three system services, SYS$IO_SETUP, SYS$IO_PERFORM, and SYS$IO_CLEANUP, that were developed as an alternative to $QIO. These services are not a $QIO replacement; $QIO is unchanged, and $QIO interoperation with these services is fully supported. Rather, the services substitute for a subset of $QIO operations, namely, only the high-volume read/write I/O requests.
The Fast I/O services support 64-bit addresses for data transfers to and from disk and tape devices.
While Fast I/O services are available on OpenVMS VAX, the performance
advantage applies only to OpenVMS Alpha. OpenVMS VAX has a run-time
library (RTL) compatibility package that translates the Fast I/O
service requests to $QIO system service requests, so one set of source
code can be used on both VAX and Alpha systems.
11.22.1.1 Fast I/O Benefits
The performance benefits of Fast I/O result from streamlining high-volume I/O requests. The Fast I/O system service interfaces are optimized to avoid the overhead of general-purpose services. For example, I/O request packets (IRPs) are now permanently allocated and used repeatedly for I/O rather than allocated and deallocated anew for each I/O.
The greatest benefits stem from having user data buffers and user I/O status structures permanently locked down and mapped using system space. This allows Fast I/O to do the following:
In total, Fast I/O services eliminate four spinlock acquisitions per
I/O (two for the MMG spinlock and two for the SCHED spinlock). The
reduction in CPU cost per I/O is 20% for uniprocessor systems and 10%
for multiprocessor systems.
11.22.1.2 Buffer Objects
The lockdown of user-process data structures is accomplished by buffer objects. A "buffer object" is process memory whose physical pages have been locked in memory and double-mapped into system space. After creating a buffer object, the process remains fully pageable and swappable and the process retains normal virtual memory access to its pages in the buffer object.
If the buffer object contains process data structures to be passed to an OpenVMS system service, the OpenVMS system can use the buffer object to avoid any probing, lockdown, and unlocking overhead associated with these process data structures. Additionally, double-mapping into system space allows the OpenVMS system direct access to the process memory from system context.
To date, only the $QIO system service and the Fast I/O services have been changed to accept buffer objects. For example, a buffer object allows a programmer to eliminate I/O memory management overhead. On each I/O, each page of a user data buffer is probed and then locked down on I/O initiation and unlocked on I/O completion. Instead of incurring this overhead for each I/O, it can be done once at buffer object creation time. Subsequent I/O operations involving the buffer object can completely avoid this memory management overhead.
Two system services can be used to create and delete buffer objects, respectively, and can be called from any access mode. To create a buffer object, the SYS$CREATE_BUFOBJ system service is called. This service expects as inputs an existing process memory range and returns a buffer handle for the buffer object. The buffer handle is an opaque identifier used to identify the buffer object on future I/O requests. The SYS$DELETE_BUFOBJ system service is used to delete the buffer object and accepts as input the buffer handle. Although image rundown deletes all existing buffer objects, it is good form for the application to clean up properly.
A 64-bit equivalent version of the SYS$CREATE_BUFOBJ system service, SYS$CREATE_BUFOBJ_64, can be used to create buffer objects from the new 64-bit P2 or S2 regions. The SYS$DELETE_BUFOBJ system service can be used to delete 32-bit or 64-bit buffer objects.
Buffer objects require system management. Because buffer objects tie up physical memory, extensive use of buffer objects require system management planning. All the bytes of memory in the buffer object are deducted from a systemwide SYSGEN parameter called MAXBOBMEM (maximum buffer object memory). System managers must set this parameter correctly for the application loads that run on their systems.
The MAXBOBMEM parameter defaults to 100 Alpha pages, but for applications with large buffer pools it will likely be set much larger. To prevent user-mode code from tying up excessive physical memory, user-mode callers of $CREATE_BUFOBJ must have a new system identifier, VMS$BUFFER_OBJECT_USER, assigned. This new identifier is automatically created in an OpenVMS Version 7.0 upgrade if the file SYS$SYSTEM:RIGHTSLIST.DAT is present. The system manager can assign this identifier with the DCL command SET ACL command to a protected subsystem or application that creates buffer objects from user mode. It may also be appropriate to grant the identifier to a particular user with the Authorize utility command GRANT/IDENTIFIER (for example, to a programmer who is working on a development system).
There is currently a restriction on the type of process memory that can
be used for buffer objects. Global section memory cannot be made into a
buffer object.
11.22.1.3 Additional Information About Fast I/O and Buffer Objects
For complete information about using Fast I/O, the Fast I/O system services, and the buffer objects system services that are in the following list, see the OpenVMS I/O User's Reference Manual, and the OpenVMS System Services Reference Manual: A--GETMSG and OpenVMS System Services Reference Manual: GETQUI--Z:
Like Fast I/O, Fast Path is an optional, high-performance feature designed to improve I/O performance. By restructuring and optimizing class and port device driver code around high-volume I/O code paths, Fast Path creates a streamlined path to the device. Fast Path is of interest to any application where enhanced I/O performance is desirable. Two examples are database systems and real-time applications, where the speed of transferring data to disk is often a vital concern.
Using Fast Path features does not require source-code changes. Minor interface changes are available for expert programmers who want to maximize Fast Path benefits.
Currently, Fast Path only supports disk I/O for the CIXCD port. This port provides access to CI storage for XMI based systems.
At this time, Fast Path is not available on the OpenVMS VAX operating
system.
11.22.2.1 Fast Path Features and Benefits
Fast Path achieves performance gains by reducing CPU time for I/O requests on both uniprocessor and SMP systems. The performance benefits are produced by:
The performance improvement can best be seen by contrasting the current OpenVMS I/O scheme to the new Fast Path scheme. While transparent to an OpenVMS user, each disk and tape device is tied to a specific port interconnect. All I/O for a device is sent out over its assigned port. Under the current OpenVMS I/O scheme, a multiprocessor I/O can be initiated on any CPU, but I/O completion must occur on the primary CPU. Under Fast Path, all I/O for a given port is affinitized to a specific CPU, eliminating the requirement for completing the I/O on the primary CPU. This means that the entire I/O can be initiated and completed on a single CPU. Because I/O operations are no longer split among different CPUs, performance increases as memory cache thrashing between CPUs decreases.
Fast Path also removes a possible SMP bottleneck on the primary CPU. If the primary CPU must be involved in all I/O, then once this CPU becomes saturated, no further increase in I/O throughput is possible. Spreading the I/O load evenly among CPUs in a multiprocessor system provides greater maximum I/O throughput on a multiprocessor system.
With most of the I/O code path executing under port-specific spinlocks
and with each port assigned to a specific CPU, a scalable SMP model of
parallel operation exists. Given multiple port and CPUs, I/O can be
issued in parallel to a large degree.
11.22.2.2 Additional Information About Fast Path
For complete information about using Fast Path, see the OpenVMS I/O User's Reference Manual.
This chapter describes how to create and use logical names and logical name tables. It contains the following sections:
Section 12.1 describes how to use logical name system services and DCL commands, how to use logical and equivalence names, and how to use logical name tables.
Section 12.2 describes how to create user-defined and clusterwide logical name tables.
Section 12.3 describes how to check access and protection of logical names and logical name tables.
Section 12.4 describes how to specify access modes of a logical name.
Section 12.5 describes how to translate logical names.
Section 12.6 describes how to specify attributes.
Section 12.7 describes how to establish logical name table quotas.
Section 12.8 describes interprocess communication.
Section 12.9 describes the format convention for logical names and equivalence names.
Section 12.10 describes how to use logical name and logical name tables
system services with example programs.
12.1 Logical Name System Services and DCL Commands
This section describes how to use system services to establish logical names for general application purposes. The system performs special logical name translation procedures for names associated with certain system services. For further information, see the following chapters:
The operating system's logical name services provide a technique for manipulating and substituting character-string names. Logical names are commonly used to specify devices or files for input or output operations. You can also use logical names to communicate information between processes by creating a logical name in one process in a shared logical name table and translating the logical name in another process.
Besides using logical name system services, you can use DCL commands to create and manipulate logical names and logical name tables. Table 12-1 lists the operating system's logical name system services and equivalent DCL commands.
System Service | Meaning | DCL Command | Meaning |
---|---|---|---|
SYS$CRELNM | Create Logical Name | ALLOCATE | Optionally associates a logical name with a device. |
ASSIGN | Creates a logical name and assigns an equivalence string to a specific logical name. | ||
DEFINE | Associates an equivalence name with a logical name. | ||
MOUNT | Allows the optional naming of a logical name for a disk or magnetic tape volume. | ||
SYS$CRELNT | Create Logical Name Table | CREATE/NAME_TABLE | Creates a new logical name table. |
SYS$DELLNM | Delete Logical Name | DEASSIGN | Cancels a logical name assignment. |
SYS$TRNLNM | Translate Logical Name | SHOW LOGICAL | Displays translations and the logical name table for a specified logical name. |
SHOW TRANSLATION | Displays the first translation found for the specified logical name. |
The following sections describe various concepts you should be aware of
when you use the logical name system services. For further discussion
of logical names, see the OpenVMS User's Manual.
12.1.1 Logical Names, Equivalence Names, and Search Lists
A logical name is a user-specified character string that can represent a file specification, device name, logical name table name, application-specific information, or another logical name. Typically, for process-private purposes, you specify logical names that are easy to use and to remember. System managers and privileged users choose mnemonics for files, system devices, and search lists that are frequently accessed by all users.
An equivalence string, or an equivalence name, is a character string that denotes the actual file specification, device name, or character string. An equivalence name can also be a logical name. In this case, further translation is necessary to reveal the actual equivalence name.
A multivalued logical name, commonly called a search list, is a logical name that has more than one equivalence string. Each equivalence string in the search list is assigned an index number starting at zero.
Logical names and their equivalence strings are stored in logical name tables. Logical names can have a maximum length of 255 characters. Equivalence strings can have a maximum of 255 characters. You can establish logical name and equivalence string pairs as follows:
For example, you could use the symbolic name TERMINAL to refer to an output terminal in a program. For a particular run of the program, you could use the DEFINE command to establish the equivalence name TTA2.
To create a logical name in a program, you must define character-string
descriptors for the name strings and call the system service within
your program.
12.1.2 Logical Name Tables
A logical name table contains logical name and equivalence string pairs. Each table is an independent name space. When you translate a logical name, you specify the table containing the name. A logical name table is referred to by its name, which is itself a logical name, or by another logical name that translates into the table name.
Logical name tables can be created in process space or in system space. Tables created in process space are accessible only by that process. Tables created in system space are potentially shareable among many processes. OpenVMS creates a number of logical name tables with specific characteristics. These predefined logical name tables have names beginning with the prefix LNM$.
Logical name and equivalence name pairs are maintained in three types of logical name tables:
Because the names of logical name tables are logical names, table names must reside in logical name tables. Two special tables called directories exist for this purpose. Table names are translated from these logical name directory tables. Logical name and equivalence name pairs for logical name tables are maintained in the following two directory tables:
The process directory table contains the names of all process-private user-defined logical name tables created through the SYS$CRELNT system service. In addition, the process directory table contains system-assigned logical name table names and the name of the process logical name table LNM$PROCESS_TABLE.
The system directory table contains the names of potentially shareable logical name tables and system-assigned logical name table names. Typically, you must have the SYSPRV privilege to create a logical name in the system directory table. For a discussion of privileges, see Section 12.3.
Logical names other than logical name table names can exist within
these tables, but are strongly discouraged. The length of the logical
names and table names created in either of these tables must not exceed
31 characters. Logical table names and logical names created in the
directory tables must consist of uppercase alphanumeric characters,
dollar signs ($), and underscores (_). Equivalence strings must not
exceed 255 characters.
12.1.2.2 Process, Job, Group, System and Clusterwide Default Logical Name Tables
OpenVMS creates a number of logical name tables automatically, some at system initialization and some at process creation. Some of these tables are accessible to all processes, and some are accessible only to selected processes. These tables are called the default logical name tables.
Each default logical name table has a logical name associated with it in addition to its table name. The default logical name table names and the common logical names used to refer to them are as follows:
Table | Name | Logical Name |
---|---|---|
Process | LNM$PROCESS_TABLE | LNM$PROCESS |
Job | LNM$JOB_ xxxxxxxx 1 | LNM$JOB |
Group | LNM$GROUP_ gggggg 2 | LNM$GROUP |
System | LNM$SYSTEM_TABLE, LNM$SYSCLUSTER | LNM$SYSTEM |
Clusterwide system table | LNM$SYSCLUSTER_TABLE | LNM$SYSCLUSTER |
Clusterwide parent table | LNM$CLUSTER_TABLE | LNM$CLUSTER |
The length of the logical names created in these tables cannot exceed
255 characters, with no restriction on the types of characters used.
Equivalence strings cannot exceed 255 characters. By convention, a
Compaq-created logical name begins with a facility-specific prefix,
followed by a dollar sign ($) and a name within that facility. You are
strongly encouraged to define logical names without the dollar sign ($)
to avoid inadvertent conflicts.
12.1.2.2.1 Process Logical Name Table
The process logical name table LNM$PROCESS_TABLE contains names used exclusively by the process. A process logical name table exists for each process in the system. Some entries in the process logical name table are made by system programs executing at more privileged access modes; these entries are qualified by the access mode from which the entry was made. The process logical name table contains the following process-permanent logical names:
Logical Name | Meaning |
---|---|
SYS$INPUT | Default input stream |
SYS$OUTPUT | Default output stream |
SYS$COMMAND | Original first-level (SYS$INPUT) input stream |
SYS$ERROR | Default device to which the system writes error messages |
SYS$COMMAND is created only for processes that execute LOGINOUT.
Usually, you create logical names only in your process logical name table. Most entries in the process logical name table are made in user or supervisor mode.
Process logical names that are created in user mode are deleted whenever the creating process runs an image down. The following DCL commands illustrate this behavior with supervisor mode and /TABLE=LNM$PROCESS as the defaults (default mode and default table) for the DEFINE command:
$ DEFINE/USER ABC XYZ $ SHOW TRANSLATION ABC ABC = XYZ $ DIRECTORY . . . $ SHOW LOGICAL ABC ABC = (undefined) |
The DCL command DIRECTORY performs image rundown when it is finished operating. At that time, all user-mode process-private logical names are deleted, including the logical name ABC.
Previous | Next | Contents | Index |
Copyright © Compaq Computer Corporation 1998. All rights reserved. Legal |
5841PRO_033.HTML
|