Request processing method and device, electronic equipment, chip, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-08-11
AI Technical Summary
其主要目的在于解决PTW请求合并有效性差的问题
[0020]本申请提供的请求处理方法及装置、电子设备、芯片、存储介质,通过获取待合并的页表查询请求的计数信息;在所述计数信息符合预设计数条件的情况下,基于预设合并检测条件对所述页表查询请求进行检测,所述预设合并检测条件包括区间组组合条件、步长一致性条件以及页表一致性条件;在所述页表查询请求符合预设合并检测条件的情况下,对所述页表查询请求进行区间合并,得到合并请求组,实现同层级的多PTW请求合并目的,大大提高区间PTW请求批量处理效率,节约内存访问消耗,提高PTW请求的处理吞吐量,避免内存带宽浪费严重,从而内存资源的合理有效利用。
Smart Images

Figure CN122332311B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer processing technology, and in particular to a request processing method and apparatus, electronic device, chip, and storage medium. Background Technology
[0002] Heterogeneous computing refers to a computing method that mixes computing units with different instruction sets and architectures within a computer and dynamically allocates them according to task type. It is applicable to computing architectures such as the Central Processing Unit (CPU) and the Graphics Processing Unit (GPU). In a heterogeneous computing architecture, when a virtual address is not found in the Translation Look-aside Buffer (TLB), the Memory Management Unit (MMU) can initiate a Page Table Walk Request (PTW) to translate the virtual address (VA) or IOVA into a physical address (PA). When the MMU sends multiple independent PTW requests, they need to be merged to reduce system processing load.
[0003] Currently, existing methods for merging PTW requests at the same page table level typically employ a single-point merging approach, which involves concatenating and merging multiple PTW requests based on the same time point or the same form. However, single-point merging alone leads to a decrease in PTW request processing throughput. In scenarios with high-frequency TLB misses, a large number of PTW requests need to queue and wait, resulting in significant waste of memory bandwidth and failing to meet the requirements for efficient and reasonable utilization of memory resources. Summary of the Invention
[0004] This application provides a request processing method and apparatus, electronic device, chip, and storage medium. Its main purpose is to solve the problem of poor effectiveness in PTW request merging.
[0005] According to a first aspect of this application, a request processing method is provided, comprising: Obtain the count information of the page table query requests to be merged; If the counting information meets the preset counting conditions, the page table query request is detected based on the preset merge detection conditions, which include interval group combination conditions, step size consistency conditions, and page table consistency conditions. If the page table query request meets the preset merge detection conditions, the page table query request is merged into a merge request group.
[0006] Furthermore, the counting information includes request wait time counting information and request quantity counting information. After obtaining the counting information of the page table query requests to be merged, the method further includes: If the request waiting time count is greater than a preset timing threshold, it is determined that the count meets the preset counting condition; or, If the number of requests is greater than a preset counting threshold, it is determined that the count information meets the preset counting condition.
[0007] Furthermore, the preset merge detection conditions include interval group combination conditions, step size consistency conditions, and page table consistency conditions. The detection of the page table query request based on the preset merge detection conditions includes at least one of the following: The virtual address information of the page table query request is detected based on the interval group combination conditions, wherein the interval group combination conditions are used to characterize whether the page table query request can be combined with interval conditions. The step size of the page table query request is detected based on the step size consistency condition. The step size consistency condition is used to characterize whether the page table query request is combined into a step size condition of an interval. The page table consistency condition is used to detect the level and attributes of the page table query request. The page table consistency condition is used to characterize whether the page table query request has page table conditions that can be combined.
[0008] Furthermore, the step of merging the page table query requests into a merged request group includes: The target merging interval is determined based on the page table query request; If the target merging interval exists, the page table query request will be merged into the merging request group corresponding to the target merging interval; If the target merge interval does not exist, a merge interval is created, and the page table query requests are merged based on the created merge interval to obtain a new merge request group.
[0009] Furthermore, after merging the page table query requests into a merged request group, the method further includes: Obtain the virtual address information and step size of the page table query request; The merge request group is cached according to the virtual address information and the step size; In response to the first request retrieval instruction at the same level, the merge request group is retrieved according to the merge priority at the same level to trigger multiple page table query requests in the merge request group; In response to a second request retrieval instruction from an upper or lower level, the multi-level merge request group corresponding to the upper or lower level is merged with the merge request group to trigger multiple page table query requests in the multi-level merge request group.
[0010] Furthermore, the method also includes: If the page table query request is detected to match a preset abnormal condition, the page table query request is determined to be an independent request. The preset abnormal conditions include step size abnormal conditions, address abnormal conditions, and permission abnormal conditions.
[0011] According to a second aspect of this application, a request processing apparatus is provided, comprising: The acquisition module is used to obtain the count information of the page table query requests to be merged; The detection module is used to detect the page table query request based on preset merging detection conditions when the counting information meets preset counting conditions. The preset merging detection conditions include interval group combination conditions, step size consistency conditions, and page table consistency conditions. The merging module is used to merge the page table query requests into a merged request group when the page table query requests meet the preset merging detection conditions.
[0012] Furthermore, the device also includes: The determining module is configured to determine that the count information meets the preset counting condition when the request waiting time count information is greater than the preset timing threshold; or, to determine that the count information meets the preset counting condition when the request quantity count information is greater than the preset counting threshold.
[0013] Furthermore, the preset merging detection conditions include interval group combination conditions, step size consistency conditions, and page table consistency conditions. The detection module is specifically used to detect the virtual address information of the page table query request based on the interval group combination conditions. The interval group combination conditions are used to characterize whether the page table query request can be combined. The step size of the page table query request is detected based on the step size consistency condition. The step size consistency condition is used to characterize whether the page table query request is combined into a step size condition of an interval. The page table consistency condition is used to detect the level and attributes of the page table query request. The page table consistency condition is used to characterize whether the page table query request has page table conditions that can be combined.
[0014] Furthermore, the merging module is specifically used to determine a target merging interval based on the page table query request; if the target merging interval exists, the page table query request is merged into the merging request group corresponding to the target merging interval; if the target merging interval does not exist, a merging interval is created, and the page table query request is merged based on the created merging interval to obtain a new merging request group.
[0015] Furthermore, the device also includes: The retrieval module is used to obtain the virtual address information and step size of the page table query request, and cache the merge request group according to the virtual address information and the step size; in response to the first request retrieval instruction at the same level, the merge request group is retrieved according to the merge priority at the same level to trigger multiple page table query requests in the merge request group; in response to the second request retrieval instruction at the upper or lower level, the merge request group is merged with the multi-level merge request group corresponding to the upper or lower level to trigger multiple page table query requests in the multi-level merge request group.
[0016] Furthermore, the determining module is specifically used to determine the page table query request as an independent request when it is detected that the page table query request matches a preset abnormal condition. The preset abnormal conditions include step size abnormal conditions, address abnormal conditions, and permission abnormal conditions.
[0017] A third aspect of this application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the methods described in the first aspect of this application.
[0018] A fourth aspect of this application provides a chip including one or more interface circuits and one or more processors; the interface circuits are configured to receive signals from the memory of an electronic device and send signals to the processors, the signals including computer instructions stored in the memory, which, when executed by the processors, cause the electronic device to perform the methods described in the first aspect of this application.
[0019] A fifth aspect of this application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods described in the first aspect of this application.
[0020] The request processing method, apparatus, electronic device, chip, and storage medium provided in this application acquire count information of page table query requests to be merged; when the count information meets preset count conditions, the page table query requests are detected based on preset merge detection conditions, including interval group combination conditions, step size consistency conditions, and page table consistency conditions; when the page table query requests meet the preset merge detection conditions, the page table query requests are merged into intervals to obtain merged request groups, thereby achieving the purpose of merging multiple PTW requests at the same level, greatly improving the batch processing efficiency of interval PTW requests, saving memory access consumption, increasing the processing throughput of PTW requests, avoiding serious waste of memory bandwidth, and thus making reasonable and effective use of memory resources.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0022] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of this application. Wherein: Figure 1 A flowchart illustrating a request hierarchy merging method provided in an embodiment of this application; Figure 2 A framework diagram of the hierarchical merging function module for PTW requests; Figure 3 This is a schematic diagram of the hierarchical merging process for PTW requests. Figure 4 A schematic diagram of a request hierarchy merging device provided in an embodiment of this application; Figure 5 A schematic block diagram of an example electronic device 300 provided for embodiments of this application; Figure 6 This is a schematic diagram of a chip structure provided in an embodiment of this application. Detailed Implementation
[0023] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0024] The following description, with reference to the accompanying drawings, describes a request processing method and apparatus, electronic device, chip, and storage medium according to embodiments of this application.
[0025] Figure 1 This is a flowchart illustrating a request processing method provided in an embodiment of this application.
[0026] like Figure 1 As shown, the method includes the following steps: Step 101: Obtain the count information of the page table query requests to be merged.
[0027] In this embodiment, the Page Table Lookup Request (PTW) to be merged refers to a page table lookup request initiated by the Memory Management Unit (MMU) when the virtual address is not found in the TLB. It can be a single PTW request or multiple PTW requests concatenated; this embodiment does not impose specific limitations. Additionally, the counting information is information obtained by standardly counting the time or number of page table lookup requests, and may include request wait time count information and request quantity count information.
[0028] It should be noted that the PWT requests to be merged are at the same level. In this case, the level refers to the division of all page tables according to the characteristics of the page tables. In one example, all page tables can be divided into 4 levels, of which L1 and L2 are temporary shallow page table levels, and L3 and L4 are temporary deep page table levels. Correspondingly, the PTWs to be merged are in the same level.
[0029] Step 102: If the counting information meets the preset counting conditions, the page table query request is detected based on the preset merge detection conditions.
[0030] In this embodiment, the preset counting condition is used to characterize the maximum value constrained by the count. For both the request waiting time count and the request quantity count, corresponding counting conditions can be set separately. This allows for a merging determination of the PTW requests based on preset merging detection conditions after any one of the counting conditions is met, i.e., determining whether they can be merged. The preset merging detection conditions include interval group combination conditions, step size consistency conditions, and page table consistency conditions. Here, the interval group combination condition characterizes the interval conditions for whether the page table query requests can be combined; the step size consistency condition characterizes the step size conditions for whether the page table query requests can be combined into an interval; and the page table consistency condition characterizes the page table conditions for whether the page table query requests are allowed to be combined. This ensures that after all conditions are met, the PTW requests pass the merging detection and can be merged.
[0031] It should be noted that the interval in the embodiments of this application refers to a non-contiguous set of virtual addresses, which can be represented by virtual address information VPN. It may include access patterns with fixed step size or sparse distribution to achieve discrete and regular access.
[0032] In one embodiment of this application, an encoding mechanism can be used to generate intervals. Specifically, base+delta or base+bitmap encoding methods are used to avoid being identified as simple continuous intervals. Simultaneously, based on the encoding logic of the interval encoding circuit, the virtual address information VPN corresponding to each PTW request, i.e., the virtual page number, is extracted. The encoding logic unit quickly detects whether it can be integrated into an existing VPN interval or form a new continuous or discrete local interval with other requests. This embodiment of the application does not impose specific limitations.
[0033] Step 103: If the page table query request meets the preset merge detection conditions, perform interval merging on the page table query request to obtain a merge request group.
[0034] In this embodiment of the application, when the preset merging detection conditions are met, it indicates that the page table query request can be merged in the current level. Therefore, the interval is merged to obtain a merge request group, so that when the retrieval instruction is called, the merged merge request group is preferred to be requested.
[0035] It should be noted that the interval merging in this embodiment may include merging the current PTW request into an existing merge request group, or it may include generating a new merge request group. Furthermore, once the merge request group has been merged, the translation results of each merge request can be associated with the corresponding request identifier and interval information, and sent in batches to the MMU. After receiving the batch translation results, the MMU writes all results to the TLB at once, eliminating the need to perform a separate TLB write operation for each request. Simultaneously, it optimizes TLB entry allocation by incorporating interval information. When the MMU needs to make a retrieval request, the object synchronously wakes up all waiting memory requests belonging to the merge group in batches, allowing these requests to quickly use the translated physical address for subsequent data access.
[0036] In another embodiment of this application, for further definition and explanation, after obtaining the count information of the page table query requests to be merged, the method further includes: If the request waiting time count is greater than a preset timing threshold, it is determined that the count meets the preset counting condition; or, If the number of requests is greater than a preset counting threshold, it is determined that the count information meets the preset counting condition.
[0037] To achieve batch processing of PTW requests, the counting information includes request wait time count and request quantity count, satisfying the counting requirements for merging PTW request intervals. The request wait time count is obtained by counting the wait time for each PTW request, and the request quantity count is obtained by counting the number of PTW requests. At this point, preset timing thresholds and preset counting thresholds can be set based on batch processing requirements to achieve the purpose of a dual-trigger mechanism.
[0038] In a specific example, for quantity threshold triggering, the preset counting threshold is preferably 8. When the number of PTW requests in the merge request group reaches the threshold, regardless of whether the preset timing threshold confirms that the adaptation conditions are met, the next step of the batch PTW merge processing is started for merging detection.
[0039] In a specific example, for timeout triggering, the preset timing threshold is preferably 3 processor cycles, such as 3 nanoseconds. When the request waiting time count recorded by the counter exceeds 3 processor cycles, regardless of the number of requests in the current group, the next step of batch PTW merging processing is initiated for merging detection.
[0040] In another embodiment of this application, for further definition and explanation, the detection of the page table query request based on preset merge detection conditions includes at least one of the following: The virtual address information of the page table query request is detected based on the interval group combination conditions; The step size of the page table query request is detected based on the step size consistency condition. The hierarchy and attributes of the page table query request are detected based on the page table consistency condition.
[0041] To achieve batch processing of PTW requests at the same level and reduce resource waste in request processing within the system, multiple detection conditions in the merged detection conditions are activated simultaneously.
[0042] In this embodiment, the interval group combination condition is used to characterize whether the page table query request can be combined with other interval conditions. These conditions may include, for example, whether the interval code can be integrated into an existing interval, or whether the interval code can form a new interval with other requests, etc., as pre-defined conditions. In a specific example, the virtual address information VPN (i.e., the virtual page number) corresponding to the PTW request is first extracted. Then, by comparing each request one by one, it is determined whether the VPN falls into an interval at the current level, whether it can be integrated into an existing VPN interval, or whether it can form a new continuous or discrete local interval with other requests. This embodiment does not impose specific limitations.
[0043] In this embodiment, the step size consistency condition is used to characterize whether the page table query requests are combined into a step size condition of an interval. This can include pre-set conditions such as whether the step size alignment is consistent or whether the step size length is consistent. In a specific example, when a new VPN request arrives, after storing the most recent VPN request in the VPN cache queue, the current step size is obtained by the difference between the current VPN and the previous VPN. For step size consistency judgment, the current step size can be compared with the recorded interval step size in the same level. If the current step size is consistent with the recorded step size in the group, it indicates that merging can be performed, i.e., the current continuous sequence can be expanded for merging. If the step sizes are inconsistent, the merging of the current continuous sequence is truncated. In this case, VPN requests that have formed continuous rules can be merged into a batch page table access request, and the new VPN with the changed step size is used as the starting request of the new continuous sequence. The step size detection and merging group construction is restarted. This embodiment does not impose specific limitations.
[0044] In this embodiment, the page table consistency condition is used to characterize whether the page table query requests are entitled to be combined. This can include pre-defined conditions such as whether page table attributes are the same or whether page table levels are the same. In one specific example, for page table attribute consistency detection, the memory access permissions, address space IDs, memory protection, and other attributes of the requests to be merged and the intervals can be checked for consistency. Additionally, a prefetch request identifier detection can be added, that is, determining whether the PTW requests to be merged carry a prefetch request identifier corresponding to the interval, to achieve unified merging scheduling of ordinary requests and HPW prefetch requests. In another specific example, for page table level consistency detection, it can be determined whether the page table levels corresponding to all mergeable requests are consistent, to ensure that batch traversal can complete the page table traversal of all requests in one go.
[0045] It should be noted that this application proposes a new encoding method, namely, using base+delt or base+bitmap encoding to encode the virtual address. The base is the starting VPN of the interval, and each bit of the bitmap corresponds to a virtual page number. The marking and identification are realized through the encoding logic unit to avoid being identified as a simple continuous interval. At this time, the interval can represent a non-continuous set of virtual pages, including access patterns with fixed step size or sparse distribution, so as to clearly support the purpose of discrete but regular access.
[0046] In another embodiment of this application, for further definition and explanation, the step of merging the page table query requests to obtain a merged request group includes: determining a target merged interval based on the page table query requests; if the target merged interval exists, merging the page table query requests into the merged request group corresponding to the target merged interval; if the target merged interval does not exist, creating a merged interval, and merging the page table query requests based on the created merged interval to obtain a new merged request group. Specifically, the page table query requests can be merged into the merged request group corresponding to the target merged interval according to a preset merging rule.
[0047] To reduce system resource waste and improve batch processing efficiency, during interval merging, specifically, the first step is to determine whether an existing merge interval can potentially be integrated into the target merge interval based on the step size of the PTW request. At this point, the VPN of the PTW request can be compared with each merged interval through a query-by-query approach. If the encoding range of an already merged interval is greater than the VPN range, it indicates that integration is possible. Therefore, the page table query request can be merged into the merge request group corresponding to the target merge interval according to preset merging rules. The preset merging rules include interval merging rules, step size merging rules, and page table merging rules. The interval merging rules characterize the rules for merging PTW requests by increasing the interval length. The step size merging rules characterize the rules for merging PTW requests by continuously adding steps. The page table merging rules characterize the rules for uniformly merging PTW requests according to the page table hierarchy. This embodiment does not impose specific limitations on these rules.
[0048] In one specific embodiment, the page table in this application embodiment can be pre-divided into independent and dedicated interval tables according to different levels. For example, a dedicated interval table is maintained for the page table level corresponding to L2, L3, and L4. Each level adopts an independent management strategy and is optimized for the page table characteristics of different levels. At this time, each level interval corresponds to the access path of different page table levels.
[0049] The corresponding method further includes: if the target merge interval does not exist, then creating an update merge interval to generate an update merge request group according to the update merge interval.
[0050] In a specific example, if the request to be merged can be incorporated into an existing range, then only the corresponding bit in the bitmap and request_cnt need to be updated by encoding; if it cannot be incorporated into an existing range, then a new range entry is added in the Range-based MSHR and it is assigned to a new merge request group.
[0051] It should be noted that, in this embodiment, a DRAM burst adapter unit can be used to convert the merged virtual page number range into a burst read operation conforming to the DRAM protocol specification. Specifically, the DRAM burst adapter unit has the following functions: automatically calculates the optimal burst length based on the merged range length, enabling the reading of multiple page table entries at once; aligns the physical address according to the bus width to avoid cross-row and cross-boundary accesses, improving DRAM efficiency; generates a continuous address sequence based on the stride, supporting batch reads of non-contiguous but fixed stride lengths; filters invalid page table entries using a valid bitmap, performing memory access only on the actual requested location; and generates standard DRAM control signals to merge multiple independent PTW memory accesses into a single long burst, significantly reducing overhead such as row activation and column addressing, and lowering memory bandwidth usage and page table traversal latency.
[0052] In another embodiment of this application, for further definition and explanation, after merging the page table query requests to obtain a merged request group, the method further includes: The merge request group is cached according to the virtual address information and the step size; In response to the first request retrieval instruction at the same level, the merge request group is retrieved according to the merge priority at the same level to trigger multiple page table query requests in the merge request group; In response to a second request retrieval instruction from an upper or lower level, the multi-level merge request group corresponding to the upper or lower level is merged with the merge request group to trigger multiple page table query requests in the multi-level merge request group.
[0053] To achieve flexible and efficient merging and retrieval of PTW requests at the same level in high-concurrency scenarios, after merging the PTW requests, the merged request group can be cached according to the VPN and step size. This can be done using a Range-based MSHR. In a specific embodiment, the Range-based MSHR, which serves as the main management structure for PTW requests, stores the merged PTW request ranges. Each entry represents multiple requests. After range merging, the request table within the range replaces the traditional MSHR as the primary state management structure for PTW requests. Each entry contains the fields [base, length, stride, ASID, access_right, timeout_cnt, request_cnt], supports non-contiguous access, and is compatible with base+bitmap encoding.
[0054] In this embodiment, after the PTW request processing is completed, in response to the first request retrieval instruction at the same level, the merge request group is retrieved according to the merge priority at the same level to trigger multiple page table query requests in the merge request group. Here, the request retrieval instruction at the same level refers to the request retrieval instruction corresponding to the same level of the current merge interval group, so as to retrieve the merged merge request group according to the merge priority at the same level. The merge priority at the same level is used to characterize the priority order in which multiple existing merge request groups are retrieved, including but not limited to step size priority, time priority, interval order priority, etc., which are not specifically limited in this embodiment.
[0055] In this embodiment, after the PTW request processing is completed, in response to the second request retrieval instruction from the upper or lower level, the multi-level merge request group corresponding to the upper or lower level is merged with the merge request group to trigger multiple page table query requests in the multi-level merge request group. At this time, the upper or lower level request retrieval instruction refers to the request retrieval instruction corresponding to the upper or lower level of the current merge interval group, and can be used to merge with merge request groups in other levels. That is, after merging the multi-level merge request group corresponding to the upper or lower level with the merge request group, multiple page table query requests in the multi-level merge request group are triggered. This embodiment does not impose specific limitations.
[0056] In another embodiment of this application, for further definition and explanation, the method further includes: If the page table query request is detected to match a preset abnormal condition, the page table query request will be determined as an independent request.
[0057] To ensure the effective processing of PTW request merging, it is necessary to perform anomaly detection on the PTW requests to be merged. At this time, the anomaly conditions include step size anomaly conditions, address anomaly conditions, and permission anomaly conditions. The step size anomaly condition is used to characterize the condition that the step size is determined to be abnormal when it exceeds the preset step size threshold. The address anomaly condition is used to characterize the condition that the virtual address matches the address blacklist and is determined to be abnormal. The permission anomaly condition is used to characterize the condition that the page table matches the list of unauthorized mergers and is determined to be abnormal. This application does not specify the specific thresholds or lists.
[0058] In a specific example, if a PTW request encounters an exception such as an invalid page table entry or permission error during batch access, the merging of this PTW request is terminated, while the remaining requests continue to complete the merging process. Simultaneously, the location of the exception can be recorded, and the bitmap state in the Range-based MSHR can be updated using a range-encoded circuit. After exception handling, the corresponding bit is updated using range encoding to maintain the consistency of the range structure.
[0059] In this embodiment of the application, when merging is not possible, the PTW request can be returned through the page walk mechanism to ensure system stability and enhance the rationality of the project.
[0060] In a specific implementation scenario, such as Figure 2 As shown, as a hardware device for executing request merging, when the current execution entity is a chip, it can include multiple hardware devices, such as a range merging detection unit, a range-based MSHR, a DRAM burst adapter unit, and a dual-trigger control unit. Among these, the irreplaceable hardware structure of the range encoding circuit possesses unique structural hardware innovation, rather than simple logic optimization. Specifically, after a PTW request is initiated, it enters the range merging detection unit. The range encoding circuit encodes the request according to the aforementioned encoding method, updates the range-based MSHR, and uses the dual-layer trigger control unit to determine the trigger for request merging, performing the merging through trigger control logic. The range merging detection unit is an independent dedicated hardware logic unit, containing a range continuity detection circuit, an attribute consistency detection circuit, and a step size detection circuit, used to detect the range continuity, attribute consistency, and step size consistency of the request. The DRAM burst adapter unit stores the merged request group, the merging scheduling unit schedules the execution of the request, and finally feeds back to the MMU for specific requests. Figure 2 The hardware structure shown executes as follows: Figure 3 The method flow is shown.
[0061] In another specific implementation scenario, within a specific execution entity, the virtual program can be further divided into functional modules, including: a PTW request input and synchronization module, a VPN interval resolution module, a step size extraction and alignment detection module, an interval attribute register module, an interval merging feasibility judgment module, an interval merging and expansion control module, a step size mutation splitting module, a merge request arbitration and triggering module, a page table access cache (PTC) module, a DRAM burst adaptation module, a merge result temporary storage module, a result broadcasting and backfilling module, and an exception handling and fault tolerance rollback module. Specifically, in the PTW request input and synchronization module, the input is multiple parallel PTW requests, each containing: VA, permission, ASID, request validity, and address source identifier. The output is the synchronized request vector, used to perform bucking, alignment, and de-glitching on multi-source requests, ensuring stability and effectiveness when entering the pipeline. In the VPN interval resolution module, the input is VA, and the output is VPN_START, VPN_END, and page offset, converting virtual addresses into virtual page number intervals, providing a foundation for subsequent merging. In the step size extraction and alignment detection module, the input is multiple consecutive VPNs, and the output is the step size (Stride), alignment flag, and step size validity flag. The difference between adjacent VPNs is calculated as: Stride = VPN[i+1] VPN[i] is used to determine whether it has a fixed step size and whether it is aligned according to the step size. The final output step size value is used for subsequent merging judgment. In the interval attribute register module, the inputs are VPN_START, VPN_END, Stride, ASID, and permissions. The output is the registered complete interval attributes to save all attributes of each request to be merged for the judgment module to read. In the interval merging judgment module, the conditions that must be met for merging include: the same ASID, compatible permissions (no conflict), overlapping intervals, adjacent or near neighbor intervals, the same step size Stride, and consistent step size alignment. If any one of these conditions is not met, merging is not allowed. In the interval merging and expansion control module, the inputs are multiple mergeable intervals, and the output is the merged large interval. The merging rules include: merged VPN_START = minimum VPN, merged VPN_END = maximum VPN, merged Stride = original unified step size, merged permissions = intersection of common permissions, and merged ASID remains unchanged. In the step-size mutation splitting module, if a step-size mutation occurs during the merging process (i.e., inconsistent stride), the current merging interval is immediately truncated, the already merged interval is committed, and a new independent interval is created for the mutated part, ensuring that the merging interval always has a fixed step size. In the merge request arbitration and triggering module, PTW merging is triggered under the following conditions: interval length reaches a threshold and waiting timeout. Additionally, step-size mutation triggering and external forced triggering can be set. In the page table access cache (PTC) module, already read page tables can be quickly hit, avoiding duplicate memory accesses. In the DRAM burst adaptation module, the optimal DRAM burst length can be generated based on the interval length and step size, enabling batch reading. In the merge result temporary storage module, batch-read page table entries can be saved, arranged in order of VPN and stride. In the result broadcasting and backfilling module, the merge result can be broadcast to all original requests, achieving one-time reading and full reuse. In the exception handling and fault tolerance rollback module, when there are permission conflicts, illegal step sizes, or address errors, the system automatically rolls back to independent PTW mode.
[0062] In a specific example, multiple consecutive address accesses from different threads enter the device, generating multiple PTW requests. The VPN interval is then resolved, specifically for each VA (Version Aspect), represented as VPN_START=VA>>PAGE_SHIFT; VPN_END=VPN_START, meaning the length of a single page request interval is 1. In the stride extraction and alignment detection, for consecutively arriving VPNs, the calculation is: Stride=VPN[i+1]. VPN[i] is used to determine if the step size is fixed, if it is aligned to the step size, and if the step size is valid (i.e., step size > 0 and does not exceed the maximum limit). At this point, the interval attributes are registered as VPN_START, VPN_END, Stride, ASID, permissions, and a valid flag. Furthermore, merging is checked sequentially, including whether the ASIDs are the same, whether the permissions are compatible, whether the overlapping intervals are adjacent or close neighbors, whether the step size Stride is the same, and whether the step size alignment is consistent. If all conditions are met, the interval is marked as merging. Additionally, if the new request's step size is inconsistent with the current merge interval, the current merge is stopped, and the merged interval is submitted, or a new independent interval is requested. During interval merging, the merging rules can include at least one of the following: new VPN_START = minimum VPN, new VPN_END = maximum VPN, new Stride = original unified step size, permission intersection, and unified ASID merging, to trigger a merge PTW request. At this point, merging is triggered when any of the following conditions are met: interval length ≥ threshold, timeout, step size mutation, or forced submission. During PTC queries, if the result is found, it is retrieved directly; otherwise, DRAM access is initiated. During DRAM batch reads, aligned burst accesses can be generated based on the interval length and step size, allowing all page tables to be read at once. Finally, the results are temporarily stored, arranged by VPN order and step size, and stored in a result buffer. Result broadcasting and backfilling can also be performed, broadcasting the results to all original requests, with each request retrieving the corresponding page table entry according to its own VPN. If permission conflicts, invalid step sizes, or address errors occur during the above process, merging can be canceled, switching to independent PTW mode, and ensuring the system does not crash.
[0063] The request processing method provided in this application embodiment obtains the count information of page table query requests to be merged; when the count information meets the preset count conditions, the page table query requests are detected based on preset merge detection conditions, which include interval group combination conditions, step size consistency conditions, and page table consistency conditions; when the page table query requests meet the preset merge detection conditions, the page table query requests are merged into intervals to obtain merged request groups, thereby achieving the purpose of merging multiple PTW requests at the same level, greatly improving the batch processing efficiency of interval PTW requests, saving memory access consumption, increasing the processing throughput of PTW requests, avoiding serious waste of memory bandwidth, and thus making reasonable and effective use of memory resources.
[0064] Figure 4 This is a schematic diagram of the structure of a request processing device provided in an embodiment of this application, as shown below. Figure 4 As shown, it includes: The acquisition module 21 is used to acquire the count information of the page table query requests to be merged; The detection module 22 is used to detect the page table query request based on a preset merging detection condition when the counting information meets the preset counting condition. Merging module 23 is used to merge the page table query requests into a merge request group when the page table query requests meet the preset merging detection conditions.
[0065] Furthermore, the device also includes: The determining module is configured to determine that the count information meets the preset counting condition when the request waiting time count information is greater than the preset timing threshold; or, to determine that the count information meets the preset counting condition when the request quantity count information is greater than the preset counting threshold.
[0066] Furthermore, the detection module is specifically used to detect the virtual address information of the page table query request based on the interval group combination conditions, wherein the interval group combination conditions are used to characterize whether the page table query request can be combined with interval conditions. The step size of the page table query request is detected based on the step size consistency condition. The step size consistency condition is used to characterize whether the page table query request is combined into a step size condition of an interval. The page table consistency condition is used to detect the level and attributes of the page table query request. The page table consistency condition is used to characterize whether the page table query request has page table conditions that can be combined.
[0067] Furthermore, the merging module is specifically used to determine a target merging interval based on the page table query request; if the target merging interval exists, the page table query request is merged into the merging request group corresponding to the target merging interval; if the target merging interval does not exist, a merging interval is created, and the page table query request is merged based on the created merging interval to obtain a new merging request group.
[0068] Furthermore, the preset merging rules include interval merging rules, step size merging rules, and page table merging rules.
[0069] Furthermore, the device also includes: The retrieval module is used to cache the merge request group according to the virtual address information and the step size; in response to the first request retrieval instruction at the same level, it retrieves the merge request group according to the merge priority at the same level to trigger multiple page table query requests in the merge request group; in response to the second request retrieval instruction at the upper or lower level, it merges the merge request group with the multi-level merge request group corresponding to the upper or lower level to trigger multiple page table query requests in the multi-level merge request group.
[0070] Furthermore, the determining module is specifically used to determine the page table query request as an independent request when it is detected that the page table query request matches a preset abnormal condition. The preset abnormal conditions include step size abnormal conditions, address abnormal conditions, and permission abnormal conditions.
[0071] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of the embodiments of this application, and the principle is the same. Therefore, the embodiments of this application are not limited thereto.
[0072] The request processing apparatus provided in this application embodiment obtains the count information of page table query requests to be merged; when the count information meets the preset count conditions, the page table query requests are detected based on preset merge detection conditions, the preset merge detection conditions including interval group combination conditions, step size consistency conditions, and page table consistency conditions; when the page table query requests meet the preset merge detection conditions, the page table query requests are merged into intervals to obtain merged request groups, thereby achieving the purpose of merging multiple PTW requests at the same level, greatly improving the batch processing efficiency of interval PTW requests, saving memory access consumption, increasing the processing throughput of PTW requests, avoiding serious waste of memory bandwidth, and thus making reasonable and effective use of memory resources.
[0073] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0074] Figure 5 A schematic block diagram of an example electronic device 300 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0075] like Figure 5As shown, the electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes based on a computer program stored in ROM (Read-Only Memory) 302 or a computer program loaded from storage unit 308 into RAM (Random Access Memory) 303. The RAM 303 may also store various programs and data required for the operation of the electronic device 300. The computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An I / O (Input / Output) interface 305 is also connected to the bus 304.
[0076] Multiple components in electronic device 300 are connected to I / O interface 305, including: input unit 306, such as keyboard, mouse, etc.; output unit 307, such as various types of displays, speakers, etc.; storage unit 308, such as disk, optical disk, etc.; and communication unit 309, such as network card, modem, wireless transceiver, etc. Communication unit 309 allows electronic device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0077] The computing unit 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, CPUs (Central Processing Units), GPUs (Graphics Processing Units), various special-purpose AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSPs (Digital Signal Processors), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above, such as drawing parsing methods. For example, in some embodiments, the drawing parsing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 300 via ROM 302 and / or communication unit 309. When the computer program is loaded into RAM 306 and executed by the computing unit 301, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to perform the aforementioned drawing parsing method by any other suitable means (e.g., by means of firmware).
[0078] Embodiments of this application also propose a chip, such as Figure 6 As shown, the chip includes one or more interface circuits 401 and one or more processors 402; the interface circuits are used to receive signals from the memory of the electronic device and send signals to the processors, the signals including computer instructions stored in the memory, and when the processor executes the computer instructions, it causes the electronic device to perform the request processing method described in the above embodiments of this application.
[0079] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System-on-Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0080] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0081] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0082] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0083] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.
[0084] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0085] It's important to note that artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.
[0086] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.
[0087] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A request processing method, characterized in that, include: Obtain the count information of the page table query requests to be merged; If the counting information meets preset counting conditions, the page table query request is detected based on preset merging detection conditions. These preset merging detection conditions include interval group combination conditions, step size consistency conditions, and page table consistency conditions. Specifically, detecting the page table query request based on the preset merging detection conditions includes at least one of the following: detecting the virtual address information of the page table query request based on the interval group combination conditions, where the interval group combination conditions characterize whether the page table query request can be combined into interval conditions; detecting the step size of the page table query request based on the step size consistency conditions, where the step size consistency conditions characterize whether the page table query request can be combined into an interval step size condition; and detecting the level and attributes of the page table query request based on the page table consistency conditions, where the page table consistency conditions characterize whether the page table query request has the right to be combined page table conditions. If the page table query request meets the preset merge detection conditions, the page table query request is merged into a range to obtain a merge request group; In response to the first request retrieval instruction at the same level, the merge request group is retrieved according to the merge priority at the same level to trigger multiple page table query requests in the merge request group; In response to a second request retrieval instruction from an upper or lower level, the multi-level merge request group corresponding to the upper or lower level is merged with the merge request group to trigger multiple page table query requests in the multi-level merge request group.
2. The method according to claim 1, characterized in that, The counting information includes request wait time counting information and request quantity counting information. After obtaining the counting information of the page table query requests to be merged, the method further includes: If the request waiting time count is greater than a preset timing threshold, it is determined that the count meets the preset counting condition; or, If the number of requests is greater than a preset counting threshold, it is determined that the count information meets the preset counting condition.
3. The method according to claim 1, characterized in that, The process of merging the page table query requests into a merged request group includes: The target merging interval is determined based on the page table query request; If the target merging interval exists, the page table query request will be merged into the merging request group corresponding to the target merging interval; If the target merge interval does not exist, a merge interval is created, and the page table query requests are merged based on the created merge interval to obtain a new merge request group.
4. The method according to claim 1, characterized in that, After merging the page table query requests into a merged request group, the method further includes: Obtain the virtual address information and step size of the page table query request; The merge request group is cached based on the virtual address information and the step size.
5. The method according to claim 1, characterized in that, The method further includes: If the page table query request is detected to match a preset abnormal condition, the page table query request is determined to be an independent request. The preset abnormal conditions include step size abnormal conditions, address abnormal conditions, and permission abnormal conditions.
6. A request processing apparatus, characterized in that, include: The acquisition module is used to obtain the count information of the page table query requests to be merged; The detection module is used to detect the page table query request based on preset merging detection conditions when the counting information meets preset counting conditions. The preset merging detection conditions include interval group combination conditions, step size consistency conditions, and page table consistency conditions. Specifically, detecting the page table query request based on the preset merging detection conditions includes at least one of the following: detecting the virtual address information of the page table query request based on the interval group combination conditions, where the interval group combination conditions characterize whether the page table query request can be combined into interval conditions; detecting the step size of the page table query request based on the step size consistency conditions, where the step size consistency conditions characterize whether the page table query request can be combined into an interval step size condition; and detecting the level and attributes of the page table query request based on the page table consistency conditions, where the page table consistency conditions characterize whether the page table query request has page table conditions that can be combined. The merging module is used to merge the page table query requests into a merged request group when the page table query requests meet the preset merging detection conditions. The first response module is used to respond to the first request retrieval instruction at the same level, and retrieve the merge request group according to the merge priority at the same level, so as to trigger multiple page table query requests in the merge request group. The second response module is used to respond to the second request retrieval instruction of the upper or lower level, and merge the multi-level merge request group corresponding to the upper or lower level with the merge request group to trigger multiple page table query requests in the multi-level merge request group.
7. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the request processing method according to any one of claims 1-5.
8. A chip, characterized in that, The device includes one or more interface circuits and one or more processors; the interface circuits are configured to receive signals from the memory of the electronic device and send the signals to the processors, the signals including computer instructions stored in the memory, which, when executed by the processors, cause the electronic device to perform the request processing method according to any one of claims 1-5.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to execute the request processing method according to any one of claims 1-5.
Citation Information
Patent Citations
Prefetch instruction management method, system and equipment
CN120892093A
Memory management method, device and equipment applied to server-free data center
CN121210109A