Address conversion method, computing system and electronic equipment
By setting the tag information and address translation request mechanism of the shared process in the computing system, only the complete page table entries of the shared process are saved in the target computing device, which solves the problem of resource waste in the system of multiple computing devices and achieves the optimization of storage resources and reduction of power consumption.
Patent Information
- Application Number
- CN202311469872.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2043-11-03
AI Technical Summary
In a computing system composed of multiple computing devices, the page table of a process occupies valuable high-speed video memory resources, resulting in resource waste and increased storage requirements of the computing system.
By setting the tag information of the shared process in the computing system, only the complete page table entries of the shared process are saved in the target computing device, and only the root page table entries are saved in other computing devices, and address translation requests are made through the target computing device, thereby reducing the overall storage requirements of the page table.
The storage resource occupation of shared processes is reduced, the overall storage requirement of page tables is reduced, the storage resource utilization of the computing system is optimized, and the power consumption of the computing system is reduced.
Smart Images

Figure CN117520216B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computing technology, and in particular to an address conversion method, a computing system, and an electronic device. Background Art
[0002] In order to meet the market's growing demand for computing power, one solution is to combine multiple computing devices (such as computing cards, GPUs (Graphics Processing Units), etc.) into a computing system to work together to provide greater computing power.
[0003] Computing devices typically integrate high-speed video memory and a page table translation module. The high-speed video memory stores a multi-level page table for each process. When a computing unit accesses memory, the page table translation module within the computing device searches the multi-level page table in the high-speed video memory, converting VA (Virtual Address) to PA (Physical Address), thereby accessing data in the high-speed video memory.
[0004] However, in a computing system composed of multiple computing devices, to ensure that each computing device can collaboratively run tasks for the same process, each computing device uses local storage to store the page table for the same process. The page table of a process on a single computing device typically occupies between several hundred kilobytes (KB) and several megabytes (MB). For example, if the page table of a single process occupies 1MB on a single computing device, in a computing system composed of 8 computing devices, the total page table occupancy for a single process is 8MB; the page tables corresponding to two processes total 16MB; and the page tables corresponding to 128 processes total 1GB.
[0005] Obviously, the more processes an application has, the larger the total page table usage. With the widespread adoption and application of computing systems composed of multiple computing devices, a large number of processes are running simultaneously on multiple computing devices. The page tables corresponding to these processes occupy valuable high-speed video memory capacity, resulting in a waste of resources. Summary of the Invention
[0006] The purpose of the embodiments of the present application is to provide an address translation method, a computing system, and an electronic device to alleviate the resource waste in a computing system including multiple computing devices.
[0007] An embodiment of the present application provides an address translation method, which is applied to any one computing device of a computing system including multiple computing devices; wherein: a root page table of a page table of each of the computing devices is provided with tag information of a process running in the computing device; the processes in the computing system include a shared process running in the multiple computing devices, and among the multiple computing devices running the shared process, in the root page tables of the remaining computing devices except the target computing device, the tag information of the shared process is the first tag value, and in the root page table of the target computing device, the tag information of the shared process is not the first tag value; all table entries of the shared process are recorded in the page table corresponding to the target computing device, and only the table entries of the shared process recorded in the root page table are retained in the page tables corresponding to the remaining computing devices;
[0008] The method includes: obtaining a virtual address to be converted and a process identifier corresponding to the virtual address; determining tag information of the process corresponding to the process identifier in a root page table of a page table corresponding to the computing device according to the process identifier; if the tag information is the first tag value, packaging the virtual address and the process identifier into an address conversion request, and sending it to a target computing device of the process corresponding to the process identifier, so that the target computing device finds the physical address corresponding to the virtual address according to its own corresponding page table, the virtual address and the process identifier; if the tag information is not the first tag value, finding the physical address corresponding to the virtual address step by step in the page table corresponding to the computing device according to the virtual address.
[0009] The above implementation method, in a computing system including multiple computing devices, is to completely save all table entries of a shared process only in a target computing device among the multiple computing devices running the shared process, and only save the table entries recorded in the root page table in the remaining computing devices, and set the value of the tag information of the shared process in the remaining computing devices to a first tag value, and set the value of the tag information of the shared process in the root page table of the target computing device to a second tag value. In this way, for any computing device, when performing address conversion, the tag information corresponding to the process can be determined in its own corresponding page table according to the process identifier corresponding to the virtual address to be converted, and then determine whether the page table corresponding to its own has a complete table entry corresponding to the process based on the value of the tag information. In the absence of a complete table entry, address conversion is achieved using the page table corresponding to the target computing device by sending an address conversion request to the target computing device; in the presence of a complete table entry, address conversion is achieved through its own corresponding page table. In this way, while ensuring that address translation can proceed normally, the number of complete table entries that the shared process needs to save is reduced from multiple copies to one. A single table entry in the root page table only occupies 64 bits, and the root page table entries of a process generally do not exceed 255. Therefore, for the same process, the page table occupancy on computing devices other than the target computing device will be reduced to less than 2K, thereby reducing the shared process's demand for storage resources, reducing resource waste, and leaving more storage resources for business use. For example, taking the example of a single process's page table occupying 1M on a single computing device, in a computing system composed of 8 computing devices, the total page table occupancy of the shared process will be reduced from 8M to 1M plus a few KB or 1M plus a dozen KB, thereby significantly reducing the shared process's demand for storage resources.
[0010] Furthermore, if the virtual address and the process identifier are obtained from an address conversion request sent from another computing device, after searching for the physical address corresponding to the virtual address step by step in the page table corresponding to the computing device according to the virtual address, the method also includes: returning the physical address to the other computing device.
[0011] In the above implementation, when the computing device itself is the target computing device and receives an address conversion request from another computing device, it can find the physical address of the virtual address to be converted from its corresponding page table, and then return it to the other computing device that sent the address conversion request, so that the other computing device can use the target computing device to realize the conversion from the virtual address to the physical address, thereby meeting business needs.
[0012] Furthermore, the tag information of the process is recorded in a reserved bit of the entry corresponding to the process in the root page table.
[0013] In the above implementation method, by using the reserved bits in the root page table entry to set the process marking information, the page table entry resources can be fully utilized without introducing an additional marking information management mechanism, thereby eliminating the need for additional overhead and facilitating promotion and use in industrial applications.
[0014] Furthermore, the target computing device of the shared process is the computing device that first runs the shared process among the multiple computing devices that run the shared process.
[0015] In the above implementation, by defining the computing device that first runs the shared process as the target computing device, when establishing page table entries for the sharing in the computing device that subsequently runs the shared process, only the root page table entries can be established, without establishing entries for the page tables of all levels after the root page table. Compared to the method of using the computing device that subsequently runs the shared process as the target computing device, the above implementation does not require the establishment of page table entries other than the root page table in the computing device that subsequently runs the shared process, nor does it require the deletion of page table entries other than the root page table in the computing device that first runs the shared process. This simplifies the page table entry management process of the shared process and saves related entry management overhead.
[0016] Furthermore, the target computing device is one of the multiple computing devices running the shared process; the tag information of the shared process in the root page table of the target computing device is a second tag value, and the first tag value and the second tag value are different; the method also includes: for any shared process, determining the computing device with the greatest address conversion demand for the shared process as the new target computing device of the shared process; in the page table corresponding to the target computing device of the shared process, each target table entry is migrated to the page table corresponding to the new target computing device, and the tag information of the shared process in the root page table corresponding to the target computing device is updated to the first tag value, and the tag information of the shared process in the root page table corresponding to the new target computing device is updated to the second tag value; wherein, the target table entry is the table entry of the shared process in the remaining page tables except the root page table.
[0017] In the above implementation, by migrating the page table entries of the shared process to the computing device that has the greatest demand for address conversion of the shared process, the computing device no longer needs to use other computing devices to perform the address conversion of the shared process. Since the computing device is the computing device that has the greatest demand for address conversion of the shared process, the frequency of performing the address conversion of the shared process through other computing devices can be reduced as a whole. Since there are interactive operations such as address conversion requests when performing address conversion through other computing devices, the power consumption will be higher than the power consumption generated by performing address conversion using its own page table. Therefore, the above implementation can improve the power consumption of the computing system to a certain extent.
[0018] The embodiment of the present application also provides a computing system, comprising: a plurality of computing devices, wherein the root page table of the page table of each computing device is provided with tag information of a process running in the computing device; the processes in the computing system include a shared process running in the plurality of computing devices, and among the plurality of computing devices running the shared process, in the root page tables of the remaining computing devices except the target computing device, the tag information of the shared process is the first tag value; all table entries of the shared process are recorded in the page table corresponding to the target computing device, and only the table entries of the shared process recorded in the root page table are retained in the page tables corresponding to the remaining computing devices; each computing device comprises a computing unit and a processing module; the processing module is in communication connection with the computing unit; the processing module is used to receive information reported by the computing unit or other computing units. The processing module is further used to: when the tag information is not the first tag value, find out the physical address corresponding to the virtual address step by step in the page table corresponding to the computing device according to the virtual address, and return the physical address to the computing unit or the other computing device; when the tag information is the first tag value, package the virtual address and the process identifier into an address conversion request and send it to the target computing device of the process corresponding to the process identifier, so that the target computing device can find out the physical address corresponding to the virtual address according to its own corresponding page table, the virtual address and the process identifier.
[0019] In the above-mentioned computing system, all table entries of the shared process are completely saved only in the target computing device among the multiple computing devices running the shared process, while only the table entries recorded in the root page table are saved in the remaining computing devices, thereby reducing the page table entry occupancy of the shared process. By setting the value of the tag information of the shared process in the root page table of the target computing device to the second tag value, and setting the value of the tag information of the shared process in the remaining computing devices to the first tag value, for any computing device, when performing address conversion, the tag information corresponding to the process can be determined in its own corresponding page table according to the process identifier corresponding to the virtual address to be converted, and then based on the value of the tag information, it is determined whether there is a complete table entry corresponding to the process in its own corresponding page table. In the absence of a complete table entry, the address conversion is implemented using the page table corresponding to the target computing device by sending an address conversion request to the target computing device; in the presence of a complete table entry, the address conversion is implemented through its own corresponding page table, thereby ensuring that the computing system can perform address conversion normally. That is, the computing system provided above can reduce the number of complete table entries that the shared process needs to save from multiple copies to one copy while ensuring the normal address conversion, thereby reducing the shared process's demand for storage resources, reducing resource waste, and leaving more storage resources for business use.
[0020] Furthermore, the processing module includes a page table conversion module and a page table proxy module; the page table conversion module is respectively connected to the computing unit and the page table proxy module; the page table proxy modules of each computing device are connected to each other; the page table proxy module is used to receive the address conversion request from the other computing device, and parse out the virtual address and the process identifier, and send the physical address found by the page table conversion module to the other computing device, and package the virtual address and process identifier into an address conversion request and send it to the target computing device; the page table conversion module is used to receive the virtual address and the process identifier reported by the computing unit, and receive the The virtual address and the process identifier transmitted by the page table proxy module; the page table conversion module is also used to determine the tag information of the process corresponding to the process identifier in the root page table of the page table corresponding to the computing device according to the process identifier in the address conversion request; the page table conversion module is also used to: when the tag information is not the first tag value, find out the physical address corresponding to the virtual address step by step in the page table corresponding to the computing device according to the virtual address, and return the physical address to the computing unit or send it to the page table proxy module; when the tag information is the first tag value, send the virtual address and the process identifier to the page table proxy module for packaging.
[0021] In the above implementation method, by setting up a page table conversion module and a page table proxy module, the interconnection between the computing devices is realized through the page table proxy module, and the identification of the process tag information in the computing device and the address conversion are realized through the page table conversion module. In this way, in each computing device, through the cooperation between the page table conversion module and the page table proxy module, each computing device can realize the address conversion work through the page table of the target computing device.
[0022] Furthermore, the page table proxy module includes a proxy connection unit, a message transceiver unit and a conversion request processing unit that are communicatively connected in sequence; the proxy connection unit is used to establish a communication connection with the proxy connection unit of other computing devices to receive address conversion requests transmitted by the other computing devices, or to send the physical address found by the page table conversion module to the other computing devices; the conversion request processing unit is communicatively connected to the page table conversion module, and is used to receive the virtual address and the process identifier transmitted by the page table conversion module, and send them to the message transceiver unit, and is used to receive the virtual address and the process identifier transmitted by the message transceiver unit, and send them to the page table conversion module; the message transceiver unit is used to parse the address conversion request received by the proxy connection unit to obtain the virtual address and the process identifier; and is used to package the virtual address and the process identifier transmitted by the conversion request processing unit into an address conversion request; the proxy connection unit is also used to send the address conversion request to the target computing device.
[0023] In the above implementation method, the page table proxy module can realize communication interconnection and message sending and receiving functions through three parts: the proxy connection unit, the message sending and receiving unit, and the conversion request processing unit. The functions of each unit are relatively simple and easy to implement in the circuit, which makes the page table proxy module easy to implement.
[0024] Furthermore, the page table proxy module caches page table entries whose usage frequency is higher than a preset usage frequency; the page table proxy module is also used to, after receiving an address conversion request from the other computing device and parsing the virtual address and the process identifier, first search for the physical address corresponding to the virtual address in the page table entries cached in the page table proxy module based on the virtual address.
[0025] In the above implementation, by caching page table entries with a usage frequency higher than a preset usage frequency into the page table proxy module, the computing device can pre-fetch the page table entries that are most likely to be used according to the frequency of use of the entries by the process and cache them in the page table proxy module. Therefore, when performing address conversion, the physical address can be directly found from the page table proxy module without the need for a step-by-step search based on the page table, thereby reducing the overhead of obtaining the page table entries.
[0026] Furthermore, each of the computing devices further includes a high-speed video memory, and the page table corresponding to each of the computing devices is stored in the high-speed video memory of the computing device.
[0027] In the above implementation, by storing the page table in the high-speed video memory of the computing device, the computing device only needs to obtain the page table from its own high-speed video memory when it subsequently obtains the page table. Compared with the solution of storing the page table outside the computing device, the above implementation has a faster page table acquisition speed and lower overhead.
[0028] An embodiment of the present application also provides an electronic device comprising any of the above-mentioned computing systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0030] Figure 1 A schematic diagram of the structure of a computing system provided in an embodiment of the present application;
[0031] Figure 2 A flowchart of an address conversion method provided in an embodiment of the present application;
[0032] Figure 3 A schematic diagram of the structure of a basic computing system provided in an embodiment of the present application;
[0033] Figure 4 A schematic diagram of the structure of a computing system provided in an embodiment of the present application;
[0034] Figure 5 A schematic diagram of a more specific computing system provided in an embodiment of the present application;
[0035] Figure 6 A schematic diagram of the connection structure of a page table conversion module provided in an embodiment of the present application;
[0036] Figure 7 A schematic diagram of the connection structure of a page table proxy module provided in an embodiment of the present application;
[0037] Figure 8 A schematic diagram of the structure of a computing system in a one-machine dual-SIM application scenario provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0039] Example 1:
[0040] In order to alleviate the resource waste in a computing system including multiple computing devices, an embodiment of the present application provides an address conversion method, which is applied to any computing device in the computing system including multiple computing devices.
[0041] In the embodiment of the present application, a computing device refers to a device that can run processes, convert virtual addresses to physical addresses, and perform computing tasks, which can be but is not limited to a computing card, GPU, etc.
[0042] In the embodiment of the present application, each computing device in the computing system is connected to each other in communication, and each computing device has a corresponding page table. Figure 1 As shown, each computing device in the computing system can be connected to the host computer separately, and then each computing device can be connected to each other through the host computer. In addition, the physical paths between the computing devices can be reused to achieve communication connection, or the communication connection can be achieved through a physical network card (such as an Infiniband card, an Ethernet card, etc.), which is not limited in the embodiments of the present application. In addition, the computing devices can be connected in a ring, a star, or connected to a switch, and the connection form between the computing devices is not limited in the embodiments of the present application.
[0043] In an embodiment of the present application, the page table of each computing device can be stored in a storage device such as the high-speed video memory of each computing device itself (for example, HBM (High Band Memory, high-speed physical storage for GPU or computing card), GDDR (Graphics Double Data Rate, video memory), etc.). The page table of each computing device can also be stored in a remote device, for example, it can be stored in a host to which each computing device is connected, or it can be stored in a memory provided outside the computing device, or it can all be stored in the high-speed video memory of a computing device. At this time, a correspondence between each page table and each computing device is configured in the remote device, so that each computing device can obtain its own corresponding page table from the remote device according to the correspondence.
[0044] It is understood that the page tables currently used are typically multi-level tables. When converting a virtual address to a physical address, the computing device first searches the first-level page table. Then, based on the entry information in the first-level page table found, it searches the first-level page table again. This process continues in this manner until the physical address corresponding to the virtual address is found. In the embodiments of the present application, the first-level page table in the multi-level page table is referred to as the root page table.
[0045] In an embodiment of the present application, the root page table of each page table is provided with tag information of a process running in the computing device corresponding to the page table, wherein the tag information includes at least two tag values: a first tag value and a second tag value.
[0046] In the embodiments of the present application, the concept of shared processes is proposed, and processes running in multiple computing devices in a computing system are defined as shared processes.
[0047] In an embodiment of the present application, among multiple computing devices running a shared process, one or more of them are selected as target computing devices, and the tag information of the shared process in the root page table of the target computing device is recorded as a value other than the first tag value, for example, the second tag value, and the tag information of the shared process in the root page tables of the remaining computing devices running the shared process, excluding the target computing device, is recorded as the first tag value. The first tag value and the second tag value are different.
[0048] In addition, all table entries of the shared process are normally saved in the page table of the target computing device, while in the page tables of the remaining computing devices except the target computing device among the multiple computing devices running the shared process, only the table entries of the shared process in the root page table are saved.
[0049] In this way, each computing device can distinguish whether its own page table contains all the entries of the shared process through the first tag value and the second tag value in the root page table.
[0050] In the embodiment of the present application, only two tag values, the first tag value and the second tag value, can be configured, wherein the second tag value also serves as tag information corresponding to a normal process that is not a shared process (i.e., a process running on only one computing device). In this way, when the computing device finds that the tag information of the process in its corresponding root page table is the second tag value, regardless of whether it is a normal process or a shared process, it indicates that the page table has a complete table entry for the process, and thus the physical address required by the process can be found.
[0051] Furthermore, in an embodiment of the present application, in addition to configuring the first and second tag values, a third tag value may also be configured, and the first, second, and third tag values may be different from each other. In this case, the first tag value indicates that the process is a shared process and that a complete entry does not exist in the page table, the second tag value indicates that the process is a shared process and that a complete entry exists in the page table, and the third tag value indicates that the process is a normal process.
[0052] It can be understood that the table entries of the page table have a fixed format. In the definition of the page table entries, bits are reserved for function expansion. In the embodiment of the present application, the reserved bits (i.e., reserved bits) in the table entries of the root page table can be used to record the tag information of the process, that is, the tag information of the process can be recorded in the reserved bits of the table entry corresponding to the process in the root page table. In this way, the page table entry resources can be fully utilized without the need to introduce an additional management mechanism for tag information, thereby eliminating the need for additional overhead and facilitating promotion and use in industrial applications.
[0053] For example, when the tag information has two values: a first tag value and a second tag value, the fifth bit of the table entry can be used to record the tag information of the process. For example, the first tag value can be set to 1 and the second tag value to 0; or the first tag value can be set to 0 and the second tag value to 1. When the tag information has three values: a first tag value, a second tag value, and a third tag value, the fourth and fifth bits of the table entry can be used to record the tag information of the process. For example, the first tag value can be set to 11, the second tag value to 10, and the third tag value to 00, etc.
[0054] The address conversion method provided in the embodiments of the present application is applied to any computing device of the above computing system, see Figure 2 Shown, including:
[0055] S201: Obtain a virtual address to be translated and a process identifier corresponding to the virtual address.
[0056] In the embodiments of this application, Figure 3 As shown, each computing device may have at least one computing unit for executing specific computing tasks assigned by a process. The virtual address to be converted and the process identifier corresponding to the virtual address may be provided by the computing unit when performing a memory access operation.
[0057] In addition, since only the target computing device of the shared process can implement address translation for a shared process, when a computing device is not the target computing device of the shared process, the virtual address to be translated and the process identifier corresponding to the virtual address obtained from its computing unit will be packaged as an address translation request and sent to the target computing device of the shared process. Therefore, when the computing device executing the method provided in the embodiment of the present application is the target computing device of the shared process, the virtual address to be translated and the process identifier corresponding to the virtual address in S201 can also be obtained from the address translation request transmitted from other computing devices.
[0058] In the embodiment of the present application, the process identifier may be, but is not limited to, a process ID (Identity) or other information that can uniquely identify a process.
[0059] S202: Determine, according to the process ID, tag information of the process corresponding to the process ID in a root page table of a page table corresponding to the computing device.
[0060] In an embodiment of the present application, after obtaining the process identifier, the table entry corresponding to the process identifier can be found in the page table, and then the value of the tag information recorded in the table entry can be obtained to determine whether it can perform address translation.
[0061] S203: If the tag information is the first tag value, the virtual address and the process identifier are packaged into an address conversion request and sent to the target computing device of the process corresponding to the process identifier, so that the target computing device can find the physical address corresponding to the virtual address according to its own corresponding page table, virtual address and process identifier; if the tag information is not the first tag value, the physical address corresponding to the virtual address is found step by step in the page table corresponding to the computing device according to the virtual address.
[0062] In an embodiment of the present application, a packaged address conversion request can be sent to all computing devices. After receiving the address conversion request, each computing device can parse the virtual address to be converted and the process identifier corresponding to the virtual address, and then determine whether it can perform the address conversion of the virtual address based on the process identifier.
[0063] In addition, in an embodiment of the present application, in each computing device running a shared process, the correspondence between the process identifier and the target computing device of the shared process can be pre-set, and then the packaged address conversion request can be directly sent to the target computing device.
[0064] In an embodiment of the present application, if the virtual address and process identifier are obtained from an address conversion request sent from another computing device, after searching the physical address corresponding to the virtual address step by step in the page table corresponding to the computing device according to the virtual address, the physical address can also be returned to the other computing device that sent the address conversion request.
[0065] In an embodiment of the present application, a computing device may include its own identification information or address information in the packaged address translation request. Upon receiving the address translation request, the target computing device may return the physical address found based on the identification information or address information to the computing device that sent the address translation request.
[0066] In an embodiment of the present application, after receiving the physical address returned by the target computing device, the computing device can hand over the physical address to the computing unit that provides the virtual address to be converted, thereby enabling the computing unit to complete the memory access operation based on the physical address.
[0067] Similarly, when the virtual address to be converted is provided by its own computing unit, the computing device can hand over the physical address to the computing unit that provides the virtual address to be converted after finding the physical address, so that the computing unit can complete the memory access operation based on the physical address.
[0068] In some implementations of the embodiments of the present application, a certain computing device can be designated as a target computing device. In this case, if there is a computing device that runs the shared process before the target computing device, then: the complete table entry of the shared process can be first stored in the page table of these computing devices, and the tag information is set to the second tag value. When the shared process runs in the target computing device, the complete table entry of the shared process is stored in the page table of the target computing device, and the table entries in each page table of each computing device except the root page table are removed, and the tag information in the root page table is modified to the first tag value; or, the computing device that first runs the shared process can notify the target computing device so that the target computing device stores the complete table entry of the shared process in the page table and sets the tag information to the second tag value. At the same time, the computing device that first runs the shared process only creates the table entry of the shared process in the root page table and sets the tag information to the first tag value.
[0069] In some implementations of the embodiments of the present application, the computing device that first runs the shared process among multiple computing devices running the shared process can be used as the target computing device.
[0070] For example, when a computing device runs a process, it can ask other computing devices whether they have run the process before, and then determine whether it is the computing device that first ran the process based on the query result. When it is the computing device that first ran the process, a complete table entry corresponding to the process is established in the page table. When it is not the computing device that first ran the process, only the table entry corresponding to the process is established in the root page table. In this way, there is no need to create page table entries other than the root page table in the computing device that subsequently runs the shared process, nor is there any need to delete page table entries other than the root page table in the computing device that first ran the shared process. This simplifies the page table entry management process of the shared process and saves related table entry management overhead.
[0071] Among them, the inquiry method can be but is not limited to: the process identifier of the process can be sent to each computing device, and each computing device queries whether there is a page table entry corresponding to the process identifier in its own corresponding page table. If it exists, it means that the process has been run; if it does not exist, it means that the process has not been run, and then the query result is fed back to the computing device that sent the process identifier.
[0072] In some implementations of the embodiments of the present application, for any shared process, when the target computing device has been determined, the computing device with the greatest address translation demand for the shared process can be periodically or irregularly determined as the new target computing device for the shared process. Then, each target table entry in the page table corresponding to the target computing device of the shared process is migrated to the page table corresponding to the new target computing device, and the tag information of the shared process in the root page table corresponding to the original target computing device is updated to the first tag value, and the tag information of the shared process in the root page table corresponding to the new target computing device is updated to the second tag value. The target table entry is the table entry of the shared process in each of the remaining page tables except the root page table.
[0073] In this way, since the computing device is the computing device with the greatest demand for address translation for the shared process, the frequency of address translation work for the shared process performed by other computing devices can be reduced overall. However, since address translation work performed by other computing devices involves interactive operations such as address translation requests, its power consumption will be higher than the power consumption generated by performing address translation work using its own page table. Therefore, the above embodiment can improve the power consumption of the computing system to a certain extent.
[0074] In an embodiment of the present application, for the same shared process, the number of address translation requests generated by the computing units in each computing device for the shared process can be counted separately, and then the computing device with the largest number of address translation requests generated can be used as the new target computing device for the shared process. Alternatively, for the same shared process, the number of address translation requests generated locally by the target computing device of the shared process can be counted separately, as can the number of address translation requests issued by computing devices other than the target computing device among all computing devices running the shared process, and then the computing device with the largest number of requests can be used as the new target computing device for the shared process.
[0075] In the embodiment of the present application, a computing system is also provided, which can be found in Figure 4 As shown, it includes multiple computing devices, and each computing device includes a computing unit and a processing module, and the processing module is communicatively connected to the computing unit.
[0076] Each computing device has a corresponding page table. The page table setting method can be found in the above description and will not be described in detail here. Similarly, the table entry setting method of the shared process can also be found in the above description and will not be described in detail here.
[0077] In an embodiment of the present application, the processing module is used to receive the virtual address to be converted and the process identifier corresponding to the virtual address reported by the computing unit or transmitted by other computing devices, and determine the tag information of the process corresponding to the process identifier in the root page table of the page table corresponding to the computing device according to the process identifier.
[0078] The processing module is also used to: when the tag information is not the first tag value, search the physical address corresponding to the virtual address step by step in the page table corresponding to the computing device to which it belongs according to the virtual address, and return the physical address to the computing unit or other computing device; when the tag information is the first tag value, package the virtual address and the process identifier into an address conversion request and send it to the target computing device of the process corresponding to the process identifier, so that the target computing device can find the physical address corresponding to the virtual address according to its own corresponding page table, virtual address and process identifier.
[0079] In the embodiments of this application, Figure 5 As shown, the processing module may include a page table conversion module and a page table proxy module.
[0080] The page table conversion module is in communication with the computing unit and the page table proxy module respectively. The page table proxy modules of each computing device are in communication with each other.
[0081] The page table proxy module is used to receive address translation requests from other computing devices, parse out the virtual address and process ID, send the physical address found by the page table translation module to other computing devices, and package the virtual address and process ID into an address translation request and send it to the target computing device.
[0082] The page table conversion module is used to receive the virtual address and process identifier reported by the computing unit, and receive the virtual address and process identifier transmitted by the page table proxy module.
[0083] The page table conversion module is further configured to determine tag information of a process corresponding to the process identifier in a root page table of a page table corresponding to the computing device according to the process identifier in the address conversion request.
[0084] The page table conversion module is also used for: when the tag information is not the first tag value, searching for the physical address corresponding to the virtual address in the page table corresponding to the computing device step by step according to the virtual address, and returning the physical address to the computing unit or sending it to the page table proxy module; when the tag information is the first tag value, sending the virtual address and the process identifier to the page table proxy module for packaging.
[0085] In the embodiment of the present application, the page table conversion module can refer to Figure 6 As shown, it may include a page table conversion unit and a shared page table processing unit.
[0086] The page table conversion unit is mainly used to perform a level-by-level search in the page table based on the virtual address and process identifier transmitted by the computing unit. Specifically, when it is found that the tag information of the table entry in the found root page table is the first tag value, it is used to generate a shared page table conversion request and submit it to the shared page table processing unit; when it is found that the tag information of the table entry in the found root page table is not the first tag value, it continues to search the physical address in the page table level by level until the final page table entry is found and the physical address is obtained.
[0087] The shared page table processing unit is mainly used to receive shared page table conversion requests from the page table conversion unit and submit them to the page table proxy module for processing; and to interact with the page table proxy module, such as receiving the result of the shared page table conversion request returned by the page table proxy module and returning the result to the page table conversion unit, as well as receiving the virtual address and process ID in the address conversion request sent by other computing devices from the page table proxy module, and submitting them to the page table conversion unit for search.
[0088] In the embodiment of the present application, technicians can arrange corresponding functional circuits according to the above functions to implement the above page table conversion unit and shared page table processing unit. The circuits for implementing the relevant functions are well-known circuits in the art and will not be expanded here.
[0089] In the embodiment of the present application, the page table proxy module can be found in Figure 7 As shown, it may include a proxy connection unit, a message transceiver unit, and a conversion request processing unit that are communicatively connected in sequence.
[0090] The proxy connection unit is used to establish a communication connection with the proxy connection units of other computing devices to receive address translation requests from other computing devices, or to send the physical address found by the page table translation module to other computing devices.
[0091] The conversion request processing unit is communicatively connected to the page table conversion module, and is used to receive the virtual address and the process identifier transmitted by the page table conversion module and send them to the message transceiver unit, and is used to receive the virtual address and process identifier transmitted by the message transceiver unit and send them to the page table conversion module.
[0092] The message transceiver unit is used to parse the address translation request received by the proxy connection unit to obtain the virtual address and process identifier; and to package the virtual address and process identifier transmitted by the translation request processing unit into an address translation request.
[0093] The proxy connection unit is further configured to send the address translation request to the target computing device.
[0094] In the embodiment of the present application, technicians can arrange corresponding functional circuits according to the above functions to implement the above-mentioned proxy connection unit, message receiving and sending unit and conversion request processing unit. The implementation circuits of the relevant functions are circuits well known in the art, so they will not be expanded here.
[0095] In an embodiment of the present application, a cache can also be provided in the page table proxy module to cache page table entries whose usage frequency exceeds a preset frequency. This allows the computing device to pre-fetch the most likely page table entries based on the frequency of use of the entries by the process and cache them in the page table proxy module. This allows the computing device to prioritize directly searching for physical addresses in the page table proxy module during address translation, eliminating the need for a level-by-level search based on the page table, thereby reducing the overhead of obtaining page table entries.
[0096] To facilitate understanding of the solution of the embodiment of the present application, the solution of the embodiment of the present application is further illustrated below by taking the case where the computing device is a computing card and the computing system includes two computing cards as an example.
[0097] See also Figure 8 As shown, the computing system includes computing card 1 and computing card 2. Both computing card 1 and computing card 2 are connected to the host, and the page table proxy module of computing card 1 is in communication with the page table proxy module of computing card 2. The page table of computing card 1 is stored in the high-speed video memory of computing card 1, and the page table of computing card 2 is stored in the high-speed video memory of computing card 2. Figure 8 As shown, for the shared process, only the root page table entries are retained in the page table of computing card 2.
[0098] For this shared process:
[0099] When the computing unit in computing card 2 initiates data access, the computing unit in computing card 2 inputs the virtual address VA and process ID to be converted to the page table conversion module in computing card 2. When the page table conversion module searches the table entry of the root page table through VA, it finds that the tag information of the current process is the first tag value, so it sends the VA and process ID to the shared page table processing unit; the shared page table processing unit in the page table conversion module generates a request and sends it to the conversion request processing unit in the page table proxy module of this card.
[0100] After receiving the request, the conversion request processing unit of computing card 2 sends the VA and process ID to the message transceiver unit, encapsulating them into a message, and sends it to the page table proxy module of computing card 1 through the proxy connection unit.
[0101] After receiving the message through the proxy connection unit, the page table proxy module of computing card 1 parses the VA and process ID through the message transceiver unit, generates a shared page table conversion request through the conversion request processing unit, and sends it to the shared page table processing unit of computing card 1.
[0102] The shared page table processing unit of computing card 1 generates a page table conversion request for VA and process ID, and hands it over to the page table conversion unit of computing card 1 for page table conversion to obtain the physical address PA corresponding to the VA and process ID.
[0103] The page table conversion unit of computing card 1 returns the found PA to the shared page table processing unit, which in turn returns the PA to the conversion request processing unit of the page table proxy module. The conversion request processing unit encapsulates the PA into an address conversion request in the form of a message through the message transceiver unit.
[0104] The page table proxy module of computing card 1 sends the return address translation request back to the page table proxy module of computing card 2.
[0105] The page table proxy module of computing card 2 parses the address translation request to obtain PA and sends it to the page table translation module of computing card 2.
[0106] At this point, Compute Card 2 uses the page table conversion proxy mechanism to allow the page table conversion module of Compute Card 1 to help it complete the VA to PA conversion.
[0107] When the computing unit in computing card 1 initiates data access, the computing unit in computing card 1 inputs the virtual address VA and process ID to be converted to the page table conversion module in computing card 1. When the page table conversion module searches the table entry of the root page table through VA, it finds that the tag information of the current process is the second tag value, and continues to perform conversion queries on the second, third, and fourth level page tables, and finally obtains the physical address PA.
[0108] In this embodiment of the present application, since root page table entries only occupy 64 bits, and the root page table entries of a process generally do not exceed 255, for the same shared process, the page table entries on Compute Card 2 occupy less than 2K, and Compute Card 2 does not need to retain the second-level, third-level, and fourth-level page tables of the shared process, thus significantly reducing the page table usage of Compute Card 2. Overall, the system page table usage in a multi-computing device scenario is almost equivalent to that in a single computing device scenario, which can reduce resource waste and leave more storage resources for business use.
[0109] Based on the same inventive concept, an embodiment of the present application further provides an electronic device, including the computing system provided by the aforementioned embodiment of the present application.
[0110] In the embodiments of the present application, the electronic device may be, but is not limited to, a smart terminal (such as a smart phone, computer, tablet, smart TV, etc.), a server, a console, a drone, or other device that requires computing power.
[0111] In the embodiments of the present application, various embodiments or implementation methods can be freely combined to obtain new embodiments without conflict.
[0112] In the embodiments provided in this application, the device embodiments described above are merely illustrative.
[0113] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any actual relationship or order between these entities or operations.
[0114] As used herein, a plurality refers to two or more than two.
[0115] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, various modifications and variations of the present application are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. An address conversion method, characterized in that: The method is applied to any one computing device of a computing system including a plurality of computing devices; wherein: a root page table of a page table of each computing device is provided with tag information of a process running in the computing device; the processes in the computing system include a shared process running in the plurality of computing devices, and among the plurality of computing devices running the shared process, in the root page tables of the remaining computing devices except a target computing device, the tag information of the shared process is a first tag value, and in the root page table of the target computing device, the tag information of the shared process is not the first tag value; all table entries of the shared process are recorded in the page table corresponding to the target computing device, and only the table entries of the shared process recorded in the root page table are retained in the page tables corresponding to the remaining computing devices; the method comprises: Obtain the virtual address to be translated and the process ID corresponding to the virtual address; Determining, according to the process identifier, tag information of the process corresponding to the process identifier in a root page table of a page table corresponding to the computing device; If the tag information is the first tag value, packaging the virtual address and the process identifier into an address translation request and sending the request to a target computing device of the process corresponding to the process identifier, so that the target computing device searches for a physical address corresponding to the virtual address based on its corresponding page table, the virtual address, and the process identifier; If the tag information is not the first tag value, the physical address corresponding to the virtual address is searched level by level in the page table corresponding to the computing device according to the virtual address.
2. The method according to claim 1, wherein If the virtual address and the process identifier are obtained from an address translation request sent from another computing device, after searching for a physical address corresponding to the virtual address in a page table corresponding to the computing device level by level according to the virtual address, the method further includes: The physical address is returned to the other computing device.
3. The method according to claim 1, wherein The tag information of the process is recorded in the reserved bit of the table entry corresponding to the process in the root page table.
4. The method according to claim 2, wherein The tag information of the process is recorded in the reserved bit of the table entry corresponding to the process in the root page table.
5. The method according to any one of claims 1 to 4, characterized in that The target computing device of the shared process is the computing device that first runs the shared process among the multiple computing devices that run the shared process.
6. The method according to any one of claims 1 to 4, characterized in that The target computing device is one of the plurality of computing devices running the shared process; the tag information of the shared process in the root page table of the target computing device is a second tag value, and the first tag value and the second tag value are different; the method further includes: For any shared process, determine the computing device with the greatest address translation demand for the shared process as the new target computing device for the shared process; Migrating each target table entry in the page table corresponding to the target computing device of the shared process to the page table corresponding to the new target computing device, and updating the tag information of the shared process in the root page table corresponding to the target computing device to the first tag value, and updating the tag information of the shared process in the root page table corresponding to the new target computing device to the second tag value; The target table entry is a table entry of the shared process in each of the remaining page tables except the root page table.
7. A computing system, characterized in that include: A plurality of computing devices, wherein a root page table of a page table of each computing device is provided with tag information of a process running in the computing device; The process in the computing system includes a shared process running in a plurality of the computing devices, and in the root page tables of the plurality of computing devices running the shared process, the tag information of the shared process in the root page tables of the remaining computing devices except a target computing device is a first tag value; all entries of the shared process are recorded in the page table corresponding to the target computing device, and only the entries of the shared process recorded in the root page table are retained in the page tables corresponding to the remaining computing devices; Each of the computing devices includes a computing unit and a processing module; the processing module is communicatively connected to the computing unit; The processing module is configured to receive a virtual address to be translated and a process identifier corresponding to the virtual address reported by the computing unit or transmitted by another computing device, and determine, based on the process identifier, tag information of a process corresponding to the process identifier in a root page table of a page table corresponding to the computing device; The processing module is also used to: when the tag information is not the first tag value, search the physical address corresponding to the virtual address step by step in the page table corresponding to the computing device to which it belongs according to the virtual address, and return the physical address to the computing unit or the other computing device; when the tag information is the first tag value, package the virtual address and the process identifier into an address conversion request and send it to the target computing device of the process corresponding to the process identifier, so that the target computing device can search the physical address corresponding to the virtual address according to its own corresponding page table, the virtual address and the process identifier.
8. The computing system of claim 7, wherein: The processing module includes a page table conversion module and a page table proxy module; The page table conversion module is respectively connected to the computing unit and the page table proxy module; the page table proxy modules of each computing device are connected to each other; The page table proxy module is configured to receive an address translation request from the other computing device, parse the virtual address and the process identifier, send the physical address found by the page table translation module to the other computing device, and package the virtual address and the process identifier into an address translation request and send it to the target computing device; The page table conversion module is used to receive the virtual address and the process identifier reported by the computing unit, and receive the virtual address and the process identifier transmitted by the page table proxy module; The page table conversion module is further configured to determine, based on the process identifier in the address conversion request, tag information of the process corresponding to the process identifier in the root page table of the page table corresponding to the computing device; The page table conversion module is also used to: when the tag information is not the first tag value, search the physical address corresponding to the virtual address step by step in the page table corresponding to the computing device according to the virtual address, and return the physical address to the computing unit or send it to the page table proxy module; when the tag information is the first tag value, send the virtual address and the process identifier to the page table proxy module for packaging.
9. The computing system of claim 8, wherein: The page table proxy module includes a proxy connection unit, a message receiving and sending unit, and a conversion request processing unit that are communicatively connected in sequence; The proxy connection unit is used to establish a communication connection with the proxy connection unit of another computing device to receive an address translation request from the other computing device, or to send the physical address found by the page table translation module to the other computing device; The conversion request processing unit is communicatively connected to the page table conversion module, and is configured to receive the virtual address and the process identifier transmitted by the page table conversion module and send them to the message transceiver unit, and is configured to receive the virtual address and the process identifier transmitted by the message transceiver unit and send them to the page table conversion module; The message transceiver unit is used to parse the address translation request received by the proxy connection unit to obtain the virtual address and the process identifier; and is used to package the virtual address and the process identifier transmitted by the translation request processing unit into an address translation request; The proxy connection unit is further configured to send an address translation request to the target computing device.
10. The computing system of claim 8, wherein: The page table proxy module caches page table entries with a usage frequency higher than a preset usage frequency; The page table proxy module is also used to, after receiving the address conversion request from the other computing device and parsing the virtual address and the process identifier, first search for the physical address corresponding to the virtual address in the page table entry cached in the page table proxy module based on the virtual address.
11. The computing system of claim 9, wherein: The page table proxy module caches page table entries with a usage frequency higher than a preset usage frequency; The page table proxy module is also used to, after receiving the address conversion request from the other computing device and parsing the virtual address and the process identifier, first search for the physical address corresponding to the virtual address in the page table entry cached in the page table proxy module based on the virtual address.
12. The computing system according to any one of claims 7 to 11, wherein: Each of the computing devices further includes a high-speed display memory, and the page table corresponding to each of the computing devices is stored in the high-speed display memory of the computing device.
13. An electronic device, characterized in that: A computing system comprising any one of claims 7 to 12.
Citation Information
Patent Citations
Page table access method and system, electronic component and page table configuration method
CN116069689A
Process creation method and device, electronic equipment and computer readable medium
CN116302376A