Request processing method and device, electronic equipment, chip, and storage medium
By obtaining the virtual address and hierarchy identifier of page table query requests in a heterogeneous computing architecture, and merging multiple PTW requests across hierarchies, the problem of low efficiency in merging page table query requests in existing technologies is solved, achieving efficient memory access and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN JIANGYUAN TECHNOLOGY CO LTD
- Filing Date
- 2026-05-29
- Publication Date
- 2026-06-26
Smart Images

Figure CN122285553A_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 PTW request merging methods typically only merge multiple independent PTW requests at the same page table level. PTW requests generated across multiple levels require repeated page table traversals, resulting in significant redundancy, increased memory bandwidth usage, and latency for many requests. Furthermore, simple merging within a single level cannot match the characteristics of page tables at different levels, failing to meet the requirements for merging PTW requests across multiple levels. 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 low efficiency in PTW request merging. According to a first aspect of this application, a request processing method is provided, comprising: Obtain the virtual address information and page table hierarchy identifier of the page table query request to be merged; According to the virtual address information and the page table level identifier, the target merging interval is queried from the multi-level merging interval. The multi-level merging interval includes a parent level merging interval and / or a child level merging interval. The parent level merging interval and the child level merging interval are obtained by merging them separately in each level. The child level merging interval is determined after the parent level merging interval does not meet the merging conditions. If the attribute information of the target merging interval matches the hierarchical attribute of the page table query request, the page table query request is merged into the target request merging group corresponding to the target merging interval.
[0005] Further, the step of querying the target merge interval from the multi-level merge intervals according to the virtual address information and the page table level identifier includes: The parent level merging interval is determined according to the page table level identifier, and the parent level merging interval is checked for compliance with the merging conditions based on the virtual address information. If the parent-level merging region meets the merging conditions, the target merging interval corresponding to the parent-level merging interval is determined based on the filtering conditions; If the parent-level merging region does not meet the merging conditions, the child-level merging interval is determined based on the page table level identifier, and the target merging interval is determined based on the child-level merging interval.
[0006] Furthermore, after determining the target merging interval corresponding to the parent-level merging interval based on the filtering conditions, the method further includes: Based on the target merging interval, query whether there are multi-level merging intervals in the sub-level merging intervals; In the case of multi-level merging intervals, the multi-level merging intervals are merged with the target merging interval to determine the target merging interval for the page table query requests to be merged.
[0007] Furthermore, the method also includes: In response to a cross-level request retrieval instruction, the target request merging group is retrieved according to the level priority to trigger multiple page table query requests in the target merging request group. The division of parent and child levels in the level priority is based on dynamic threshold configuration.
[0008] Furthermore, before querying the target merge interval from the multi-level merge interval according to the virtual address information and the page table level identifier, the method further includes: Obtain the count information of page table query requests to be merged in each level; If the counting information meets the preset counting conditions, the page table query request is detected based on the merge detection conditions, which include interval group combination conditions, step size consistency conditions, and page table consistency conditions. If the count information does not meet the preset count conditions, the page table query request is merged into a range to obtain the merged range and the merged request group corresponding to the merged range.
[0009] Further, before determining the sub-level merging interval based on the page table level identifier, and determining the target merging interval based on the sub-level merging interval, the method further includes: If the page table query request meets the merge detection conditions of the current level based on the page table level identifier, then the target merge interval is determined in the current level, and the interval is merged to obtain a merge request group.
[0010] According to a second aspect of this application, a request processing apparatus is provided, comprising: The acquisition module is used to acquire the virtual address information and page table hierarchy identifier of the page table query request to be merged; The query module is used to query the target merging interval from the multi-level merging interval according to the virtual address information and the page table level identifier. The multi-level merging interval includes a parent level merging interval and / or a child level merging interval. The parent level merging interval and the child level merging interval are obtained by merging them separately in each level. The child level merging interval is determined after the parent level merging interval does not meet the merging conditions. The merging module is used to merge the page table query request into the target request merging group corresponding to the target merging interval when the attribute information of the target merging interval matches the hierarchical attribute of the page table query request.
[0011] Further, the query module is specifically used to determine the parent level merging interval according to the page table level identifier, and to detect whether the parent level merging interval meets the merging conditions based on the virtual address information; if the parent level merging interval meets the merging conditions, to determine the target merging interval corresponding to the parent level merging interval based on the filtering conditions; if the parent level merging interval does not meet the merging conditions, to determine the child level merging interval based on the page table level identifier, and to determine the target merging interval based on the child level merging interval.
[0012] Furthermore, the device also includes: The determination module is used to query whether there are multi-level merging intervals in the sub-level merging interval based on the target merging interval; if there are multi-level merging intervals, the multi-level merging intervals are merged with the target merging interval to determine the target merging interval for the page table query request to be merged.
[0013] Furthermore, the device also includes: The retrieval module is used to respond to cross-level request retrieval instructions and retrieve the target request merging group according to the level priority to trigger multiple page table query requests in the target merging request group. The division of parent and child levels in the level priority is based on dynamic threshold configuration.
[0014] Furthermore, the device also includes: a detection module, The acquisition module is also used to acquire the count information of page table query requests to be merged in each level; The detection module is used to detect the page table query request based on the merge detection conditions when the counting information meets the preset counting conditions. The merge detection conditions include the interval group combination condition, the step size consistency condition, and the page table consistency condition. The merging module is further configured to merge the page table query requests in the event that the count information does not meet the preset count conditions, thereby obtaining a merged interval and a merged request group corresponding to the merged interval.
[0015] Furthermore, The merging module is further configured to, if it is determined that the page table query request meets the merging detection conditions of the current level based on the page table level identifier, determine the target merging interval in the current level and perform interval merging to obtain a merging request group.
[0016] 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.
[0017] 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.
[0018] 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.
[0019] The request processing method, apparatus, electronic device, chip, and storage medium provided in this application obtain the virtual address information and page table level identifier of the page table query request to be merged; query the target merging interval from multiple merging intervals according to the virtual address information and the page table level identifier, wherein the multiple merging intervals include parent level merging intervals and / or child level merging intervals, the parent level merging intervals and the child level merging intervals are obtained by merging them separately in each level, wherein the child level merging intervals are determined after the parent level merging intervals do not meet the merging conditions; when the attribute information of the target merging interval matches the level attribute of the page table query request, the page table query request is merged into the target request merging group corresponding to the target merging interval, thereby achieving the purpose of merging multiple PTW requests across levels, greatly improving the batch processing efficiency of PTW requests between levels, saving memory access consumption, and avoiding resource waste caused by repeated merging of multiple level page tables.
[0020] 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
[0021] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this application. Wherein: Figure 1 A flowchart illustrating a request processing method provided in an embodiment of this application; Figure 2 Framework diagram of PTW request processing function module; Figure 3 This is a schematic diagram of the structure of a request processing device provided in an embodiment of this application; Figure 4 A schematic block diagram of an example electronic device 300 provided for embodiments of this application; Figure 5 This is a schematic diagram of a chip structure provided in an embodiment of this application. Detailed Implementation
[0022] 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.
[0023] 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.
[0024] Figure 1 This is a flowchart illustrating a request processing method provided in an embodiment of this application.
[0025] like Figure 1 As shown, the method includes the following steps: Step 101: Obtain the virtual address information and page table hierarchy identifier of the page table query request to be merged.
[0026] A 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. This request can be a single PTW or multiple PTWs linked together; this embodiment does not impose specific limitations. The PTW request carries virtual address information (VPN) and a page table level identifier, i.e., the level ID corresponding to this PTW request. Here, "level" refers to the hierarchical division of all page tables according to their characteristics. In one example, all page tables can be divided into four levels: 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 belong to the same level.
[0027] Step 102: Query the target merge interval from the multi-level merge interval according to the virtual address information and the page table level identifier.
[0028] In this embodiment, since the page table can be divided into multiple levels, at least one upper level of the current level corresponding to the PTW request can be taken as the parent level, and at least one lower level of the current level can be taken as the child level. Then, it is queried whether there is a target merge interval that can be merged in the parent level merge interval and the child level merge interval respectively. Furthermore, the parent level merge interval and the child level merge interval are obtained by merging separately in each level; that is, the parent level merge interval is obtained by merging the requested intervals in the page table corresponding to the parent level, and the child level merge interval is obtained by merging the requested intervals in the page table corresponding to the child level. In this case, the child level merge interval is determined after the parent level merge interval does not meet the merging conditions.
[0029] 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.
[0030] 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.
[0031] Step 103: If the attribute information of the target merging interval matches the hierarchical attribute of the page table query request, merge the page table query request into the target request merging group corresponding to the target merging interval.
[0032] In this embodiment, once a target merge interval for interval merging is found, the attribute information of this interval is further matched with the hierarchical attributes of the PTW request to ensure that the PTE request can be merged. At this time, the attribute information may include, but is not limited to, VPN intervals, page table access permissions, page table identifiers, etc. Correspondingly, the hierarchical attributes may include, but are not limited to, the page table access permissions, page table identifiers, VPN intervals, etc. of the current level, so as to determine whether the attribute information matches the hierarchical attributes through an overlay judgment method.
[0033] It should be noted that if a match is found, it means that the PTW request can be merged into this target merge interval. Therefore, this PTW request is merged into the target request merge group corresponding to the target merge interval to obtain the merged target request merge group.
[0034] 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 calculating the optimal burst length based on the merged range length to read multiple page table entries at once; aligning physical addresses according to the bus width to avoid cross-row and cross-boundary accesses and improve DRAM efficiency; generating a continuous address sequence based on the stride to support batch reads with non-contiguous but fixed strides; filtering invalid page table entries using a valid bitmap to perform memory access only on the actual requested location; and generating a standard AXI control signal 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. By merging PTW requests through range-level batch processing and combining DRAM burst access optimization, the processing throughput of the PTW stage can be significantly improved, and the address translation latency in high-frequency TLB miss scenarios can be greatly reduced. Meanwhile, DRAM burst-aware batch access can significantly reduce the number of main memory accesses in the PTW stage, and the saved memory bandwidth can be used for business data access, improving the performance of memory-intensive applications.
[0035] In another embodiment of this application, for further definition and explanation, the step of querying the target merge interval from the multi-level merge interval according to the virtual address information and the page table level identifier includes: The parent level merging interval is determined according to the page table level identifier, and the parent level merging interval is checked for compliance with the merging conditions based on the virtual address information. If the parent-level merging region meets the merging conditions, the target merging interval corresponding to the parent-level merging interval is determined based on the filtering conditions; If the parent-level merging region does not meet the merging conditions, the child-level merging interval is determined based on the page table level identifier, and the target merging interval is determined based on the child-level merging interval.
[0036] To meet the batch processing requirements of requests between different levels, when querying the target merge interval from multiple levels of merge intervals, specifically, the parent level merge interval is determined according to the page table level identifier. At this time, the parent level can be determined first according to the page table level identifier carried in the PTW request, and all existing merge intervals are determined from the parent level. In this embodiment, the division of different levels can be determined according to level characteristics. For example, shallow page tables correspond to L2 level, and deep page tables correspond to L3 or L4. If the current level is L3, then the corresponding parent level is L2, and the existing merge intervals in L2 are determined. This embodiment does not make specific limitations. Furthermore, based on virtual address information, it is detected whether the parent level merge interval meets the merge conditions. Here, the merge conditions refer to the conditions for determining whether the encoded VPN of the current PTW request can be integrated into the parent level merge interval and whether the page table attributes are consistent. In a specific example, based on the PTW request's level identifier and VPN range, the parent level is traced upwards. That is, L3's parent level is L2. It checks whether there is already a merged interval in the parent level that can cover the VPN range of the current PTW request. At the same time, it determines whether the attributes of the parent level interval, such as ASID and access permissions, are consistent with the current PTW request.
[0037] In this embodiment of the application, if the merging conditions are not met, it means that cross-level PTW request merging cannot be performed. Then, the sub-level merging interval is determined based on the page table level identifier, that is, the sub-level query is automatically started, so that after the sub-level merging interval is found, the target merging interval is determined based on the sub-level merging interval.
[0038] In a specific example, based on the query results of the parent level, there are two traffic routing paths. If the parent level has a merging range that can be covered and the attributes are consistent, the PTW request is routed to the parent level for cross-level merging. If the parent level has no covered range or the attributes are inconsistent, the request is routed to the hierarchical Range-based MSHR sub-storage area of the current level to query the sub-level or the current level for range merging at the sub-level and range merging at the current level. After being routed to the sub-level of the current level, the interval encoding circuit can be used to perform interval continuity, attribute consistency, and page table level consistency checks, i.e., determine whether range merging at the same level is possible. The Range-based MSHR sub-storage area of the sub-level is then updated, including updating the corresponding bitmap bits, request_cnt, and other fields, forming a merge request group for the current level, awaiting trigger processing.
[0039] 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.
[0040] In one embodiment of this application, the interval can be generated using an encoding mechanism, namely, base+delta or base+bitmap encoding, to avoid being identified as a simple continuous interval. 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 on this.
[0041] In another embodiment of this application, for further definition and explanation, after determining the target merging interval corresponding to the parent-level merging interval based on the filtering conditions, the method further includes: Based on the target merging interval, query whether there are multi-level merging intervals in the sub-level merging intervals; In the case of multi-level merging intervals, the multi-level merging intervals are merged with the target merging interval to determine the target merging interval for the page table query requests to be merged.
[0042] To achieve cross-level request merging and integrate multiple level merge intervals, thereby improving the efficiency of batch request processing, after determining the target merge interval, it is possible to query whether multi-level merge intervals exist in the sub-level merge intervals based on the target merge interval. That is, to query whether the target merge interval and the sub-level merge intervals can be merged from the parent level. During the query, merging conditions can be followed to ensure the validity of the merge. If a multi-level merge interval exists in the sub-level merge interval that corresponds to the target merge interval in the parent level, it indicates that cross-level PTW request merging can be performed. This involves merging the multi-level merge intervals with the target merge interval. The merging method can be to merge the page table query requests into the merge request group corresponding to the target merge interval according to preset merging rules, thus determining the target merge interval for merging the page table query requests. The preset merging rules include interval merging rules, step-size merging rules, and page table merging rules. The interval merging rule is used to characterize the rule of merging PTW requests by increasing the interval length. The step-size merging rule is used to characterize the rule of merging PTW requests by continuously adding steps. The page table merging rule is used to characterize the rule of uniformly merging PTW requests according to the page table hierarchy. This application embodiment does not make specific limitations.
[0043] In another embodiment of this application, for further definition and explanation, the method further includes: In response to a cross-level request retrieval instruction, the target request merging group is retrieved according to its level priority to trigger multiple page table query requests within the target merging request group.
[0044] To achieve flexible and efficient merging and retrieval of multi-level PTW requests in high-concurrency scenarios, after merging, cross-level request retrieval instructions can be received, i.e., PTW request retrieval instructions from other levels. The target request merge group can be retrieved according to level priority. Here, level priority is used to characterize the priority order of retrieving each merge request group, and can be configured based on different instruction retrieval requirements. For example, if the target request merge group is matched in L2, L3, and L4, the retrieval instructions are retrieved from high to low level, i.e., the target request merge group is retrieved first from L2, and then the corresponding target request merge group is retrieved from L3 or L4 in sequence. This embodiment does not specifically limit this. At this time, according to level priority, the processing priority of shallow page table L2 requests is higher than that of deep page table L3 or L4 requests because, as the parent level, its processing result can cover a large number of child level requests. When multiple levels simultaneously meet the triggering conditions, shallow requests are scheduled first, and PTW hardware resources are dynamically allocated. By prioritizing the scheduling of merged request groups and allocating dedicated hardware resources, the utilization rate of PTW hardware resources can be effectively improved, avoiding resource idleness and competition.
[0045] It should be noted that the division of parent and child levels in the hierarchical priority is based on dynamic threshold configuration. That is, in this embodiment, a dynamic threshold-based hierarchical method is used to divide multiple page table levels into parent and child levels. Specifically, independent configurable thresholds can be preset for different levels. In a specific example, the shallow page table L2 is configured with a small number threshold and a short timeout threshold for hierarchical conditions, such as a number threshold of 4 and a timeout threshold of 2 processor cycles for level L2, to adapt to its characteristics of having few entries and high concentration. The deep page tables L3 or L4 are configured with a large number threshold and a long timeout threshold for hierarchical conditions, such as a number threshold of 16 and a timeout threshold of 5 processor cycles for level L4, to adapt to its characteristics of having many entries and scattered distribution. The above threshold parameters are dynamically adjusted after the system load of each level is collected in real time to achieve the purpose of dynamic hierarchical classification.
[0046] In this embodiment, since the page table is divided into multiple levels, the access results of the upper level can guide the access of the lower level, realizing efficient reuse of page table information and reducing repeated access. At this time, the access strategies for different page table levels can be a shared access strategy for the upper-level page table, multiple requests sharing the same upper-level page table entry, and a batch reading strategy for the leaf-level page table, reading multiple consecutive page table entries at once, etc., which are not specifically limited in this embodiment.
[0047] In a specific example of batch-triggered PTW requests, after receiving a cross-level request, the system can perform a lookup using hash calculation. Based on the VPN information of the PTW request, it quickly finds a reusable parent-level request merge group in the shallow page table result cache. It verifies the validity of the page table entries in the parent-level request merge group, ensuring permission matching and address space consistency. If verification passes, the parent-level merge result is directly pushed down to the current request for address translation, without initiating a new burst access. If verification fails, the request is re-distributed to the current level's hierarchical range-based MSHR for merging at this level.
[0048] In a specific example of batch-triggered PTW requests, for burst access batch processing, shallow page table merging request groups can be processed first, initiating burst access and loading page table entries into the PTW request cache. After shallow processing is completed, burst access at the next level (sub-level) is automatically triggered (if unmerged ranges exist), and so on, until all levels of merge request groups are processed. Simultaneously, cached page table entries can be loaded to batch complete the address mapping calculation for all requests at that level. If an exception occurs during batch access, such as an invalid page table entry or permission error, only the translation of that request is terminated, while the remaining requests continue processing. At the same time, the bitmap state of the hierarchical Range-based MSHR is updated through the range encoding circuit of that level.
[0049] In another embodiment of this application, for further definition and explanation, before querying the target merge interval from the multi-level merge interval according to the virtual address information and the page table level identifier, the method further includes: Obtain the count information of page table query requests to be merged in each level; If the counting information meets the preset counting conditions, the page table query request is detected based on the merge detection conditions, which include interval group combination conditions, step size consistency conditions, and page table consistency conditions. If the count information does not meet the preset count conditions, the page table query request is merged into a range to obtain the merged range and the merged request group corresponding to the merged range.
[0050] 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 can include request wait time count information and request quantity count information. In a specific embodiment, the PWT requests to be merged are at the same level. In this case, "level" refers to dividing all page tables according to their characteristics. In one example, all page tables can be divided into four levels: 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 within the same level.
[0051] In this embodiment, a 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 judgment of PTW requests based on merging detection conditions after any one of the counting conditions is met, i.e., determining whether merging is possible. The merging detection conditions include interval group combination conditions, step size consistency conditions, and page table consistency conditions. The interval combination condition characterizes whether the page table query requests can be combined into an interval; the step size consistency condition characterizes whether the page table query requests can be combined into an interval; and the page table consistency condition characterizes whether the page table query requests have the right to be combined. This ensures that after all conditions are met, the PTW request passes the merging detection and can be merged. In this embodiment, an interval refers to a non-contiguous set of virtual addresses, which can be represented by virtual address information (VPN). It can include access patterns with fixed step sizes or sparse distributions to achieve discrete yet regular access.
[0052] In this embodiment of the application, when the 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 merged request group, so that when the retrieval instruction is called, the merged merged request group is preferred for the request.
[0053] 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 continuously at once, without needing to perform a separate TLB write operation for each request. Simultaneously, it optimizes TLB entry allocation by combining the 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.
[0054] 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.
[0055] 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.
[0056] In a specific example, the virtual address information VPN (i.e., the virtual page number) corresponding to the PTW request is first extracted. By comparing one by one, it is compared whether the VPN falls into the interval of the current level, whether it can be integrated into the existing VPN interval, or whether it can form a new continuous or discrete local interval with other requests. This application embodiment does not make specific limitations.
[0057] 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.
[0058] 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.
[0059] In another embodiment of this application, for further definition and explanation, before determining the sub-level merging interval based on the page table level identifier and determining the target merging interval based on the sub-level merging interval, the method further includes: If the page table query request meets the merge detection conditions of the current level based on the page table level identifier, then the target merge interval is determined in the current level, and the interval is merged to obtain a merge request group.
[0060] To reduce system resource waste and improve the batch processing efficiency of multi-level requests, when merging intervals at the same level, the process first determines whether the page table query request meets the merging detection conditions of the current level based on the page table level identifier carried by the PTW request. Then, the VPN of the PTW request can be compared with each merged interval by querying one by one. If the encoding range of the merged interval is greater than the VPN range, it indicates that it can be merged. Therefore, after determining the target merged interval at the current level, interval merging is performed to obtain a merged request group. The preset merging rules for interval merging include interval merging rules, step-size merging rules, and page table merging rules. The interval merging rules represent rules for merging PTW requests by increasing the interval length, the step-size merging rules represent rules for merging PTW requests by continuously adding steps, and the page table merging rules represent rules for uniformly merging PTW requests according to the page table level. This application embodiment does not specifically limit these rules.
[0061] In a specific implementation scenario, such as Figure 2 As shown, within a specific execution entity, the virtual program can be further divided into functional modules, including hierarchical collaborative detection units, cross-layer result reuse units, and hierarchical dynamic threshold control units. A hierarchical range-based MSHR has been optimized and designed, forming a unique hierarchical collaborative hardware system. This represents a structural hardware innovation rather than a simple logical extension. The core innovation lies in cross-layer result reuse and hierarchical dynamic threshold control, which completely solves the core bottlenecks such as repeated traversal, poor threshold adaptability, and disordered resource contention in multi-level page table scenarios.
[0062] In a specific example, within a specific execution entity, the virtual program can be further divided into functional modules, including: a hierarchical page table query module (for parent-level and child-level queries), an MSHR module, an internal wait queue register group within the MSHR, a query status detection module, a query result temporary storage module, a cross-level result reuse unit, a child-level query initiation module, an exception handling and timeout module, and a request arbitration and priority module. The hierarchical page table query module executes multi-level page table queries, including parent-level page table queries, and then automatically executes child-level page table queries. Functionally, the module can also include parent-level page table query units and child-level page table query units; all queries are executed automatically via a hardware pipeline. Each parent-level query in the MSHR module corresponds to an independent MSHR, used to record the parent-level query status, temporarily store child-level requests, control query initiation and termination, control result output and reuse, and function as a full hardware state machine. The MSHR internal wait queue register group, located within MSHR, includes: a request validity register, a request ID register, a request type register, a request priority register, and a wait reason register. This register temporarily stores all newly arriving child-level requests until the parent-level query is complete. The query status detection module monitors the parent-level query status in real time, including idle, querying, query complete, and query exception states, and outputs status signals to all subsequent modules. The query result storage module temporarily stores the parent-level query results, including physical address, validity bits, permission bits, and exception flags, and retains the results until all child-level requests have been read. The cross-level result reuse unit receives the parent-level query results and broadcasts the results to all waiting child-level requests, enabling a single query to be reused multiple times. In the child-level query initiation module, when the parent-level result is available, the child-level query is automatically initiated, eliminating the need to re-initiate the parent-level query. The exception handling and timeout module detects parent-level query timeouts, invalid results, permission exceptions, bus exceptions, and automatically enters exception handling procedures. The Arbitration and Priority module can perform hardware arbitration based on request type, ID, and priority, and higher priority requests will receive the results first.
[0063] In another specific example, when a PTW request from a sub-level is received, the request is sent to the request arbitration module based on the virtual address, request type, priority, and sub-level query information carried in the PTW request. This determines whether to initiate a parent-level query. In the parent-level query status detection, the query status detection module monitors the parent-level MSHR status in real time. For example, if the parent level is querying, the PTW request enters the MSHR internal waiting queue register; if the parent level has completed the query, the result is broadcast to all waiting requests; if the parent level is abnormal, an exception handling process is implemented. Specifically, after the PTW request enters the MSHR internal waiting queue register, if the request validity bit is set to 1, the request ID and request type are written to the register, and the waiting reason is marked as waiting for the parent-level query to complete. The request then enters a waiting state and does not issue any new queries. Otherwise, the parent-level query continues to execute. At this time, the parent-level query hardware pipeline runs automatically, specifically including: address sending, data reading, result detection, and exception detection, until the query is completed. When the parent-level query is completed, the query completion signal is valid, the query result is written to the query result temporary storage module, and the result validity bit in the cross-level result reuse unit is set to 1. In the step of broadcasting the result to all waiting requests, the cross-level result reuse unit broadcasts the result to all waiting requests. At this time, each waiting request can include: reading the result, clearing the waiting status, and clearing the waiting queue register, to achieve full reuse from a single query. After the parent-level query is completed, the child-level query is automatically started; that is, the child-level query initiation module detects that the parent result is valid and automatically starts the child-level query. At this time, the child-level query pipeline runs using the parent result as input, and outputs the final result upon completion. In the exception handling process, if a parent-level query exceeds its limit, the result is invalid, there is a permission error, or a bus error is detected, the exception validity bit can be set, the exception can be broadcast to all waiting requests, and the waiting queue can be cleared to enter hardware exception handling.
[0064] In another specific example, due to the use of the MSHR register, the key signals of the register can include: parent query busy signal (parent_query_busy), parent query completed signal (parent_query_done), result valid signal (result_valid), wait queue valid signal (wait_queue_valid), and exception enable signal (abort_ena). Key registers include: MSHR configuration register (MSHR_config_reg), wait request ID register (wait_queue_request_ID), parent result register (parent_result_reg), and exception status register (abort_status_reg). In this case, all registers can be configured in hardware without software intervention.
[0065] The request processing method provided in this application embodiment obtains the virtual address information and page table level identifier of the page table query request to be merged; queries the target merging interval from the multi-level merging interval according to the virtual address information and the page table level identifier, wherein the multi-level merging interval includes a parent level merging interval and / or a child level merging interval, wherein the parent level merging interval and the child level merging interval are obtained by merging separately in each level, and wherein the child level merging interval is determined after the parent level merging interval does not meet the merging conditions; if the attribute information of the target merging interval matches the level attribute of the page table query request, the page table query request is merged into the target request merging group corresponding to the target merging interval, thereby achieving the purpose of merging multiple PTW requests across levels, greatly improving the batch processing efficiency of PTW requests between levels, saving memory access consumption, and avoiding resource waste caused by repeated merging of multi-level page tables.
[0066] Figure 3 This is a schematic diagram of the structure of a request processing device provided in an embodiment of this application, as shown below. Figure 3 As shown, it includes: The acquisition module 21 is used to acquire the virtual address information and page table hierarchy identifier of the page table query request to be merged; The query module 22 is used to query the target merging interval from the multi-level merging interval according to the virtual address information and the page table level identifier. The multi-level merging interval includes a parent level merging interval and / or a child level merging interval. The parent level merging interval and the child level merging interval are obtained by merging them separately in each level. The child level merging interval is determined after the parent level merging interval does not meet the merging conditions. The merging module 23 is used to merge the page table query request into the target request merging group corresponding to the target merging interval when the attribute information of the target merging interval matches the hierarchical attribute of the page table query request.
[0067] Further, the query module is specifically used to determine the parent level merging interval according to the page table level identifier, and to detect whether the parent level merging interval meets the merging conditions based on the virtual address information; if the parent level merging interval meets the merging conditions, to determine the target merging interval corresponding to the parent level merging interval based on the filtering conditions; if the parent level merging interval does not meet the merging conditions, to determine the child level merging interval based on the page table level identifier, and to determine the target merging interval based on the child level merging interval.
[0068] Furthermore, the device also includes: The determination module is used to query whether there are multi-level merging intervals in the sub-level merging interval based on the target merging interval; if there are multi-level merging intervals, the multi-level merging intervals are merged with the target merging interval to determine the target merging interval for the page table query request to be merged.
[0069] Furthermore, the device also includes: The retrieval module is used to respond to cross-level request retrieval instructions and retrieve the target request merging group according to the level priority to trigger multiple page table query requests in the target merging request group. The division of parent and child levels in the level priority is based on dynamic threshold configuration.
[0070] Furthermore, the device also includes: a detection module, The acquisition module is also used to acquire the count information of page table query requests to be merged in each level; The detection module is used to detect the page table query request based on the merge detection conditions when the counting information meets the preset counting conditions. The merge detection conditions include the interval group combination condition, the step size consistency condition, and the page table consistency condition. The merging module is further configured to merge the page table query requests in the event that the count information does not meet the preset count conditions, thereby obtaining a merged interval and a merged request group corresponding to the merged interval.
[0071] Furthermore, the merging module is also used to determine the target merging interval in the current level and perform interval merging to obtain a merging request group if the page table query request meets the merging detection conditions of the current level based on the page table level identifier.
[0072] The request processing apparatus provided in this application obtains the virtual address information and page table level identifier of the page table query request to be merged; queries the target merging interval from the multi-level merging interval according to the virtual address information and the page table level identifier. The multi-level merging interval includes a parent level merging interval and / or a child level merging interval. The parent level merging interval and the child level merging interval are obtained by merging them separately in each level. The child level merging interval is determined after the parent level merging interval does not meet the merging conditions; if the attribute information of the target merging interval matches the level attribute of the page table query request, the page table query request is merged into the target request merging group corresponding to the target merging interval. This achieves the purpose of merging multiple PTW requests across levels, greatly improves the batch processing efficiency of PTW requests between levels, saves memory access consumption, and avoids resource waste caused by repeated merging of multi-level page tables.
[0073] 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.
[0074] According to embodiments of this disclosure, this disclosure also provides an electronic device and a readable storage medium.
[0075] Figure 4 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.
[0076] like Figure 4 As 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.
[0077] 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.
[0078] The computing unit 301 can be various 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 303 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).
[0079] Embodiments of this application also propose a chip, such as Figure 5 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.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] 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).
[0084] 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.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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 virtual address information and page table hierarchy identifier of the page table query request to be merged; According to the virtual address information and the page table level identifier, the target merging interval is queried from the multi-level merging interval. The multi-level merging interval includes a parent level merging interval and / or a child level merging interval. The parent level merging interval and the child level merging interval are obtained by merging them separately in each level. The child level merging interval is determined after the parent level merging interval does not meet the merging conditions. If the attribute information of the target merging interval matches the hierarchical attribute of the page table query request, the page table query request is merged into the target request merging group corresponding to the target merging interval.
2. The method according to claim 1, characterized in that, The step of querying the target merge interval from the multi-level merge intervals according to the virtual address information and the page table level identifier includes: The parent level merging interval is determined according to the page table level identifier, and the parent level merging interval is checked for compliance with the merging conditions based on the virtual address information. If the parent-level merge interval meets the merge conditions, the target merge interval corresponding to the parent-level merge interval is determined based on the filtering conditions. If the parent level merge interval does not meet the merge conditions, the child level merge interval is determined based on the page table level identifier, and the target merge interval is determined based on the child level merge interval.
3. The method according to claim 2, characterized in that, After determining the target merge interval corresponding to the parent-level merge interval based on the filtering conditions, the method further includes: Based on the target merging interval, query whether there are multi-level merging intervals in the sub-level merging intervals; In the case of multi-level merging intervals, the multi-level merging intervals are merged with the target merging interval to determine the target merging interval for the page table query requests to be merged.
4. The method according to claim 1, characterized in that, The method further includes: In response to a cross-level request retrieval instruction, the target request merging group is retrieved according to the level priority to trigger multiple page table query requests in the target request merging group. The division of parent and child levels in the level priority is based on dynamic threshold configuration.
5. The method according to claim 1, characterized in that, Before querying the target merge interval from the multi-level merge interval according to the virtual address information and the page table level identifier, the method further includes: Obtain the count information of page table query requests to be merged in each level; If the counting information meets the preset counting conditions, the page table query request is detected based on the merge detection conditions, which include interval group combination conditions, step size consistency conditions, and page table consistency conditions. If the count information does not meet the preset count conditions, the page table query request is merged into a range to obtain a merged range and the merged request group corresponding to the merged range.
6. The method according to claim 5, characterized in that, Before determining the sub-level merging interval based on the page table level identifier, and determining the target merging interval based on the sub-level merging interval, the method further includes: If the page table query request meets the merge detection conditions of the current level based on the page table level identifier, then the target merge interval is determined in the current level, and the interval is merged to obtain a merge request group.
7. A request processing method, characterized in that, include: The acquisition module is used to acquire the virtual address information and page table hierarchy identifier of the page table query request to be merged; The query module is used to query the target merging interval from the multi-level merging interval according to the virtual address information and the page table level identifier. The multi-level merging interval includes a parent level merging interval and / or a child level merging interval. The parent level merging interval and the child level merging interval are obtained by merging them separately in each level. The child level merging interval is determined after the parent level merging interval does not meet the merging conditions. The merging module is used to merge the page table query request into the target request merging group corresponding to the target merging interval when the attribute information of the target merging interval matches the hierarchical attribute of the page table query request.
8. 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-6.
9. A chip, characterized in that, It includes one or more interface circuits and one or more processors; the interface circuits are used 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-6.
10. 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-6.