Processor, request scheduling method, cache system and computer equipment
By introducing a request scheduler into the processor, conflict resolution and arbitration are performed, and the sharing priority of different storage module groups is ensured, which solves the problem of low bandwidth utilization under the multi-storage module group architecture in multi-core processors, achieving higher storage bandwidth utilization and stronger concurrency capabilities.
Patent Information
- Application Number
- CN202411635957.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-21
AI Technical Summary
Existing multi-core processors such as GPUs have low bandwidth utilization due to memory access request splitting and conflicts under a multi-storage module group architecture.
By introducing a request scheduler into the processor, conflict resolution and arbitration are performed, ensuring that different storage module groups share priority, thus supporting concurrency of multiple storage module groups and reducing the impact of storage fetch conflicts.
It improves the utilization rate of storage bandwidth, enhances the concurrency capability of multiple storage module groups, and reduces memory access latency.
Smart Images

Figure CN119669143A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically, to a processor, a request scheduling method, a cache system and a computer device. Background Art
[0002] Multi-core processors such as graphics processing units (GPUs) have the characteristics of a large number of threads and a large memory access data bandwidth, so their caches at all levels usually use a multi-bank architecture. The multi-bank architecture distributes data to multiple parallel memory module groups (bank-groups) according to the address, and multiple clients share the data in these bank-groups. In the prior art, a bank-group can only serve one client in one clock cycle. Among them, when a memory access request needs to access multiple bank-groups at the same time, it will be split into multiple cycles for access. When multiple clients want to access a bank-group at the same time, they will also access it one by one in multiple cycles. These two conflicts are important factors that cause low memory access bandwidth utilization. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a processor, a request scheduling method, a cache system and a computer device, so as to support the concurrency of multiple storage module groups by allowing different storage module groups to share priorities, thereby weakening the impact of memory access conflicts and improving bandwidth utilization.
[0004] In a first aspect, an embodiment of the present invention provides a processor, the processor comprising:
[0005] A plurality of processing cores are configured to run a plurality of threads, at least one of the threads sharing a corresponding cache region;
[0006] A cache area, wherein the cache area includes a plurality of storage module groups, and the storage module group includes a plurality of storage modules;
[0007] A request scheduler is configured to perform conflict resolution on a transaction request received from a client, obtain at least one corresponding sub-transaction, arbitrate each of the sub-transactions, and obtain a target request, wherein the storage modules required to be accessed by any of the sub-transactions include different storage modules in the same storage module group and / or storage modules in different storage module groups, and the different storage module groups corresponding to the sub-transactions share priorities.
[0008] Further, the request scheduler includes:
[0009] A conflict resolution device, configured to perform conflict resolution on each of the transaction requests;
[0010] The arbitrator is configured to determine the priority queue of each client for each storage module group based on a predetermined method, and detect each client based on the priority of the priority queue to determine the target request.
[0011] Furthermore, the priority queue is initialized based on the serial number of each of the clients, and is updated after the target request is determined.
[0012] Furthermore, the arbitrator is further configured to determine whether to merge the access request of the current client with the previously authorized access request based on the request type of the access request of the current client and the request order of the corresponding type.
[0013] In a second aspect, an embodiment of the present invention provides a request scheduling method, applicable to a processor, wherein at least one thread of the processor shares a corresponding cache area, wherein the cache area includes a plurality of storage module groups, wherein the storage module group includes a plurality of storage modules, and the method includes:
[0014] Performing conflict resolution on the received transaction request of the client to obtain at least one corresponding sub-transaction, wherein the storage modules to be accessed by any of the sub-transactions include different storage modules in the same storage module group and / or storage modules in different storage module groups;
[0015] Inputting each of the sub-transactions into an arbitrator for arbitration to obtain a target request, wherein different storage module groups corresponding to the sub-transactions share a priority;
[0016] Based on the target request, a corresponding storage module is accessed to perform a corresponding data processing operation.
[0017] Furthermore, the step of inputting each of the sub-transactions into an arbitrator for arbitration to obtain a target request includes:
[0018] For each of the storage module groups, determining a priority queue for each of the clients, wherein the priority queue is initialized based on the serial number of each of the clients and is updated after determining the target request;
[0019] Each of the clients is detected based on the priority of the priority queue to determine the target request.
[0020] Further, updating the priority queue after determining the target request includes:
[0021] The priority of the client satisfying the authorization condition is reduced to the lowest to update the priority queue.
[0022] Further, the detecting each of the clients based on the priority of the priority queue to determine the target request includes:
[0023] Determining a current client based on the priority of the priority queue;
[0024] Determine the request type of the access request of the current client;
[0025] In response to the request type being a predetermined type and the access request of the current client being the first request of the predetermined type, determining the access request of the current client as a target request;
[0026] In response to the request type being a predetermined type, and the access request of the current client and the previously authorized access request satisfying a merging condition, the access request of the current client is determined as a target request.
[0027] Furthermore, the access request of the current client and the previously authorized access request satisfy the merging condition specifically: the access request of the current client and the previously authorized access request are of the same request type, and the storage module corresponding to the access request of the current client is different from the storage module corresponding to the previously authorized access request and is located in the same storage module group.
[0028] In a third aspect, an embodiment of the present invention provides a cache system, applicable to a processor, wherein at least one thread of the processor shares a corresponding cache area, and the cache system includes:
[0029] A cache area, wherein the cache area includes a plurality of storage module groups, and the storage module group includes a plurality of storage modules;
[0030] A conflict resolution device is configured to perform conflict resolution on a received transaction request of a client, and obtain at least one corresponding sub-transaction, wherein the storage modules to be accessed by any of the sub-transactions include different storage modules in the same storage module group and / or storage modules in different storage module groups;
[0031] The arbitrator is configured to arbitrate each of the sub-transactions to obtain a target request, wherein different storage module groups corresponding to the sub-transactions share a priority.
[0032] In a fourth aspect, an embodiment of the present invention provides a request scheduling device, applicable to a processor, wherein at least one thread of the processor shares a corresponding cache area, the cache area includes a plurality of storage module groups, the storage module group includes a plurality of storage modules, and the device includes:
[0033] a conflict resolution unit configured to perform conflict resolution on a transaction request received from a client, and obtain at least one corresponding sub-transaction, wherein the storage modules to be accessed by the sub-transaction include different storage modules in the same storage module group and / or storage modules in different storage module groups;
[0034] an arbitration unit configured to input each of the sub-transactions into an arbitrator for arbitration to obtain a target request, wherein different storage module groups corresponding to the sub-transactions share a priority;
[0035] The memory access unit is configured to access the corresponding storage module based on the target request to perform a corresponding data processing operation.
[0036] In a fifth aspect, an embodiment of the present invention provides a computer device, wherein the computer device includes the processor as described above.
[0037] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0038] In a seventh aspect, an embodiment of the present invention provides a computer program product, which, when executed on a computer, enables the computer to execute the method described above.
[0039] The processor of this embodiment includes a processing core running multiple threads, a cache area and a request scheduler, at least one thread shares the cache area, the cache area includes multiple storage module groups, the storage module group includes multiple storage modules, the request scheduler performs conflict resolution on the transaction request received from the client, obtains at least one corresponding sub-transaction, arbitrates each sub-transaction, obtains the target request, and the storage modules required to be accessed by any sub-transaction include different storage modules in the same storage module group and / or storage modules in different storage module groups, and different storage module groups corresponding to the sub-transactions share priorities. Therefore, the embodiment of the present invention can support the concurrency of multiple storage module groups by allowing different storage module groups in the cache area to share priorities, thereby weakening the impact of memory access conflicts and improving bandwidth utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0041] Figure 1 is a schematic diagram of a processor according to an embodiment of the present invention;
[0042] Figure 2 is a flow chart of a request scheduling method according to an embodiment of the present invention;
[0043] Figure 3 is a flow chart of a method for requesting arbitration according to an embodiment of the present invention;
[0044] Figure 4 is a flow chart of another method for requesting arbitration according to an embodiment of the present invention;
[0045] Figure 5 is a flow chart of a priority queue updating method according to an embodiment of the present invention;
[0046] Figure 6 is a schematic diagram of a cache system according to an embodiment of the present invention;
[0047] Figure 7 is a schematic diagram of a request scheduling device according to an embodiment of the present invention;
[0048] Figure 8 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The present application is described below based on embodiments, but the present application is not limited to these embodiments. In the detailed description of the present application below, some specific details are described in detail. It is possible for those skilled in the art to fully understand the present application without the description of these details. In order to avoid confusing the essence of the present application, known methods, processes, flows, components and circuits are not described in detail.
[0050] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.
[0051] Unless the context clearly requires otherwise, the words "include", "comprising" and similar words throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is "including but not limited to".
[0052] In the description of this application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" is two or more.
[0053] The solutions described in this specification and in the examples, if they involve the processing of personal information, will be processed on the premise of having a legal basis (such as obtaining the consent of the subject of personal information, or being necessary for the performance of a contract, etc.), and will only be processed within the scope of regulations or agreements. If a user refuses to process personal information other than the necessary information for basic functions, it will not affect the user's use of basic functions.
[0054] For processors that require efficient local memory management, such as GPUs, high-performance embedded systems, and digital signal processors (DSPs), caches use a multi-bank architecture. Taking the GPU as an example, the GPU can implement multi-threaded concurrent processing, and each storage module (bank) in the cache can independently serve a thread within a single clock cycle. Furthermore, multiple banks form a storage module group (bank-group), and multiple banks in a bank-group can be executed concurrently. When a thread accesses the cache, the bank it needs to access is determined based on the address it accesses. Among them, if two or more threads try to access different addresses in the same bank within the same clock cycle, a bank conflict will occur.
[0055] In the corresponding comparative example, TSM (Thread Shared Memory) first splits the requests of multiple bank-groups to be accessed into multiple requests, and then arbitrates the read and write access requests of multiple clients at the entrance of each bank-group, and selects the client with the highest priority to access the memory. This method will cause low bandwidth utilization due to request splitting and memory access conflicts. In another comparative example, the DPA arbiter (Diagonal Propagation Arbiter) is used to weaken the impact of memory access conflicts. Its arbitration mechanism observes the first N requests of each client and selects requests without bank-group conflicts to issue, but this scheduling scheme has the following disadvantages: 1. It can only maintain the order of the same address, and cannot maintain strict order. Therefore, it is not suitable for TSM. 2. Due to the limitation of the DPA algorithm, it can only be used in scenarios where the number of clients and the number of bank-groups are the same. 3. It cannot solve the problem of splitting cross-bank-group requests into multiple cycle accesses. 4. The request needs to be cached first, and the hardware overhead is large.
[0056] In view of the deficiencies in the prior art, embodiments of the present invention provide a processor, a request scheduling method, a cache system and a computer device, which schedule transaction requests or decomposed sub-transactions to support multi-bank-group concurrency and inter-client merging, thereby weakening the impact of memory access conflicts and improving bandwidth utilization.
[0057] Figure 1 Schematic diagram of a processor according to an embodiment of the present invention. Figure 1 As shown, the processor according to the embodiment of the present invention includes multiple processing cores 11 , a cache area 12 and a request scheduler 13 .
[0058] The multiple processing cores 11 are configured to run multiple threads, and at least one thread shares a corresponding cache area. The cache area 12 adopts a multi-bank architecture, that is, it includes multiple storage module groups (bank-group), and the storage module group includes multiple storage modules (bank). The request scheduler 13 is configured to perform conflict resolution on the transaction request received from the client, obtain at least one corresponding sub-transaction, arbitrate each sub-transaction, and obtain the target request. Among them, the storage modules that any of the sub-transactions needs to access include different storage modules in the same storage module group and / or storage modules in different storage module groups. Different storage module groups corresponding to sub-transactions share priorities.
[0059] Further, the request scheduler 13 includes a conflict resolution device and an arbitrator. The conflict resolution device is configured to perform conflict resolution on each transaction request. The arbitrator is configured to determine the priority queue of each client for each storage module group based on a predetermined method, and detect each client based on the priority of the priority queue to determine the target request. The priority queue corresponding to each client is initialized based on the number of each client, and is updated after the target request is determined. Further optionally, the arbitrator is further configured to determine whether to merge the access request of the current client with the previously authorized access request based on the request type of the access request of the current client and the request order under the corresponding type.
[0060] In an optional implementation, the arbiter determines the current client based on the priority of the priority queue, and determines the request type of the access request of the current client, and in response to the request type being a predetermined type and the access request of the current client being the first request under the predetermined type, determines the access request of the current client as a target request, and in response to the request type being a predetermined type and the access request of the current client and the previously authorized access request satisfying a merging condition, determines the access request of the current client as a target request. Optionally, the predetermined type may be a write access request and / or a read access request. Further, the access request of the current client and the previously authorized access request satisfying the merging condition specifically include: the access request of the current client and the previously authorized access request have the same request type, and the storage module corresponding to the access request of the current client is different from the storage module corresponding to the previously authorized access request and is located in the same storage module group. Thus, this embodiment can merge access requests of the same type from different clients and accessing different banks in the same bank-group to increase the number of access requests that can be executed concurrently in the same clock cycle, thereby improving bandwidth utilization.
[0061] The processor of this embodiment includes a processing core running multiple threads, a cache area and a request scheduler, at least one thread shares the cache area, the cache area includes multiple storage module groups, the storage module group includes multiple storage modules, the request scheduler performs conflict resolution on the transaction request received from the client, obtains at least one corresponding sub-transaction, arbitrates each sub-transaction, obtains the target request, and the storage modules required to be accessed by any sub-transaction include different storage modules in the same storage module group and / or storage modules in different storage module groups, and different storage module groups corresponding to the sub-transactions share priorities. Therefore, the embodiment of the present invention can support the concurrency of multiple storage module groups by allowing different storage module groups in the cache area to share priorities, thereby weakening the impact of memory access conflicts and improving bandwidth utilization.
[0062] Figure 2 is a flowchart of a request scheduling method according to an embodiment of the present invention. The request scheduling method according to this embodiment can be applied to Figure 1 The processor shown in the figure is executed so that the processor supports multiple storage module groups concurrently, weakens the impact of memory access conflicts, and improves bandwidth utilization. Figure 2 As shown, the scheduling method of the embodiment of the present invention includes the following steps:
[0063] Step S110, performing conflict resolution on the received transaction request of the client to obtain at least one corresponding sub-transaction, wherein the storage modules to be accessed by any sub-transaction include different storage modules in the same storage module group and / or storage modules in different storage module groups.
[0064] A transaction request includes at least one access request, and each access request is used to access a corresponding storage module (bank). Specifically, in this embodiment, after receiving a transaction request (i.e., a read / write operation request at the transaction level) from each client, the corresponding cache parses the data address to be accessed by the transaction request, determines at least one access request of the transaction request and the bank accessed by each access request, splits the transaction request based on the access requests accessing the same bank, and obtains at least one sub-transaction. In other words, this embodiment allocates the access requests accessing the same bank in the transaction request to different sub-transactions to avoid bank conflicts.
[0065] For example, assuming that the transaction request Req1 includes access requests req11-req13, if the access request req11 and the access request req12 are used to access bank11 in bank-group1, and the access request req13 is used to access bank12 in bank-group1. Since the access request req11 and the access request req12 are both used to access bank11 in bank-group1, there is a bank conflict, and therefore, the access request req11 and the access request req12 need to be split into different sub-transactions. Thus, the transaction request Req1 can be split into a sub-transaction sub-Req11 including access requests req11 and req13 and a sub-transaction sub-Req12 including access request req12. It should be understood that this embodiment needs to allocate access requests that access the same bank to different sub-transactions, but does not restrict the sub-transactions to which other access requests that do not generate bank conflicts belong, and it is sufficient to ensure that there are no bank conflicts for the access requests in the sub-transactions. Based on this, in other optional implementations, the transaction request Req1 may also be split into a sub-transaction sub-Req11 including an access request req11 and a sub-transaction sub-Req12 including access requests req12 and req13.
[0066] Furthermore, in this embodiment, if the transaction request includes access requests for accessing different bank-groups, these access requests can be allocated to the same sub-transaction. For example, the access request req21 and the access request req22 in the transaction request Req2 are used to access bank13 in bank-group1 and bank21 in bank-group2, respectively, and the access request req21 and the access request req22 can also be allocated to the same sub-transaction for access.
[0067] In an optional implementation, during the conflict resolution of transaction requests, this embodiment can also merge read access requests for the same address of the same bank, and broadcast the merged access requests after reading the corresponding data, so that each read access request obtains the required data for feedback. In this way, the utilization rate can be improved by request merging.
[0068] Step S120, input each sub-transaction into the arbitrator for arbitration, and obtain the target request. The target request is also the access request authorized to access the corresponding storage module. In this embodiment, different storage module groups corresponding to the sub-transactions share the priority. That is, this embodiment enables the arbitration process of each bank-group corresponding to each sub-transaction to be performed independently, and at the same time enables multiple bank-groups to share the corresponding priority, thereby supporting multiple bank-group concurrency and improving bandwidth utilization.
[0069] Step S130, access the corresponding storage module based on the target request to perform the corresponding data processing operation. For example, if the target request is a read access request, read the corresponding data from the corresponding storage module based on the address corresponding to the read access request and feed it back to the corresponding client.
[0070] Figure 3 FIG. 1 is a flow chart of a method for requesting arbitration according to an embodiment of the present invention. In an optional implementation, Figure 3 As shown, the arbitration request method of the embodiment of the present invention includes the following steps:
[0071] Step S121: for each storage module group, determine the priority queue of each client based on a predetermined method.
[0072] In this embodiment, for each sub-transaction corresponding to each client received by the arbitrator, the storage module groups corresponding to the access requests in each sub-transaction are determined, and the arbitration process is performed on each storage module group in the same clock cycle. Among them, each storage module group adopts a priority sharing method, that is, the client priority queues in each storage module group are the same, thereby supporting multi-bank-group concurrency and improving bandwidth utilization.
[0073] In an optional implementation, the present embodiment determines the priority queue of each client based on a predetermined method, including: initializing the priority queue based on the client number. For example, the priority of the client numbered 0 is determined to be the highest, the priority of the client numbered 1 is the second highest, and so on, the priority of the client with the largest number is the lowest. In other optional implementations, the present embodiment may also initialize the priority queue in a manner that the client with the largest number has the highest priority and the client with the smallest number has the lowest priority. Furthermore, the present embodiment may also initialize the priority queue based on the transaction request reception time of the client, or initialize the priority queue in a random manner, etc. The present embodiment does not limit the order of initialization priority and the initialization method, and it is sufficient to determine the initial priority queue.
[0074] For example, assume that the transaction requests that the cache system needs to process in the current clock cycle include the transaction requests of client c0, client c1, and client c2. After conflict resolution, the transaction request of client c0 obtains subtransactions {req11, req12} and subtransactions {req13, req14}. Among them, access requests req11 and req13 are used to access bank11 in bank-group1, access request req12 is used to access bank12 in bank-group1, and access request req14 is used to access bank21 in bank-group2. After conflict resolution, the transaction request of client c1 obtains subtransactions {req21, req22}. Among them, access requests req21 and req22 are used to access bank13 and bank14 in bank-group1. After conflict resolution, the transaction request of client c2 obtains subtransactions {req31, req32}. Among them, access requests req31 and req32 are used to access bank15 and bank16 in bank-group1.
[0075] If the client number is used to initialize the priority queue in this embodiment, the initialized priority queue is {client c0, client c1, client c2}. The storage module groups bank-group1 and bank-group2 share the priority queue and respectively perform arbitration processes in the current clock cycle to determine the corresponding target request.
[0076] In an optional implementation, the method of determining the priority queue of each client based on a predetermined method in this embodiment also includes: reducing the priority of the client satisfying the authorization condition to the lowest level to update the priority queue. Further optionally, this embodiment can reduce the priority of the client with the highest priority authorized (grant) by any storage module group to the lowest level, and increase the priorities of other clients in turn to update the priority queue, or reduce the priority of the client with the highest priority authorized (grant) by a predetermined storage module group to the lowest level, and increase the priorities of other clients in turn to update the priority queue, or reduce the priority of the client with the highest priority authorized (grant) by all corresponding storage module groups to the lowest level, and increase the priorities of other clients in turn to update the priority queue. Thus, this embodiment can effectively avoid the occurrence of livelock.
[0077] Step S122, detect each client based on the priority of the priority queue to determine the target request. Further, in this embodiment, the clients in the priority queue are detected in order from high to low priority to detect whether the access request corresponding to the client can be authorized to access the corresponding storage module. If it can be authorized to access the corresponding storage module, the corresponding access request is determined as the target request.
[0078] In an optional implementation, this embodiment determines the current client based on the priority of the priority queue, and determines the request type of the access request of the current client, and in response to the request type being a predetermined type and the access request of the current client being the first request of the predetermined type, determines the access request of the current client as a target request, and in response to the request type being a predetermined type and the access request of the current client and the previously authorized access request satisfying a merge condition, determines the access request of the current client as a target request. Optionally, the predetermined type may be a write access request and / or a read access request.
[0079] Furthermore, the access request of the current client and the previously authorized access request satisfy the merging condition specifically as follows: the access request of the current client is of the same request type as the previously authorized access request, and the storage module corresponding to the access request of the current client is different from the storage module corresponding to the previously authorized access request and is located in the same storage module group. Thus, this embodiment can merge access requests of the same type from different clients and accessing different banks in the same bank-group, so as to increase the number of access requests that can be executed concurrently in the same clock cycle, thereby improving bandwidth utilization.
[0080] Figure 4 1 is a flowchart of another method for requesting arbitration according to an embodiment of the present invention. This embodiment takes the arbitration process of a certain storage module group bank-group1 as an example. It should be understood that the arbitration process of other storage module groups is similar to it. Figure 4 As shown, the arbitration request method of the embodiment of the present invention includes the following steps:
[0081] Step S1, determine the current client. In this embodiment, for the start detection of the initialized priority queue pri_queue, the current client is the client with idx=0 in the priority queue pri_queue. Wherein, idx is used to represent the number of the client, and the client with idx=0 is also the highest priority client in the priority queue pri_queue.
[0082] Step S2, determine whether the current client has a write access request. That is, determine whether the current client has a write access request to access bank-group1. If the current client has a corresponding write access request, execute step S3; if the current client does not have a corresponding write access request, execute step S8.
[0083] Step S3, when the current client has a write access request to access bank-group1, determine whether the current client is the first client whose write access request is granted. If the current client is the first client whose write access request is granted, execute step S4; if the current client is not the first client whose write access request is granted, execute step S5.
[0084] Step S4, when the current client has a write access request to access bank-group1 and it is the first client to be granted a write access request, initialize the write access list (bank_mask) and operation code (opcode). Bank_mask is used to indicate the bank to be accessed. Opcode is used to identify the specific operation type to be performed.
[0085] Step S5, when the current client has a write access request to access bank-group1 and it is not the first client to be granted a write access request, determine whether it can be merged into the write access list of the client with the previous priority. If it can be merged, execute step S6, if it cannot be merged, execute step S14. As described above, if the access request of the current client is of the same request type as the previously authorized access request, and the storage module corresponding to the access request of the current client is different from the storage module corresponding to the authorized access request of the client with the previous priority and is located in the same storage module group, the access request of the current client can be merged into the write access list of the client with the previous priority.
[0086] Step S6, if the write access request of the current client can be merged into the write access list of the client with the previous priority, merge the write bank_mask. That is, if the write access request of the current client can be merged into the write access list of the client with the previous priority, update the write access list corresponding to bank-group1, which includes the write access request of the current client and the write access request of the client with the previous priority. Thus, this embodiment can merge the access requests of the same type from different clients and accessing different banks in the same bank-group, so as to increase the number of access requests that can be executed concurrently in the same clock cycle, thereby improving bandwidth utilization.
[0087] Step S7, authorize the current client.
[0088] Step S8, when the current client does not have a write access request, determine whether the current client has a read access request. That is, when the current client does not have a write access request, determine whether the current client has a read access request to access bank-group1. If the current client has a corresponding read access request, execute step S9; if the current client does not have a corresponding read access request, execute step S14.
[0089] Step S9, when the current client has a read access request to access bank-group1, determine whether the current client is the first client whose read access request is granted. If the current client is the first client whose read access request is granted, execute step S10; if the current client is not the first client whose read access request is granted, execute step S11.
[0090] Step S10, when the current client has a read access request to access bank-group1 and it is the first client whose read access request is granted, initialize the read access list (bank_mask) and operation code (opcode). Among them, bank_mask is used to indicate the bank to be accessed. Opcode is used to identify the specific operation type to be performed.
[0091] Step S11, when the current client has a read access request to access bank-group1 and it is not the first client to be granted a read access request, determine whether it can be merged into the read access list of the client with the previous priority. If it can be merged, execute step S12, if it cannot be merged, execute step S14. As described above, if the access request of the current client is of the same request type as the previously authorized access request, and the storage module corresponding to the access request of the current client is different from the storage module corresponding to the authorized access request of the client with the previous priority and is located in the same storage module group, the access request of the current client can be merged into the read access list of the client with the previous priority.
[0092] Step S12, if the read access request of the current client can be merged into the read access list of the client with the previous priority, merge and read bank_mask. That is, if the read access request of the current client can be merged into the read access list of the client with the previous priority, update the read access list corresponding to bank-group1, which includes the read access request of the current client and the read access request of the client with the previous priority. Thus, this embodiment can merge the access requests of the same type from different clients and accessing different banks in the same bank-group, so as to increase the number of access requests that can be executed concurrently in the same clock cycle, thereby improving bandwidth utilization.
[0093] Step S13: Authorize the current client.
[0094] Step S14: After executing Step S7 or authorizing the current client in Step S13, or when the current client has a corresponding write access request or read access request, but the current client is neither the first client whose write access request or read access request is authorized nor can it be merged with the client with a higher priority, or when the current client has no corresponding write access request or read access request, determine whether idx is less than n - 1, that is, determine whether the current client is the last client in the priority queue pri_queue. If idx < n - 1, execute Step S15; if idx ≥ n - 1, execute Step S16.
[0095] Step S15: Execute idx++, that is, continue to detect the next client in the priority queue, and continue to execute Steps S2 - S15 until idx ≥ n - 1. Here, n is the number of clients in the priority queue.
[0096] Step S16: After detecting each client in the priority queue, update the priority queue pri_queue and perform the next round of arbitration.
[0097] For example, assume that the transaction requests to be processed by the cache system in the current clock cycle include the transaction requests of clients c0, c1, and c2. Among them, the transaction requests of clients c0 and c2 are write transaction requests, and the transaction request of client c1 is a read transaction request. After conflict resolution, the write transaction request of client c0 obtains sub - transactions {req11, req12} and sub - transactions {req13, req14}. Among them, the write access requests req11 and req13 are used to access bank11 in bank - group1, the write access request req12 is used to access bank12 in bank - group1, and the write access request req14 is used to access bank21 in bank - group2. After conflict resolution, the read transaction request of client c1 obtains sub - transactions {req21, req22}. Among them, the read access requests req21 and req22 are used to access bank13 and bank14 in bank - group1. After conflict resolution, the write transaction request of client c2 obtains sub - transactions {req31, req32}. Among them, the access requests req31 and req32 are used to access bank15 and bank16 in bank - group1.
[0098] Assuming that the current priority queue pri_queue is {client c0, client c1, client c2}, the client with idx=0 is client c0. Taking the arbitration process of the storage module group bank-group1 as an example, client c0 has write access requests req11, req12 and req13 to access bank-group1, and the write access requests req11, req12 and the write access request req13 are in different sub-transactions. In this embodiment, taking the sub-transaction with more access requests as an example, it should be understood that this embodiment is not limited to this, and it can give priority to any sub-transaction. After detection, client c0 is the first client authorized for the write access request (that is, req11, req12), and the write bank_mask and opcode are initialized, that is, the write bank_mask is initialized to indicate that the storage modules currently authorized to access are bank11 and bank12 corresponding to the write access requests req11 and req12, thereby authorizing client c0. Further, idx++ is executed to obtain the current client c1. Client c1 has read access requests req21 and req22 to access bank-group1. Read access requests req21 and req22 are in the same subtransaction. After detection, client c1 is the first client authorized for read access requests (i.e., req21 and req22). The read bank_mask and opcode are initialized, that is, the read bank_mask is initialized to indicate that the storage modules currently authorized for access are bank13 and bank14 corresponding to the read access requests req21 and req22, thereby authorizing client c1. Further, idx++ is executed to obtain the current client c2. Client c2 has write access requests req31 and req32 to access bank-group1. Write access requests req31 and req32 are in the same subtransaction. After detection, client c0 corresponding to the priority before client c2 is the first client whose write access request is authorized, that is, client c2 is not the first client whose write access request is authorized, but client c2 and client c0 are both write access requests, and client c2's write access requests req31 and req32 are used to access bank15 and bank16 in bank-group1, which are different from bank11 and bank12 in bank-group1 accessed by client c0's write access requests req11 and req12. Therefore, client merging can be performed to determine the merged write bank_mask, that is, update the write bank_mask to indicate that the storage modules currently authorized to access are bank11, bank12, bank15 and bank16 corresponding to the write access requests req11 and req12, req31 and req32, thereby authorizing client c2.At this time, idx=2 (ie, n-1), and the priority queue is updated to perform the next round of arbitration.
[0099] It should be understood that in this embodiment, the write access requests req11 and req12, req31 and req32, and the read access requests req21 and req22 of the above-mentioned authorized clients c0-c2 can be used as target requests to concurrently access bank11, bank12, bank13, bank14, bank15 and bank16 in the corresponding storage module group bank-group1, and the execution results will be fed back to the corresponding clients c0-c2.
[0100] Optionally, this embodiment may adjust the priority of clients authorized by any one or more or all corresponding storage module groups to the lowest, and move the priorities of other clients forward to update the priority queue, thereby effectively avoiding livelock.
[0101] Figure 5 : is a flow chart of a priority queue updating method according to an embodiment of the present invention. Figure 5 As shown, the priority queue updating method of the embodiment of the present invention comprises the following steps:
[0102] Step S210, obtaining an initialized priority queue.
[0103] Step S220, determining the current client. For example, at the beginning of the detection, the current client is the client with idx=0, that is, the client with the highest priority.
[0104] Step S230, determining whether the current client satisfies the authorization condition. When the current client satisfies the authorization condition, step S250 is executed, and when the current client does not satisfy the authorization condition, step S240 is executed. Optionally, in this embodiment, the current client satisfies the authorization condition for: the current client is the client with the highest priority authorized (grant) by any storage module group, or the current client is the client with the highest priority authorized (grant) by a predetermined storage module group, or the current client is the client with the highest priority authorized (grant) by all corresponding storage module groups.
[0105] Step S240, when the current client does not meet the authorization conditions, control idx++, that is, detect the client with the next priority, and continue to execute steps S220-S250 with it as the current client until idx is not less than (n-1), where n is the number of clients in the priority queue.
[0106] Step S250: When the current client meets the authorization condition, the current client is placed at the end of the queue, and other clients are moved forward in sequence to update the priority queue.
[0107] This embodiment can reduce the priority of the client with the highest priority authorized by any storage module group to the lowest, and the priorities of other clients can be increased in sequence to update the priority queue, or reduce the priority of the client with the highest priority authorized by a predetermined storage module group to the lowest, and the priorities of other clients can be increased in sequence to update the priority queue, or reduce the priority of the client with the highest priority authorized by all corresponding storage module groups to the lowest, and the priorities of other clients can be increased in sequence to update the priority queue. Therefore, this embodiment can effectively avoid the generation of livelock.
[0108] The embodiment of the present invention performs conflict resolution on the transaction request received from the client, obtains at least one corresponding sub-transaction, inputs each sub-transaction into an arbitrator for arbitration, obtains a target request, and accesses the corresponding storage module based on the target request to perform a corresponding data processing operation, wherein the storage module to be accessed by the sub-transaction includes different storage modules in the same storage module group and / or storage modules in different storage module groups, and the different storage module groups corresponding to the sub-transaction share priorities. Thus, the embodiment of the present invention can support the concurrency of multiple storage module groups by allowing different storage module groups to share priorities, thereby improving bandwidth utilization. At the same time, the embodiment of the present invention can also merge access requests of the same type from different clients that access different storage modules in the same storage module group, thereby increasing the number of access requests that can be executed concurrently in the same clock cycle, thereby further improving bandwidth utilization.
[0109] Figure 6 Schematic diagram of a cache system according to an embodiment of the present invention. Figure 6 As shown, the cache system 6 of the embodiment of the present invention includes a conflict resolution device 61, an arbitrator 62 and a cache area 63. The cache area 63 adopts a multi-storage module group architecture (i.e., a multi-bank architecture), including m (m is greater than or equal to 1) storage module groups bank-group_1-bank-group_m-1, and the storage module group includes multiple storage modules (banks).
[0110] like Figure 6As shown, after receiving the transaction requests from n (n is greater than or equal to 1) clients client_0-client_n-1, the cache system 6 sends the transaction requests of each client to the conflict resolution device 61 for conflict resolution, obtains at least one sub-transaction corresponding to each client, and caches it (as shown in 6, it can be cached in the corresponding buffer). The storage modules that the sub-transaction needs to access include different storage modules in the same storage module group and / or storage modules in different storage module groups to avoid bank conflicts.
[0111] Furthermore, the sub-transactions of each client are input into the arbitrator 62 for arbitration to obtain the target request, wherein the different storage module groups corresponding to the sub-transactions share priorities to achieve multi-bank-group concurrency, thereby improving bandwidth utilization. Further optionally, the arbitrator 62 of this embodiment merges clients accessing different storage modules in the same storage module group during the arbitration process to support a single bank-group to merge requests from multiple clients, thereby increasing the concurrency of requests and thereby improving bandwidth utilization. It should be understood that the specific implementation process of the arbitrator 62 of this embodiment can be referred to. Figure 2-Figure 3 The embodiments shown will not be described in detail here.
[0112] Further, after obtaining the target request, the corresponding bank-group is accessed based on the target request. Figure 6 As shown, the bank-group of this embodiment supports parallel access of read and write. It should be understood that the request calling method of the embodiment of the present invention can also be applied to a cache system that adopts serial access of read and write, wherein, in the serial access of read and write, the read access request and the write access request need to be accessed serially, that is, to avoid the concurrent execution of the read and write requests, and it can adaptively adjust the above arbitration process, which will not be described in detail here.
[0113] The embodiment of the present invention performs conflict resolution on the transaction request received from the client, obtains at least one corresponding sub-transaction, inputs each sub-transaction into an arbitrator for arbitration, obtains a target request, and accesses the corresponding storage module based on the target request to perform a corresponding data processing operation, wherein the storage module to be accessed by the sub-transaction includes different storage modules in the same storage module group and / or storage modules in different storage module groups, and the different storage module groups corresponding to the sub-transaction share priorities. Thus, the embodiment of the present invention can support the concurrency of multiple storage module groups by allowing different storage module groups to share priorities, thereby improving bandwidth utilization. At the same time, the embodiment of the present invention can also merge access requests of the same type from different clients that access different storage modules in the same storage module group, thereby increasing the number of access requests that can be executed concurrently in the same clock cycle, thereby further improving bandwidth utilization.
[0114] Figure 7 The request scheduling device 7 of the embodiment of the present invention comprises a conflict resolution unit 71 , an arbitration unit 72 and a memory access unit 73 .
[0115] The conflict resolution unit 71 is configured to perform conflict resolution on the transaction request received from the client, and obtain at least one corresponding sub-transaction, wherein the storage modules required to be accessed by any of the sub-transactions include different storage modules in the same storage module group and / or storage modules in different storage module groups. The arbitration unit 72 is configured to input each of the sub-transactions into an arbitrator for arbitration, and obtain a target request, wherein the different storage module groups corresponding to the sub-transactions share a priority. The memory access unit 73 is configured to access the corresponding storage module based on the target request to perform a corresponding data processing operation.
[0116] In an optional implementation, the arbitration unit 72 is further configured to perform: for each of the storage module groups, determine a priority queue of each of the clients based on a predetermined method, and detect each of the clients based on the priority of the priority queue to determine the target request.
[0117] In an optional implementation, the arbitration unit 72 is further configured to execute: initializing the priority queue based on the number of the client, and updating the priority queue after determining the target request.
[0118] In an optional implementation, the arbitration unit 72 is further configured to execute: reducing the priority of the client satisfying the authorization condition to the lowest, so as to update the priority queue.
[0119] In an optional implementation, the arbitration unit 72 is further configured to perform: determining the current client based on the priority of the priority queue, determining the request type of the access request of the current client, in response to the request type being a predetermined type and the access request of the current client being the first request of the predetermined type, determining the access request of the current client as a target request, and in response to the request type being a predetermined type and the access request of the current client satisfying a merging condition with a previously authorized access request, determining the access request of the current client as a target request.
[0120] In an optional implementation, the access request of the current client and the previously authorized access request satisfy the merging condition specifically: the access request of the current client and the previously authorized access request are of the same request type, and the storage module corresponding to the access request of the current client is different from the storage module corresponding to the previously authorized access request and is located in the same storage module group.
[0121] The embodiment of the present invention performs conflict resolution on the transaction request received from the client, obtains at least one corresponding sub-transaction, inputs each sub-transaction into an arbitrator for arbitration, obtains a target request, and accesses the corresponding storage module based on the target request to perform a corresponding data processing operation, wherein the storage module to be accessed by the sub-transaction includes different storage modules in the same storage module group and / or storage modules in different storage module groups, and the different storage module groups corresponding to the sub-transaction share priorities. Thus, the embodiment of the present invention can support the concurrency of multiple storage module groups by allowing different storage module groups to share priorities, thereby improving bandwidth utilization. At the same time, the embodiment of the present invention can also merge access requests of the same type from different clients that access different storage modules in the same storage module group, thereby increasing the number of access requests that can be executed concurrently in the same clock cycle, thereby further improving bandwidth utilization.
[0122] Figure 8 Schematic diagram of a computer device according to an embodiment of the present invention. Figure 8 As shown, the computer device 8 includes at least one processor 81 with multiple threads. Optionally, the processor 81 can be a processor or system with multiple threads such as a GPU. The processor 81 includes multiple processing cores running multiple threads, a cache area, and a request scheduler. The request scheduler includes a conflict resolution device and an arbitrator. For details, please refer to Figure 1 and Figure 6 The embodiment shown is not described in detail here. Further, the computer device 8 of the embodiment of the present invention may also include other processors (not shown in the figure), such as a CPU processor, a memory 82 connected to at least one processor 81 or other processors, and a communication component 83 connected to the scanning device. The communication component 83 receives and sends data under the control of the processor 81 or other processors. The memory 82 stores instructions that can be executed by at least one processor 81 or other processors, and the instructions are executed by at least one processor 81 to implement the above-mentioned request scheduling method.
[0123] Specifically, the processor 81 and the memory 82 may be connected via a bus or other means. Figure 8In the example, the bus connection is used. The memory 82 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 81 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 82, that is, realizing the above-mentioned request scheduling method.
[0124] The memory 82 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store a list of options, etc. In addition, the memory 82 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 82 may optionally include a memory remotely arranged relative to the processor 81, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0125] One or more modules are stored in the memory 82, and when executed by one or more processors 81, the request scheduling method in any of the above method embodiments is executed.
[0126] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0127] The embodiment of the present invention performs conflict resolution on the transaction request received from the client, obtains at least one corresponding sub-transaction, inputs each sub-transaction into an arbitrator for arbitration, obtains a target request, and accesses the corresponding storage module based on the target request to perform a corresponding data processing operation, wherein the storage module to be accessed by the sub-transaction includes different storage modules in the same storage module group and / or storage modules in different storage module groups, and the different storage module groups corresponding to the sub-transaction share priorities. Thus, the embodiment of the present invention can support the concurrency of multiple storage module groups by allowing different storage module groups to share priorities, thereby improving bandwidth utilization. At the same time, the embodiment of the present invention can also merge access requests of the same type from different clients that access different storage modules in the same storage module group, thereby increasing the number of access requests that can be executed concurrently in the same clock cycle, thereby further improving bandwidth utilization.
[0128] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, wherein the computer-readable program is used for a computer to execute part or all of the above method embodiments.
[0129] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0130] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A processor, characterized in that: The processor comprises: A plurality of processing cores are configured to run a plurality of threads, at least one of the threads sharing a corresponding cache region; A cache area, wherein the cache area includes a plurality of storage module groups, and the storage module group includes a plurality of storage modules; A request scheduler is configured to perform conflict resolution on a transaction request received from a client, obtain at least one corresponding sub-transaction, arbitrate each of the sub-transactions, and obtain a target request, wherein the storage modules required to be accessed by any of the sub-transactions include different storage modules in the same storage module group and / or storage modules in different storage module groups, and the different storage module groups corresponding to the sub-transactions share priorities.
2. The processor according to claim 1, characterized in that The request scheduler comprises: A conflict resolution device, configured to perform conflict resolution on each of the transaction requests; The arbitrator is configured to determine the priority queue of each client for each storage module group based on a predetermined method, and detect each client based on the priority of the priority queue to determine the target request.
3. The processor according to claim 2, characterized in that The priority queue is initialized based on the serial number of each of the clients and is updated after the target request is determined.
4. The processor according to claim 2, characterized in that The arbitrator is further configured to determine whether to merge the access request of the current client with the previously authorized access request based on the request type of the access request of the current client and the request order of the corresponding type.
5. A request scheduling method, applicable to a processor, characterized in that: At least one thread of the processor shares a corresponding cache area, the cache area includes a plurality of storage module groups, the storage module group includes a plurality of storage modules, and the method includes: Performing conflict resolution on the received transaction request of the client to obtain at least one corresponding sub-transaction, wherein the storage modules to be accessed by any of the sub-transactions include different storage modules in the same storage module group and / or storage modules in different storage module groups; Inputting each of the sub-transactions into an arbitrator for arbitration to obtain a target request, wherein different storage module groups corresponding to the sub-transactions share a priority; Based on the target request, a corresponding storage module is accessed to perform a corresponding data processing operation.
6. The method according to claim 5, characterized in that The inputting each of the sub-transactions into the arbitrator for arbitration to obtain the target request comprises: For each of the storage module groups, determining a priority queue for each of the clients, wherein the priority queue is initialized based on the serial number of each of the clients and is updated after determining the target request; Each of the clients is detected based on the priority of the priority queue to determine the target request.
7. The method according to claim 6, characterized in that Updating the priority queue after determining the target request includes: The priority of the client satisfying the authorization condition is reduced to the lowest to update the priority queue.
8. The method according to claim 6, characterized in that The detecting each of the clients based on the priority of the priority queue to determine the target request includes: Determining a current client based on the priority of the priority queue; Determine the request type of the access request of the current client; In response to the request type being a predetermined type and the access request of the current client being the first request of the predetermined type, determining the access request of the current client as a target request; In response to the request type being a predetermined type, and the access request of the current client and the previously authorized access request satisfying a merging condition, the access request of the current client is determined as a target request.
9. The method according to claim 8, characterized in that The access request of the current client and the previously authorized access request satisfy the merging condition specifically: the access request of the current client is of the same request type as the previously authorized access request, and the storage module corresponding to the access request of the current client is different from the storage module corresponding to the previously authorized access request and is located in the same storage module group.
10. A cache system, applicable to a processor, characterized in that: At least one thread of the processor shares a corresponding cache area, and the cache system comprises: A cache area, wherein the cache area includes a plurality of storage module groups, and the storage module group includes a plurality of storage modules; A conflict resolution device is configured to perform conflict resolution on a received transaction request of a client, and obtain at least one corresponding sub-transaction, wherein the storage modules to be accessed by any of the sub-transactions include different storage modules in the same storage module group and / or storage modules in different storage module groups; The arbitrator is configured to arbitrate each of the sub-transactions to obtain a target request, wherein different storage module groups corresponding to the sub-transactions share a priority.
11. A request scheduling device, applicable to a processor, characterized in that: At least one thread of the processor shares a corresponding cache area, the cache area includes a plurality of storage module groups, the storage module group includes a plurality of storage modules, and the device includes: a conflict resolution unit configured to perform conflict resolution on a transaction request received from a client, and obtain at least one corresponding sub-transaction, wherein the storage modules to be accessed by the sub-transaction include different storage modules in the same storage module group and / or storage modules in different storage module groups; an arbitration unit configured to input each of the sub-transactions into an arbitrator for arbitration to obtain a target request, wherein different storage module groups corresponding to the sub-transactions share a priority; The memory access unit is configured to access the corresponding storage module based on the target request to perform a corresponding data processing operation.
12. A computer device, characterized in that: The computer device comprises a processor as claimed in any one of claims 1-4.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 5 to 9 is implemented.
14. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 5 to 9.