A disk-controller linked log writing implementation method and device

By configuring multiple journal mechanisms at the software layer and leveraging the sequential append-write feature of ZNSSSD disks, cyclic append-write of the journal is achieved, solving the performance limitations of traditional journalIO and improving the efficiency and stability of journal writing.

CN115562575BActive Publication Date: 2025-10-03CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211167346.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-23
Publication Date
2025-10-03
Estimated Expiration
2042-09-23

AI Technical Summary

Technical Problem

The traditional journalio write performance depends on the disk's own performance, and the journalio size is much smaller than the minimum disk granularity, resulting in severe write amplification and unable to meet the requirements of high performance and high concurrency.

Method used

Based on the sequential append-write feature of ZNS SSD, at least two journal mechanisms are configured through the software layer. The DRAM cache and power conservation mechanism of the ZNSSSD disk are utilized to implement the cyclic append-write function of the journal, avoiding blocking the foreground IO when the journal is full.

Benefits of technology

Improved journal writing performance, resolved performance fluctuation issues in single-journal and dual-journal modes, and significantly improved journal writing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115562575B_ABST
    Figure CN115562575B_ABST
Patent Text Reader

Abstract

This application discloses a disk-controller-linked log writing implementation method and device, which is applied to the software layer to implement an appended log (journal) mechanism, and is connected to the ZNSSSD disk at the bottom layer. The method includes: configuring at least two journal mechanisms at the software layer, and each journal mechanism corresponds to a data segment (blob) of the ZNSSSD disk; when the foreground IO fills the blob corresponding to any journal mechanism, another journal mechanism based on the at least two journal mechanisms writes the foreground IO to the corresponding blob. The embodiment of the application implements the journal's cyclic append writing function based on the sequential append writing characteristics of the ZNSSSD itself, thereby improving the performance of journal writing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a disk-controller linked log writing implementation method and device. Background Art

[0002] Traditional journaling (writing logs) allocates a fixed linear area on disk, with upper-layer software implementing the journal mechanism. JournalIO uses a round-robin sequential append-write mechanism to convert random host I / O into sequential I / O writes to disk, with each journalIO appending to the end of the data. After data is persisted to the backend disk, the corresponding journal data is discarded, freeing up journal space so that additional writes can resume from the beginning of the journal once the end of the journal is full.

[0003] However, the performance of traditional journalIO writes is completely dependent on the disk's own performance. In addition, in most scenarios, the journalIO size is much smaller than the minimum granularity of the disk, resulting in severe write amplification. This cannot meet the current trend of pursuing high performance and high concurrency. Summary of the Invention

[0004] The embodiments of the present application provide a disk-controller-linked log writing implementation method and device, which implements the journal's cyclic append writing function based on the sequential append writing characteristics of the ZNS SSD itself, thereby improving the journal writing performance.

[0005] The present application provides a disk-controller-linked log writing implementation method, which is applied to the software layer to implement an additional log writing mechanism and is connected to the ZNSSSD disk at the bottom layer, including:

[0006] At least two journal mechanisms are configured at the software layer, and each journal mechanism corresponds to a data segment (blob) of the ZNSSSD disk;

[0007] When the foreground IO has filled up the blob corresponding to any journal mechanism, another journal mechanism based on the at least two journal mechanisms writes the foreground IO into the corresponding blob.

[0008] Optionally, also include:

[0009] After persisting the data of any blob to the backend disk, the data in any blob is flushed to the disk to wait for data writing after the flush.

[0010] Optionally, multiple journal mechanisms are configured at the software layer, and the minimum size of each journal mechanism is close to that of a log.

[0011] Optionally, when the entire journal is flushed, perform a trim operation or a writezero operation on the connected ZNSSSD disk.

[0012] The present application also provides a terminal device that is applied to a software layer to implement a journal appending mechanism and is connected to a ZNSSSD disk at the bottom layer. The terminal device includes a processor configured to:

[0013] At least two journal mechanisms are configured at the software layer, and each journal mechanism corresponds to a data segment (blob) of the ZNSSSD disk;

[0014] When the foreground IO has filled up the blob corresponding to any journal mechanism, another journal mechanism based on the at least two journal mechanisms writes the foreground IO into the corresponding blob.

[0015] Optionally, after persisting the data of any blob to the backend disk, the processor is further configured to: flush the data in any blob to the disk, and wait for data writing after the flush.

[0016] Optionally, multiple journal mechanisms are configured at the software layer, and the minimum size of each journal mechanism is close to that of a log.

[0017] Optionally, in the case of a journal disk flush, the processor is further configured to perform a trim operation or a writezero operation on the connected ZNSSSD disk.

[0018] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the aforementioned disk-controller linkage log writing implementation method are implemented.

[0019] The embodiment of the present application implements the journal's cyclic append-write function based on the sequential append-write feature of the ZNSSSD itself, thereby improving the journal writing performance.

[0020] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present application. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0022] Figure 1 This is an example of a double journal mode cyclic append writing method for implementing a log writing method according to an embodiment of the present application;

[0023] Figure 2 This is an example of optimizing the dual-journal mode to the multi-journal mode of the log writing implementation method in the embodiment of the present application. DETAILED DESCRIPTION

[0024] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0025] Currently, the blob corresponding to the ZNSSSD journal does not support partial discard functions and does not support overwrite. It is impossible to implement cyclic appending of a single blob. When the journal area is full, the foreground IO needs to be blocked. After the data corresponding to the journal is persisted to the backend disk, the discard function is executed to successfully erase the data on the journal before the foreground IO write can continue to process.

[0026] The present application provides a disk-controller-linked log writing implementation method, which is applied to the software layer to implement an additional log writing mechanism and is connected to the ZNSSSD disk at the bottom layer, including:

[0027] At least two journal mechanisms are configured at the software layer, and any one of the journal mechanisms corresponds to a data segment (blob) of the ZNSSSD disk. ZNSSSD itself has a sequential write feature, and based on the DRAM cache and power conservation mechanism inside the ZNSSSD disk, it provides a high-performance, small-granularity journal function that can ensure data persistence. The method of the present application utilizes the inherent characteristics of the ZNSSSD disk to achieve the high-performance requirements of the journal. The upper software layer implements the journal's append-write mechanism, and the bottom layer is connected to the ZNSSSD disk. The high-performance journalio is implemented by the ZNSSSD internal DRAM cache, and the power conservation mechanism meets the journal data persistence requirements.

[0028] When the foreground IO fills up the blob corresponding to any journal mechanism, another journal mechanism based on the at least two journal mechanisms writes the foreground IO into the corresponding blob. In some embodiments, it also includes: after persisting the data of any blob to the backend disk, flushing the data in any blob to wait for data writing after flushing. Figure 1 As shown in the figure, after blob1 is full, the foreground IO can be written to blob2, so as not to block the foreground IO. During the process of persisting data to the backend disk and discarding blob1, the foreground IO can continue to write blob2, and a double journal mechanism is used to implement cyclic append writing.

[0029] In some application scenarios, if the dirty data corresponding to journal1 is not flushed to disk in time and the business pressure is relatively high, journal2 may be quickly filled up. At this time, the foreground IO will be suspended, resulting in performance troughs. In some embodiments, multiple journal mechanisms are configured at the software layer, and the minimum size of each journal mechanism is close to a log entry. Figure 2 As shown, multiple journal mechanisms can be configured at the software level, with each journal mechanism corresponding to a blob on the ZNSSSD disk. Ideally, each journal mechanism is approximately the size of a single entry, resulting in a similar effect to a single journal append-only write scenario. The specific journal mechanism size can be set based on actual needs and is not specified here.

[0030] In some embodiments, when the entire journal is flushed, a trim or writezero operation is performed on the connected ZNS SSD disk. The dual-journal and multi-journal modes in this example also apply to standard SSDs, NVMe, and other disk types. When the entire journal is discarded, a trim or writezero operation can be performed on the connected disk to improve the next write performance.

[0031] The performance of traditional journal writing to NVMe is limited by the performance of NVMe itself. In a single concurrent scenario, the latency of writing to NVMe bare disk is greater than 10us. However, the ZNSSSD high-performance journal using the method of this application uses approximately 1.5us for scenarios with less than 2KB of data, significantly improving journal writing performance.

[0032] The method of the embodiment of the present application implements the journal's cyclic append-write function by leveraging the sequential append-write feature of the ZNSSSD itself, thereby improving the journal write performance and solving the performance fluctuation problem of the single journal and dual journal modes.

[0033] The present application also provides a terminal device that is applied to a software layer to implement a journal appending mechanism and is connected to a ZNSSSD disk at the bottom layer. The terminal device includes a processor configured to:

[0034] At least two journal mechanisms are configured at the software layer, and each journal mechanism corresponds to a data segment (blob) of the ZNSSSD disk;

[0035] When the foreground IO has filled up the blob corresponding to any journal mechanism, another journal mechanism based on the at least two journal mechanisms writes the foreground IO into the corresponding blob.

[0036] In some embodiments, after persisting the data of any blob to the backend disk, the processor is further configured to: flush the data in any blob to the disk, and wait for data writing after the flush.

[0037] In some embodiments, multiple journal mechanisms are configured at the software layer, and the minimum size of each journal mechanism is close to that of a log.

[0038] In some embodiments, when the entire journal is flushed, the processor is further configured to perform a trim operation or a writezero operation on the docked ZNSSSD disk.

[0039] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the aforementioned disk-controller linkage log writing implementation method are implemented.

[0040] The device of the embodiment of the present application can implement the journal's cyclic append-write function based on the sequential append-write feature of the ZNSSSD itself, thereby improving the journal writing performance.

[0041] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0042] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0043] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server or network device, etc.) to execute the methods described in each embodiment of the present application.

[0044] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are protected by this application.

Claims

1. A log writing method for disk-controller linkage, characterized in that: Applied to the software layer to implement the journal appending mechanism, the underlying layer is connected to the ZNS SSD disk, including: At least two journal mechanisms are configured at the software layer, and each journal mechanism corresponds to a data segment blob of the ZNS SSD disk; When the foreground IO fills up the blob corresponding to any journal mechanism, another journal mechanism based on the at least two journal mechanisms writes the foreground IO into the corresponding blob; Also includes: After persisting the data of any blob to the backend disk, flush the data in any blob to the disk, and wait for data to be written after the flush; Configure multiple journal mechanisms at the software layer, and the minimum size of each journal mechanism is close to that of a log.

2. The disk-controller-linked log writing method according to claim 1, wherein: When the journal is flushed as a whole, the connected ZNS SSD disk will be trimmed or written to zero.

3. A terminal device, characterized in that: Applied to the software layer to implement the journal appending mechanism, the bottom layer is connected to the ZNS SSD disk, and the terminal device includes a processor configured as follows: At least two journal mechanisms are configured at the software layer, and each journal mechanism corresponds to a data segment blob of the ZNS SSD disk; When the foreground IO fills up the blob corresponding to any journal mechanism, another journal mechanism based on the at least two journal mechanisms writes the foreground IO into the corresponding blob; After persisting the data of any blob to the backend disk, the processor is further configured to: flush the data in any blob to the disk, and wait for data to be written after the flush; Configure multiple journal mechanisms at the software layer, and the minimum size of each journal mechanism is close to that of a log.

4. The terminal device according to claim 3, wherein: In the case of a journal disk flush, the processor is further configured to perform a trim operation or a write zero operation on the connected ZNS SSD disk.

5. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the disk-controller linkage log writing method according to claim 1 or 2 are implemented.

Citation Information

Patent Citations

  • Moving change log table to align with partition

    CN114730290A