Method and system for managing cache devices in a storage system
By determining and updating priorities for cache device queues and flushing data pages when conditions are met, the problem of data priority scheduling in cache devices is solved, thereby improving the response efficiency of the storage system.
Patent Information
- Application Number
- CN202111280698.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2016-12-21
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2036-12-21
AI Technical Summary
Existing technologies struggle to effectively differentiate data priorities and rationally schedule storage pages within caching devices, resulting in prolonged storage system response times.
By prioritizing queues in the cache device and updating the priorities in rounds according to predetermined conditions and update rules, data pages are flushed to the storage device when the priority conditions are met, and the LRU standard is used to select the target page for flushing.
It enables more efficient management of cache devices, prioritizes the allocation of storage pages for important data, and reduces the response time of the storage system.
Smart Images

Figure CN114036078B_ABST
Abstract
Description
[0001] This application is a divisional application of the application with the application number 201611193465.9, the application date of December 21, 2016, and the title of "Method and system for managing cache device in storage system". TECHNICAL FIELD
[0002] Embodiments of the present application relate to storage management, and more particularly, to a method and system for managing cache device in a storage system. BACKGROUND
[0003] With the development of data storage technology, various data storage devices have been able to provide users with increasingly high data storage capabilities, and the data access speed has also been greatly improved. While improving the data storage capability, users have also put forward higher and higher demands for data reliability and response time of the storage system.
[0004] At present, a technical solution has been developed to establish a storage system based on multiple levels of storage media with different access speeds. For example, frequently used data can be loaded from a storage device with lower access speed to a cache device with higher access speed, and then the cache device responds to access requests from outside the storage system. This technical solution can improve data response efficiency to some extent. However, since the cache device itself has a space limitation, only important data can be loaded into it. Therefore, how to distinguish the priority of data and how to allocate more storage pages in the cache device for data with higher priority and reasonably schedule data pages in the cache device have become a focus. SUMMARY
[0005] Therefore, it is desirable to develop and implement a technical solution that can manage cache devices in a more flexible manner to reduce the response time of the storage system and thus improve the access performance of the storage system. It is desirable that the technical solution can be compatible with the existing storage system, and can manage the storage area in the storage system with higher efficiency without the need to add additional hardware devices to the existing storage system.
[0006] In an embodiment of the present application, a method for managing a cache device in a storage system is provided, comprising: determining a first priority for a first queue included in the cache device, the first queue including at least one data page associated with a first storage device in the storage system; in at least one round, in response to the first priority not satisfying a first predetermined condition, updating the first priority according to a first updating rule, the first updating rule causing the updated first priority to be closer to the first predetermined condition than the first priority; and in response to the first priority satisfying the first predetermined condition, flushing data in the data pages in the first queue to the first storage device.
[0007] In one embodiment of the present application, a system for managing a cache device in a storage system is provided, comprising: one or more processors; a memory coupled to at least one of the one or more processors; computer program instructions stored in the memory that, when executed by the at least one processor, cause the device to perform a method for managing a storage system, the method comprising: determining a first priority for a first queue included in the cache device, the first queue comprising at least one data page associated with a first storage device in the storage system; in at least one round, in response to the first priority not satisfying a first predetermined condition, updating the first priority according to a first updating rule, the first updating rule causing the updated first priority to be closer to the first predetermined condition than the first priority; and in response to the first priority satisfying the first predetermined condition, flushing data in the data page in the first queue to the first storage device.
[0008] In one embodiment of the present application, a device for managing a cache device in a storage system is provided, comprising: a determining module configured to determine a first priority for a first queue included in the cache device, the first queue comprising at least one data page associated with a first storage device in the storage system; an updating module configured to, in at least one round, in response to the first priority not satisfying a first predetermined condition, update the first priority according to a first updating rule, the first updating rule causing the updated first priority to be closer to the first predetermined condition than the first priority; and a flushing module configured to, in response to the first priority satisfying the first predetermined condition, flush data in the data page in the first queue to the first storage device.
[0009] With the technical solution of the present application, more important data can be allocated storage pages in the cache device in priority, data pages in the cache device can be reasonably scheduled, and the storage system can be managed with higher efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0010] The features, advantages, and other aspects of the embodiments of the present application will become more apparent from the following detailed description in conjunction with the accompanying drawings, in which a number of embodiments of the present application are illustrated, by way of example, and not limitation. In the drawings:
[0011] Figure 1 A block diagram schematically illustrates an exemplary computing system suitable for implementing embodiments of the present application;
[0012] Figure 2 A block diagram schematically illustrates an exemplary computing system suitable for implementing embodiments of the present application;
[0013] Figure 3a block diagram illustrating a scheme for managing cache devices in a storage system according to an embodiment of the application;
[0014] Figure 4 a flowchart illustrating a method for managing cache devices in a storage system according to an embodiment of the application;
[0015] Figure 5 a block diagram illustrating a queue for managing cache devices in a storage system according to an embodiment of the application;
[0016] Figure 6A , 6B and 6C respectively illustrate a block diagram of different stages for managing cache devices in a storage system according to an embodiment of the application;
[0017] Figure 7 a block diagram illustrating a scheme for managing cache devices in a storage system according to an embodiment of the application;
[0018] Figure 8A and Figure 8B respectively illustrate a block diagram of an application environment in which an embodiment according to the application can be implemented; and
[0019] Figure 9 a block diagram illustrating a device for managing cache devices in a storage system according to an embodiment of the application. DETAILED DESCRIPTION
[0020] Preferred embodiments of the present disclosure will be described herein below with reference to the accompanying drawings. While preferred embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms without being limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.
[0021] Figure 1 a block diagram of an exemplary computing system 100 suitable for implementing an embodiment of the present application is shown. As Figure 1As shown, the computer system 100 can include a CPU (Central Processing Unit) 101, a RAM (Random Access Memory) 102, a ROM (Read Only Memory) 103, a system bus 104, a hard disk controller 105, a keyboard controller 106, a serial interface controller 107, a parallel interface controller 108, a display controller 109, a hard disk 110, a keyboard 111, a serial external device 112, a parallel external device 113, and a touch screen display 114. Of these devices, the CPU 101, the RAM 102, the ROM 103, the hard disk controller 105, the keyboard controller 106, the serial controller 107, the parallel controller 108, and the display controller 109 are coupled to the system bus 104. The hard disk 110 is coupled to the hard disk controller 105, the keyboard 111 is coupled to the keyboard controller 106, the serial external device 112 is coupled to the serial interface controller 107, the parallel external device 113 is coupled to the parallel interface controller 108, and the touch screen display 114 is coupled to the display controller 109. It will be appreciated that Figure 1 The structural block diagram shown is for exemplary purposes only and is not intended to limit the scope of the present application. In some cases, certain devices can be added or removed depending on the specific circumstances.
[0022] Those skilled in the art will appreciate that the application can be embodied as a system, method, or computer program product. Accordingly, the present disclosure can be embodied in any of the following forms: as a completely hardware-based embodiment, as a completely software-based embodiment (including firmware, resident software, microcode, etc.), or as a combination of hardware and software. Furthermore, in some embodiments, the present application can be embodied as a computer program product that is tangibly embodied in one or more computer-readable media, the computer-readable media having computer-readable program code embodied thereon.
[0023] Any combination of one or more computer-readable media can be employed. The computer-readable media can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, the computer-readable storage medium can be any tangible medium that can contain or store the program for use by or in connection with an instruction execution system, apparatus, or device.
[0024] The computer readable medium can include a computer-readable storage medium and / or a computer-readable signal medium. A computer-readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or any suitable combination of the foregoing. More specific examples of a computer-readable storage medium can include, for example, a portable magnetic disk, a portable optical disk, random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), and digital video disc (DVD), a Blu-ray disc, and the like. In the context of this document, a computer-readable storage medium can also include a computer- readable medium that acts to receive, to store, to communicate, to transport, or to propagate computer- program instructions.
[0025] Computer readable program code can be transmitted over a computer readable medium. A computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or any suitable combination of the foregoing. More specific examples of a computer readable medium can include, but are not limited to, a portable magnetic disk, a portable optical disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), and digital video disc (DVD), a Blu-ray disc, and the like. In the context of this document, a computer readable medium can also include a computer readable medium that acts to receive, to store, to communicate, to transport, or to propagate computer program instructions.
[0026] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0027] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0028] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable medium produce a manufacture that includes instruction means that implement the functions / operations specified in the boxes of a flowchart and / or block diagram.
[0029] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable apparatus provide a process for implementing the functions / operations specified in the boxes of the flowchart and / or block diagram.
[0030] Figure 2 A schematic diagram 200 illustrates an application environment in which embodiments of the present invention can be implemented. For example... Figure 2 As shown, a storage system may include, for example, a three-tiered storage structure: Storage device 210 is the lowest-level storage device, which may include, for example, a solid-state disk (SSD) 212 and / or a hard disk 214. Storage device 210 has a relatively slow data access speed; however, this type of storage medium has a large storage capacity and low price, thus providing large-capacity data storage for the data system. Buffer device 220 (e.g., solid-state cache) has a higher data access speed. This type of storage medium can be used as a cache device, for example, loading recently accessed data from storage device 210 into it to provide higher response efficiency for future data accesses. Dynamic random access memory (DRAM) cache 230 has an even faster data access speed, thus loading the most recently accessed data or important data into it to serve data access requests more efficiently.
[0031] When the storage system receives a data access request 240, it can sequentially search the DRAM cache 230 and cache device 220. If a match is found, the data in these faster devices can be used to serve the received access request 240. If a match is not found, the data needs to be retrieved from the slower storage device 210. In this way, the three-tier storage structure 210, 220, and 230 can coordinate their operations to provide faster data response.
[0032] In existing technical solutions, the cache device 220 is located above the storage device 210, and data from different types of storage devices 210 (e.g., SSD 212 and disk 214) can be loaded into the cache device 220. However, the access speed, status, and importance of the data stored in different storage devices can vary. Therefore, it is desirable to develop a technical solution that can distinguish the priorities of storage devices and then allocate and schedule page space in the cache device based on these priorities.
[0033] To this end, one embodiment of the present invention provides a method for managing a cache device in a storage system, comprising: determining a first priority for a first queue included in the cache device, the first queue including at least one data page associated with a first storage device in the storage system; updating the first priority according to a first update rule in at least one round in response to the first priority not satisfying a first predetermined condition, the first update rule causing the updated first priority to be closer to the first predetermined condition than the first priority; and flushing data in the data pages in the first queue to the first storage device in response to the first priority satisfying the first predetermined condition.
[0034] Specifically, Figure 3 A block diagram 300 schematically illustrates a scheme for managing cache devices in a storage system according to an embodiment of the present invention. For example... Figure 3 As shown, queue 310 includes at least one data page 312, ..., 314 associated with a storage device in the storage system, for example from... Figure 2 The disk 214 shown is loaded into at least one data page 312, ..., 314 of the cache device 220. Here, a priority 320 can be determined for the queue 310 to indicate whether the pages in the queue should be flushed to the corresponding storage device during each flush operation.
[0035] In one embodiment of the invention, the storage device shown herein can be a physical storage device, such as a physical disk, or a virtual storage device. For example, the storage device can be represented by an identifier of a physical device, or it can be represented by a logical address (e.g., a Logical Unit Number (LUN)). Although in Figure 3 Only one queue 310 is shown, but multiple queues can exist. For example, in a Redundant Array of Independent Disks (RAID) storage device, a queue can be set up for each storage device. Alternatively, a queue can be set up for each LUN.
[0036] Based on Figure 3 With the structure shown, in each round of operation, it can be determined whether to perform a flush operation for one or more pages in the queue by judging whether the priority meets a predetermined condition. The value of the priority of the queue can also be modified, and it is determined whether to perform a flush in the next round based on the modified priority. In the following, reference will be made to Figure 4 The specific steps of the method of the present application are described in detail.
[0037] Figure 4 A flowchart 400 of a method for managing a cache device in a storage system according to an embodiment of the present application is shown schematically. Specifically, at step 410, a first priority is determined for a first queue included in the cache device, the first queue including at least one data page associated with a first storage device in the storage system. In this step, the structure shown can be employed to store the queue and the priority. For example, the priority field according to the present application can be stored in association with the queue in prior art solutions so as to set the priority for the queue. In this step, the priority can be stored in a variety of formats. For example, the priority can be represented in an integer, a real number or other format. Figure 3 The structure shown can be employed to store the queue and the priority. For example, the priority field according to the present application can be stored in association with the queue in prior art solutions so as to set the priority for the queue. In this step, the priority can be stored in a variety of formats. For example, the priority can be represented in an integer, a real number or other format.
[0038] It should be noted that the at least one data page in the first queue in this step can involve a variety of cases. For example, the data page can be a page loaded into the cache device from the first storage device in response to receiving a read request for the first storage device; for another example, the data page can also be a page temporarily written into the cache device in response to receiving a write request for the first storage device and eventually to be flushed to the first storage device.
[0039] At step 420, in at least one round, the first priority is updated according to a first updating rule in response to the first priority not meeting a first predetermined condition, the first updating rule causing the updated first priority to be closer to the first predetermined condition than the first priority. The specific content of the predetermined condition can be customized, for example, when the priority is represented in an integer or a real number, the predetermined condition can be set as "priority = 0" or "priority < 0" or similar conditions. The specific content of the updating rule can be customized, for example, if the priority is represented in an integer or a real number, the updating rule can be set as: the value of the current priority minus / plus a step size as the updated priority. It should be noted that the updating rule here should cause the updated priority to be closer to the predetermined condition than the current priority.
[0040] At step 430, data in the data page in the first queue is flushed to the first storage device in response to the first priority meeting the first predetermined condition.
[0041] For the convenience of description, in the following, a specific example of integer priority will be used. For example, a queue can be assigned a priority of "2", a predetermined condition can be "priority = 0", and an update rule can be "updated priority = current priority - 1". In the first round, priority 3 does not satisfy the predetermined condition, and thus the priority should be updated to 3 - 1 = 2. At this time, the pages in the queue will not be flushed to the storage device. In the second round, priority 2 also does not satisfy the predetermined condition, and thus the priority should be updated to 2 - 1 = 1. At this time, the pages in the queue will not be flushed to the storage device. In the third round, the priority is updated to 1 - 1 = 0, which satisfies the predetermined condition "priority = 0", and thus the pages (e.g., one or more) in the queue can be flushed to the storage device.
[0042] The priority of a queue can be determined based on various factors. Specifically, in one embodiment of the present application, the first priority can be set based on at least one of the following: a response time associated with the first storage device, a usage rate of the first storage device for the cache device, and an access frequency of access requests for the first storage device.
[0043] In this embodiment, the priority of a storage device can be affected by various factors. For example, if the response time of the storage device is long, it means that the access speed of the storage device is low, and thus the pages (e.g., data associated with a write request to be written to the storage device, or data associated with a read request to be read from the storage device) associated with the storage device should be kept in the cache device for as long as possible.
[0044] For another example, if the data associated with the storage device has occupied a large portion of the storage space in the cache device (i.e., the usage rate is high), it means that there is only a small amount of storage space in the cache device that can be used to serve other storage devices, and thus the usage rate associated with the storage device should be appropriately reduced (e.g., flushing one or more pages in the queue to the storage device.
[0045] For another example, if the frequency (e.g., expressed in Input / Output Per Second (IOPS)) of the received access requests for the storage device is high, it means that the data in the storage device is more likely to be accessed, and thus the storage device should be allocated more space in the cache device.
[0046] In one embodiment of the present application, setting the first priority comprises at least one of: increasing the first priority in response to an increase in the response time being greater than or equal to a first predetermined threshold; decreasing the first priority in response to an increase in the usage being greater than or equal to a second predetermined threshold; and increasing the first priority in response to an increase in the access frequency being greater than or equal to a third predetermined threshold. Specifically, the value of the priority can be calculated as follows in Equation 1:
[0047]
[0048] where S represents the value of the first priority, r represents the response time (e.g., in milliseconds) associated with the first storage device, u represents the usage (e.g., in percentage) of the first storage device with respect to the cache device, and f represents the access frequency (e.g., in IOPS) of the access requests of the first storage device, and a, b and g represent custom weights, respectively.
[0049] In one embodiment of the present application, the value of the priority can also be calculated based on other equations. For example, it can be determined based on Equation 2 (the definitions of the parameters in Equation 2 are the same as those in Equation 1). Alternatively, one skilled in the art can also customize other equations to determine the priority of the queue.
[0050] S = a · r + g · f - b · u Equation 2
[0051] In this embodiment, the calculated priority can be normalized to a predetermined range. For example, the calculated value can be mapped to the range of [0-10]. The update rule can also be defined based on the range of the priority. For example, the size of the step in the update rule can be determined based on the range of the value of the priority. For the range of [0-10], the decrease step in the update rule can be set to 1. At this time, if the priority of a queue is 10, the queue will experience the flushing operation in the 10th round. If the decrease step is 2, the queue will experience the flushing operation in the 5th round.
[0052] In one embodiment of the present application, flushing the data in one of the at least one data page to the first storage device comprises: selecting a target page from the first queue according to a Least Recently Used (LRU) criterion; and flushing the data in the target page to the first storage device.
[0053] In this embodiment, the target page to be flushed can be selected based on the LRU criterion. Alternatively, the queue can also be sorted according to the LRU criterion. Figure 5A block diagram 500 for managing a queue of cache devices in a storage system according to an embodiment of the present application is shown schematically. As shown, the queue 510 includes pages 512, 514, and these pages can be ordered in a sequence from "hot" to "cold". In this way, when it is determined that a flush needs to be performed on the data in the queue based on the priority, the coldest page 514 can be selected from the end of the queue 510 as the target page. Figure 5
[0054] In the foregoing, the specific steps of the operations performed for a queue associated with a storage device have been described. It should be noted that in an embodiment of the present application, a plurality of queues can also be included in the cache device, and each of the plurality of queues can include pages related to a corresponding storage device. Each queue can have a corresponding priority, and the method described in the foregoing with reference to Figures 3 to 5 may be performed for each queue. Figures 3 to 5
[0055] In an embodiment of the present application, further comprising: determining a second priority for a second queue included in the cache device, the second queue including at least one data page associated with a second storage device in the storage system; in the at least one round, in response to the second priority not satisfying a second predetermined condition, updating the second priority according to a second updating rule, the second updating rule causing the updated second priority to be closer to the second predetermined condition than the second priority; and in response to the second priority satisfying the second predetermined condition, flushing data in the data page in the second queue to the second storage device.
[0056] In this embodiment, the second queue is a queue different from the first queue, and the priority, the predetermined condition, and the updating rule for the second queue are the same as or different from those for the first queue. For example, assuming that two storage devices in the storage system have the same configuration and operating state, the priority, the predetermined condition, and the updating rule for the two storage devices can be the same at this time. For another example, if the configurations and operating states of the two storage devices are different, different priorities, predetermined conditions, and updating rules can be set for the two storage devices.
[0057] In the following, details of this embodiment will be described with reference to Figures 6A to 6C . Specifically, Figure 6A , 6B Figures 6A, 6B and 6C respectively illustrate schematically block diagrams 600A, 600B and 600C of different rounds for managing cache devices in a storage system according to an embodiment of the present application. In this embodiment, the initial priority of the first queue is 3 and the initial priority of the second queue is 1. Assume that the predetermined condition for both queues is the same, i.e. "priority = 0", and the update rule for both queues is: updated priority = current priority - 1.
[0058] As shown in Figure 6A, the first queue includes pages 612, 614, 616, 618 and the second queue includes pages 622, 624, 626, 628. At this time, the method described above is applied. In the first round, the priority of the first queue is updated to 3 - 1 = 2 and the priority of the second queue is updated to 1 - 1 = 0 (satisfying the predetermined condition), at which time the page 628 at the end of the second queue will be flushed to the second storage device associated with the second queue. Figure 6A As shown in Figure 6B, the details of the second round are shown, at which time the priority of the second queue will be re-assigned to 1 since the priority of the second queue has satisfied the predetermined condition. In the second round, the priority of the first queue is updated to 2 - 1 = 1 and the priority of the second queue is updated to 1 - 1 = 0 (satisfying the predetermined condition), at which time the page 626 at the end of the second queue will be flushed to the second storage device associated with the second queue.
[0059] Figure 6B As shown in Figure 6C, the details of the third round are shown, at which time the priority of the second queue will be re-assigned to 1. In the third round, the priority of the first queue is updated to 1 - 1 = 0 (satisfying the predetermined condition), at which time the page 618 at the end of the first queue will be flushed to the first storage device associated with the first queue. The priority of the second queue is updated to 1 - 1 = 0 (satisfying the predetermined condition), at which time the page 624 at the end of the second queue will be flushed to the second storage device associated with the second queue.
[0060] As shown in Figure 6D, the details of the fourth round are shown, at which time the priority of the first queue will be re-assigned to 1. In the fourth round, the priority of the first queue is updated to 0 - 1 = -1 (satisfying the predetermined condition), at which time the page 616 at the end of the first queue will be flushed to the first storage device associated with the first queue. The priority of the second queue is updated to 1 - 1 = 0 (satisfying the predetermined condition), at which time the page 622 at the end of the second queue will be flushed to the second storage device associated with the second queue. Figure 6C In an embodiment of the present application, the first storage device has a first rank and the second storage device has a second rank, and the first rank is higher than the second rank. In this embodiment, the plurality of storage devices can have different priorities. For example, for the example shown in Figure 6A, since the rank of the first storage device is higher than the second storage device, a higher initial priority 3 is set for the first queue and a lower initial priority 1 is set for the second queue.
[0061] Figures 6A to 6C In an embodiment of the present application, the first storage device has a first rank and the second storage device has a second rank, and the first rank is higher than the second rank. In this embodiment, the plurality of storage devices can have different priorities. For example, for the example shown in Figure 6A, since the rank of the first storage device is higher than the second storage device, a higher initial priority 3 is set for the first queue and a lower initial priority 1 is set for the second queue.
[0062] In an embodiment of the present application, the first storage device has a first rank and the second storage device has a second rank, and the first rank is higher than the second rank. In this embodiment, the plurality of storage devices can have different priorities. For example, for the example shown in Figure 6A, since the rank of the first storage device is higher than the second storage device, a higher initial priority 3 is set for the first queue and a lower initial priority 1 is set for the second queue. Figures 6A to 6C In the illustrated embodiment, the first queue and the second queue have different priorities, and thus the data in the two queues are flushed to the storage device at different frequencies. The first queue involves only one flush operation in three rounds, while the second queue involves three flush operations in three rounds. In this embodiment, the first queue has higher initial priority than the second queue, and thus the first queue has higher priority to use the storage resource in the cache device than the second queue. In this way, different page scheduling strategies can be set for different storage devices according to different priorities.
[0063] In one embodiment of the present application, determining the second priority for the second queue included in the cache device comprises setting the second priority such that the second priority is updated according to the second update rule to meet the second predetermined condition at a speed faster than the first priority is updated according to the first update rule to meet the first predetermined condition.
[0064] The value of the second priority can be set in various ways. For example, in the case where the first and second update rules are the same and the first and second predetermined conditions are the same, the value of the second priority can be set to be less than the first priority. For example Figure 6A In the illustrated embodiment, the first priority is set to 3 and the second priority is set to 1. In this way, the second priority will meet the second predetermined condition in the first round.
[0065] For another example, the second priority can also be set to the same value as the first priority, i.e. 3, but the second update rule is set to have a larger step-down, e.g. 3. In this way, the second priority will meet the second predetermined condition in the first round.
[0066] For another example, the first and second priorities can both be set to 3, and the first and second update rules can both be set to "decrease by one", but the second predetermined condition is set to "priority = 2". In this way, the second priority will meet the second predetermined condition in the first round. It should be noted that the above merely illustrates specific examples of how to set the priority, the predetermined condition and the update rule. Other methods can also be used to achieve the functions of the technical solutions described herein according to the requirements of specific application environments.
[0067] The above describes an example involving two queues in detail, and in other embodiments, more queues can also be included in the cache device. Figure 7 A block diagram 700 for managing a cache device in a storage system according to one embodiment of the present application is schematically shown. As shown in the figure, the cache device includes a first queue and a second queue. The first queue and the second queue have different priorities, and thus the data in the two queues are flushed to the storage device at different frequencies. The first queue involves only one flush operation in three rounds, while the second queue involves three flush operations in three rounds. In this embodiment, the first queue has higher initial priority than the second queue, and thus the first queue has higher priority to use the storage resource in the cache device than the second queue. In this way, different page scheduling strategies can be set for different storage devices according to different priorities. Figure 7As shown, assume that the first, second, and third queues are associated with the first, second, and third storage devices, respectively, and the hierarchy of the three queues is: first priority > second priority = third priority. In this case, the first queue can be assigned a higher priority of 3, and the second and third queues can be assigned a lower priority of 1.
[0068] Following the method described above, assuming that in each round... Figure 7 Processing the three queues in bottom-up order, in the first round, the priority of the third and second queues is both 1. Therefore, page 720 at the end of the third queue should be flushed first. Figure 7 (Represented by the number 1 inside the circle), and then flushes page 628 at the end of the second queue. Since the priority of the first queue is 3-1=2 at this time, the pages in the first queue will not be flushed. In the second round, page 718 in the third queue and page 626 in the second queue will be flushed. In the third round, page 716 in the third queue, page 624 in the second queue, and page 618 in the first queue will be flushed. In this embodiment, the pages are arranged according to... Figure 7 The order within the circles is washed away: page 720, page 628, page 718, page 626, page 716, page 624, and page 618.
[0069] In one embodiment of the present invention, the storage system is a redundant array of independent disks (RAID), the first storage device is a degraded storage device in the RAID, and the second storage device is a normal storage device in the RAID. In this embodiment, since the degraded storage device in the RAID storage system is undergoing reconstruction, to minimize interference from regular data access requests on the reconstruction operation, more space can be allocated to the degraded storage device in the caching device for data caching. Therefore, a higher priority can be assigned to the degraded storage device, and a lower priority can be assigned to other normal storage devices.
[0070] For example, Figure 7 The first queue in the queue can be a queue related to the failed storage device, while the second and third queues can be queues related to the normal storage devices. For example... Figure 7 As shown, during the flushing process, pages in the second and third queues are flushed to the corresponding normal storage devices in each round, while pages in the first queue are only flushed in the third round. Therefore, by employing the technical solution of this invention, more space can be reserved in the cache device for faulty storage devices.
[0071] Figure 8A A schematic diagram 800A illustrates the structure of a redundant array of independent disks according to a technical solution.Figure 8A The working principle of RAID is explained in the following with an example of a RAID-5 array comprising five independent storage devices (810A, 812A, 814A, 816A and 818A). It should be noted that although Figure 8A five storage devices are shown in the example, in other embodiments, more or less storage devices can be included depending on the version of RAID. Although Figure 8A three stripes 820A, 822A and 824A are shown in the example, in other examples, the RAID system can comprise a different number of stripes.
[0072] In RAID, a stripe spans multiple physical storage devices (e.g. stripe 820A spans storage devices 810A, 812A, 814A, 816A and 818A). A stripe can be simply understood as a storage area in multiple storage devices that satisfies a certain address range. The data stored in stripe 820A comprises multiple portions: data block D11 stored on storage device 810A, data block D12 stored on storage device 812A, data block D13 stored on storage device 814A, data block D14 stored on storage device 816A, and data block P1 stored on storage device 818A. In this example, data blocks D11, D12, D13 and D14 are the stored data, while data block P1 is a parity value of the stored data.
[0073] The way data is stored in other stripes is similar to stripe 820A, except that the parity value for other data blocks can be stored on a storage device different from storage device 818A. In this way, when one of the multiple storage devices 810A, 812A, 814A, 816A and 818A fails, the data in the failed device can be recovered from the other normal storage devices.
[0074] Figure 8B A schematic diagram 800B illustrating the reconstruction process of a redundant array of independent disks according to an embodiment is shown. As Figure 8B shown, when one storage device (e.g. storage device 818A shown in shadow) fails, the data can be recovered from the remaining normal operating multiple storage devices 810A, 812A, 814A, 816A. At this time, a new backup storage device 818B can be added to the RAID to replace storage device 818A, in this way, the recovered data can be written to 818B and the reconstruction of the system is achieved.
[0075] Embodiments of the present application can be applied in a RAID storage system of Figure 8A and Figure 8B . Specifically, Figure 8BThe failed storage device 818A shown in the figure can be the first storage device described in the present application, while the other normal storage devices 810A, 812A, 814A, 816A can be the plurality of second storage devices. It should be noted that in this embodiment, since the first queue is associated with the failed storage device 818A, data cannot be directly written to the failed storage device 818A during flushing. Based on the working principle of the RAID storage system, data can be written to the other normal storage devices 810A, 812A, 814A, 816A in the RAID storage system.
[0076] In an embodiment of the present application, the data access speed of the first storage device is lower than the data access speed of the second storage device. In this embodiment, more cache space can be preferentially allocated to the storage device with lower data access speed. For example, the access speed of a hard disk type storage device can be slower than that of a solid state storage medium type storage device, and thus more cache space can be preferentially provided to the hard disk storage device in the cache device.
[0077] In an embodiment of the present application, different users can be provided with different services according to their ranks in the storage system. For example, more cache space can be provided to important users, and less cache space can be provided to ordinary users.
[0078] In an embodiment of the present application, the method is executed in response to any one of the following: insufficient available space in the cache device, and external invocation. The method described in the present application can be executed at different stages of the operation of the storage system. For example, it can be executed in the case where there is insufficient available space in the cache device, periodically, or in response to invocation.
[0079] Figure 9 A block diagram of an apparatus for managing a cache device in a storage system according to an embodiment of the present application is schematically shown. Specifically, an apparatus for managing a cache device in a storage system is provided, comprising: a determining module 910 configured to determine a first priority for a first queue included in the cache device, the first queue comprising at least one data page associated with a first storage device in the storage system; an updating module 920 configured to, in at least one round, update the first priority according to a first updating rule in response to the first priority not satisfying a first predetermined condition, the first updating rule causing the updated first priority to be closer to the first predetermined condition than the first priority; and a flushing module 930 configured to flush data in the data page in the first queue to the first storage device in response to the first priority satisfying the first predetermined condition.
[0080] In one embodiment of the present application, the determining module 910 is further configured to set the first priority based on at least one of: a response time associated with the first storage device, a usage rate of the first storage device to the cache device, and an access frequency of access requests to the first storage device.
[0081] In one embodiment of the present application, the determining module 910 is further configured to: increase the first priority in response to an increase amount of the response time being greater than or equal to a first predetermined threshold; decrease the first priority in response to an increase amount of the usage rate being greater than or equal to a second predetermined threshold; and increase the first priority in response to an increase amount of the access frequency being greater than or equal to a third predetermined threshold.
[0082] In one embodiment of the present application, the flushing module 930 is further configured to select a target page from the first queue according to a least recently used criterion; and flush data in the target page to the first storage device.
[0083] In one embodiment of the present application, the determining module 910 is further configured to determine a second priority for a second queue included in the cache device, the second queue including at least one data page associated with a second storage device in the storage system; the updating module is further configured to update the second priority according to a second updating rule in at least one round in response to the second priority not satisfying a second predetermined condition, the second updating rule causing the updated second priority to be closer to the second predetermined condition than the second priority; and the flushing module is further configured to flush data in the data page in the second queue to the second storage device in response to the second priority satisfying the second predetermined condition.
[0084] In one embodiment of the present application, the first storage device has a first rank, the second storage device has a second rank, and the first rank is higher than the second rank.
[0085] In one embodiment of the present application, the determining module 910 is further configured to set the second priority such that a speed of updating the second priority to satisfy the second predetermined condition according to the second updating rule is faster than a speed of updating the first priority to satisfy the first predetermined condition according to the first updating rule.
[0086] In one embodiment of the present application, the storage system is a redundant array of independent disks, the first storage device is a failed storage device in the redundant array of independent disks, and the second storage device is a normal storage device in the redundant array of independent disks.
[0087] In one embodiment of the present application, the data access speed of the first storage device is lower than the data access speed of the second storage device.
[0088] In one embodiment of the present application, the determining module 910, the updating module 920, and the flushing module 930 operate in response to any of the available space in the cache device being insufficient, and the invocation.
[0089] In one embodiment of the present application, a system for managing a cache device in a storage system is provided, comprising: one or more processors; a memory coupled to at least one of the one or more processors; computer program instructions stored in the memory that, when executed by the at least one processor, cause the device to perform a method for managing a storage system, the method comprising: determining a first priority for a first queue included in the cache device, the first queue comprising at least one data page associated with a first storage device in the storage system; in at least one round, updating the first priority according to a first updating rule in response to the first priority not satisfying a first predetermined condition, the first updating rule causing the updated first priority to be closer to the first predetermined condition than the first priority; and flushing data in the data pages in the first queue to the first storage device in response to the first priority satisfying the first predetermined condition.
[0090] In one embodiment of the present application, determining the first priority for the first queue included in the cache device comprises setting the first priority based on at least any of: a response time associated with the first storage device, a usage rate of the first storage device for the cache device, and an access frequency of access requests for the first storage device.
[0091] In one embodiment of the present application, setting the first priority comprises at least any of: increasing the first priority in response to an increase in the response time being greater than or equal to a first predetermined threshold; decreasing the first priority in response to an increase in the usage rate being greater than or equal to a second predetermined threshold; and increasing the first priority in response to an increase in the access frequency being greater than or equal to a third predetermined threshold.
[0092] In one embodiment of the present application, flushing data in one of the at least one data page to the first storage device comprises: selecting a target page from the first queue according to a least recently used criterion; and flushing data in the target page to the first storage device.
[0093] In one embodiment of the present application, further comprising: determining a second priority for a second queue included in the cache device, the second queue including at least one data page associated with a second storage device in the storage system; in the at least one round, updating the second priority according to a second update rule in response to the second priority not satisfying a second predetermined condition, the second update rule causing the updated second priority to be closer to the second predetermined condition than the second priority; and flushing data in the data page in the second queue to the second storage device in response to the second priority satisfying the second predetermined condition.
[0094] In one embodiment of the present application, the first storage device has a first rank, the second storage device has a second rank, and the first rank is higher than the second rank.
[0095] In one embodiment of the present application, determining the second priority for the second queue included in the cache device comprises: setting the second priority such that the second priority is updated to satisfy the second predetermined condition according to the second update rule at a speed faster than the first priority is updated to satisfy the first predetermined condition according to the first update rule.
[0096] In one embodiment of the present application, the storage system is a redundant array of independent disks, the first storage device is a failed storage device in the redundant array of independent disks, and the second storage device is a normal storage device in the redundant array of independent disks.
[0097] In one embodiment of the present application, the data access speed of the first storage device is lower than the data access speed of the second storage device.
[0098] In one embodiment of the present application, the system performs in response to any of: an available space in the cache device being insufficient, and a call.
[0099] The computer system can include a set of instructions readable by the machine. The set of instructions can include instructions executable by the machine to perform a method. The set of instructions can be embodied in a computer-readable medium. In the context of this document, a "computer-readable medium" is an electronic, magnetic, optical, or other physical device or means that can contain or store a set of instructions for use by or to control an
[0100] Having described various embodiments of the application, it is to be understood that the above description is meant to be illustrative only and not exhaustive and is not intended to unnecessarily limit the disclosed embodiments. Many modifications and variations of the present technology will be apparent to those of ordinary skill in the art upon reading this description. The scope of the technology encompasses all technical equivalents that do not depart from the spirit of the disclosed embodiments. The use of the terms "preferably," "preferably comprising," "more preferably," "most preferably," "specifically," "particularly" and variations thereof in the description above are used to describe one embodiment, but not to exclude other embodiments of the present technology. With regard to the use of terminology or label elements containing the term "for" or "to," for example, "for" or "to" are used herein to indicate an element that is configured to, is operable to, is operable for, is operable to, is operable for, is configured to, is configured for, is operable for, is operable to, is operable for, is configured to, is configured for, is operable for, is operable to, is operable for, is configured to, is configured for, is operable for, is operable to, is operable for, is configured to
Claims
1. A method for managing cache devices in a storage system, the method comprising: The caching device provides multiple queues, each of which includes a corresponding set of pages; The plurality of queues are assigned corresponding priorities, which are represented as corresponding numbers and are based at least in part on at least one of the following: the response time of the storage device associated with the corresponding queue in the plurality of queues, the utilization rate of the storage device for the cache device, and the access frequency of access requests to the storage device; as well as Flushing pages from the cache device to a set of storage devices in multiple rounds includes: for a first round, (i) modifying the priority of the plurality of queues according to an update rule such that the modified priority is closer to a predetermined level than the priority, (ii) comparing the modified priority with the predetermined level, and (iii) selectively flushing one or more pages from queues whose modified priority is equal to or greater than the predetermined level.
2. The method of claim 1, wherein selectively flushing one or more pages comprises: (i) In response to a modification of the first queue in the plurality of queues having a priority equal to or greater than the predetermined level, flush pages from the first queue; and (ii) In response to a modification of the second queue in the plurality of queues having a priority not equal to or greater than the predetermined level, do not flush pages from the second queue.
3. The method according to claim 2, further comprising: For the second round following the first round, (i) the priority of the modifications of the plurality of queues is modified according to the update rules to generate a priority of two modifications, (ii) the priority of the two modifications is compared with the predetermined level, and (iii) one or more additional pages from queues whose priority of the two modifications is equal to or greater than the predetermined level are selectively flushed.
4. The method according to claim 1, wherein modifying the priority according to the update rule includes: Increase or decrease the priority.
5. The method of claim 1, wherein flushing pages from the cache device comprises: From each of the plurality of queues, no more than one page is flushed per round.
6. The method of claim 1, wherein the plurality of queues includes a first queue and a second queue, the first queue being configured to flush to a first storage device of a Redundant Array of Independent Disks (RAID), and the second queue being configured to flush to a second storage device of the RAID.
7. The method of claim 6, further comprising: In response to the detection of a failure in the first storage device of the RAID, but no failure in the second storage device of the RAID, a higher priority is assigned to the first queue than to the second queue, thereby preventing data access requests from interfering with the reconstruction of the first storage device.
8. A system for managing cache devices in a storage system, comprising: One or more processors; Memory coupled to at least one of the one or more processors; Computer program instructions stored in the memory, when executed by the at least one processor, cause the device to perform a method for managing a storage system, the method comprising: Multiple queues are provided in the caching device, each of the multiple queues comprising a corresponding set of pages; The plurality of queues are assigned corresponding priorities, which are represented as corresponding numbers and are based at least in part on at least one of the following: the response time of the storage device associated with the corresponding queue among the plurality of queues, the utilization rate of the storage device for the cache device, and the access frequency of access requests to the storage device; and Flushing pages from the cache device to a set of storage devices in multiple rounds includes: for a first round, (i) modifying the priority of the plurality of queues according to an update rule such that the modified priority is closer to a predetermined level than the priority, (ii) comparing the modified priority with the predetermined level, and (iii) selectively flushing one or more pages from queues whose modified priority is equal to or greater than the predetermined level.
9. The system of claim 8, wherein selectively flushing one or more pages comprises: (i) In response to a modification of the first queue in the plurality of queues having a priority equal to or greater than the predetermined level, flush pages from the first queue; and (ii) In response to a modification of the second queue in the plurality of queues having a priority not equal to or greater than the predetermined level, do not flush pages from the second queue.
10. The system of claim 9, wherein the method further comprises: For the second round following the first round, (i) the priority of the modifications of the plurality of queues is modified according to the update rules to generate a priority of two modifications, (ii) the priority of the two modifications is compared with the predetermined level, and (iii) one or more additional pages from queues whose priority of the two modifications is equal to or greater than the predetermined level are selectively flushed.
11. The system of claim 8, wherein modifying the priority according to the update rule includes: Increase or decrease the priority.
12. The system of claim 8, wherein the plurality of queues includes a first queue and a second queue, the first queue being configured to flush to a first storage device of a Redundant Array of Independent Disks (RAID), and the second queue being configured to flush to a second storage device of the RAID.
13. The system of claim 12, wherein the method further comprises: In response to the detection of a failure in the first storage device of the RAID, but no failure in the second storage device of the RAID, a higher priority is assigned to the first queue than to the second queue, thereby preventing data access requests from interfering with the reconstruction of the first storage device.
14. A computer program product comprising one or more non-transitory computer-readable media having computer-readable program code thereon, wherein, when executed by one or more processors, the computer-readable program code performs a method for managing a cache device in a storage system, the method comprising: The caching device provides multiple queues, each of which includes a corresponding set of pages; The plurality of queues are assigned corresponding priorities, which are represented as corresponding numbers and are based at least in part on at least one of the following: the response time of the storage device associated with the corresponding queue in the plurality of queues, the utilization rate of the storage device for the cache device, and the access frequency of access requests to the storage device; as well as Flushing pages from the cache device to a set of storage devices in multiple rounds includes: for a first round, (i) modifying the priority of the plurality of queues according to an update rule such that the modified priority is closer to a predetermined level than the priority, (ii) comparing the modified priority with the predetermined level, and (iii) selectively flushing one or more pages from queues whose modified priority is equal to or greater than the predetermined level.
15. The computer program product of claim 14, wherein selectively flushing one or more pages comprises: (i) In response to a modification of the first queue in the plurality of queues having a priority equal to or greater than the predetermined level, flush pages from the first queue; and (ii) In response to a modification of the second queue in the plurality of queues having a priority not equal to or greater than the predetermined level, do not flush pages from the second queue.
16. The computer program product of claim 15, wherein the method further comprises: For the second round following the first round, (i) the priority of the modifications of the plurality of queues is modified according to the update rules to generate a priority of two modifications, (ii) the priority of the two modifications is compared with the predetermined level, and (iii) one or more additional pages from queues whose priority of the two modifications is equal to or greater than the predetermined level are selectively flushed.
17. The computer program product of claim 14, wherein modifying the priority according to the update rule includes: Increase or decrease the priority.
18. The computer program product of claim 14, wherein flushing pages from the cache device comprises: From each of the plurality of queues, no more than one page is flushed per round.
19. The computer program product of claim 14, wherein the plurality of queues includes a first queue and a second queue, the first queue being configured to flush to a first storage device of a Redundant Array of Independent Disks (RAID), and the second queue being configured to flush to a second storage device of the RAID.
20. The computer program product of claim 19, wherein the method further comprises: In response to the detection of a failure in the first storage device of the RAID, but no failure in the second storage device of the RAID, a higher priority is assigned to the first queue than to the second queue, thereby preventing data access requests from interfering with the reconstruction of the first storage device.
Citation Information
Patent Citations
Method and apparatus for implementing multiple credit levels over multiple queues
US20030223444A1
Cache destaging for virtual storage devices
US20140379988A1