Storage instruction scheduling method, device, equipment and storage medium

By setting the status bit register and countdown register for each target cache item and merging the writes of multiple store instructions, the problem of cache port and bandwidth occupation caused by multiple store instruction write operations is solved, reducing pipeline blocking and improving improve writing efficiency.

CN118349280BActive Publication Date: 2024-08-30BEIJING VCORE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410765486.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-08-30
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

When multiple store instructions write to the cache memory or the underlying storage system, the cache port and bandwidth may be occupied, causing the store instruction buffer pipeline to be blocked.

Method used

By setting a preset number of status bit registers and a countdown register for each target cache entry, monitor and manage the writing of store instructions, merge multiple store instructions, and write to the cache memory at once when a certain threshold is reached. Or the underlying storage system to avoid frequently occupying cache ports and bandwidth.

Benefits of technology

It effectively reduces pipeline blocking caused by the store instruction buffer, improves the writing efficiency of store instructions, and avoids unnecessary hardware overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118349280B
    Figure CN118349280B
Patent Text Reader

Abstract

The present application provides a method, device, equipment and storage medium for scheduling a storage instruction. The scheme is: obtain multiple target cache items; set a status bit register and a countdown register for each target cache item; in any beat, reduce the register countdown by one, and change the status bit set for the target cache item written with the storage instruction; judge whether the number of occupied target cache items is greater than or equal to a first threshold, judge whether the countdown of the countdown register is zero, and judge whether the status bit of the status bit register set for each target cache item is equal to a second threshold, obtain a second judgment result, and based on the second judgment result, change the status bit and reset the countdown; when the set status bit is equal to the second threshold, write the storage instruction cached in the target cache item into the cache memory, thereby eliminating the need to continuously occupy the cache port and bandwidth.
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 a method, device, equipment and storage medium for scheduling storage instructions. Background Art

[0002] Usually, the addresses corresponding to the store instructions Store are continuous, and some cache memories or lower-level storage systems will be quickly filled with continuous store instructions. However, when there are multiple store instructions, multiple store instructions continuously write to the cache memory or the lower-level storage system, which will cause the occupation of cache ports and bandwidth, and may cause the store instruction buffer pipeline to be blocked, resulting in additional hardware overhead. Summary of the invention

[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0004] To this end, the first purpose of the present application is to propose a method for scheduling storage instructions to merge multiple storage instructions and write them together into a cache memory or a lower-level storage system to avoid unnecessary occupation of cache ports and bandwidth.

[0005] The second objective of the present application is to provide a storage instruction scheduling device.

[0006] The third objective of the present application is to provide an electronic device.

[0007] A fourth objective of the present application is to provide a computer-readable storage medium.

[0008] A fifth object of the present application is to provide a computer program product.

[0009] To achieve the above-mentioned purpose, the first aspect of the present application proposes a method for scheduling store instructions, including: obtaining multiple target cache items for caching data stored by store instructions; setting a status bit register with a preset number of bits for each of the target cache items and setting a unified countdown register for the target cache items, wherein the initial status bit of the status bit register with a preset number of bits is zero, and the countdown register is set with an initial countdown; in response to any beat corresponding to the target cache item, reducing the countdown of the countdown register by one, and if the store instruction to be written to the target cache item is received, judging whether the store instruction is written to the occupied target cache item to obtain a first judgment result, and based on the first judgment result, changing the status bit of the status bit register set for the target cache item to which the store instruction is written, wherein , the occupied target cache item is used to indicate that the target cache item has been written with the store instruction; within any beat, it is judged whether the number of items of the occupied target cache item is greater than or equal to a first threshold, whether the countdown of the countdown register is zero, and whether the status bit of the status bit register set for each target cache item is equal to a second threshold, so as to obtain a second judgment result, and based on the second judgment result, the status bit of the status bit register set for each target cache item is changed and the countdown of the countdown register is reset; for each target cache item, when the status bit of the status bit register set for the target cache item is equal to the second threshold, the data stored by the store instruction cached by the target cache item is written into the cache memory or the lower storage system at one time.

[0010] To achieve the above-mentioned purpose, the second aspect of the present application proposes a storage instruction scheduling device, including: a first acquisition module, used to acquire multiple target cache items for caching data stored by the storage instruction; a setting module, used to set a status bit register with a preset number of bits for each of the target cache items and set a unified countdown register for the target cache item, wherein the initial status bit of the status bit register with a preset number of bits is zero, and the countdown register is set with an initial countdown; a first change module, used to reduce the countdown of the countdown register by one in response to any beat corresponding to the target cache item, and if the storage instruction to be written to the target cache item is received, it is judged whether the storage instruction is written to the occupied target cache item to obtain a first judgment result, and based on the first judgment result, the status bit of the status bit register set for the target cache item to which the storage instruction is written is changed. change, wherein the occupied target cache item is used to indicate that the target cache item has been written with the store instruction; a second change module is used to judge whether the number of items of the occupied target cache items is greater than or equal to a first threshold, whether the countdown of the countdown register is zero, and whether the status bit of the status bit register set for each target cache item is equal to a second threshold in any beat, so as to obtain a second judgment result, and based on the second judgment result, change the status bit of the status bit register set for each target cache item and reset the countdown of the countdown register; a write module is used to write the data stored by the store instruction cached by the target cache item into the cache memory or the lower storage system at one time for each target cache item, when the status bit of the status bit register set for the target cache item is equal to the second threshold.

[0011] To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the storage instruction scheduling method disclosed in the embodiment of the present application.

[0012] To achieve the above-mentioned purpose, the fourth aspect embodiment of the present application proposes a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by the processor, they are used to implement the storage instruction scheduling method disclosed in the embodiment of the present application.

[0013] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes a computer program product, including a computer program, which, when executed by a processor, implements the storage instruction scheduling method disclosed in the embodiment of the present application.

[0014] The storage instruction scheduling method, device, electronic device and storage medium provided in the present application obtain multiple target cache items for caching data stored by the storage instruction; set a status bit register with a preset number of bits for each target cache item and set a unified countdown register for the target cache item; in response to any beat corresponding to the target cache item, reduce the countdown of the countdown register by one, and if a storage instruction to be written to the target cache item is received, judge whether the storage instruction is written to the occupied target cache item to obtain a first judgment result, and based on the first judgment result, change the status bit of the status bit register set for the target cache item to which the storage instruction is written, wherein the occupied target cache item is used to indicate that the target cache item has been written by the storage instruction; in any beat, judge whether the number of occupied target cache items is greater than or equal to a first threshold, judge whether the countdown of the countdown register is zero, and judge whether the status bit of the status bit register set for each target cache item is equal to a second threshold, To obtain a second judgment result, based on the second judgment result, the status bit of the status bit register set for each target cache item is changed and the countdown register countdown is reset; for each target cache item, when the status bit of the status bit register set for the target cache item is equal to the second threshold, the data stored in the store instruction cached by the target cache item is written into the cache memory or the lower storage system at one time, thereby setting a status bit register for each target cache item in the store instruction buffer and setting a unified countdown register, and through the status bit of the status bit register set for each target cache item, the store instruction written into the target cache item can be monitored, and when the store instruction buffer reaches a certain number of occupied target cache items, multiple store instructions written into the target cache item are merged and written into the cache memory or the lower storage system at one time, without continuously occupying the cache port and bandwidth, thereby reducing the pipeline blockage caused by the store instruction buffer.

[0015] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] Figure 1 The process of the storage instruction scheduling method provided in the embodiment of the present application Figure 1 ;

[0018] Figure 2The process of the storage instruction scheduling method provided in the embodiment of the present application Figure 2 ;

[0019] Figure 3 A schematic diagram of the structure of a storage instruction scheduling device provided in an embodiment of the present application;

[0020] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0021] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0022] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0023] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.

[0024] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0025] Figure 1 A flow chart of a storage instruction scheduling method provided in an embodiment of the present application Figure 1 .

[0026] like Figure 1 As shown, the method comprises the following steps:

[0027] Step 101: Obtain multiple target cache items for caching data stored by a store instruction.

[0028] It should be noted that the storage instruction scheduling method provided in the embodiment of the present application can be executed by a storage instruction scheduling device (also referred to as a storage instruction scheduler), wherein the storage instruction scheduling device can be implemented by software and / or hardware. The storage instruction scheduling device can be an electronic device, or can be configured in an electronic device to implement the storage instruction scheduling function.

[0029] Among them, the embodiment of the present application is explained by taking the storage instruction scheduling method configured in an electronic device as an example.

[0030] Among them, the electronic device can be any device with computing capabilities, such as a personal computer, a mobile terminal, a server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0031] It can be understood that there are multiple target cache items in the store instruction buffer, each target cache item is used to cache data stored by the store instruction, and one target cache item can cache multiple store instructions.

[0032] Step 102: Set a status bit register with a preset number of bits for each target cache item and set a unified countdown register for the target cache item, wherein the initial status bit of the status bit register with the preset number of bits is zero, and the countdown register is set with an initial countdown.

[0033] It can be understood that the specific value of the preset number of bits can be preset according to actual conditions, and this embodiment does not specifically limit the specific value of the preset number of bits.

[0034] It can be understood that the specific value of the initial countdown of the countdown register can be preset according to actual needs, and this embodiment does not specifically limit the specific value of the preset number of bits.

[0035] For example, the initial countdown value can be set to 1024, and the countdown register starts counting down from 1024.

[0036] Step 103, in response to any beat corresponding to the target cache item, the countdown of the countdown register is reduced by one. If a store instruction to be written to the target cache item is received, it is judged whether the store instruction is written to the occupied target cache item to obtain a first judgment result. Based on the first judgment result, the status bit of the status bit register set for the target cache item to which the store instruction is written is changed, wherein the occupied target cache item is used to indicate that the store instruction has been written to the target cache item.

[0037] It should be noted that one beat refers to one clock cycle of the processor, and the state transition of the pipeline in the processor is based on the clock cycle.

[0038] In some examples, a store instruction to be written into a target cache item is obtained, and the address of each target cache item is compared with the address of the cache memory or the lower storage system corresponding to the store instruction to be written. If there is an address of the target cache item that is identical to the address corresponding to the store instruction, it is determined that the store instruction is written to an occupied target cache item; if there is no address of the target cache item that is identical to the address corresponding to the store instruction, the store instruction is written to an unoccupied target cache item, and the address of the target cache item into which the store instruction is written is set to the address corresponding to the store instruction.

[0039] In this example, when the first judgment result indicates that the store instruction is written to an occupied target cache entry, the status bit of the status bit register set for the target cache entry occupied by the store instruction is reset to zero.

[0040] Correspondingly, when the first judgment result indicates that the store instruction is written to an unoccupied target cache item, any positive integer within the range of values ​​from greater than zero to less than or equal to the third threshold is selected, and the status bit of the status bit register set for the target cache item to which the store instruction is written is reset to the positive integer, wherein the third threshold is a positive integer, and the unoccupied target cache item is used to indicate that the store instruction has not been written to the target cache item.

[0041] In some examples, a preset number of bits of a status bit register set for each target cache item is obtained; the preset number of bits is calculated to determine a first numerical result; the first numerical result is subtracted by one to determine a second threshold; and the first numerical result is subtracted by two to determine a third threshold.

[0042] For example, the first numerical result can be expressed by the formula: =n, wherein k represents the preset number of bits, and n represents the first numerical result, the second threshold value can be represented as n-1, and the third threshold value can be represented as n-2.

[0043] Step 104: In any beat, determine whether the number of occupied target cache items is greater than or equal to the first threshold, determine whether the countdown of the countdown register is zero, and determine whether the status bit of the status bit register set for each target cache item is equal to the second threshold to obtain a second judgment result. Based on the second judgment result, change the status bit of the status bit register set for each target cache item and reset the countdown of the countdown register.

[0044] In this example, when the second judgment result indicates that the countdown of the countdown register is not zero and the number of occupied target cache items is greater than or equal to the first threshold and there is no state bit of the state bit register set by the target cache item in each target cache item that is equal to the second threshold, the state bit of the state bit register set by each target cache item is incremented by one, and the countdown of the countdown register is reset to the initial countdown, or, in the current beat, the state bit of the state bit register set by each target cache item is continuously incremented by one until there is a state bit of the state bit register set by the target cache item that is equal to the second threshold, and the countdown of the countdown register is reset to the initial countdown;

[0045] In this example, when the second judgment result indicates that the countdown of the countdown register is zero and there is no status bit of the status bit register set for the target cache item in each target cache item that is equal to the second threshold, the status bit of the status bit register set for each target cache item is increased by one, and the countdown of the countdown register is reset to the initial countdown.

[0046] In some examples, within any beat, when the number of occupied target cache entries is greater than or equal to a first threshold, the countdown register countdown is reset to an initial countdown.

[0047] It should be noted that the first threshold can be preset according to actual needs, which will not be described in detail here.

[0048] For example, if the store instruction buffer has a total of 32 target cache items, the first threshold is set to 16 items. When the number of occupied target cache items in the store instruction buffer is greater than or equal to 16 items, the countdown register countdown is reset to the initial countdown 1024.

[0049] In this example, in the current beat, the status bit of the status bit register set for each target cache item is continuously incremented by one until the status bit of the status bit register set for the target cache item is equal to the second threshold, and after the countdown register countdown is reset to the initial countdown, the data stored in the store instruction cached by the target cache item whose status bit is equal to the second threshold is written to the cache memory or the lower-level storage system at one time.

[0050] Step 105: For each target cache item, when the status bit of the status bit register set for the target cache item is equal to the second threshold, the data stored by the store instruction cached by the target cache item is written once to the cache memory or the lower storage system.

[0051] For example, if each target cache item is to be written to a 512-bit cache memory (cache block) and the physical address is 39 bits, then because the 512-bit cache block has 64 bytes ( =64), so the offset address Block_offset in the cache block is 8 bits, then the cache block address Block_paddr is 31 bits, and the 512-bit cache block corresponds to 64 bytes (1 byte is 8 bits). The byte mask (Bytemask) is 64 bits, corresponding to 64 bytes, indicating whether the target cache item is written by the store instruction. Bytemask is 0, indicating that the target cache item has not been written by the store instruction. Bytemask is 1, indicating that the target cache item has been written by the store instruction. When Bytemask is all 1, it means that the cache block has been fully written by the store instruction. The fields of the store instruction buffer are shown in Table 1:

[0052] Among them, Table 1 Table of fields of the storage instruction buffer

[0053]

[0054] In this example, the storage instruction buffer has a total of 32 target cache items. When the processor is initialized, the valid bit of each target cache item is set to 0, and the initial value of the countdown counter register is set to 1024 through the operating system write control and status register, and the first threshold is 16 items.

[0055] It can be understood that the offset address Block_offset in the cache block is used to indicate the 64-byte position of the cache block.

[0056] It should be noted that in this example, each field of the storage instruction buffer is represented by a hexadecimal number, and the storage instruction buffer status bit register is 4 bits, and n is 2 to the power of 4, that is, n is equal to 16.

[0057] It should be noted that when a store instruction is written to a target cache item, the store instruction can be collected. As shown in Table 1 above, the item with a block address of 0xffffffffffffffff has collected a full cache line. When the status bit is n-1, that is, f (decimal 15), the target cache item begins to be written to the cache memory.

[0058] A method for scheduling a storage instruction provided in an embodiment of the present application obtains multiple target cache items for caching data stored in the storage instruction; sets a status bit register with a preset number of bits for each target cache item and sets a unified countdown register for the target cache item; in response to any beat corresponding to the target cache item, reduces the countdown of the countdown register by one, and if a storage instruction to be written to the target cache item is received, determines whether the storage instruction is written to an occupied target cache item to obtain a first determination result, and based on the first determination result, changes the status bit of the status bit register set for the target cache item to which the storage instruction is written, wherein the occupied target cache item is used to indicate that the target cache item has been written by the storage instruction; in any beat, determines whether the number of occupied target cache items is greater than or equal to a first threshold, determines whether the countdown of the countdown register is zero, and determines whether the status bit of the status bit register set for each target cache item is equal to a second threshold, to obtain a first determination result. Second judgment result, based on the second judgment result, the status bit of the status bit register set for each target cache item is changed and the countdown register countdown is reset; for each target cache item, when the status bit of the status bit register set for the target cache item is equal to the second threshold value, the data stored in the store instruction cached by the target cache item is written into the cache memory or the lower storage system at one time, thereby setting a status bit register for each target cache item in the store instruction buffer and setting a unified countdown register, and through the status bit of the status bit register set for each target cache item, the store instruction written into the target cache item can be monitored, and when the store instruction buffer reaches a certain number of occupied target cache items, multiple store instructions written into the target cache item are merged and written into the cache memory or the lower storage system at one time, without continuously occupying the cache port and bandwidth, thereby reducing the pipeline blockage caused by the store instruction buffer.

[0059] In some examples, in order to avoid the situation where the multiple store instructions cached in the target cache item cannot fill the entire cache memory and are written separately to the cache memory or the lower-level storage system, resulting in excessive port occupancy and bandwidth waste, when the status bit of the status bit register set for the target cache item has not reached the second threshold, the status bit of the status bit register set for the target cache item can be adjusted, and the multiple store instructions can be collected and written to the same cache memory or the lower-level storage system.

[0060] Based on the above embodiments, in order to clearly understand that when the status bit of the status bit register set by the target cache item has not reached the second threshold, the status bit of the status bit register set by the target cache item is adjusted, the following is combined with Figure 2 An exemplary description is given.

[0061] Figure 2 The process of the storage instruction scheduling method provided in the embodiment of the present application Figure 2 .

[0062] like Figure 2 As shown, the method may include:

[0063] Step 201: If a request instruction is received indicating that the storage instructions cached by each target cache item are written into the cache memory or the lower storage system, the status bit of the status bit register set for each target cache item is set to a second threshold.

[0064] Step 202: When the status bit of the status bit register set for each target cache item is equal to the second threshold, write the store instruction cached by each target cache item into the cache memory or the lower storage system.

[0065] It is understandable that multiple store instructions cached in the same target cache item correspond to the same high-speed cache memory or lower-level storage system.

[0066] The embodiment of the present application provides a method for scheduling storage instructions. If a request instruction is received indicating that the storage instructions cached by each target cache item are all written into a cache memory or a lower-level storage system, the status bit of the status bit register set for each target cache item is set to a second threshold value, and when the status bit of the status bit register set for each target cache item is equal to the second threshold value, the storage instructions cached by each target cache item are written into the cache memory or the lower-level storage system. Thus, by adjusting the status bit of the status bit register set for each target cache item to the second threshold value, when multiple storage instructions cached by each target cache item cannot fill up the corresponding cache memory or the lower-level storage system, multiple storage instructions can be collected and written into the same cache memory or the lower-level storage system.

[0067] Figure 3 A schematic diagram of the structure of a storage instruction scheduling device provided in an embodiment of the present application.

[0068] like Figure 3 As shown, the storage instruction scheduling device 300 includes: a first acquisition module 301, a setting module 302, a first change module 303, a second change module 304, a third change module 305 and a writing module 306.

[0069] A first acquisition module 301 is used to acquire multiple target cache items for caching data stored by a store instruction;

[0070] A setting module 302 is used to set a status bit register with a preset number of bits for each target cache item and to set a unified countdown register for the target cache item, wherein the initial status bit of the status bit register with the preset number of bits is zero, and the countdown register is set with an initial countdown;

[0071] The first changing module 303 is used to, in response to any beat corresponding to the target cache item, reduce the countdown of the countdown register by one, and if a store instruction to be written into the target cache item is received, judge whether the store instruction is written into the occupied target cache item to obtain a first judgment result, and based on the first judgment result, change the status bit of the status bit register set in the target cache item to which the store instruction is written, wherein the occupied target cache item is used to indicate that the store instruction has been written into the target cache item;

[0072] The second change module 304 is used to judge whether the number of occupied target cache items is greater than or equal to the first threshold, whether the countdown of the countdown register is zero, and whether the status bit of the status bit register set for each target cache item is equal to the second threshold in any beat, so as to obtain a second judgment result. Based on the second judgment result, the status bit of the status bit register set for each target cache item is changed and the countdown of the countdown register is reset.

[0073] The writing module 305 is used to write the data stored by the store instruction cached by each target cache item into the cache memory or the lower storage system at one time when the status bit of the status bit register set by the target cache item is equal to the second threshold.

[0074] In one embodiment of the application, the second changing module 304 includes:

[0075] The first changing unit 3041 is used to, when the second judgment result indicates that the countdown of the countdown register is not zero and the number of occupied target cache items is greater than or equal to the first threshold and there is no state bit of the state bit register set by the target cache item in each target cache item that is equal to the second threshold, add one to the state bit of the state bit register set by each target cache item and reset the countdown of the countdown register to the initial countdown, or, in the current beat, continuously add one to the state bit of the state bit register set by each target cache item until there is a state bit of the state bit register set by the target cache item that is equal to the second threshold, and reset the countdown of the countdown register to the initial countdown, wherein the second threshold is a positive integer;

[0076] The second changing unit 3042 is used to add one to the status bit of the status bit register set for each target cache item and reset the countdown of the countdown register to the initial countdown when the second judgment result indicates that the countdown of the countdown register is zero and there is no status bit of the status bit register set for the target cache item in each target cache item that is equal to the second threshold.

[0077] In one embodiment of the application, the first changing module 303 is specifically used to:

[0078] When the first judgment result indicates that the store instruction is written into an occupied target cache entry, the status bit of the status bit register set for the target cache entry occupied by the store instruction is reset to zero;

[0079] In the case where the first judgment result indicates that the store instruction is written to an unoccupied target cache item, any positive integer within the range of values ​​from greater than zero to less than or equal to the third threshold is selected, and the status bit of the status bit register set for the target cache item to which the store instruction is written is reset to the positive integer, wherein the third threshold is a positive integer, and the unoccupied target cache item is used to indicate that the store instruction has not been written to the target cache item.

[0080] In one embodiment of the application, in the current beat, the status bit of the status bit register set by each target cache item is continuously increased by one until the status bit of the status bit register set by the target cache item is equal to the second threshold, and the countdown register countdown is reset to the initial countdown, wherein after the second threshold is a positive integer, the module 305 is written, which is specifically used to:

[0081] When the status bit of the status bit register set by the target cache entry is equal to the second threshold, the data stored by the store instruction cached by the target cache entry is written once to the cache memory or the lower storage system.

[0082] In one embodiment of the application, within any beat, the device further includes a fourth changing module 306, specifically configured to

[0083] When the number of occupied target cache entries is greater than or equal to the first threshold, the countdown register countdown is reset to the initial countdown.

[0084] In one embodiment of the application, the device further includes a fifth changing module 307, which is specifically configured to:

[0085] If a request instruction is received indicating that the storage instructions cached by each target cache item are all written into the cache memory or the lower storage system, the status bit of the status bit register set for each target cache item is set to a second threshold;

[0086] The writing module 305 is specifically used to write the store instruction cached by each target cache item into the cache memory or the lower storage system when the status bit of the status bit register set for each target cache item is equal to the second threshold.

[0087] In one embodiment of the application, the apparatus further includes a determination module 308, specifically configured to:

[0088] Obtain the preset number of bits of the status bit register set for each target cache item;

[0089] Calculate the preset number of digits to determine a first numerical result;

[0090] Subtract one from the first numerical result to determine a second threshold;

[0091] The first numerical result is subtracted by two to determine a third threshold value.

[0092] The storage instruction scheduling device provided in the embodiment of the present application can be used to execute the technical solution of the storage instruction scheduling method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0093] A storage instruction scheduling device provided in an embodiment of the present application obtains multiple target cache items for caching data stored by the storage instruction; sets a status bit register with a preset number of bits for each target cache item and sets a unified countdown register for the target cache item; in response to any beat corresponding to the target cache item, reduces the countdown of the countdown register by one, and if a storage instruction to be written to the target cache item is received, determines whether the storage instruction is written to an occupied target cache item to obtain a first determination result, and based on the first determination result, changes the status bit of the status bit register set for the target cache item to which the storage instruction is written, wherein the occupied target cache item is used to indicate that the target cache item has been written by the storage instruction; in any beat, determines whether the number of occupied target cache items is greater than or equal to a first threshold, determines whether the countdown of the countdown register is zero, and determines whether the status bit of the status bit register set for each target cache item is equal to a second threshold, to obtain a first determination result. Second judgment result, based on the second judgment result, the status bit of the status bit register set for each target cache item is changed and the countdown register countdown is reset; for each target cache item, when the status bit of the status bit register set for the target cache item is equal to the second threshold value, the data stored in the store instruction cached by the target cache item is written into the cache memory or the lower storage system at one time, thereby setting a status bit register for each target cache item in the store instruction buffer and setting a unified countdown register, and through the status bit of the status bit register set for each target cache item, the store instruction written into the target cache item can be monitored, and when the store instruction buffer reaches a certain number of occupied target cache items, multiple store instructions written into the target cache item are merged and written into the cache memory or the lower storage system at one time, without continuously occupying the cache port and bandwidth, thereby reducing the pipeline blockage caused by the store instruction buffer.

[0094] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device may include: a memory 401 , a processor 402 , and computer instructions stored in the memory 401 and executable on the processor 402 .

[0095] When the processor 402 executes the instruction, the storage instruction scheduling method provided in the above embodiment is implemented.

[0096] Furthermore, the electronic device 400 further includes:

[0097] The communication interface 403 is used for communication between the memory 401 and the processor 402 .

[0098] The memory 401 is used to store computer instructions that can be executed on the processor 402 .

[0099] The memory 401 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0100] The processor 402 is used to implement the storage instruction scheduling method provided in the above embodiment when executing a program.

[0101] If the memory 401, the processor 402 and the communication interface 403 are implemented independently, the communication interface 403, the memory 401 and the processor 402 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 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.

[0102] Optionally, in a specific implementation, if the memory 401, the processor 402 and the communication interface 403 are integrated on a chip, the memory 401, the processor 402 and the communication interface 403 can communicate with each other through an internal interface.

[0103] The processor 402 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0104] An embodiment of the present application also provides a chip for executing instructions, which is used to execute the storage instruction scheduling method in the above embodiment.

[0105] An embodiment of 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, the computer executes the storage instruction scheduling method in the above embodiment.

[0106] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the storage instruction scheduling method in the above embodiment can be implemented.

[0107] In the description of the present application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0108] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0109] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for scheduling a storage instruction, characterized in that: The method comprises: Obtaining a plurality of target cache entries for caching data stored by the store instruction; Setting a status bit register with a preset number of bits for each of the target cache items and setting a unified countdown register for the target cache items, wherein the initial status bit of the status bit register with the preset number of bits is zero, and the countdown register is set with an initial countdown; In response to any beat corresponding to the target cache item, the countdown of the countdown register is reduced by one, and if the store instruction to be written into the target cache item is received, it is judged whether the store instruction is written into the occupied target cache item to obtain a first judgment result, and based on the first judgment result, the status bit of the status bit register set for the target cache item into which the store instruction is written is changed, wherein, in the case where the first judgment result indicates that the store instruction is written into the occupied target cache item, the status bit of the status bit register set for the target cache item occupied by the store instruction is changed. The status bit of the status bit register is reset to zero, and in the case where the first judgment result indicates that the store instruction is written to the unoccupied target cache item, any positive integer is selected from the range of values ​​greater than zero to less than or equal to a third threshold value, and the status bit of the status bit register set for the target cache item written with the store instruction is reset to the positive integer, the third threshold value is a positive integer, the unoccupied target cache item is used to indicate that the store instruction has not been written to the target cache item, and the occupied target cache item is used to indicate that the store instruction has been written to the target cache item; In any beat, it is judged whether the number of items of the occupied target cache items is greater than or equal to a first threshold, whether the countdown of the countdown register is zero, and whether the status bit of the status bit register set for each of the target cache items is equal to a second threshold, so as to obtain a second judgment result. Based on the second judgment result, the status bit of the status bit register set for each of the target cache items is changed and the countdown of the countdown register is reset. Wherein, when the second judgment result indicates that the countdown of the countdown register is not zero and the number of items of the occupied target cache items is greater than or equal to the first threshold and there is no status bit of the status bit register set for the target cache item in each of the target cache items that is equal to the second threshold, the status bit of the status bit register set for each of the target cache items is changed and the countdown of the countdown register is reset. The state bit of the state bit register is incremented by one, and the countdown of the countdown register is reset to the initial countdown, or, in the current beat, the state bit of the state bit register set by each of the target cache items is continuously incremented by one until there is a situation where the state bit of the state bit register set by the target cache item is equal to a second threshold, and the countdown of the countdown register is reset to the initial countdown, and when the second judgment result indicates that the countdown of the countdown register is zero and there is no state bit of the state bit register set by the target cache item in each of the target cache items that is equal to the second threshold, the state bit of the state bit register set by each of the target cache items is incremented by one, and the countdown of the countdown register is reset to the initial countdown, and the second threshold is a positive integer; For each of the target cache items, when the status bit of the status bit register set for the target cache item is equal to a second threshold, the data stored by the store instruction cached by the target cache item is written once to the cache memory or the lower storage system.

2. The method according to claim 1, characterized in that The step of continuously adding one to the status bit of the status bit register set for each of the target cache items in the current beat until the status bit of the status bit register set for the target cache item is equal to the second threshold, and after the countdown of the countdown register is reset to the initial countdown, comprises: When the status bit of the status bit register set by the target cache item is equal to the second threshold, the data stored by the store instruction cached by the target cache item is written once to the cache memory or the lower storage system.

3. The method according to claim 1, characterized in that The said in any one shot includes: When the number of occupied target cache entries is greater than or equal to a first threshold, the countdown register countdown is reset to the initial countdown.

4. The method according to any one of claims 1 to 3, characterized in that: The method comprises: If a request instruction is received indicating that the store instructions cached by each of the target cache items are all written into the cache memory or the lower storage system, the status bit of the status bit register set for each of the target cache items is set to a second threshold; When the status bit of the status bit register set for each of the target cache items is equal to a second threshold, the store instruction cached by each of the target cache items is written into a cache memory or a lower-level storage system.

5. The method according to claim 1, characterized in that The second threshold and the third threshold include: Obtaining a preset number of bits of a status bit register set for each of the target cache items; Calculating the preset number of bits to determine a first numerical result; Subtract one from the first numerical result to determine the second threshold; The first numerical result is subtracted by two to determine the third threshold.

6. A storage instruction scheduling device used in the method according to any one of claims 1 to 5, characterized in that: include: A first acquisition module, used for acquiring a plurality of target cache items for caching data stored by a store instruction; A setting module, used for setting a status bit register with a preset number of bits for each of the target cache items and setting a unified countdown register for the target cache items, wherein the initial status bit of the status bit register with the preset number of bits is zero, and the countdown register is set with an initial countdown; A first change module is used to reduce the countdown of the countdown register by one in response to any beat corresponding to the target cache item, and if the store instruction to be written into the target cache item is received, it is judged whether the store instruction is written into the occupied target cache item to obtain a first judgment result, and based on the first judgment result, the status bit of the status bit register set for the target cache item into which the store instruction is written is changed, wherein, when the first judgment result indicates that the store instruction is written into the occupied target cache item, the target cache item occupied by the store instruction is The status bit of the status bit register set for the target cache item is reset to zero, and in the case where the first judgment result indicates that the store instruction is written to an unoccupied target cache item, any positive integer is selected within the range of values ​​from greater than zero to less than or equal to a third threshold value, and the status bit of the status bit register set for the target cache item into which the store instruction is written is reset to the positive integer, the third threshold value is a positive integer, the unoccupied target cache item is used to indicate that the store instruction has not been written to the target cache item, and the occupied target cache item is used to indicate that the store instruction has been written to the target cache item; A second change module is used to judge whether the number of items of the occupied target cache items is greater than or equal to the first threshold, whether the countdown of the countdown register is zero, and whether the status bit of the status bit register set for each of the target cache items is equal to the second threshold in any beat, so as to obtain a second judgment result, and based on the second judgment result, change the status bit of the status bit register set for each of the target cache items and reset the countdown of the countdown register, wherein, when the second judgment result indicates that the countdown of the countdown register is not zero and the number of items of the occupied target cache items is greater than or equal to the first threshold and there is no status bit of the status bit register set for the target cache item in each of the target cache items that is equal to the second threshold, the status bit of the status bit register set for each of the target cache items is changed. The state bit of the state bit register of the target cache item is incremented by one, and the countdown of the countdown register is reset to the initial countdown, or, in the current beat, the state bit of the state bit register set by each target cache item is continuously incremented by one until there is a situation where the state bit of the state bit register set by the target cache item is equal to a second threshold, and the countdown of the countdown register is reset to the initial countdown, and when the second judgment result indicates that the countdown of the countdown register is zero and there is no state bit of the state bit register set by the target cache item in each target cache item that is equal to the second threshold, the state bit of the state bit register set by each target cache item is incremented by one, and the countdown of the countdown register is reset to the initial countdown, and the second threshold is a positive integer; A write module is used to write the data stored by the store instruction cached by each target cache item into the cache memory or the lower storage system at one time when the status bit of the status bit register set for the target cache item is equal to a second threshold.

7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the storage instruction scheduling method as described in any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the storage instruction scheduling method as described in any one of claims 1-5 is implemented.

9. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the storage instruction scheduling method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data caching method and device, server and storage medium

    CN113806651A

  • Execution method, system and device of data storage instruction

    CN115563027A

  • Copy back cache tag memory

    EP0604030A2