Access scheduling method, computer equipment and medium

By providing caches and optimized data structures equal to the number of access sources, it solves the problem of conflicting accesses to the same table item from multiple access sources, improves access efficiency and system performance, and supports system specification upgrades.

CN118426705BActive Publication Date: 2024-10-01SHENZHEN XINGYUN ZHILIAN TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410881239.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-10-01
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

In the fields of cloud computing, virtualization and server applications, when a single physical device is divided into multiple virtual devices through hardware-accelerated virtualization technology such as SRIOV, multiple access sources read and write access to the same table entry, resulting in access conflicts and data inconsistency. sexual problems, and as system specifications improve, access efficiency is difficult to improve.

Method used

Provide cache equal to the number of multiple access sources, using an optimized design data structure, including data field segment, table identification field segment, table address identification field segment, occupancy identification field segment and read-write identification field segment, and judge based on these field segments Check whether the access request hits, and allocate or recycle cache to achieve centralized management of cache, avoid complex access scheduling mechanisms, convert control flow into data flow, and resolve multi-source access conflicts.

Benefits of technology

It improves access efficiency, supports fast and smooth upgrades when upgrading system specifications, avoids the complexity of access scheduling and conflict handling, realizes parallelization of multi-source access, and improves system performance and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118426705B_ABST
    Figure CN118426705B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology and provides an access scheduling method, a computer device and a medium. The method includes: providing multiple first caches, the number of the first caches being equal to the number of first access sources; responding to an access request of a given first access source among the multiple first access sources, judging whether the access request of the given first access source is hit based on the occupation identification field, table identification field and table address identification field of the data structure of each of the multiple first caches, if not, allocating an unoccupied first cache among the multiple first caches for the access request of the given first access source, if hit, completing the access request of the given first access source through the first cache hit by the access request of the given first access source, and, after completing the access request of the given first access source, reclaiming the first cache used for the access request of the given first access source. In this way, multi-source access conflicts are resolved and access efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an access scheduling method, a computer device and a medium. Background Art

[0002] In the fields of cloud computing, virtualization, server applications, etc., hardware-accelerated virtualization technologies such as Single Root I / O Virtualization (SRIOV) are used to divide a single physical device into multiple virtual devices or virtual ports to provide an independent physical channel for each virtual machine. SRIOV contains two types of functions, physical function (PF) and virtual function (VF). Each PF can be discovered and managed by the physical host. VF is a function virtualized by PF. It is a lightweight function that only allows configuration resources for its own behavior. When multiple PFs (for example, multiple access sources) read and write to the same table entry in the chip, access conflicts or data inconsistency problems will occur. As system specifications increase, there are more access sources, more table entries, and the depth of each table entry varies. These bring challenges in access scheduling and conflict handling, and it is difficult to improve access efficiency for a single access source.

[0003] To this end, the present application provides an access scheduling method, a computer device and a medium for addressing the technical difficulties in the prior art. Summary of the invention

[0004] In a first aspect, the present application provides an access scheduling method. The access scheduling method includes: providing multiple first caches, wherein the number of the multiple first caches is equal to the number of multiple first access sources, and the data structure of each first cache in the multiple first caches includes: a data field segment for storing data of a given entry of a given first table entry in multiple first table entries, a table identification field segment for indicating that the data stored in the data field segment of the data structure of the first cache comes from the given first table entry, a table address identification field segment for indicating the address in the first table entry corresponding to the data stored in the data field segment of the data structure of the first cache, an occupied identification field segment for indicating whether the first cache is occupied, and a read-write identification field segment for indicating a data read operation or Data write operation; in response to an access request of a given first access source among the multiple first access sources, based on the occupied identification field, table identification field and table address identification field of the data structure of each of the multiple first caches, determine whether the access request of the given first access source hits; if not, allocate an unoccupied first cache among the multiple first caches for the access request of the given first access source; if hit, complete the access request of the given first access source through the first cache hit by the access request of the given first access source, and, after completing the access request of the given first access source, recycle the first cache used for the access request of the given first access source.

[0005] Through the first aspect of the present application, the same number of caches as the number of access sources are configured, and centralized management of the cache is achieved by providing an optimized data structure. The corresponding domain segments in the unified data structure can be used to meet the needs of simultaneous access by multiple access sources and avoid complex access scheduling mechanisms; complex control flow problems are converted into data flow problems, that is, by parsing the corresponding domain segments of the data structure of the first cache, cache selection strategies can be implemented to resolve multi-source access conflicts; by allocating unoccupied caches and recycling caches that have completed access requests, combined with a multi-source access table entry method that will not initiate the next access before the end of the current access, it is beneficial to optimize serial access to parallel access, improve access efficiency, and support rapid and smooth upgrades as system specifications are upgraded, such as an upgrade in the number of chip entries.

[0006] In a possible implementation of the first aspect of the present application, the access request of the given first access source indicates a data read operation or a data write operation on a specific entry in a specific first table entry among the multiple first table entries, and the access scheduling method also includes: by comparing the access request of the given first access source with the occupancy identification field, table identification field and table address identification field of the data structure of each of the multiple first caches, it is determined whether the access request of the given first access source hits, and the specific first table entry corresponds to the given first access source.

[0007] In a possible implementation of the first aspect of the present application, the occupancy identification field of the data structure of the first cache hit by the access request of the given first access source indicates that it is not occupied, and the table identification field and the table address identification field of the data structure of the first cache hit by the access request of the given first access source match the specific entry in the specific first table entry indicated by the access request of the given first access source.

[0008] In a possible implementation of the first aspect of the present application, the access scheduling method also includes: allocating an unoccupied first cache among the multiple first caches for the access request of the given first access source by reading the cache sequence number first-in-first-out memory, and reclaiming the first cache for the access request of the given first access source by writing the cache sequence number first-in-first-out memory.

[0009] In a possible implementation of the first aspect of the present application, at least two of the multiple first access sources simultaneously initiate access requests to the same first table entry among the multiple first table entries, and the access request of the given first access source is an access request of any first access source among the at least two first access sources.

[0010] In a possible implementation manner of the first aspect of the present application, conflict handling between access requests simultaneously initiated by the at least two first access sources to the same first entry is based on centralized management of the multiple first caches.

[0011] In a possible implementation manner of the first aspect of the present application, the at least two first access sources are the multiple first access sources.

[0012] In a possible implementation of the first aspect of the present application, the network interface card chip includes multiple Ethernet ports, the multiple Ethernet ports support multiple physical functions, the multiple first access sources are the multiple physical functions, and the multiple first table entries are internal table entries of the network interface card chip.

[0013] In a possible implementation of the first aspect of the present application, an artificial intelligence acceleration chip includes at least one graphics processor, the at least one graphics processor supports multiple threads, the multiple first access sources are the multiple threads, and the multiple first table entries are internal table entries of the artificial intelligence acceleration chip.

[0014] In a possible implementation of the first aspect of the present application, the multiple first access sources initiate access requests to the multiple first table entries in a serial manner through the same data bus, and completing the access request of the given first access source includes at least one access operation based on the data bus, and the number of the at least one access operation is determined based on the data bit width of each entry of the multiple first table entries and the bit width of the data bus.

[0015] In a possible implementation manner of the first aspect of the present application, the read-write identification field is also used to indicate that a data read operation is invalid during a data write operation.

[0016] In a possible implementation of the first aspect of the present application, the occupancy identification field is also used to indicate whether a data read operation or a data write operation on the data stored in the data field of the data structure of the first cache is completed.

[0017] In a possible implementation of the first aspect of the present application, the access scheduling method also includes: providing multiple second caches, wherein the multiple second caches correspond one-to-one to multiple second table entries, and each of the multiple second caches is used to store read and write data of the second table entry corresponding to the second cache; and converting access requests initiated by multiple second access sources to the multiple second table entries into read and write interface timing of the multiple second access sources to the multiple second caches through polling scheduling.

[0018] In a possible implementation of the first aspect of the present application, the number of the multiple first access sources is fixed, the number of the multiple second access sources is not fixed, the number of the multiple first table entries is not fixed, and the number of the multiple second table entries is fixed.

[0019] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.

[0020] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.

[0021] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 A schematic diagram of multiple physical functions accessing chip internal table entries provided in an embodiment of the present application;

[0024] Figure 2 A flowchart of an access scheduling method provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0027] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0028] Figure 1 A schematic diagram of multiple physical functions accessing chip internal table entries provided in an embodiment of the present application. Figure 1 As shown, the physical function pool 100 includes multiple physical functions. Figure 1 Schematically, physical function A 110 , physical function B 112 , physical function C 114 , and physical function D 116 are shown. Figure 1 The cache module 102 is also shown, and the cache module 102 includes a plurality of first caches, namely a first cache A 120 , a first cache B 122 , a first cache C 124 , and a first cache D 126 . Figure 1The chip internal table entry 104 is also exemplarily shown, and the chip internal table entry 104 includes multiple first table entries, namely, a first table entry A140, a first table entry B142, a first table entry C144, a first table entry D146, a first table entry E147, a first table entry F148, and a first table entry G149. Figure 1 , multiple conversion modules are also shown as examples, which are used to interface with the internal table entry interface to achieve read and write access to the corresponding table entry. Figure 1 As shown, conversion module A130 corresponds to the first table entry A140, conversion module B132 corresponds to the first table entry B142, conversion module C134 corresponds to the first table entry C144, conversion module D136 corresponds to the first table entry D146, conversion module E137 corresponds to the first table entry E147, conversion module F138 corresponds to the first table entry F148, and conversion module G139 corresponds to the first table entry G149.

[0029] Continue reading Figure 1In the fields of cloud computing, virtualization, server applications, etc., hardware-accelerated virtualization technologies such as Single Root I / O Virtualization (SRIOV) are used to divide a single physical device into multiple virtual devices or virtual ports. For example, a physical network card is virtualized into multiple virtual network cards for virtual machines to use, providing independent physical channels for each virtual machine. SRIOV allows multiple virtual machines to access physical devices at the same time, thereby improving the performance and reliability of virtual machines. SRIOV can improve the network and storage performance of virtual machines in applications such as cloud computing and data centers, allowing flexible allocation and management of resources, and reducing resource consumption and costs. In server applications, SRIOV can support high-density virtualization, high-performance computing, and large-scale distributed storage. SRIOV contains two types of functions, physical functions (PF) and virtual functions (VF), which are used to manage SRIOV functions. Each PF can be discovered and managed by the physical host. VF is a function virtualized by PF. It is a lightweight function that is only allowed to have configuration resources for its own behavior. When multiple PFs (for example, multiple access sources) perform read and write access to the same table entry in the chip, access conflicts or data inconsistency problems will occur. Taking multiple PFs, that is, multiple physical functions, as an example, multiple access sources may access the same table entry in multiple table entries at the same time, which will cause access conflicts. It is necessary to schedule the access of each of the multiple access sources. The depth of a table entry is the number of entries under the same table entry. Each read and write operation accesses an entry in a table entry. According to the entry bit width and the data bus bit width, multiple read and write operations may be required to complete the data read and write operation of an entry. Each table entry has a register for data read and write operations for the entries under the table entry. As system specifications increase, there are more access sources, more table entries, and the depth of each table entry varies. These bring challenges in access scheduling and conflict handling, and it is difficult to improve access efficiency for a single access source.

[0030] Figure 2 A flowchart of an access scheduling method provided in an embodiment of the present application. Figure 2 As shown, the access scheduling method includes the following steps.

[0031] Step S210: Provide multiple first caches, wherein the number of the multiple first caches is equal to the number of multiple first access sources, and the data structure of each first cache in the multiple first caches includes: a data field segment for storing data of a given entry of a given first table entry in a plurality of first table entries, a table identification field segment for indicating that the data stored in the data field segment of the data structure of the first cache comes from the given first table entry, a table address identification field segment for indicating the address in the first table entry corresponding to the data stored in the data field segment of the data structure of the first cache, an occupied identification field segment for indicating whether the first cache is occupied, and a read-write identification field segment for indicating a data read operation or a data write operation.

[0032] Step S220: In response to an access request of a given first access source among the multiple first access sources, based on the occupied identification field, the table identification field and the table address identification field of the data structure of each of the multiple first caches, determine whether the access request of the given first access source hits; if not, allocate an unoccupied first cache among the multiple first caches for the access request of the given first access source; if hit, complete the access request of the given first access source through the first cache hit by the access request of the given first access source; and, after completing the access request of the given first access source, recycle the first cache used for the access request of the given first access source.

[0033] See also Figure 2 ,Multiple first access sources can be multiple physical functions, such as Figure 1 The physical function pool 100 shown includes physical function A110, physical function B112, physical function C114, and physical function D116. Multiple first access sources initiate access requests to multiple first table items, such as performing data read operations or data write operations. These access requests may or may not occur simultaneously. When multiple first access sources access the same first table item in multiple first table items at the same time, this may cause access conflicts and data inconsistency problems. Therefore, it is necessary to schedule the access requests of the multiple first access sources to resolve the access conflicts. In addition, from the access request initiated by the first access source to the final read and write operations on the internal table items of the chip, the differences in interface formats need to be considered. Therefore, it is necessary to perform interface conversion on the scheduled access instructions and convert them into the interface format of the internal table items, so as to respond to the currently scheduled first access source, such as the currently scheduled physical function. Figure 1Taking the multiple physical functions shown as accessing the internal table items of the chip as an example, the access between the multiple physical functions to the internal table items 104 of the chip adopts a handshake mechanism combining request and confirmation, that is, after a request is initiated, the access is not completed until a confirmation response is received. The operation between the valid request and the valid confirmation is called a handshake. The depth of the table item is the number of entries under the same table item. Each read and write operation accesses an entry in a table item. According to the entry bit width and the data bus bit width, multiple read and write operations may be required to complete the data read and write operation of an entry. For example, if the data bus bit width is 32 bits and the entry bit width in the table item is 128 bits, four read and write operations are required to complete the data read and write operation of an entry, so four handshakes are required. Therefore, as the system specifications are improved, there may be more access sources that need to initiate access requests, there may be more table items, and the depth of each table item may be different, and the entry bit width of the table item is also determined according to business needs. These bring challenges in access scheduling and conflict handling, and it is difficult to improve the access efficiency for a single access source. The following is combined with Figure 2 It is described in detail how an access scheduling method provided by a specific embodiment of the present application copes with these challenges.

[0034] Continue reading Figure 2 , in step S210, multiple first caches are provided. The number of the multiple first caches is equal to the number of the multiple first access sources, so that the same number of caches as the number of access sources are configured. Furthermore, the data structure of each first cache in the multiple first caches includes: a data field segment for storing data of a given entry of a given first table entry in the multiple first table entries, a table identification field segment for indicating that the data stored in the data field segment of the data structure of the first cache comes from the given first table entry, a table address identification field segment for indicating the address in the first table entry corresponding to the data stored in the data field segment of the data structure of the first cache, an occupied identification field segment for indicating whether the first cache is occupied, and a read-write identification field segment for indicating a data read operation or a data write operation. In this way, by providing an optimized data structure, centralized management of the cache is achieved, and the corresponding fields in a unified data structure are used to meet the requirements of simultaneous access by multiple access sources, and a complex access scheduling mechanism is avoided. Through the information provided by each field segment in the data structure, the challenges of access scheduling and conflict handling through complex control flow design are avoided, and the complex control flow problem is converted into a data flow problem. That is, by parsing the corresponding field segment of the data structure of the first cache, the cache selection strategy can be implemented to resolve multi-source access conflicts.

[0035] Continue reading Figure 2, in step S220, in response to the access request of a given first access source among the multiple first access sources, based on the occupied identification field, table identification field and table address identification field of the data structure of each of the multiple first caches, it is determined whether the access request of the given first access source hits, if not, then the first cache that is not occupied among the multiple first caches is allocated for the access request of the given first access source, if hit, then the access request of the given first access source is completed through the first cache hit by the access request of the given first access source, and, after completing the access request of the given first access source, the first cache used for the access request of the given first access source is recycled. As mentioned above, the data structure of each of the multiple first caches includes multiple fields, which are used to convert the originally complex control flow problem into a data flow problem. Therefore, by parsing each field, the corresponding information can be obtained to implement the cache selection strategy and resolve multi-source access conflicts. Specifically, the data field is used to store data of a given entry of a given first table entry among multiple first table entries, the table identification field is used to indicate that the data stored in the data field of the data structure of the first cache comes from the given first table entry, the table address identification field is used to indicate the address in the first table entry corresponding to the data stored in the data field of the data structure of the first cache, the occupied identification field is used to indicate whether the first cache is occupied, and the read-write identification field is used to indicate a data read operation or a data write operation. In this way, combined with the above-mentioned number of the multiple first caches being equal to the number of the multiple first access sources (which means that the same number of caches as the number of access sources are configured), in application scenarios where the number of access sources is fixed or can be predetermined, for example Figure 1 The four physical functions shown can provide a number of first caches equal to the number of first access sources, for example Figure 1 As shown, four first caches are provided for four physical functions, which can meet the needs of simultaneous access by multiple access sources, solve access conflicts and improve access efficiency. In addition, considering the actual design and occupancy needs of hardware resources, as well as the actual situation that hardware resources are difficult to dynamically adjust after configuration, by providing multiple first caches equal to the number of multiple first access sources, the needs of simultaneous access by multiple first access sources can be met. For example, an intelligent network interface card chip includes four Ethernet ports, and based on the needs of upper-layer software applications, it supports four physical functions. Therefore, the number of Ethernet ports is determined by the hardware specifications supported by the chip, and the number of physical functions is therefore also determined. Generally, in the chip specification definition stage, it is necessary to clearly define the number of network ports, bandwidth, number of physical functions, etc. supported by the chip, and can be set in combination with the specific application scenarios of the chip. However, in the actual application of the chip, the maximum size of the internal table entries of the chip can be increased by means of external memory, for example Figure 1 The number of first entries included in the chip internal table 104 shown exceeds Figure 1 The number of physical functions shown.

[0036] Continue reading Figure 2, in response to an access request of a given first access source among the multiple first access sources, based on the occupation identification field, table identification field and table address identification field of the data structure of each of the multiple first caches, it is determined whether the access request of the given first access source hits. For example, the occupation identification field can be 1 bit, which is used to indicate whether the current cache is occupied by the corresponding first access source, such as a physical function. For example, if the data bus bit width is 32 bits and the entry bit width in the table entry is 128 bits, four read and write operations are required to complete the data read and write operation of an entry, so four handshakes are required. When performing a data read operation, the data read operation of the first 32-bit data triggers the internal logic to write to the current cache, and sets the occupation identification field to 1. When reading the last 32-bit data, the occupation identification field is set to 0. Conversely, when performing a data write operation, before writing the last 32-bit data, the occupation identification field is set to 1, and after caching the complete table entry and initiating the internal write operation, the occupation identification field is set to 0. The table identification field is used to indicate that the data stored in the data field of the data structure of the first cache comes from the given first table entry, for example, to indicate which table entry the data stored in the current cache comes from, for example, a 3-bit table identification field is used to distinguish eight different table entries. The table address identification field is used to indicate the address in the first table entry corresponding to the data stored in the data field of the data structure of the first cache, for example, to indicate which address of the table entry the data stored in the current cache corresponds to. In this way, using the three conditions of the occupation identification field, the table identification field and the table address identification field, it can be determined whether the current access operation, that is, the access request of the given first access source, hits the current cache. If it is the first request from a certain first access source to a certain table entry, such as the first 32-bit data operation, which means that all the first caches are not hit, then the unoccupied first cache among the multiple first caches is allocated for the access request of the given first access source, for example, a cache sequence number can be read from the cache sequence number first-in-first-out memory that stores the cache sequence numbers of all the first caches. In this way, when all the first caches are allocated, the cache sequence number first-in-first-out memory should be empty, that is, the data is cleared. Considering that the access between multiple physical functions to the internal table items of the chip adopts a handshake mechanism combining request and confirmation, that is, after a request is initiated, the access is not completed until a confirmation response is received. Therefore, a certain access source needs to complete the operation of a certain table item before accessing a new table item. This means that the access operation to the current table item is completed, and it will also trigger the corresponding cache sequence number to be recycled to the cache sequence number first-in-first-out memory, so as to be used for new access operations.Therefore, by using the three conditions of the occupied identification field, the table identification field and the table address identification field, it is possible to determine whether the current access operation, that is, the access request of a given first access source, hits the current cache; if so, the access request of the given first access source is completed through the first cache hit by the access request of the given first access source, and after completing the access request of the given first access source, the first cache used for the access request of the given first access source is reclaimed. In this way, on the basis of using the occupied identification field segment, the table identification field segment and the table address identification field segment to determine whether a certain cache is hit, centralized management of the cache is realized by providing an optimized data structure. The corresponding fields in the unified data structure can meet the needs of simultaneous access by multiple access sources and avoid complex access scheduling mechanisms. Through the information provided by each field segment in the data structure, it is avoided to overcome the challenges of access scheduling and conflict handling through complex control flow design, and the complex control flow problem is converted into a data flow problem, that is, by parsing the corresponding fields of the data structure of the first cache, the cache selection strategy can be implemented to solve multi-source access conflicts. In addition, by allocating unoccupied cache and recycling the cache for which the access request has been completed, combined with the multi-source access table entry method that will not initiate the next access before the current access ends, it is beneficial to optimize serial access to parallel access, improve access efficiency, and support fast and smooth upgrades as system specifications are upgraded, such as the number of chip table entries.

[0037] In conclusion, Figure 2 The access scheduling method shown configures the same number of caches as the number of access sources, and realizes centralized management of the cache by providing an optimized data structure. By utilizing the corresponding domain segments in a unified data structure, the requirements of simultaneous access by multiple access sources can be met, and a complex access scheduling mechanism can be avoided. The complex control flow problem is converted into a data flow problem, that is, by parsing the corresponding domain segments of the data structure of the first cache, a cache selection strategy can be implemented to resolve multi-source access conflicts. By allocating unoccupied cache and recycling the cache for which access requests have been completed, combined with a multi-source access table entry method that will not initiate the next access before the end of the current access, it is beneficial to optimize serial access to parallel access, thereby improving access efficiency and supporting rapid and smooth upgrades as system specifications are upgraded, such as an upgrade in the number of chip entries.

[0038] In a possible implementation, the access request of the given first access source indicates a data read operation or a data write operation on a specific entry in a specific first table entry among the multiple first table entries, and the access scheduling method further includes: by comparing the access request of the given first access source with the occupation identification field, table identification field and table address identification field of each data structure of the multiple first caches, judging whether the access request of the given first access source hits, and the specific first table entry corresponds to the given first access source. In this way, by providing an optimized data structure, centralized management of the cache is realized, and by using the corresponding fields in the unified data structure, corresponding information can be obtained by parsing each field to realize the cache selection strategy and solve the multi-source access conflict, and by using the three conditions of the occupation identification field, the table identification field and the table address identification field, it can be judged whether the current access operation, that is, the access request of the given first access source, hits the current cache. Here, the access request of the given first access source indicates a data read operation or a data write operation on a specific entry in a specific first table entry among the multiple first table entries. If the access request of the given first access source corresponds to the initial request from a first access source for a table entry, such as the first 32-bit data operation, which means that all the first caches miss, an unoccupied first cache among the multiple first caches is allocated for the access request of the given first access source, for example, a cache number can be read from a cache number first-in-first-out memory that stores the cache numbers of all the first caches.

[0039] In some embodiments, the occupied identification field of the data structure of the first cache hit by the access request of the given first access source indicates that it is not occupied, and the table identification field and the table address identification field of the data structure of the first cache hit by the access request of the given first access source match the specific entry in the specific first table item indicated by the access request of the given first access source. In this way, by providing an optimized data structure, centralized management of the cache is achieved, and by using the corresponding fields in the unified data structure, corresponding information can be obtained by parsing each field to implement the cache selection strategy and resolve multi-source access conflicts.

[0040] In a possible implementation, the access scheduling method further includes: allocating an unoccupied first cache in the plurality of first caches for the access request of the given first access source by reading the cache sequence number first-in-first-out memory, and reclaiming the first cache for the access request of the given first access source by writing the cache sequence number first-in-first-out memory. In this way, using the three conditions of the occupation identification field, the table identification field and the table address identification field, it can be determined whether the current access operation, that is, the access request of the given first access source, hits the current cache. If it is the first request from a certain first access source to a certain table item, such as the first 32-bit data operation, which means that all the first caches are not hit, then allocating an unoccupied first cache in the plurality of first caches for the access request of the given first access source, and allocating an unoccupied first cache in the plurality of first caches for the access request of the given first access source by reading the cache sequence number first-in-first-out memory. When all the first caches are allocated, the cache sequence number first-in-first-out memory should be empty, that is, the data is cleared. Considering that the access between multiple physical functions to the internal table items of the chip adopts a handshake mechanism combining request and confirmation, that is, after initiating a request, the access is not completed until a confirmation response is received. Therefore, a certain access source needs to complete the operation of a certain table item before accessing a new table item. This means that the access operation to the current table item is completed, and the corresponding cache number is also triggered to be recycled to the cache number first-in-first-out memory, so as to be used for new access operations, that is, the first cache for the access request of the given first access source is recycled by writing the cache number first-in-first-out memory. Therefore, on the basis of using the occupied identification field segment, the table identification field segment and the table address identification field segment to determine whether a certain cache is hit, by providing an optimized data structure, centralized management of the cache is realized, and the corresponding field segments in the unified data structure are used to meet the needs of simultaneous access by multiple access sources, and avoid complex access scheduling mechanisms.

[0041] In a possible implementation, at least two of the multiple first access sources simultaneously initiate access requests to the same first entry in the multiple first entries, and the access request of the given first access source is an access request of any first access source of the at least two first access sources. In this way, as many caches as the number of access sources are configured, and centralized management of the cache is achieved by providing an optimized data structure. The corresponding domain segments in the unified data structure can meet the requirements of simultaneous access by multiple access sources, and avoid complex access scheduling mechanisms; the complex control flow problem is converted into a data flow problem, that is, by parsing the corresponding domain segments of the data structure of the first cache, the cache selection strategy can be implemented to solve multi-source access conflicts. In some embodiments, the conflict handling between the access requests simultaneously initiated by the at least two first access sources to the same first entry is based on the centralized management of the multiple first caches. In this way, centralized management of the cache is achieved, and the requirements of simultaneous access by multiple access sources can be met. In some embodiments, the at least two first access sources are the multiple first access sources. In this way, the requirements of simultaneous access by the multiple first access sources are met.

[0042] In one possible implementation, the network interface card chip includes multiple Ethernet ports, the multiple Ethernet ports support multiple physical functions, the multiple first access sources are the multiple physical functions, and the multiple first table entries are internal table entries of the network interface card chip. In this way, combined with the above-mentioned number of the multiple first caches being equal to the number of the multiple first access sources (which means that the same number of caches as the number of access sources are configured), in application scenarios where the number of access sources is fixed or can be predetermined, the need for simultaneous access by multiple access sources can be met, access conflicts are resolved, and access efficiency is improved. In addition, it supports rapid and smooth upgrades as system specifications are upgraded, such as an upgrade in the number of chip table entries.

[0043] In one possible implementation, the artificial intelligence acceleration chip includes at least one graphics processor, the at least one graphics processor supports multiple threads, the multiple first access sources are the multiple threads, and the multiple first table entries are internal table entries of the artificial intelligence acceleration chip. In this way, combined with the above-mentioned number of the multiple first caches being equal to the number of the multiple first access sources (which means that the same number of caches as the number of access sources are configured), in application scenarios where the number of access sources is fixed or can be predetermined, the need for simultaneous access by multiple access sources can be met, access conflicts are resolved, and access efficiency is improved. In addition, it supports rapid and smooth upgrades as system specifications are upgraded, such as an upgrade in the number of chip table entries.

[0044] In a possible implementation, the multiple first access sources initiate access requests to the multiple first table entries in a serial manner through the same data bus, and completing the access request of the given first access source includes at least one access operation based on the data bus, and the number of the at least one access operation is determined based on the data bit width of each entry of the multiple first table entries and the bit width of the data bus. Here, the multiple first access sources initiate access requests to the multiple first table entries through the same data bus, so the multiple first access sources initiate access requests to the multiple first table entries in a serial manner through the same data bus. Figure 1 Taking the multiple physical functions shown as accessing the chip internal table items as an example, the access between the multiple physical functions to the chip internal table items 104 adopts a handshake mechanism combining request and confirmation, that is, after initiating a request, the access is not completed until a confirmation response is received. The operation between the valid request and the valid confirmation is called a handshake. The depth of the table item is the number of entries under the same table item. Each read and write operation accesses an entry in a table item. According to the entry bit width and the data bus bit width, multiple read and write operations may be required to complete the data read and write operation of an entry. For example, if the data bus bit width is 32 bits and the entry bit width in the table item is 128 bits, four read and write operations are required to complete the data read and write operation of an entry, so four handshakes are required. Therefore, completing the access request of the given first access source includes at least one access operation based on the data bus, and the number of the at least one access operation is determined based on the data bit width of the entries of each of the multiple first table items and the bit width of the data bus. It should be understood that when there is more than one data bus, Figure 2 The access scheduling method shown, combined with a multi-source access table entry method in which the next access will not be initiated before the current access ends, is conducive to optimizing the multi-source access table entry method from serial access to parallel access, thereby improving access efficiency and supporting rapid and smooth upgrades as system specifications are upgraded, such as an upgrade in the number of chip table entries.

[0045] In a possible implementation, the read / write identification field is also used to indicate that a data read operation is invalid during a data write operation. For example, when performing a data write operation, the read / write identification field is used to indicate whether the current 32 bits of data are written into the current cache, and is used to prevent the software from writing the last 32 bits before the complete cache is filled, thereby triggering an internal write operation. After initiating an internal write operation, all bits of the field are set to 0. In this way, the read / write identification field is also used to indicate that a data read operation is invalid during a data write operation, thereby avoiding erroneous operations.

[0046] In a possible implementation, the occupancy identification field is also used to indicate whether a data read operation or a data write operation on the data stored in the data field of the data structure of the first cache has been completed. For example, the occupancy identification field can be 1 bit, which is used to indicate whether the current cache is occupied by the corresponding first access source, such as a physical function. For example, if the data bus bit width is 32 bits and the entry bit width in the table entry is 128 bits, four read and write operations are required to complete the data read and write operations of an entry, so four handshakes are required. When performing a data read operation, the data read operation of the first 32-bit data triggers the internal logic to write to the current cache, and sets the occupancy identification field to 1. When reading the last 32-bit data, the occupancy identification field is set to 0. Conversely, when performing a data write operation, before writing the last 32-bit data, the occupancy identification field is set to 1, and after caching the complete table entry and initiating the internal write operation, the occupancy identification field is set to 0.

[0047] In a possible implementation, the access scheduling method further includes: providing multiple second caches, wherein the multiple second caches correspond one-to-one to the multiple second entries, and each of the multiple second caches is used to store the read and write data of the second entry corresponding to the second cache; and converting the access requests initiated by the multiple second access sources to the multiple second entries into the read and write interface timing of the multiple second access sources to the multiple second caches through polling scheduling. As described above, multiple first caches are provided. The number of the multiple first caches is equal to the number of the multiple first access sources, so that the requirement of simultaneous access by multiple first access sources can be met, that is, the consideration of maximum parallelism. Here, combined with the above-mentioned number of the multiple first caches being equal to the number of the multiple first access sources (which means that the same number of caches as the number of access sources are configured), in an application scenario where the number of access sources is fixed or can be predetermined, for example, the intelligent network interface card chip includes four Ethernet ports, and based on the needs of the upper-layer software application, supports four physical functions. Therefore, the number of Ethernet ports is determined by the hardware specifications supported by the chip, and the number of physical functions is therefore also determined. Generally, during the chip specification definition phase, it is necessary to clearly define the number of network ports, bandwidth, number of physical functions, etc. supported by the chip, and can be set in combination with the specific application scenarios of the chip. Furthermore, multiple second caches can be provided, and the multiple second caches correspond one-to-one to the multiple second table entries, so that the multiple second caches can be used to satisfy the access requests initiated by multiple second access sources to the multiple second table entries. In this way, by using multiple second caches, it is possible to cope with application scenarios in which the number of table entries is fixed or can be predetermined. Through the combination of multiple first caches and multiple second caches, various application scenarios can be flexibly adapted, simplifying access scheduling and conflict handling.

[0048] In some embodiments, the number of the multiple first access sources is fixed, the number of the multiple second access sources is not fixed, the number of the multiple first table entries is not fixed, and the number of the multiple second table entries is fixed. In this way, through the combination of multiple first caches and multiple second caches, various application scenarios can be flexibly adapted, simplifying access scheduling and conflict handling. For example, assuming that the access source as a whole has part A and part B, part A is fixed, such as 10 processor cores or 10 threads, and part B is not fixed, such as a reconfigurable processor or computing power resources provided by cloud services. For another example, the table entry as a whole can also have a fixed part and a non-fixed part to better adapt to the needs of the application scenario.

[0049] Figure 3 3 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 300 includes: one or more processors 310, a communication interface 320 and a memory 330. The processor 310, the communication interface 320 and the memory 330 are interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned apparatus embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these apparatuses and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these apparatuses and components.

[0050] It should be understood that Figure 3 The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.

[0051] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 310 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.

[0052] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.

[0053] The bus 340 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0054] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.

[0055] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.

[0056] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.

[0057] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0058] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in order, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. An access scheduling method, characterized in that: The access scheduling method comprises: A plurality of first caches are provided, wherein the number of the plurality of first caches is equal to the number of the plurality of first access sources, and the data structure of each of the plurality of first caches comprises: a data field segment for storing data of a given entry of a given first table entry in a plurality of first table entries, a table identification field segment for indicating that the data stored in the data field segment of the data structure of the first cache comes from the given first table entry, a table address identification field segment for indicating the address in the first table entry corresponding to the data stored in the data field segment of the data structure of the first cache, an occupied identification field segment for indicating whether the first cache is occupied, and a read / write identification field segment for indicating a data read operation or a data write operation; In response to an access request of a given first access source among the multiple first access sources, based on the occupied identification field, the table identification field and the table address identification field of the data structure of each of the multiple first caches, it is determined whether the access request of the given first access source hits; if not, an unoccupied first cache among the multiple first caches is allocated for the access request of the given first access source; if hit, the access request of the given first access source is completed through the first cache hit by the access request of the given first access source; and, after completing the access request of the given first access source, the first cache used for the access request of the given first access source is recycled. The access request of the given first access source indicates a data read operation or a data write operation for a specific entry in a specific first table entry among the multiple first table entries, and the access scheduling method further includes: judging whether the access request of the given first access source hits by comparing the access request of the given first access source with the occupation identification field, the table identification field and the table address identification field of the data structure of each of the multiple first caches, and the specific first table entry corresponds to the given first access source, The occupied identification field of the data structure of the first cache hit by the access request of the given first access source indicates that it is not occupied, and the table identification field and the table address identification field of the data structure of the first cache hit by the access request of the given first access source match the specific entry in the specific first table entry indicated by the access request of the given first access source.

2. The access scheduling method according to claim 1, characterized in that: The access scheduling method also includes: allocating an unoccupied first cache among the multiple first caches for the access request of the given first access source by reading the cache sequence number first-in-first-out memory, and reclaiming the first cache for the access request of the given first access source by writing the cache sequence number first-in-first-out memory.

3. The access scheduling method according to claim 1, characterized in that: At least two of the multiple first access sources simultaneously initiate access requests to the same first table entry in the multiple first table entries, and the access request of the given first access source is an access request of any first access source among the at least two first access sources.

4. The access scheduling method according to claim 3, characterized in that: The conflict handling between the access requests simultaneously initiated by the at least two first access sources to the same first entry is based on the centralized management of the multiple first caches.

5. The access scheduling method according to claim 3, characterized in that: The at least two first access sources are the multiple first access sources.

6. The access scheduling method according to claim 1, characterized in that: The network interface card chip comprises a plurality of Ethernet ports, the plurality of Ethernet ports support a plurality of physical functions, the plurality of first access sources are the plurality of physical functions, and the plurality of first table entries are internal table entries of the network interface card chip.

7. The access scheduling method according to claim 1, characterized in that: The artificial intelligence acceleration chip includes at least one graphics processor, the at least one graphics processor supports multiple threads, the multiple first access sources are the multiple threads, and the multiple first table entries are internal table entries of the artificial intelligence acceleration chip.

8. The access scheduling method according to claim 1, characterized in that: The multiple first access sources initiate access requests to the multiple first table entries in a serial manner through the same data bus, and completing the access request of the given first access source includes at least one access operation based on the data bus, and the number of the at least one access operation is determined based on the data bit width of each entry of the multiple first table entries and the bit width of the data bus.

9. The access scheduling method according to claim 1, characterized in that: The read / write identification field is also used to indicate that a data read operation is invalid during a data write operation.

10. The access scheduling method according to claim 1, characterized in that: The occupation identification field is also used to indicate whether a data read operation or a data write operation on the data stored in the data field of the data structure of the first cache is completed.

11. The access scheduling method according to claim 1, characterized in that: The access scheduling method further includes: Providing a plurality of second caches, wherein the plurality of second caches correspond one-to-one to the plurality of second table entries, and each second cache in the plurality of second caches is used to store read and write data of the second table entry corresponding to the second cache; The access requests initiated by the multiple second access sources to the multiple second table entries are converted into the read and write interface timings of the multiple second access sources to the multiple second caches through polling scheduling.

12. The access scheduling method according to claim 11, characterized in that: The number of the multiple first access sources is fixed, the number of the multiple second access sources is not fixed, the number of the multiple first table entries is not fixed, and the number of the multiple second table entries is fixed.

13. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 12 when executing the computer program.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Method and device for holding cache miss states of caches in processor of computer

    CN103399824A

  • Multi-source access scheduling method and device for registers of network interface chip

    CN105718393A

  • Implementation method of high-performance multichannel shared cache

    CN115052042A

  • Data processing apparatus and method for performing a cache lookup in an energy efficient manner

    US20080040546A1

  • Content filling method and memory

    WO2019052442A1