A data processing system for partial writing

By splitting the target atomic operation into read instructions and write instructions, and reordering them in the instruction queue buffer, the problem of low writing efficiency of some data in the existing technology is solved, and efficient memory operations and data consistency are achieved. .

CN117707468BActive Publication Date: 2024-09-20MUXI LINGZHI TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311675112.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-07
Publication Date
2024-09-20
Estimated Expiration
2043-12-07

AI Technical Summary

Technical Problem

When partial data is written in the existing technology, since the error check and data mask functions in the memory share a pin, partial data cannot be written through the data mask, and the uninterruptibility of atomic operations reduces memory efficiency. .

Method used

Split the target atomic operation into read instructions and write instructions, and reorder them in the instruction queue buffer to ensure that read instructions precede write instructions and meet the bit width threshold when there are instructions accessing the target address to reduce reads and writes Instruction switching times and ensuring data consistency.

Benefits of technology

It improves memory efficiency, reduces the number of read and write instruction switches, and ensures data consistency and timeliness of repeated operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117707468B
    Figure CN117707468B
Patent Text Reader

Abstract

The present application relates to the field of data processing technology, and in particular to a data processing system for partial writing, the system comprising: a memory, an instruction queue buffer, a database, a processor and a memory storing a computer program, and when the computer program is executed by the processor, the following steps are implemented: after splitting a target atomic operation into a read instruction and a write instruction, the instructions are stored in the instruction queue buffer with instructions to be executed for reordering to obtain a reordering result, wherein the read instruction is before the write instruction, and when there is an instruction to be executed that accesses a target address, the sum of the bit widths of the read instruction, the write instruction and the instructions to be executed between the two is less than a threshold, and the data processing result is obtained by executing according to the reordering result. It can be seen that the target atomic operation is split into a read instruction and a write instruction, so that other instructions to be executed can be inserted between the read instruction and the write instruction, and there is no need to directly switch between the read and write instructions, thereby reducing the number of read and write instruction switches and effectively improving memory efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a data processing system for partial writing. Background Art

[0002] Partial data writing means that for multi-byte data, only some bytes are overwritten. In the scenario of partial data writing to the memory, since the memory can support the data mask (DM) function, a common practice is to use the data mask to write partial data. However, usually the error checking (ECC) function and the data mask function in the memory share a pin. In order to ensure the integrity of the data, it is usually necessary to enable ECC, which often makes it impossible to write partial data through DM.

[0003] To address the above issues, existing methods usually adopt a "read first, write later" approach, that is, first read out the data that needs to be partially written, then rewrite the bytes in the data that need to be partially written, and then write the rewritten data. The above steps form an atomic operation (read modify write, RMW). However, due to the non-interruptibility of atomic operations, other instructions cannot be executed during the read and write operations, and a time-consuming conversion operation is required between the read and write operations, which greatly reduces the efficiency of the memory.

[0004] Therefore, how to achieve partial data writing using non-DM methods while ensuring high memory efficiency has become an urgent problem to be solved. Summary of the invention

[0005] In view of the above technical problems, the technical solution adopted by the present invention is:

[0006] A data processing system for partial writing, the system comprising: a memory, an instruction queue buffer, a database, a processor and a memory storing a computer program, wherein the database comprises a target atomic operation to be executed and N instructions to be executed, the target atomic operation comprises a read operation of original data D1 corresponding to a target address A, a rewrite operation of D1 and an operation of writing the rewritten target data D2 into A, and when the computer program is executed by the processor, the following steps are implemented:

[0007] S101, splitting the target atomic operation into read instructions R A And write instruction W A , R A is the instruction corresponding to the read operation of the original data D1 corresponding to the target address A, W AThis is the instruction corresponding to the operation of writing the rewritten target data D2 into A.

[0008] S102, R A , W A and the N to-be-executed instructions are respectively used as target instructions and stored in the instruction queue buffer.

[0009] S103, reordering all target instructions in the instruction queue buffer to obtain a reordering result, wherein in the reordering result, R A In W A Before, and R A and W A There are M instructions to be executed between them, N≥M≥0, when there is an instruction to be executed that accesses A among the N instructions to be executed, the reordering result satisfies the first preset condition, and the first preset condition is R A , W A The sum of the bit widths corresponding to the M instructions to be executed is less than a first preset bit width threshold.

[0010] S104, executing the target instructions one by one in the memory according to the reordering result to obtain a data processing result, wherein the data processing result includes D2 obtained by rewriting D1.

[0011] Compared with the prior art, the present invention has obvious beneficial effects. By means of the above technical solution, a data processing system for partial writing provided by the present invention can achieve considerable technical advancement and practicality, and has wide industrial utilization value, and has at least the following beneficial effects:

[0012] The present invention provides a data processing system for partial writing, the system comprising: a memory, an instruction queue buffer, a database, a processor and a memory storing a computer program, wherein the database comprises a target atomic operation to be executed and N instructions to be executed, and when the computer program is executed by the processor, the following steps are implemented: splitting the target atomic operation into read instructions R A And write instruction W A , R A , W A and the N to-be-executed instructions are respectively used as target instructions and stored in the instruction queue buffer. In the instruction queue buffer, all target instructions are reordered to obtain a reordering result. In the reordering result, R A In W A Before, and R A and W AThere are M instructions to be executed between them. When there is an instruction to be executed that accesses A among the N instructions to be executed, the reordering result satisfies the first preset condition, and the first preset condition is R A , W A The sum of the bit widths corresponding to the M instructions to be executed is less than a first preset bit width threshold, and according to the reordering result, the target instructions are executed one by one in the memory to obtain a data processing result, and the data processing result includes D2 obtained by rewriting D1.

[0013] It can be seen that the present invention splits the target atomic operation into read instructions and write instructions, so that other instructions to be executed can be inserted between the read instructions and the write instructions without directly switching between the read instructions and the write instructions, thereby reducing the number of read and write instruction switching times, effectively improving memory efficiency, and at the same time constraining the read instruction to be before the write instruction in the reordering result, and constraining the bit width between the read instruction and the write instruction when there is an instruction to access the target address, thereby ensuring data consistency and timeliness of the re-operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0015] Figure 1 A flowchart of a computer program executed by a processor in a partially written data processing system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0017] This embodiment provides a data processing system for partial writing, the system comprising: a memory, an instruction queue buffer, a database, a processor and a memory storing a computer program, wherein the database comprises a target atomic operation to be executed and N instructions to be executed, the target atomic operation comprises a read operation of the original data D1 corresponding to the target address A, a rewrite operation of D1 and an operation of writing the rewritten target data D2 into A, see Figure 1, is a flowchart of a computer program executed by a processor in a partially written data processing system provided by an embodiment of the present invention. When the computer program is executed by the processor, the following steps are implemented:

[0018] S101, splitting the target atomic operation into read instructions R A And write instruction W A , R A is the instruction corresponding to the read operation of the original data D1 corresponding to the target address A, W A This is the instruction corresponding to the operation of writing the rewritten target data D2 into A.

[0019] S102, R A , W A and the N to-be-executed instructions are respectively used as target instructions and stored in the instruction queue buffer.

[0020] S103, reordering all target instructions in the instruction queue buffer to obtain a reordering result, wherein in the reordering result, R A In W A Before, and R A and W A There are M instructions to be executed between them, N≥M≥0, when there is an instruction to be executed that accesses A among the N instructions to be executed, the reordering result satisfies the first preset condition, and the first preset condition is R A , W A The sum of the bit widths corresponding to the M instructions to be executed is less than a first preset bit width threshold.

[0021] S104, executing the target instructions one by one in the memory according to the reordering result to obtain a data processing result, wherein the data processing result includes D2 obtained by rewriting D1.

[0022] Among them, the memory can refer to DRAM. In this embodiment, the memory can be HBM. The instruction queue buffer can be used to temporarily store the instructions that need to be executed. The target atomic operation is the atomic operation formed by reading data, rewriting data, and writing data. The read operation is the read operation of the original data D1 corresponding to the target address A. The rewrite operation can refer to rewriting the target byte of D1. The target byte can refer to the byte that needs to be partially written in D1. The write operation is the operation of writing the rewritten target data D2 to A.

[0023] Specifically, in this embodiment, each target instruction has a corresponding tag to provide information of the corresponding target instruction in the instruction queue buffer, so that the reordering result can meet the preset constraint conditions during the reordering.

[0024] The first constraint satisfied by the reordering result is that in the reordering result, R A In W A Before, thus ensuring that the read and write order of the target atomic operation is met.

[0025] The second constraint satisfied by the reordering result is, R A and W A There are M instructions to be executed between R A and W A M instructions to be executed can be inserted between them, so that after completing R A Afterwards, other instructions to be executed can continue to be executed. Compared with the existing technology, there is no need to directly switch between read instructions and write instructions, which can reduce the number of times the read and write instructions are switched, and effectively improve memory efficiency.

[0026] The third constraint condition satisfied by the reordering result is that when there is an instruction to be executed that accesses A among the N instructions to be executed, the reordering result satisfies the first preset condition, and the first preset condition is R A , W A The sum of the bit widths corresponding to the M instructions to be executed is less than the first preset bit width threshold, that is, when there is an instruction to be executed that accesses A among the instructions to be executed, it means that the rewritten data needs to be operated, so R needs to be completed as soon as possible. A and W A In this embodiment, R A and W A M instructions to be executed are inserted into R A , W A The sum of the bit widths corresponding to the M instructions to be executed can be constrained to constrain R A and W A The execution time is reduced to ensure the timeliness of the re-operation on some written data.

[0027] It should be noted that if there is no pending instruction accessing A among the N pending instructions, M can be any integer in the range of [0, N] so that the reordering result satisfies the memory constraint. The memory constraint may refer to the optimal utilization of the memory communication timing, the shortest overall execution time of all instructions, etc.

[0028] Optionally, the reordering of all target instructions to obtain a reordering result includes:

[0029] All target instructions are reordered according to the communication timing of the memory to obtain a reordering result.

[0030] The goal of the reordering is to optimize the utilization of the AC timing of the memory and satisfy the set constraints.

[0031] Optionally, when there is an instruction to be executed that accesses A among the N instructions to be executed, the reordering result also satisfies a second preset condition, and the second preset condition is that all the instructions to be executed that access A are in W A after.

[0032] The reordering result can also satisfy the fourth constraint condition. When there is an instruction to be executed that accesses A among the N instructions to be executed, the reordering result also satisfies the second preset condition. The second preset condition is that all instructions to be executed that access A are in W. A After that, that is, all pending instructions accessing A cannot be inserted into R A and W A Nor can they be sorted in R A Before, it should be in W A Afterwards, data consistency is guaranteed.

[0033] Optionally, the M instructions to be executed include M1 read instructions to be executed and M2 write instructions to be executed, wherein M1 and M2 satisfy the following conditions: M1+M2=M, M≥M1≥0, M≥M2≥0.

[0034] In the reordering result, M1 pending read instructions are before M2 pending write instructions.

[0035] Among them, since the time consumption of the read and write instruction switching of the memory is relatively long, a batch of read instructions is usually executed in the memory, and then a batch of write instructions are executed, so as to reduce the number of read and write instruction switching times. Therefore, in this embodiment, R A and W A When inserting the pending instructions into the R, the pending instructions are divided into the pending read instructions and the pending write instructions, and the pending read instructions are constrained to be before the pending write instructions. At this time, R A Adjacent to the read instruction to be executed, both are read instructions, W A Adjacent to the write instruction to be executed, both are write instructions.

[0036] Optionally, when there is an instruction to be executed that accesses A among the N instructions to be executed, R A The sum of the bit widths corresponding to the M1 to-be-executed read instructions is less than or equal to the second preset bit width threshold.

[0037] The second preset bit width threshold can be determined based on the total bit width of a batch of read instructions or write instructions in a normal situation, and the constraint R A The sum of the bit widths corresponding to the M1 and M2 read instructions to be executed is less than or equal to the second preset bit width threshold, thereby ensuring that A After the read instruction batch to which it belongs is executed, it can execute the A batches of write instructions.

[0038] Optionally, when there is an instruction to be executed that accesses A among the N instructions to be executed, W A The sum of the bit widths corresponding to the M2 write instructions to be executed is less than or equal to the second preset bit width threshold.

[0039] Among them, the constraint W A The sum of the bit widths corresponding to the M2 and M3 to-be-executed write instructions is less than or equal to the second preset bit width threshold, thereby ensuring that A After the read instruction batch to which it belongs is executed, it can execute the A The write instruction batch can be executed immediately without waiting for the next round of read instruction batches and write instruction batches.

[0040] Optionally, the second preset bit width threshold is set to 32 bits.

[0041] Among them, this embodiment sets the total bit width of a batch of read instructions or write instructions to 32 bits, that is, the second preset bit width threshold is set to 32 bits. The implementer can adjust the second preset bit width threshold according to actual conditions, for example, it can be set to 20 bits.

[0042] Optionally, the first preset bit width threshold is set to 64 bits.

[0043] The first preset bit width threshold may be set to twice the second preset bit width threshold. When the second preset bit width threshold is set to 20 bits, the first preset bit width threshold may be correspondingly set to 40 bits.

[0044] It can be seen that this embodiment splits the target atomic operation into read instructions and write instructions, so that other instructions to be executed can be inserted between the read instructions and the write instructions without directly switching between the read instructions and the write instructions, thereby reducing the number of read and write instruction switches and effectively improving memory efficiency. At the same time, the read instruction is constrained to be before the write instruction in the reordering result, and the bit width between the read instruction and the write instruction is constrained when there is an instruction to access the target address, thereby ensuring data consistency and the timeliness of the re-operation.

[0045] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A data processing system for partial writing, characterized in that The system comprises: a memory, an instruction queue buffer, a database, a processor and a memory storing a computer program, wherein the database comprises a target atomic operation to be executed and N instructions to be executed, the target atomic operation comprises a read operation of original data D1 corresponding to a target address A, a rewrite operation of D1 and an operation of writing the rewritten target data D2 into A, and when the computer program is executed by the processor, the following steps are implemented: S101, splitting the target atomic operation into read instructions R A And write instruction W A , R A is the instruction corresponding to the read operation of the original data D1 corresponding to the target address A, W A The instruction corresponding to the operation of writing the rewritten target data D2 into A; S102, R A , W A and the N to-be-executed instructions are respectively used as target instructions and stored in the instruction queue buffer; S103, reordering all target instructions in the instruction queue buffer to obtain a reordering result, wherein in the reordering result, R A In W A Before, and R A and W A There are M instructions to be executed between them, N≥M≥0, when there is an instruction to be executed that accesses A among the N instructions to be executed, the reordering result satisfies the first preset condition, and the first preset condition is R A , W A and the sum of the bit widths corresponding to the M to-be-executed instructions respectively is less than a first preset bit width threshold, when there is an instruction to be executed accessing A among the N to-be-executed instructions, the reordering result also satisfies a second preset condition, which is that all the to-be-executed instructions accessing A are within W A after; S104, executing the target instructions one by one in the memory according to the reordering result to obtain a data processing result, wherein the data processing result includes D2 obtained by rewriting D1.

2. The data processing system for partial writing according to claim 1, characterized in that The reordering of all target instructions to obtain the reordering result includes: All target instructions are reordered according to the communication timing of the memory to obtain a reordering result.

3. The data processing system for partial writing according to claim 1, characterized in that: The M instructions to be executed include M1 read instructions to be executed and M2 write instructions to be executed, wherein M1 and M2 satisfy the following conditions: M1+M2=M, M≥M1≥0, M≥M2≥0; In the reordering result, the M1 read instructions to be executed are before the M2 write instructions to be executed.

4. The data processing system for partial writing according to claim 3, characterized in that: When there is an instruction to be executed that accesses A among the N instructions to be executed, R A The sum of the bit widths respectively corresponding to the M1 to-be-executed read instructions is less than or equal to a second preset bit width threshold.

5. The data processing system for partial writing according to claim 4, characterized in that: When there is an instruction to access A among the N instructions to be executed, W A The sum of the bit widths corresponding to the M2 write instructions to be executed is less than or equal to the second preset bit width threshold.

6. The data processing system for partial writing according to claim 5, characterized in that: The second preset bit width threshold is set to 32 bits.

7. The data processing system for partial writing according to claim 6, characterized in that: The first preset bit width threshold is set to 64 bits.