Storage scheduling method, device and storage medium
By calculating the update depth of the target queue and dequeuing messages when the queue is congested, the problem of low on-chip storage space utilization when the queue is congested is solved, improving chip performance and reducing the probability of packet discarding.
Patent Information
- Application Number
- CN202010582287.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-23
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2040-06-23
AI Technical Summary
In the network processing engine, when queues are congested, existing storage scheduling methods cannot effectively utilize on-chip storage space, resulting in low utilization of on-chip storage space and affecting the overall performance of the chip.
The update depth of the target queue is determined by calculating the sum of the length of the received target message and the current on-chip queue depth of the target queue. When the update depth is greater than the migration threshold, it is determined whether the packet needs to be moved to an off-chip storage device. If the move fails and the on-chip storage occupancy value is less than the threshold, the queue message is triggered to be dequeued and the queue depth is reduced so that the next received message can be stored on the chip.
It improves the utilization of on-chip storage space, enhances the overall performance of the chip, and reduces the probability of discarding packets as much as possible to avoid affecting the normal operation of the business.
Smart Images

Figure CN113835611B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communication technology, and in particular to a storage scheduling method, device and storage medium. Background Art
[0002] In the network processing engine, on the one hand, performance indicators need to be continuously improved, but on the other hand, it is limited by chip area, resources and technology. It is impossible to increase the main frequency indefinitely or pile up resources to meet performance requirements. Therefore, when designing the system, performance indicators are often achieved by increasing the number of queues and increasing the on-chip storage space accordingly. The messages in each queue can be stored in the on-chip storage space or in an off-chip storage device. When a new message is received, the storage location of the message needs to be scheduled.
[0003] At present, after the number of queues increases, when the queue is congested, that is, in a scenario where messages enter the queue quickly and leave the queue slowly, the queue depth of the congested queue increases quickly and decreases slowly. When the queue depth reaches the migration threshold, the storage management module will move the newly received messages to the off-chip storage device for storage. Since the queue depth increases quickly and decreases slowly, the queue depth will be greater than the migration threshold for a period of time, which will cause the storage management module to move all newly received messages to the off-chip storage. At this time, the congested queue will have messages dequeued. Since the queue management is first-in-first-out, the messages dequeued are the messages previously stored in the on-chip storage space. After the messages are dequeued, the on-chip storage space will be free, while the newly received messages of the congested queue are still stored off-chip.
[0004] Therefore, the current storage scheduling method, when the queue is congested, will result in the inability to store newly received messages in the congested queue in the on-chip storage space when the on-chip storage space is idle, resulting in low utilization of the on-chip storage space, thereby affecting the overall performance of the chip. Summary of the invention
[0005] The main purpose of the embodiments of the present invention is to propose a storage scheduling method, device and storage medium, aiming to improve the utilization of on-chip storage space through storage scheduling, thereby improving the overall performance of the chip.
[0006] To achieve the above object, an embodiment of the present invention provides a storage scheduling method, which includes the following steps:
[0007] Determine the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue;
[0008] When the update depth of the target queue is greater than the migration threshold of the target queue, determining that the target message needs to be migrated to an off-chip storage device for storage;
[0009] If message removal and discarding occur when the target message is moved to an off-chip storage device for storage, and the current on-chip storage occupancy value is less than a preset storage occupancy threshold, the message of the target queue is triggered to be dequeued and the dequeued message is discarded;
[0010] The difference between the current on-chip queue depth of the target queue and the length of the dequeued message is subtracted to determine the new current on-chip queue depth of the target queue.
[0011] To achieve the above objectives, an embodiment of the present invention further proposes a storage scheduling device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program implements the steps of the aforementioned method when executed by the processor.
[0012] To achieve the above objectives, an embodiment of the present invention provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the aforementioned method.
[0013] The storage scheduling method, device and storage medium proposed in this embodiment include: determining the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue; when the update depth of the target queue is greater than the migration threshold of the target queue, determining that the target message needs to be moved to an off-chip storage device for storage; if message migration and discarding occurs when the target message is moved to the off-chip storage device for storage, and the current on-chip storage occupancy value is less than the preset storage occupancy threshold, triggering the dequeueing of the message of the target queue and discarding the dequeued message; and determining the difference between the current on-chip queue depth of the target queue and the length of the dequeued message as the new current on-chip queue depth of the target queue. The storage scheduling method triggers the dequeueing of the message of the target queue and discards the dequeued message when the update depth of the target queue is greater than the migration threshold of the target queue, that is, when the queue is congested, when the off-chip storage device cannot successfully store the target message and the current on-chip storage occupancy value is less than the preset storage occupancy threshold. Due to the nature of the queue, the dequeued message must be the message stored in the on-chip storage space. The difference between the current on-chip queue depth of the target queue and the length of the dequeued message is determined as the new current on-chip queue depth of the target queue, which is equivalent to reducing the current on-chip queue depth of the target queue. When a message is received again, the sum of the length of the message and the new current on-chip queue depth of the target queue can be made smaller than the migration threshold of the target queue, thereby realizing the storage of the newly received message in the on-chip storage space, improving the utilization rate of the on-chip storage space, and thus improving the overall performance of the chip; on the other hand, when the off-chip storage device cannot successfully store the target message and the current on-chip storage occupancy value is less than the preset storage occupancy threshold, the message of the target queue is triggered to be dequeued and the dequeued message is discarded, thereby minimizing the probability of discarding the message and avoiding the storage scheduling method affecting the normal operation of the business. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A flowchart of a storage scheduling method provided by an embodiment;
[0015] Figure 2 A flowchart of a storage scheduling method provided by another embodiment;
[0016] Figure 3 A schematic diagram of the structure of a storage scheduling device provided by an embodiment;
[0017] Figure 4 A schematic diagram of the structure of a storage scheduling device provided in another embodiment;
[0018] Figure 5 A schematic diagram of the structure of a storage scheduling device provided in yet another embodiment;
[0019] Figure 6A schematic diagram of the structure of a storage scheduling device provided in one embodiment. DETAILED DESCRIPTION
[0020] It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, and are not used to limit the embodiments of the present invention.
[0021] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the embodiments of the present invention, and have no special meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0022] The current storage scheduling method, when the queue is congested, will result in the inability to store newly received messages in the congested queue in the on-chip storage space when the on-chip storage space is idle, resulting in low utilization of the on-chip storage space, thereby affecting the overall performance of the chip.
[0023] An embodiment of the present invention provides a storage scheduling method, comprising: determining the sum of the length of a received target message and the current on-chip queue depth of a target queue corresponding to the target message as the update depth of the target queue; when the update depth of the target queue is greater than the migration threshold of the target queue, determining that the target message needs to be moved to an off-chip storage device for storage; if message migration and discarding occurs when the target message is moved to the off-chip storage device for storage, and the current on-chip storage occupancy value is less than a preset storage occupancy threshold, triggering the dequeueing of a message of the target queue and discarding the dequeued message; and determining the difference between the current on-chip queue depth of the target queue and the length of the dequeued message as the new current on-chip queue depth of the target queue. The storage scheduling method triggers the dequeueing of the message of the target queue and discards the dequeued message when the update depth of the target queue is greater than the migration threshold of the target queue, that is, when the queue is congested, when the off-chip storage device cannot successfully store the target message and the current on-chip storage occupancy value is less than the preset storage occupancy threshold. Due to the nature of the queue, the dequeued message must be the message stored in the on-chip storage space. The difference between the current on-chip queue depth of the target queue and the length of the dequeued message is determined as the new current on-chip queue depth of the target queue, which is equivalent to reducing the current on-chip queue depth of the target queue. When a message is received again, the sum of the length of the message and the new current on-chip queue depth of the target queue can be made smaller than the migration threshold of the target queue, thereby realizing the storage of the newly received message in the on-chip storage space, improving the utilization rate of the on-chip storage space, and then improving the overall performance of the chip; on the other hand, when the off-chip storage device cannot successfully store the target message and the current on-chip storage occupancy value is less than the preset storage occupancy threshold, the message of the target queue is triggered to be dequeued and the dequeued message is discarded, thereby minimizing the probability of discarding the message and avoiding the storage scheduling method affecting the normal operation of the business.
[0024] Figure 1 This is a flowchart of a storage scheduling method provided by an embodiment. This embodiment is applicable to a scenario in which the storage location of a message is scheduled. This embodiment can be executed by a storage scheduling device, which can be implemented by software and / or hardware, and the storage scheduling device can be integrated into a communication device. Figure 1 As shown, the storage scheduling method provided in this embodiment includes the following steps:
[0025] Step 101: Determine the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue.
[0026] The queues in this embodiment may be divided according to users, that is, messages of different users belong to different queues; they may also be divided according to service types, that is, messages of different services belong to different queues; queues may also be divided according to other factors, which are not limited in this embodiment.
[0027] After receiving the target message, the storage scheduling device needs to determine whether the target message is stored in the on-chip storage space or in the off-chip storage device. The on-chip storage space in this embodiment refers to the storage space on the chip in the storage scheduling device. The on-chip storage space in this embodiment can be a cache space, a random access memory (RAM), etc. The off-chip storage device in this embodiment can be a storage device arranged outside the chip. The chip in this embodiment can be a chip in a network processing engine.
[0028] In one embodiment, the target message may carry a queue number. After receiving the target message, the queue corresponding to the target message is determined according to the queue number of the target message. For the convenience of description, the queue corresponding to the target message is referred to as the target queue. The current on-chip queue depth of the target queue refers to the length of the message stored in the on-chip storage space of the target queue. The current on-chip queue depth of the target queue may be obtained from a module for managing the on-chip queue depth in a storage scheduling device after receiving the target message, or may be directly calculated according to the length of the message currently stored in the on-chip storage space of the target queue after receiving the target message.
[0029] Optionally, the length of the message in this embodiment may refer to the length under different metric standards such as the number of bytes of the message, the number of slices of the message, etc.
[0030] The sum of the length of the received target message and the current on-chip queue depth of the target queue is determined as the update depth of the target queue. For example, assuming that the length of the target message is c0 and the current on-chip queue depth of the target queue is b0, c0+b0 is determined as the update depth of the target queue.
[0031] Step 102: When the update depth of the target queue is greater than the migration threshold of the target queue, it is determined that the target message needs to be migrated to an off-chip storage device for storage.
[0032] In one embodiment, each target queue has a corresponding migration threshold, which can be preset. The migration threshold of the target queue can be set according to user needs, or can be sent to the storage scheduling device by other devices.
[0033] In one implementation, when the update depth of the target queue is greater than the migration threshold of the target queue, it indicates that the target queue is congested, and it is determined that the target message needs to be migrated to an off-chip storage device for storage.
[0034] In another implementation, when the update depth of the target queue is less than or equal to the migration threshold of the target queue, the target message is stored in the on-chip storage space; the sum of the current on-chip queue depth of the target queue plus the length of the target message is determined as the new current on-chip queue depth of the target queue. In this implementation, when there is no congestion in the target queue, after the target message is stored in the on-chip storage space, the current on-chip queue depth of the target queue is updated, which can improve the accuracy of the current on-chip queue depth of the target queue, thereby improving the accuracy of subsequent storage scheduling and further improving the performance of the chip.
[0035] It should be noted that the way in which the messages in the queue are stored in the on-chip storage space can be shared storage, that is, multiple queues share the on-chip storage space, or exclusive storage, that is, each queue has its own corresponding on-chip storage space, or mixed storage, that is, multiple queues share a part of the on-chip storage space, and each queue also has its own corresponding on-chip storage space. This embodiment does not limit the storage method of the queue messages in the on-chip storage space.
[0036] Step 103: If message removal and discarding occur when the target message is moved to the off-chip storage device for storage, and the current on-chip storage occupancy value is less than the preset storage occupancy threshold, the message dequeueing of the target queue is triggered and the dequeued message is discarded.
[0037] In one embodiment, when the bandwidth of the off-chip storage device cannot meet the bandwidth requirement of the target message, or the storage space of the off-chip storage device is insufficient, that is, the off-chip storage device is congested, the storage scheduling device, after determining that the target message needs to be moved to the off-chip storage device for storage, cannot successfully move the target message during the process of moving the target message, and will discard the target message.
[0038] At the same time, if the current on-chip storage occupancy value is less than the preset storage occupancy threshold, the message of the target queue is triggered to be dequeued and the dequeued message is discarded. The current on-chip storage occupancy value is less than the preset storage occupancy threshold, which means that there is extra storage space in the on-chip storage space.
[0039] It is understandable that, since the queue is managed on a first-in-first-out principle, the dequeued messages in the target queue are messages located in the on-chip storage space.
[0040] Optionally, the specific process of triggering the dequeueing of the message of the target queue and discarding the dequeued message may be: adding a discard tag to the target queue; in queue dequeue scheduling, if it is determined that the target queue has a discard tag, triggering the dequeueing of the message of the target queue, and discarding the dequeued message. This process may also be called a fast aging process.
[0041] The purpose of fast aging is to quickly reduce the current on-chip queue depth of the target queue. During the normal dequeue process of the queue, the messages in the queue need to wait to be scheduled before determining whether they are eligible for dequeue, that is, each queue has a sequence of dequeue. This processing method will cause the current on-chip queue depth of the target queue to decrease slowly or not decrease at all when the target queue is congested.
[0042] After adding a discard tag to the target queue, each time the queue is dequeued, it is first scanned to see if there is a queue with a discard tag added; if there is a queue with a discard tag added, the messages in the queue are dequeued first and the dequeued messages are discarded. This is equivalent to the target queue with a discard tag added having the priority to be dequeued without waiting to be scheduled, thus quickly reducing the current on-chip queue depth of the target queue.
[0043] The current on-chip storage occupancy value refers to the sum of the current on-chip queue depths of all queues.
[0044] In one embodiment, the current on-chip storage occupancy value may be sent to the storage scheduling device by other modules.
[0045] In another embodiment, before step 103, the storage scheduling device needs to determine the current on-chip storage occupancy value: the sum of the current on-chip queue depths of all queues is determined as the current on-chip storage occupancy value. In this implementation, the sum of the current on-chip queue depths of all queues is determined as the current on-chip storage occupancy value, which can improve the accuracy of the current on-chip storage occupancy value as much as possible.
[0046] Optionally, the off-chip storage device may send status information to the storage scheduling device at a preset frequency. The status information is used to indicate whether the off-chip storage device has the ability to store the target message. Exemplarily, the status information may be information such as the current bandwidth and / or the current remaining storage space of the off-chip storage device.
[0047] Before step 103, the storage scheduling device can receive status information sent by the off-chip storage device; if it is determined based on the status information that the off-chip storage device can store the target message, the target message is moved to the off-chip storage device for storage; if it is determined based on the status information that the off-chip storage device cannot store the target message, the target message is discarded.
[0048] More specifically, if it is determined according to the status information that the current bandwidth of the off-chip storage device cannot meet the required bandwidth of the target message, and / or it is determined according to the status information that the remaining storage space of the off-chip storage device is less than the required storage space of the target message, then it is determined that the off-chip storage device cannot store the target message. When it is determined that the off-chip storage device cannot store the target message, the storage scheduling device discards the target message.
[0049] The above method of determining whether message removal and discarding occurs is simple to implement and highly efficient.
[0050] Step 104: The difference between the current on-chip queue depth of the target queue and the length of the dequeued message is subtracted to determine the new current on-chip queue depth of the target queue.
[0051] In one embodiment, after step 103, the current on-chip queue depth of the target queue needs to be updated. The specific updating method is: subtract the length of the dequeued message from the current on-chip queue depth of the target queue to determine the new current on-chip queue depth of the target queue.
[0052] Afterwards, when a new message from the target queue is received, step 101 is repeated. In this process, the new current on-chip queue depth of the target queue is used. At this time, since the current on-chip queue depth of the target queue has been reduced compared to the last time, the update depth of the target queue is likely to be less than or equal to the migration threshold of the target queue. The new message is likely to be stored in the on-chip storage space, thereby improving the utilization rate of the on-chip storage space and, in turn, improving the performance of the chip.
[0053] Before executing the storage scheduling method provided in this embodiment, information configuration needs to be performed in advance. The information to be configured may include: the number of queues, the migration threshold corresponding to each queue, and the preset storage occupancy threshold.
[0054] An embodiment of the present invention provides a storage scheduling method, comprising: determining the sum of the length of a received target message and the current on-chip queue depth of a target queue corresponding to the target message as the update depth of the target queue; when the update depth of the target queue is greater than the migration threshold of the target queue, determining that the target message needs to be moved to an off-chip storage device for storage; if message migration and discarding occurs when the target message is moved to the off-chip storage device for storage, and the current on-chip storage occupancy value is less than a preset storage occupancy threshold, triggering the dequeueing of a message of the target queue and discarding the dequeued message; and determining the difference between the current on-chip queue depth of the target queue and the length of the dequeued message as the new current on-chip queue depth of the target queue. The storage scheduling method triggers the dequeueing of the message of the target queue and discards the dequeued message when the update depth of the target queue is greater than the migration threshold of the target queue, that is, when the queue is congested, when the off-chip storage device cannot successfully store the target message and the current on-chip storage occupancy value is less than the preset storage occupancy threshold. Due to the nature of the queue, the dequeued message must be the message stored in the on-chip storage space. The difference between the current on-chip queue depth of the target queue and the length of the dequeued message is determined as the new current on-chip queue depth of the target queue, which is equivalent to reducing the current on-chip queue depth of the target queue. When a message is received again, the sum of the length of the message and the new current on-chip queue depth of the target queue can be made smaller than the migration threshold of the target queue, thereby realizing the storage of the newly received message in the on-chip storage space, improving the utilization rate of the on-chip storage space, and thus improving the overall performance of the chip; on the other hand, when the off-chip storage device cannot successfully store the target message and the current on-chip storage occupancy value is less than the preset storage occupancy threshold, the message of the target queue is triggered to be dequeued and the dequeued message is discarded, thereby minimizing the probability of discarding the message and avoiding the storage scheduling method affecting the normal operation of the business.
[0055] Figure 2 A flowchart of a storage scheduling method provided in another embodiment. Figure 1 Based on the illustrated embodiment and various optional solutions, other steps included in the storage scheduling method are described in detail. Figure 2 As shown, the storage scheduling method provided in this embodiment includes the following steps:
[0056] Step 201: Determine the attributes of the target message.
[0057] Step 202: When it is determined that the attribute of the target message is of a mixed type, it is determined to execute step 205.
[0058] That is, when it is determined that the attribute of the target message is of mixed type, a step is performed to determine the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue.
[0059] Step 203: When it is determined that the attribute of the target message is an on-chip message, the target message is stored in the on-chip storage.
[0060] Step 204: When it is determined that the attribute of the target message is an off-chip message, the target message is stored in an off-chip storage device.
[0061] In one embodiment, the target message still carries its own attribute information. The attributes of the message in this embodiment may include: mixed type messages, on-chip messages, and off-chip messages. Among them, mixed type messages refer to messages that can be stored in both off-chip storage devices and on-chip storage space, on-chip messages refer to messages that can only be stored in on-chip storage space, and off-chip messages refer to messages that can only be stored in off-chip storage devices.
[0062] After receiving the target message, this embodiment first determines the attributes of the target message. The subsequent operation is selected according to the attributes of the target message. The first case: when it is determined that the attribute of the target message is a mixed type, it is necessary to determine whether the target message needs to be stored on-chip or off-chip, that is, storage scheduling is required, and step 205 is determined to be executed. The second case: when it is determined that the target message is an on-chip message, storage scheduling is not required, and the target message is stored in the on-chip storage space. The third case: when it is determined that the target message is an off-chip message, storage scheduling is also not required, and the target message is stored in an off-chip storage device.
[0063] This method of first determining the attributes of the target message and then determining the processing of subsequent operations can perform storage scheduling only when storage scheduling is needed, avoiding blind scheduling to store on-chip messages in off-chip storage devices, which leads to reduced business processing efficiency, or storing off-chip messages in on-chip storage space and occupying on-chip storage space.
[0064] It should be noted that the messages in the same queue in this embodiment may be messages with the same attributes or messages with different attributes, but this embodiment is not limited thereto.
[0065] Step 205: Determine the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue.
[0066] The implementation process and technical principle of step 205 are similar to those of step 101 and will not be repeated here.
[0067] Step 206: Determine whether the update depth of the target queue is greater than the migration threshold of the target queue.
[0068] Step 207: When the update depth of the target queue is greater than the migration threshold of the target queue, it is determined that the target message needs to be migrated to an off-chip storage device for storage.
[0069] The implementation process and technical principle of step 207 are similar to those of step 102 and will not be repeated here.
[0070] Step 208: Determine whether message removal and discarding occurs.
[0071] In step 208, when congestion occurs in the off-chip storage device, after the storage scheduling device determines that the target message needs to be moved to the off-chip storage device for storage, if the target message cannot be moved successfully during the process of moving the target message, the target message will be discarded.
[0072] Step 209: If message removal and discarding occur when the target message is moved to the off-chip storage device for storage, and the current on-chip storage occupancy value is less than the preset storage occupancy threshold, the message dequeueing of the target queue is triggered and the dequeued message is discarded.
[0073] The implementation process and technical principle of step 209 are similar to those of step 103, and will not be repeated here.
[0074] In one embodiment, the preset storage occupancy threshold is the storage occupancy threshold corresponding to the target queue. Correspondingly, before step 209, the following steps may also be included: if message removal and discarding occur when the target message is moved to the off-chip storage device for storage, then according to the priority of the target queue, a storage occupancy threshold corresponding to the priority of the target queue is determined.
[0075] This processing method can set a preset storage occupancy threshold that is compatible with the priority of the queue, so as to implement different storage scheduling management for different queues and improve the flexibility of storage scheduling.
[0076] Step 210: The difference between the current on-chip queue depth of the target queue and the length of the dequeued message is subtracted to determine the new current on-chip queue depth of the target queue.
[0077] The implementation process and technical principle of step 210 are similar to those of step 104 and will not be described in detail here.
[0078] Step 211: When the update depth of the target queue is less than or equal to the migration threshold of the target queue, the target message is stored in the on-chip storage space.
[0079] In step 211, the update depth of the target queue is less than or equal to the migration threshold of the target queue, indicating that the target message can be stored in the on-chip storage space. Therefore, the target message is stored in the on-chip storage space.
[0080] Step 212: The sum of the current on-chip queue depth of the target queue and the length of the target message is added to determine the new current on-chip queue depth of the target queue.
[0081] In step 212, after the target message is stored in the on-chip storage space, the current on-chip queue depth of the target queue needs to be updated to improve the accuracy of subsequent storage scheduling. The update method is to add the sum of the length of the target message to the current on-chip queue depth of the target queue to determine the new current on-chip queue depth of the target queue.
[0082] Step 213: If the target message is successfully moved to the off-chip storage device for storage, the current on-chip queue depth of the target queue is determined as the new current on-chip queue depth of the target queue.
[0083] In step 213, after successfully moving the target message to the off-chip storage device for storage, the storage scheduling device also needs to update the current on-chip queue depth of the target queue. Since the current on-chip queue depth of the target queue does not increase in this scenario, the current on-chip queue depth of the target queue is determined as the new current on-chip queue depth of the target queue.
[0084] The solution of this embodiment is described in detail below in conjunction with a specific implementation of the storage scheduling device. Figure 3 FIG. 1 is a schematic diagram of the structure of a storage scheduling device provided by an embodiment. Figure 3 As shown, the storage scheduling device provided in this embodiment includes the following modules: a threshold counting module 31 , a moving state counting module 32 and a moving arbitration module 33 . The threshold counting module 31 and the moving state counting module 32 are both connected to the moving arbitration module 33 .
[0085] The threshold counting module 31 can query the migration threshold of the queue and the storage occupancy threshold corresponding to the queue. Assuming that the number of queues is 2, numbered 0 and 1, then the threshold counting module 31 can query the corresponding queue migration threshold according to the queue number, store it in the shared temporary register for use by the migration arbitration module 33, and can also query the corresponding storage occupancy threshold according to the queue number. Assume that the migration domain value corresponding to queue 0 is a0, and the corresponding storage occupancy threshold is s0. The migration threshold corresponding to queue 1 is a1, and the corresponding storage occupancy threshold is s1.
[0086] The move state counting module 32 can determine the current on-chip queue depth of the queue, determine the updated depth of the queue, and determine the new current on-chip queue depth of the queue. Further, the move state counting module 32 can also determine the message attributes of the target message. Figure 3The system includes N+1 transfer state counting modules 32. Each transfer state counting module 32 can manage the current on-chip queue depth of queues in different dimensions. For example, when the transfer state counting module 0 manages the current on-chip queue depth of Q+1 queues when the queues are divided from dimension A, the transfer state counting module N manages the current on-chip queue depth of Q+1 queues when the queues are divided from dimension M. Assume that the current on-chip queue depth of queue 0 is b0, and assume that the current on-chip queue depth of queue 1 is b1. Queue 0 and queue 1 here can be queues in any dimension.
[0087] The relocation arbitration module 33 includes an on-chip resource judgment submodule 331 and a scheduler 332. Among them, the number of schedulers 332 can be multiple. Optionally, the configuration value of scheduler 0 is 2'b00, indicating that scheduler 0 performs system-level scheduling. Scheduler 0 is used to calculate the on-chip storage space consumption status in real time, that is, to calculate the current on-chip storage occupancy value. Other schedulers are used to schedule queues. Each queue can correspond to a scheduler. Exemplarily, queue 0 corresponds to scheduler 1, and queue 1 corresponds to scheduler 2. The configuration values of scheduler 1 and scheduler 2 are 2'b01, indicating that the scheduling strategy is flow-level scheduling.
[0088] The length of the message received by queue 0 is c0, the on-chip storage occupancy value at this time is c0', and the current on-chip queue depth of queue 0 is b0. b0+c0 is determined as the update depth of queue 0. If scheduler 1 determines that b0+c0>a0, then the currently received message corresponding to queue 0 is moved to the off-chip storage device; if scheduler 1 determines that b0+c0≤a0, then the currently received message corresponding to queue 0 is stored in the on-chip storage space.
[0089] Similarly, the length of the message received by queue 1 is c1, and the on-chip cache occupancy value at this time is c0'+c1', and the current on-chip queue depth of queue 1 is b1. b1+c1 is determined as the update depth of queue 1. If scheduler 2 determines that b1+c1>a1, then the currently received message corresponding to queue 1 is moved to the off-chip storage device; if scheduler 2 determines that b1+c1≤a1, then the currently received message corresponding to queue 1 is stored in the on-chip storage space.
[0090] If the off-chip storage device is congested (for example, the bandwidth of the off-chip storage device is insufficient) during the process of moving the currently received message corresponding to queue 1 to the off-chip storage device, then the move will be discarded. At this time, if the on-chip resource judgment submodule 331 determines that there are resources on the chip, that is, c0'+c1'≤s1, then the queue 1 is triggered to perform fast aging.
[0091] like Figure 3As shown, any one of the multiple schedulers determines that the message needs to be moved, and then moves it. Therefore, the multiple schedulers are connected by "logical OR". If any scheduler determines that the message needs to be moved to an off-chip storage device, and (i.e. Figure 3 The “and” in the upper middle), if the bandwidth of the off-chip storage device is insufficient, a migration discard will occur. If a migration discard occurs, and (i.e. Figure 3 The “and” in the lower middle), if there are resources on the chip, the rapid aging of the corresponding queue is triggered.
[0092] The transfer state counting module 32 can update the current on-chip queue depth of the queue according to the storage scheduling result. Therefore, the transfer state counting module can be connected with the storage scheduling result, that is, the on-chip / off-chip transfer result.
[0093] After the rapid aging of queue 1, it is equivalent to that the current on-chip queue depth of queue 1 is reduced. After the next message is received, the sum of the length of the newly received message and the current on-chip queue depth of queue 1 will be less than the migration threshold a1 corresponding to queue 1, thereby storing the messages of queue 1 in the on-chip storage space and reusing the idle on-chip storage space to improve the performance of the chip.
[0094] Based on the storage scheduling method provided in this embodiment, there is a high degree of freedom in designing multiple input queues. Parameterization and scalability can be achieved in terms of the number of queues and scheduling strategies. It can adapt to various system structures and data flow scheduling requirements. The design difficulty of the system is greatly reduced and the reliability of the structure is improved. At the same time, it also helps the portability and inheritability of the structure.
[0095] The storage scheduling method provided in this embodiment, on the one hand, before performing storage scheduling, first determines the attributes of the target message, and then determines the subsequent operation. Storage scheduling can be performed only when storage scheduling is needed, thereby avoiding blind scheduling to store on-chip messages in off-chip storage devices, resulting in reduced business processing efficiency, or storing off-chip messages in on-chip storage space and occupying on-chip storage space; on the other hand, this embodiment can use different calculation processes based on different storage scheduling results to update the current on-chip queue depth of the target queue, so as to provide an accurate basis for the subsequent storage scheduling process, improve the accuracy of storage scheduling, and further improve the performance of the chip.
[0096] Figure 4 FIG. 1 is a schematic diagram of the structure of a storage scheduling device provided in another embodiment. Figure 4 As shown, the storage scheduling device provided in this embodiment includes the following modules: a first determining module 41 , a second determining module 42 , a triggering module 43 and a third determining module 44 .
[0097] The first determining module 41 is configured to determine the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue.
[0098] The second determination module 42 is configured to determine that the target message needs to be moved to an off-chip storage device for storage when the update depth of the target queue is greater than the migration threshold of the target queue.
[0099] The trigger module 43 is configured to trigger the dequeueing of the message of the target queue and discard the dequeued message if the message is discarded when the target message is moved to the off-chip storage device for storage, and the current on-chip storage occupancy value is less than the preset storage occupancy threshold.
[0100] Optionally, the device further includes: a receiving module, a first storage module and a discarding module.
[0101] The receiving module is configured to receive status information sent by the off-chip storage device.
[0102] The first storage module is configured to move the target message to the off-chip storage device for storage if it is determined according to the status information that the off-chip storage device can store the target message.
[0103] The discarding module is configured to discard the target message if it is determined according to the status information that the off-chip storage device cannot store the target message.
[0104] The third determining module 44 is configured to determine the difference between the current on-chip queue depth of the target queue and the length of the dequeued message as the new current on-chip queue depth of the target queue.
[0105] In one embodiment, the apparatus further includes: a fourth determination module configured to determine the sum of current on-chip queue depths of all queues as the current on-chip storage occupancy value.
[0106] In one embodiment, in terms of triggering the dequeueing of a message of a target queue and discarding the dequeued message, the trigger module 43 is specifically used to: add a discard tag to the target queue; in queue dequeue scheduling, if it is determined that the target queue has a discard tag, trigger the dequeueing of a message of the target queue and discard the dequeued message.
[0107] The storage scheduling device provided in this embodiment is used to execute the storage scheduling method of any of the above embodiments. The implementation principle and technical effect of the storage scheduling device provided in this embodiment are similar and will not be repeated here.
[0108] Figure 5 A schematic diagram of the structure of a storage scheduling device provided in another embodiment. Figure 4 Based on the illustrated embodiments and various optional solutions, other modules included in the storage scheduling device are described in detail. Figure 5 As shown, the storage scheduling device provided in this embodiment further includes the following modules: a second storage module 51 , a judgment module 52 , a fifth determination module 53 , a third storage module 54 and a fourth storage module 55 .
[0109] The second storage module 51 is configured to store the target message in the on-chip storage space when the update depth of the target queue is less than or equal to the migration threshold of the target queue.
[0110] The third determining module 44 is further configured to determine the sum of the current on-chip queue depth of the target queue and the length of the target message as the new current on-chip queue depth of the target queue.
[0111] The third determination module 44 is further configured to determine the current on-chip queue depth of the target queue as the new current on-chip queue depth of the target queue if the target message is successfully moved to the off-chip storage device for storage.
[0112] Optionally, the preset storage occupancy threshold is a storage occupancy threshold corresponding to the target queue. Correspondingly, the device further comprises: a fourth determination module configured to determine a storage occupancy threshold corresponding to the priority of the target queue according to the priority of the target queue if message removal and discarding occurs when the target message is moved to an off-chip storage device for storage.
[0113] The determination module 52 is configured to determine the attribute of the target message.
[0114] The fifth determination module 53 is configured to determine the step of determining the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue when it is determined that the attribute of the target message is of mixed type.
[0115] In one embodiment, the third storage module 54 is configured to store the target message in the on-chip storage when it is determined that the attribute of the target message is an on-chip message.
[0116] The fourth storage module 55 is configured to store the target message in an off-chip storage device when it is determined that the attribute of the target message is an off-chip message.
[0117] The storage scheduling device provided in this embodiment is used to execute the storage scheduling method of any of the above embodiments. The implementation principle and technical effect of the storage scheduling device provided in this embodiment are similar and will not be repeated here.
[0118] Figure 6 FIG. 1 is a schematic diagram of a storage scheduling device provided in an embodiment. Figure 6 As shown, the storage scheduling device includes a processor 61 and a memory 62; the number of the processor 61 in the storage scheduling device can be one or more. Figure 6 A processor 61 is taken as an example; the processor 61 and the memory 62 in the storage scheduling device can be connected by a bus or other means, Figure 6 The example of connecting through bus is taken in the following.
[0119] The memory 62, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the storage scheduling method in the embodiment of the present application (for example, the first determination module 41, the second determination module 42, the trigger module 43 and the third determination module 44 in the storage scheduling device). The processor 61 executes the software programs, instructions and modules stored in the memory 62, thereby storing various functional applications and data processing of the scheduling device, that is, implementing the above-mentioned storage scheduling method.
[0120] The memory 62 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the storage scheduling device, etc. In addition, the memory 62 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 devices.
[0121] The embodiment of the present application further provides a storage medium including computer executable instructions, and when the computer executable instructions are executed by a computer processor, they are used to execute a storage scheduling method, the method comprising:
[0122] Determine the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue;
[0123] When the update depth of the target queue is greater than the migration threshold of the target queue, determining that the target message needs to be migrated to an off-chip storage device for storage;
[0124] If message removal and discarding occur when the target message is moved to an off-chip storage device for storage, and the current on-chip storage occupancy value is less than a preset storage occupancy threshold, the message of the target queue is triggered to be dequeued and the dequeued message is discarded;
[0125] The difference between the current on-chip queue depth of the target queue and the length of the dequeued message is subtracted to determine the new current on-chip queue depth of the target queue.
[0126] Of course, the storage medium provided by the present application contains computer executable instructions, and its computer executable instructions are not limited to the method operations described above, but can also execute related operations in the storage scheduling method provided by any embodiment of the present application.
[0127] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.
[0128] In general, various embodiments of the present application can be implemented in hardware or dedicated circuits, software, logic or any combination thereof. For example, some aspects can be implemented in hardware, while other aspects can be implemented in firmware or software that can be executed by a controller, microprocessor or other computing device, although the present application is not limited thereto.
[0129] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0130] In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0131] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the embodiments of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the embodiments of the present invention shall be within the scope of the rights of the embodiments of the present invention.
Claims
1. A storage scheduling method, characterized in that: The method comprises: Determine the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue; When the update depth of the target queue is greater than the migration threshold of the target queue, determining that the target message needs to be migrated to an off-chip storage device for storage; If message removal and discarding occurs when the target message is moved to an off-chip storage device for storage, and the current on-chip storage occupancy value is less than a preset storage occupancy threshold, the message of the target queue is triggered to be dequeued and the dequeued message is discarded; wherein the current on-chip storage occupancy value is the sum of the current on-chip queue depths of all queues; The difference between the current on-chip queue depth of the target queue and the length of the dequeued message is subtracted to determine the new current on-chip queue depth of the target queue.
2. The method according to claim 1, characterized in that: If the target message is moved to an off-chip storage device for storage and message removal is discarded, and the current on-chip storage occupancy value is less than a preset storage occupancy threshold, before triggering the message dequeuing of the target queue and discarding the dequeued message, the method further includes: The sum of the current on-chip queue depths of all queues is determined as the current on-chip storage occupancy value.
3. The method according to claim 1, characterized in that The method further comprises: When the update depth of the target queue is less than or equal to the migration threshold of the target queue, storing the target message in an on-chip storage space; The sum of the current on-chip queue depth of the target queue and the length of the target message is determined as the new current on-chip queue depth of the target queue.
4. The method according to claim 1, characterized in that: The method further comprises: If the target message is successfully moved to the off-chip storage device for storage, the current on-chip queue depth of the target queue is determined as a new current on-chip queue depth of the target queue.
5. The method according to any one of claims 1 to 4, characterized in that: The preset storage occupancy threshold is the storage occupancy threshold corresponding to the target queue; Before triggering the message of the target queue to be dequeued and discarding the dequeued message, the method further includes: If message removal and discarding occur when the target message is removed to an off-chip storage device for storage, a storage occupancy threshold corresponding to the priority of the target queue is determined according to the priority of the target queue.
6. The method according to any one of claims 1 to 4, characterized in that: Before determining the sum of the length of the received target message and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue, the method further includes: Determining the attributes of the target message; When it is determined that the attribute of the target message is of a mixed type, a step is performed to determine the sum of the length of the target message to be received and the current on-chip queue depth of the target queue corresponding to the target message as the update depth of the target queue.
7. The method according to claim 6, characterized in that After determining the attribute of the target message, the method further includes: When it is determined that the attribute of the target message is an on-chip message, storing the target message in an on-chip storage; When it is determined that the attribute of the target message is an off-chip message, the target message is stored in the off-chip storage device.
8. The method according to any one of claims 1 to 4, characterized in that: The triggering of dequeuing of the message of the target queue and discarding the dequeued message includes: Adding a discard tag to the target queue; In queue dequeue scheduling, if it is determined that the target queue has the discard tag, the dequeue of the message of the target queue is triggered, and the dequeued message is discarded.
9. The method according to any one of claims 1 to 4, characterized in that: If the target message is moved to an off-chip storage device for storage and message removal is discarded, and the current on-chip storage occupancy value is less than a preset storage occupancy threshold, before triggering the message dequeuing of the target queue and discarding the dequeued message, the method further includes: Receiving status information sent by the off-chip storage device; If it is determined according to the status information that the off-chip storage device can store the target message, the target message is moved to the off-chip storage device for storage; If it is determined according to the status information that the off-chip storage device cannot store the target message, the target message is discarded.
10. A storage scheduling device, characterized in that: The device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the storage scheduling method as described in any one of claims 1 to 9 are realized.
11. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the storage scheduling method described in any one of claims 1 to 9.
Citation Information
Patent Citations
Cache management method and device
CN103685062A
Message cache method and device
CN103888377A
Congestion avoiding method and apparatus of router
CN104426796A
Switch message congestion processing method and device, and storage medium
CN111107017A