STORAGE DEVICE, CACHE MEMORY WRITE PROGRAM, AND WRITE METHOD

By generating a new cache page and linking it with the existing page for non-continuous write commands, the storage device addresses performance degradation issues, ensuring efficient cache memory storage and reduced risk of interruptions.

JP7663192B2Active Publication Date: 2025-04-16NEC PLATFROMS LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2021034764
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-03-04
Publication Date
2025-04-16
Estimated Expiration
2041-03-04

AI Technical Summary

Technical Problem

Existing storage devices employing a write-back cache method experience performance degradation due to the need to read data from the disk to fill gaps between valid and unwritten data ranges, especially when handling non-continuous write commands or interruptions.

Method used

A storage device that generates a new cache page when a write command is issued for a non-continuous area, linking this new page with the existing cache page, thereby avoiding the need to read data from the disk to fill gaps and reducing the likelihood of performance degradation.

Benefits of technology

This approach allows for efficient storage in cache memory, suppressing performance degradation by eliminating the need for disk reads to fill gaps and reducing the complexity of handling write interruptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007663192000001
    Figure 0007663192000001
  • Figure 0007663192000002
    Figure 0007663192000002
  • Figure 0007663192000003
    Figure 0007663192000003
Patent Text Reader

Abstract

To prevent performance degradation associated with processing to be prepared for writing interruption in cache memory control.SOLUTION: A storage device adopting a write-back cache method that manages a cache memory as a fixed length cache page includes: a command control unit 2 that supplies a write command for writing data to an area that is not continuous with a valid data range of a first cache page already stored in a cache memory 1 or overlaps with an unwritten data range of the first cache page; and a cache control unit 3 that, when the write command is supplied from the command control unit 2, generates a new second cache page, links it with the first cache page, and manages it.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a storage device, a cache memory write program, and a cache memory write method. [Background technology]

[0002] Patent Document 1 related to the present invention describes a storage device that employs a write-back cache method. In this storage device, a fixed-length cache that manages the size of data stored in a cache memory at a fixed length has one valid data storage range and one unwritten data storage range that has not been written to a disk for each cache page. The valid data storage range includes all unwritten data ranges, and the valid data storage range that is not the unwritten data range is a valid data range that has been written to a disk.

[0003] For this reason, when a write command is requested for a range that is not contiguous with an existing unwritten data range, before storing the data in the cache page, data is read from the disk between the existing unwritten data range and the data storage range requested by the write command and stored in the cache page, thereby expanding the valid data storage range, and then the data from the write command is written to the cache page, and the newly written data range from the existing unwritten data range is treated as a single unwritten data range.

[0004] With this method, performance degrades because data must be read from disk to fill the gap between the existing valid data range and the requested range while the write command is being processed; if multiple write commands with small data sizes less than the storage size of the cache page are issued sequentially, the storage order of the cache pages may change due to multiple processing on the storage device side, and after a read process from disk to fill the gap occurs, a write command to the filled range may be processed. [Prior art documents] [Patent documents]

[0005] [Patent Document 1] JP 2003-196032 A Summary of the Invention [Problem to be solved by the invention]

[0006] When this method is used, the unwritten data range is overwritten in terms of cache page management, and if the host that requested the write command during this write is interrupted by rebooting, etc., it is not possible to expect a retry of the write command from the host, so depending on the host, it is necessary to either destructively write the range being written so that it is clear that it is invalid data, or to evacuate the existing unwritten data range before writing to the cache page in preparation for the interruption of the data write, and to restore the evacuated data in the event of a write failure. This can result in a decrease in performance, as there is a possibility that data will be read from the disk to fill in the gaps during write command processing, or that the data in the unwritten data range will be evacuated.

[0007] This hole-filling process can occur not only when multiple sequential write commands are executed, but also when the cluster size (allocation unit size) of the host file system and the cache page size are not an integer multiple, or when there are frequent writes to the same or nearby area.

[0008] Alternatively, there is a method in which the existing unwritten data range is written to disk to become an invalid data range before storing the data in the cache page, and then the data requested by the write command is stored. This method incurs performance degradation because existing unwritten data must be flushed to disk while the write command is being processed.

[0009] An object of the present invention is to provide a storage device that suppresses performance degradation due to processing for saving data in preparation for interruption of writing. [Means for solving the problem]

[0010] In order to solve the above problems, a storage device according to a first aspect of the present invention proposes the following means. A storage device employs a write-back cache method that manages a cache memory as a fixed-length cache page, and includes a command control unit that supplies a write command for writing data to an area that is not contiguous with a valid data range of a first cache page already stored in the cache memory or that overlaps with an unwritten data range of the first cache page, and a cache control unit that generates a new second cache page and manages it in link with the first cache page when a write command is supplied from this command control unit.

[0011] The cache memory write method according to the second aspect of the present invention proposes the following means. A method for writing to a cache memory of a storage device using a write-back cache method that manages the cache memory as a fixed-length cache page, the method comprising the steps of: supplying a write command for writing data to an area that is not contiguous with a valid data range of a first cache page already stored in the cache memory or that overlaps with an unwritten data range of the first cache page; and, when this write command is supplied, generating a new second cache page and managing it in link with the first cache page. Effect of the Invention

[0012] In the present invention, data can be efficiently stored in the cache memory, making it possible to suppress a decrease in performance. [Brief description of the drawings]

[0013] [Figure 1]FIG. 1 is a block diagram showing a minimum configuration example of the present invention. [Diagram 2] FIG. 1 is a block diagram of one embodiment of the present invention. [Diagram 3] 11 is a schematic diagram showing the relationship between a valid data range and an unwritten data range when data is written to a first cache page in an embodiment. FIG. [Figure 4] 11A and 11B are schematic diagrams illustrating memory write states when data is written to first and second cache pages in one embodiment. [Diagram 5] FIG. 5 is a schematic diagram showing a write state in which a third cache page is further received from the state of FIG. 4 and storage data is written to the third cache page. [Figure 6] 6 is a schematic diagram showing a memory write state in which stored data is further written to a third cache page from the state shown in FIG. 5; FIG. [Figure 7] FIG. 7 is a schematic diagram showing a write state in which the listening data in the second cache page is written to the third cache page from the state of FIG. 6 . [Figure 8] 8 is a schematic diagram showing the arrangement of unwritten data and written data in the first cache page before the stored data is written, after FIG. 7; FIG. [Figure 9] 9 is a schematic diagram showing the arrangement of unwritten data, stored data, and written data in the first cache page of FIG. 8 after the stored data has been written. [Figure 10] 10 is a schematic diagram showing a state before the stored data is written to a second cache page, following the state shown in FIG. 9; FIG. [Figure 11] 11 is a schematic diagram showing a state in which unwritten data is moved from a first cache page to a second cache page in FIG. 10; FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014] An example of a minimum configuration of the present invention will be described with reference to FIG. This storage device employs a write-back cache method that manages the cache memory as fixed-length cache pages, and has a command control unit 2 that supplies a write command for writing data to an area that is not contiguous with the valid data range of a first cache page already stored in the cache memory 1 or that overlaps with an unwritten data range of the first cache page, and a cache control unit 3 that, when a write command is supplied from this command control unit 2, generates a new second cache page and manages it in link with the first cache page.

[0015] According to the above configuration, when a write command with a size smaller than the data storage size of a fixed-length cache page is issued, the read process from the disk due to hole filling and the cache page This makes it unnecessary to perform the process of saving old data during the processing of a write command in preparation for a write interruption due to a reboot or the like in the middle of writing to the hard disk, thereby making it possible to prevent a decrease in performance.

[0016] Furthermore, a method according to a minimum configuration example of the present invention is a method for writing data to a cache memory of a storage device using a write-back cache method that manages the cache memory as a fixed-length cache page, and includes the steps of: supplying a write command for writing data to an area that is not contiguous with the valid data range of a first cache page already stored in the cache memory or that overlaps with an unwritten data range of the first cache page; and, when this write command is supplied, generating a new second cache page and managing it in link with the first cache page.

[0017] According to the above configuration, it is no longer necessary to perform read processing from disk to fill holes, which may occur when a write command of a size smaller than the data storage size of a fixed-length cache page is issued, or to perform processing to evacuate old data in preparation for a write being interrupted due to a reboot or the like while writing to the cache page, during the processing of the write command, thereby preventing a degradation in performance.

[0018] A configuration according to one embodiment of the present invention that embodies FIG. 1 will be described with reference to FIGS. FIG. 2 shows a storage device according to an embodiment of the present invention. The storage device 101 receives a command to process a command requested by the host device 100. Control Unit The system includes a cache memory 103 for storing data, a cache control unit 102 for managing the cache memory 104 for each fixed-length area, and a disk 105 which is a storage medium configured by a disk array or a hard disk.

[0019] The host device 100 outputs a write command for writing data to the storage device 101. When the storage device 101 receives this write command, the command control unit 103 that processes the write command requests a cache page for storing data from the cache control unit 102 that manages the cache memory 104 in fixed length. That is, the cache control unit 102 divides the cache memory 104 into fixed-length sizes and manages each as a cache page, and these cache pages have either an unused state or a state in which data is virtually assigned to a logical address and stored, and within the range of stored data, there is a range of valid data and a state in which the data has not been written to the disk 105 that is its element. TaTherefore, the cache control unit 102 can release the allocated cache page and make it unused only when there is no unwritten area in the disk 105. Under such conditions, the cache control unit 102 gives the command control unit 103 the right to write data to the memory area corresponding to the cache page, or receives the right back. If existing data exists in the cache page received from the cache control unit 102, the command control unit 103 again requests a new cache page from the cache control unit 102, links it to the existing cache page, and stores the data of the write command issued by the host device 100 in the new cache page. After storing this data, the command control unit 103 returns the cache page to the cache control unit 102, and the cache control unit 102 promotes, in the background, the integration of data in the linked cache page or writing to the disk 105.

[0020] The operation of the storage device configured as above will be described together with a cache memory writing method and program with reference to FIGS. 3, in a (first) cache page 200 of a fixed length (of a predetermined data size), the storage status of data within the page is managed by a valid data range 202 (the range indicated by the arrow 202) and an unwritten data range (the range indicated by the arrow with reference symbol 203) indicating the range of unwritten data 201 that has not been written to the disk 105. The unwritten data range 203 is included in a part of the valid data range 202. Data written to a range other than the unwritten data range 203 in the valid data range 202 becomes written data 205 that has already been written to the disk. Therefore, no valid data is stored in the range other than the valid data range 202 of the cache page 200.

[0021] 4, the command control unit 103 of the storage device 101 that has received a write command requested by the host device 100 requests a cache page for storing data from the cache control unit 102, and receives a (first) cache page 300. At this time, in the first cache page 300, a valid data range 302 and an unwritten data range 303 match, and unwritten data 301 exists in this range. Here, if the stored data 304 requested by the write command is not in a continuous range with the unwritten data 301, the command control unit 103 requests a new cache page from the cache control unit 102, receives a (second) cache page 305, links the (first) cache page 300 and the (second) cache page 305 via a link 309, and notifies the cache control unit 102 of the linking. The command control unit 103 stores the stored data 304 in the unwritten data 308 of the newly received (second) cache page 305, and returns the (first) cache page 300 and the (second) cache page 305 to the cache control unit 102.

[0022] As shown in FIG. 5, when the stored data 404 is requested by another write command to the same (first) cache page 400, the command control unit 103 requests an additional cache page from the cache control unit 102. The (first) cache page 400 receives the (second) cache page 405 linked via the cache page 400 and the link 409. The command control unit 103 requests a new (third) cache page 410 from the cache control unit 102 because the stored data 404 is not continuous with the unwritten data 401 stored in the valid data range 402 and the unwritten data range 403 of the (first) cache page 400, nor with the unwritten data 408 stored in the cache page 405, and links the existing (first) cache page 400 and (second) cache page 405 with the new (third) cache page 410 via the link 409, and notifies the cache control unit 102. The stored data 404 is stored in the unwritten data 413 of the new (third) cache page 410, and the (first) cache page 400, the (second) cache page 405, and the (third) cache page 410 are returned to the cache control unit 102.

[0023] 5, and further, as shown in Fig. 6, when unwritten data 501 is stored in a valid data range 502 and an unwritten data range 503 of a (first) cache page 500, and unwritten data 508 is written in a valid data range 506 and an unwritten data range 507 of a (second) cache page, if storage data 504 is requested to the (first) cache page 500 by another write command, the command control unit 103 requests a cache page from the cache control unit 102. In response to this request, the (first) cache page 500 and the (second) cache page 505 and (third) cache page 510 linked thereto via a link 509 are received. Since the stored data 504 does not overlap with the unwritten data 508 of the (second) cache page 505, and does not overlap with the unwritten data 513 of the third (third) cache page 510, and is a continuous range, the command control unit 103 stores the stored data 504 in the unwritten data 514 of the (third) cache page 510, combines the unwritten data 513 and the unwritten data 514 as the valid data range 511 and the unwritten data range 512, and returns the (second) cache page 505 and the (third) cache page 510, which are linked to the (first) cache page 500 via the link 509, to the cache control unit 102.

[0024] At this time, as shown in FIG. 7, in a state in which unwritten data 601 is stored in the valid data range 602 and the unwritten data range 603 of the (first) cache page 600, the cache control unit 102, which has received the (second) cache page 605 and the (third) cache page 610 linked to the (first) cache page 600 by a link 609, checks the unwritten data range or the valid data range of each cache page in the background. In the example of FIG. 7, since the unwritten data 608 of the (first) cache page 605 and the unwritten data 613 of the (third) cache page 610 are continuous ranges that do not overlap, the unwritten data 608 of the (second) cache page 605 is copied to the unwritten data 614 of the (third) cache page 610, and the unwritten data 613 and the unwritten data 614 are combined to form the valid data range 611 and the unwritten data range 612. The (first) cache page 605 is removed from the link via the link 609 and made into an unused cache page, and the (third) cache page 610 linked to the (first) cache page 600 via the link 609 is retained.

[0025] In this process, data is not written by overwriting an unwritten data range of the cache page, so if the write is interrupted midway, the process does not consider that range to be an unwritten data range or a valid data range.

[0026] In the (first) cache page 700 shown in FIG. 8, the storage status of data in the page is managed by a valid data range 702 (the range indicated by the arrow 702 in FIG. 8) and an unwritten data range 703 indicating the range of data 701 not yet written to the disk 105, and data in the valid data range 702 other than the unwritten data range 703 (the range indicated by the arrow 703 in FIG. 8) is data 705 written to the disk. When stored data 704 is requested by a write command to the written data 705 of the cache page 700, the data of the unwritten data 701 is not overwritten, so that the data is written directly to the cache page 700. At this time, if the write ranges of the unwritten data 701 and the stored data 704 are not continuous, the data sandwiched between the unwritten data 701 and the stored data 704 among the written data 705 is also managed as unwritten data. As a result, as shown in FIG. 9, the written data is included in the unwritten data range 803 of the cache page 800, and becomes unwritten data 801.

[0027] 10, when a write command is issued to overwrite stored data 904 onto unwritten data 901, the command control unit 103 requests a new cache page from the cache control unit 102, receives a (second) cache page 905, and links the (first) cache page 900 and the new (second) cache page 905 via a link 909, and notifies the cache control unit 102. The stored data 904 is written to the new (second) cache page 905 as unwritten data 908. The (second) cache page 905 linked to the (first) cache page 900 via the link 909 is returned to the cache control unit 102.

[0028] At this time, as shown in FIG. 11, when the (second) cache page 1005 linked to the (first) cache page 1000 via link 1009 is returned, the cache control unit 102 checks the unwritten data range or valid data range of each cache page in the background, copies data from the unwritten data 1001 of the (first) cache page 1000 that does not overlap with the unwritten data 1008 of the (second) cache page 1005 to the unwritten data 1011 and the unwritten data 1012, and combines this with the unwritten data 1008 to form the unwritten data range 1007. Furthermore, written data 1010 of the (first) cache page 1000 is also copied to written data 1013 of the (second) cache page 1005, and the ranges of unwritten data 1008, unwritten data 1011, unwritten data 1012, and written data 1013 are combined to form a valid data range 1006 (the range indicated by arrow 1006 in FIG. 11), and the (first) cache page 10000 is removed from the link via link 1009, made into an unused cache page, and the (second) cache page 1005 is retained.

[0029] The above write process prevents the read process from disk to fill holes that may occur when write commands of a size smaller than the data storage size of a cache page managed by a fixed-length cache are issued sequentially and multiple times from the host, and the process of evacuation of old data before writing in preparation for an interruption of writing due to a host reboot or other reason while writing to the cache page, which is likely to occur during write command processing, thereby preventing performance degradation.

[0030] Variations of an embodiment (1) The command control unit 103 of the storage device 101, which has received a write command requested by the host device 100, requests a cache page for storing data from the cache control unit 102. In the example of Fig. 4, when unwritten data 301 that is not consecutive with the stored data 304 exists in the received (first) cache page 300, the command control unit 103 requests a new cache page from the cache control unit 102. However, when the command control unit 103 requests a cache page from the cache control unit 102 together with the range of the stored data 304, the cache control unit 102 may confirm the non-continuity between the stored data 304 and the unwritten data 301 of the (first) cache page 300, secure a new (second) cache page 305, link it with the new (second) cache page 305 by a link 309, and then pass only the (second) cache page 305 to the command control unit 103.

[0031] (2) In the example of FIG. 7, the cache control unit 102 receives the (second) cache page 605 and the (third) cache page 610 linked to the (first) cache page 600 by the link 609 from the command control unit 103, and checks the unwritten data range or valid data range of each cache page in the background to integrate the data of the cache pages. However, if there is a request for a cache page from the command control unit 103 by another write command waiting for the right to use the (first) cache page 600 at this time, the cache control unit 102 may perform a process of passing the (first) cache page 600 to the command control unit 103 without integrating the cache pages, or may perform a transfer by DMA (Direct Memory Access) used for a copy process for integrating the cache pages, or may select not to integrate the cache pages if the utilization rate of the CPU (Central Processing Unit) is high, or may perform a write back to the disk 105 instead of integrating the cache pages if the utilization rate of the disk 105, which writes out data, is low.

[0032] As described above, in one embodiment, when a write command is requested from the host to a range that is not contiguous with the valid data range of an existing (first) cache page or overlaps with an unwritten data range, a new (second) cache page is requested before storing the data in the cache page, and this new cache page is linked to the existing cache page, and data by the write command is stored in the new cache page. For subsequent write commands, if there is no contiguous valid data range in the existing cache page and the cache page linked to it, or if there is a range that overlaps with the unwritten data range, the new cache page is used, and if there is a contiguous valid data range in the existing cache page or the linked cache page and does not overlap with the unwritten data range, the data is stored in that cache page. Furthermore, if data storage is interrupted due to a reboot of the host while data is being stored in the cache page, the range may be set as an invalid range.

[0033] Furthermore, in this process, the number of cache pages in use temporarily increases, but if there are no other write commands waiting for the right to use the cache page when the cache page is released after data has been written to the cache page during the processing of a write command, this can be avoided by integrating the linked cache pages into one cache page by accelerating writing to the disk in the background depending on the disk load and the storage range of the data for each linked cache page, or by performing a copy process on the linked cache pages, thereby reducing the number of cache pages in use.

[0034] Although an embodiment of the present invention has been described in detail above with reference to the drawings, the specific configuration is not limited to this embodiment, and design modifications and the like are also included within the scope of the present invention that does not deviate from the gist of the present invention. [Industrial Applicability]

[0035] The present invention relates to a storage device, a cache memory write program, and a write method. [Explanation of symbols]

[0036] 100...Host device 101...Storage device 102...Cache control unit 103...Command control unit 104…Cache memory 105…Disc 201, 301, 401, 308, 408, 413, 508, 513, 514, 608, 613, 614, 701, 703, 801, 901, 1001, 1008, 1011, 1012...Unwritten data 202, 302, 306, 402, 406, 411, 502, 506, 511, 602, 611, 702, 802, 902, 906, 1006...Valid data range 203, 303, 403, 407, 412, 503, 507, 512, 603, 612, 703, 803, 903, 907, 1007...Unwritten data range 205…Written data 304, 404, 504, 704, 904...Stored data 200, 300, 400, 500, 600, 700, 800, 900, 1000...(first) cache pages 305, 405, 505, 605, 705, 805, 905, 1005...(second) cache pages 410, 510, 610...(third) cache pages

Claims

1. In a storage device that employs a write-back cache method in which a cache memory is managed as a fixed-length cache page, a command control unit that supplies a write command for writing data to a first cache page already stored in the cache memory; a cache control unit which, when a write command is supplied from this command control unit, if the write command indicates writing of data to an area not contiguous with an unwritten data range of the first cache page, or indicates writing of data to an area overlapping an unwritten data range indicating data written to the first cache page that has not been written to a disk, generates a new second cache page, links it to the first cache page and manages it, and writes storage data included in the write command to an area of ​​the second cache page designated by the write command; A storage device having the above configuration.

2. After generating the first cache page, the cache control unit stores the storage data included in the write command in the second cache page when the write range indicated by the storage data included in the write command is not contiguous with the unwritten data range or the data in the range overlaps with the unwritten data range, and stores the storage data included in the write command in the first cache page when the write range indicated by the storage data included in the write command is not contiguous with the unwritten data range or the data does not overlap with the unwritten data range. The storage device according to claim 1.

3. when the command control unit further requests writing of other stored data by a write command, if the write range indicated by the other stored data is not continuous with either of the ranges of unwritten data stored in the first and second cache pages, or if the command control unit indicates writing of data to an area overlapping an unwritten data range indicating data that has not been written to a disk among data written to the first and second cache pages, the command control unit requests a third cache page, and the cache control unit writes the other stored data to an area of ​​the third cache page indicated by the write command. The storage device according to claim 2.

4. A computer of a storage device that employs a write-back cache method that manages a cache memory as a fixed-length cache page, command control means for providing a write command for writing data to a first cache page already stored in the cache memory; a cache control means for generating a new second cache page, linking it with the first cache page and managing it, and writing storage data included in the write command to an area of ​​the second cache page designated by the write command, when the write command indicates writing of data to an area not contiguous with an unwritten data range of the first cache page, or when the write command indicates writing of data to an area overlapping an unwritten data range indicating data written to the first cache page that has not been written to a disk; A cache memory writing program that acts as a

5. A method for writing data to a cache memory of a storage device using a write-back cache method that manages the cache memory as a fixed-length cache page, comprising: providing a write command to write data to a first cache page already stored in the cache memory; a step of generating a new second cache page, linking it with the first cache page and managing it, and writing storage data included in the write command to an area of ​​the second cache page designated by the write command when the write command indicates writing of data to an area not contiguous with an unwritten data range of the first cache page, or indicates writing of data to an area overlapping an unwritten data range indicating data written to the first cache page that has not been written to a disk; A cache memory write method comprising:

Citation Information

Patent Citations

  • Write cache control method of storage device, and storage device

    JP2003196032A

  • Memory controller, memory device and control method for memory controller

    JP2006092169A

  • Storage device, control method thereof, and program

    JP2006163474A

  • Cache memory device, its cache management method, program for cache management

    JP2008234532A

  • Memory control device and method therefor, data management device and method therefor, and program

    JP2013050880A