Before a computing device may accomplish a desired task, it must receive an appropriate set of instructions. Executed by a device's processor(s), these instructions direct the operation of the device. These instructions can be stored in a memory of the computer. Instructions can invoke other instructions.
A computing device, such as a server, router, desktop computer, laptop, etc., and other devices having processor logic and memory, includes an operating system layer and an application layer to enable the device to perform various functions or roles. The operating system layer includes a “kernel” (i.e., master control program) that runs the computing device. The kernel provides task management, device management, and data management, among others. The kernel sets the standards for application programs that run on the computing device and controls resources used by application programs. The application layer includes programs, i.e., executable instructions, which are located above the operating system layer and accessible by a user. As used herein, “user space”, “user-mode”, or “application space” implies a layer of code which is less privileged and more directly accessible by users than the layer of code which is in the operating system layer or “kernel” space.
When the execution of the program instructions call for data or other program instructions, the program will want to know where in memory the data or instructions are stored. In effect, the program will use a means for referencing or indexing where in memory the data or instructions are held. This work is done as part of the virtual memory subsystem of the operating system. In virtual memory, a process has a logical view of memory that does not correspond to the actual layout of physical memory. When a process uses a virtual memory address the virtual memory system translates it into a physical address using a virtual to physical address mapping contained in some type of look up structure and address mapping database.
The kernel manages various data structures within virtual memory, such as virtual address spaces, pregions, and regions. A virtual address space contains a set of pregions, which are associated with regions. Each pregion is linked to a region which has further information about access to a particular range of addresses within an address space. A region contains one or more pages that have virtual memory locations, in which data or instructions can be stored. A private region is associated with a pregion from one process and a shared region is associated with pregions from more than one process. A virtual memory location in a private region is a private virtual memory location and a virtual memory location in a shared region is a shared virtual memory location.
The location of a virtual memory location can be identified or described in various ways. A virtual memory address, associated with or assigned to a virtual memory location, identifies or describes the general location within a virtual memory. A descriptor, associated with or assigned to a virtual memory location, identifies or describes the specific location of its virtual memory location within a virtual memory. A unique descriptor is the sole descriptor for its virtual memory location. The term descriptor and/or unique descriptor as used herein is a “space id”. The term space id will be appreciated by one familiar with the art of virtual memory management. As will be appreciated, a space id is generated and maintained by the virtual memory subsystem of the operating system. A space id is associated with each virtual memory address.
As the user space virtual memory addresses are not unique addresses like kernel virtual memory addresses, a key is generated for these virtual addresses when the user space applications enter kernel space to wait for a particular event or resource. This key is used to identify the specific location of a virtual memory location within a virtual memory. To generate the key, the program instructions search through a virtual address space of the given process to locate the pregion that corresponds to the virtual memory address. While the program instructions search, the virtual address space is locked to prevent data in the virtual memory from being changed and/or moved. Once the program instructions find the pregion that corresponds to the virtual memory address, the program instructions can generate a key for identifying the specific location of the virtual memory location using the pregion and region information. After the program instructions have found or traversed through the entire virtual memory space, the virtual address space is unlocked.
When a virtual address space is locked, the use of the space is restricted. While locked, no process can write to the virtual address space and some processes may not be able to read from the virtual address space. These restrictions can limit the efficiency of processes that use the virtual address space. This may be particularly detrimental when the process has a large virtual address space.
Embodiments include systems, methods, and devices, including executable program instructions, for virtual memory key generation. One method embodiment includes selecting a virtual memory location that has a virtual memory address and a unique descriptor, assigned to it. According to various embodiments program instructions execute to generate a key for identifying the virtual memory location using the virtual memory address and the unique descriptor.
According to various embodiments, a key, for identifying the specific location of a virtual memory location within a virtual memory, can be generated without locking a virtual address space, processes can write to and read from the virtual address space, thus removing restrictions that would otherwise limit their efficient use of the virtual address space.
The processor 107 represents a processing unit of various architectures. Embodiments of the disclosure can be implemented in a multi-processor or single processor system or computing device. Embodiments described herein can similarly be implemented in a distributed computing network environment, as the same are known and understood by one of ordinary skill in the art. The embodiments are not limited to the examples given herein.
The host bridge chipset 120 includes a number of interface circuits to allow the host processor 107 to access the system memory 130 and the PCI bus 145. The system memory 130 represents one or more mechanisms for storing information. For example, the system memory 130 may include non-volatile and/or volatile memories. Examples of these memories include flash memory, read only memory (ROM), random access memory (RAM), etc. The system memory 130 may be loaded with an operating system (OS) 131, e.g., in ROM. A basic input/output system (BIOS) is stored in ROM in the system memory 130. Examples of operating systems include, but are not limited to, Windows, Mac, Unix, Linux, etc. The system memory 130 further includes a memory management system 135, e.g., in RAM, and other programs and data 138. The memory management system 135 includes the virtual memory subsystem associated with a given operating system 131 and, as mentioned above, the virtual memory subsystem is capable of generating and maintaining descriptors (unique or otherwise), i.e., space ids, associated with each virtual memory address. The system memory 130 may also contain additional software as the same will be known and understood by one of ordinary skill in the art. The memory management system 135 includes elements such as virtual memory data structures associated with various processes to support the management of memory in connection with program applications being executed by the processor 107. That is, as one of ordinary skill in the art will appreciate, the memory management system includes programs, code, data, look-up tables, etc.
The PCI slots 160-1 to 160-N provide interfaces to PCI devices. Examples of PCI devices can include printers, removable disk storage and databases, facsimiles, scanners, network interface devices, media interface devices, etc. Storage devices 172 can include CD ROMs, databases, disks, hard drives, etc. Embodiments, however, are not limited to these examples.
The memory 230 includes an operating system 240, which contains a virtual memory 250 and a key generation functionality 290. The virtual memory 250 includes a virtual memory location 260. A virtual memory address 270 and a unique descriptor 280 are associated with the virtual memory location 260. The key generation functionality 290 is capable of generating a key, for identifying the specific location of the virtual memory location 260 within the virtual memory 250, without locking a virtual address space, by using the virtual memory address 270 and the unique descriptor 280, as described herein.
In the embodiment shown in
In the embodiment shown in
In the embodiment of
In one embodiment, program instructions can execute to generate a two-part key. Program instructions can execute to generate a first part of the two-part key, so that the first part is a value or expression that represents a virtual memory address assigned to a selected virtual memory location. Program instructions can also execute to generate a second part of the two-part key, so that the second part is a value or expression that represents a unique descriptor assigned to the selected virtual memory location. In this embodiment, the two-part key includes the first part and the second part.
For example, in the embodiment of
In various embodiments, a value in a key can be a numerical value. The numerical value can be in a number of different formats such as binary, hexadecimal, or some other format. The numerical value also can be a number of different sizes, such as a byte value, a multibyte value, or some other size. Embodiments are not limited to these examples.
In the embodiment of
In the virtual memory of some computing devices, private virtual memory locations have unique descriptors, but shared virtual memory locations may not have unique descriptors. In these devices, program instructions that execute to generate a key by using a unique descriptor assigned to a virtual memory location, cannot execute to generate a key for a shared virtual memory location. Since such program instructions use unique descriptors to execute to generate a key, it can be useful to determine whether a virtual memory location selected from such a device is a private virtual memory location.
In various embodiments, program instructions can execute to determine whether a selected virtual memory location is a private virtual memory location. In one embodiment, a record maintains data about whether a virtual memory location is a private virtual memory location. In this embodiment, such a record can be a library, a file, a table, and/or some other type of record, in a system memory, an operating system, a kernel, and/or some other type of record storage. In this embodiment, the program instructions can execute to determine whether a selected virtual memory location is a private virtual memory location by directly or indirectly using the data maintained in the record.
In another embodiment, a record maintains data about whether a virtual memory location is a private virtual memory location and the record is capable of providing an indicator to program instructions. In this embodiment, such an indicator can be a flag, data, an instruction, and/or some other type of indicator. In this embodiment, the program instructions can execute to determine whether a selected virtual memory location is a private virtual memory location by receiving an indicator provided by the record.
The embodiments described herein can be performed by software and/or firmware (i.e., computer executable instructions), hardware, application modules, and the like, executable and/or resident on the systems and devices shown herein or otherwise. The embodiments of the invention are not limited to any particular operating environment or to instructions written in a particular programming language. Software, firmware, and/or processing modules, suitable for carrying out embodiments of the present invention, can be resident in one or more devices or locations. Processing modules can include separate modules connected together or include several modules on an application specific integrated circuit (ASIC).
In the embodiment shown in
Although specific embodiments have been illustrated and described herein, those of ordinary skill in the art will appreciate that an arrangement calculated to achieve the same techniques can be substituted for the specific embodiments shown. This disclosure is intended to cover all adaptations or variations of various embodiments of the present disclosure. It is to be understood that the above description has been made in an illustrative fashion, and not a restrictive one. Combination of the above embodiments, and other embodiments not specifically described herein will be apparent to those of skill in the art upon reviewing the above description. The scope of the various embodiments of the present disclosure includes other applications in which the above structures and methods are used. Therefore, the scope of various embodiments of the present disclosure should be determined with reference to the appended claims, along with the full range of equivalents to which such claims are entitled.
In the foregoing Detailed Description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the embodiments of the present disclosure require more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive subject matter lies in less than all features of a single disclosed embodiment. Thus, the following claims are hereby incorporated into the Detailed Description, with each claim standing on its own as a separate embodiment.