Manages the indication of accessed tracks to the MRU end of the cache list based on accesses to different areas of the cache list
By determining the access frequency area of the track in the cache list and setting flags to decide whether to reserve the track location, lock contention and delay problems are solved, and the processing efficiency and hit rate of the cache are improved.
Patent Information
- Application Number
- CN202010816353.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-08-16
- Filing Date
- 2020-08-14
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-08-14
AI Technical Summary
Existing cache management systems have lock contention issues when moving tracks from the least recently used (LRU) end to the most recently used (MRU) end, resulting in increased latency.
This reduces lock contention and latency by determining whether the accessed track is in a high-access area in the cache list and setting the corresponding flag to decide whether to retain the track at its current location rather than immediately moving it to the MRU side.
It effectively reduces lock contention and latency, improves cache processing efficiency, maintains the location of high-access frequency tracks in the cache, and simultaneously moves low-access frequency tracks to the MRU array.
Smart Images

Figure CN112395223B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a computer program product, system and method for managing the addition of accessed tracks to the most recently used end of a cache list in a cache based on accesses to different areas of the cache list. Background Art
[0002] As a result of read and write operations in a faster access storage device (e.g., memory) than the storage device storing the requested track, the cache management system buffers tracks in the most recently accessed storage device. Subsequent read requests for tracks in the faster access cache memory are returned faster than the requested tracks are returned from the slower access storage device, thereby reducing read latency. The cache management system may also return completion of a write request when a modified track pointing to a storage device is written to the cache memory, and before the modified track is written out to a storage device such as a hard drive. Typically, the write latency of a storage device is much longer than the latency of writing to the cache memory. Therefore, using a cache also reduces write latency.
[0003] The cache management system may maintain a linked list with one entry for each track stored in the cache, which may include write data or read data buffered in the cache before being written to the storage device. In a common least recently used (LRU) cache technique, if a track in the cache is accessed, i.e., a cache "hit", the entry in the LRU cache list for the accessed track will be moved to the most recently used (MRU) end of the list. If the requested track is not in the cache, i.e., a cache miss, the track in the cache whose entry is at the LRU end of the list may be removed and demoted, and the entry for the track data that entered the cache from the storage device is added to the MRU end of the LRU list. Using this LRU cache technique, tracks that are accessed more frequently are likely to remain in the cache, while data that is accessed less frequently is more likely to be removed from the LRU end of the list, thereby making room in the cache for newly accessed tracks.
[0004] In order to move the track to the MRU end when the track is accessed, the process managing the cache needs to obtain a lock on the LRU cache list. Since many processes are eager to obtain this lock, there may be a lot of lock contention to obtain it.
[0005] One technique to resolve lock contention is to batch the tracks that need to be moved to the MRU end into an MRU array. When the MRU array is full, all tracks in the MRU array are moved to the MRU end of the cache list. Another technique to resolve lock contention is cache partitioning, where multiple LRU lists are maintained for different track partitions, where each partition has its own LRU lock.
[0006] There is a need in the art for improved techniques for moving tracks to the MRU end of a cache as they are accessed. Summary of the invention
[0007] A computer program product, system, and method are provided for managing the addition of accessed tracks to a most recently used end of a cache list in a cache based on accesses to different areas of the cache list. A cache list for the cache has a least recently used (LRU) end and a most recently used (MRU) end, wherein tracks in the cache are indicated in the cache list. Based on the number of accesses to tracks in a high access region of tracks starting from the MRU end of the cache list, the high access region is determined. It is determined whether the accessed track is in the high access region of tracks starting from the MRU end. In response to determining that the accessed track is in the high access region, a flag is set for the accessed track indicating that the accessed track is at the MRU end after processing the accessed track at the LRU end. After the flag is set, the accessed track remains at a current position in the cache list before being accessed. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 An embodiment of a computing environment is shown.
[0009] Figure 2 An embodiment of a least recently used (LRU) list is shown.
[0010] Figure 3 An embodiment of a cache control block is shown.
[0011] Figure 4 An embodiment showing an example of region information for a region of a cache list is shown.
[0012] Figure 5 An embodiment of the operation of determining a highly accessed region of a cache list from the most recently used (MRU) end of the cache list is shown.
[0013] Figure 6 An embodiment of the operation of processing an access request to a track is shown.
[0014] Figure 7An embodiment of the operation of initiating a destage scan to demote tracks from the LRU end of a cache list is shown.
[0015] Figure 8 An embodiment of the operation of processing tracks in an MRU array is shown.
[0016] Fig. 9 Shows Figure 1 The computing environment in which the components of the are implemented. DETAILED DESCRIPTION
[0017] In the prior art, accessed tracks may be processed in batches and then relocated to the MRU end of a cache list. Operations for moving indications of tracks into and out of a cache list result in delays in processing read / write requests to obtain locks required to move tracks into and out of a cache list. The described embodiments provide improvements to computer cache technology by providing enhanced decision making to determine whether a track that is being considered for demotion (e.g., at the least recently used (LRU) end of a cache list) should be added back to the MRU end. In the described embodiments, before moving an accessed track in the cache back to the MRU end, a consideration is given based on the track cache residency time of the accessed track whether a region in the cache list that includes the accessed track is in a high access region of the cache list, the high access region extending from the MRU end of the track region having a predetermined percentage of cache accesses within a time interval. If the accessed track is within the high access region, a flag is set for the accessed track indicating that the accessed track is at the MRU end in response to determining that the accessed track is within the high access region. After the flag is set, the accessed track remains in its current position in the cache list before being accessed.
[0018] Figure 1 An embodiment of a computing environment is shown. A plurality of hosts 102 1 , 102 2 ……102 n Input / output (I / O) requests may be submitted to the storage controller 104 via the network 106 to access data at a volume 108 in the storage device 110 (e.g., a logical unit number, a logical device, a logical subsystem, etc.). The storage controller 104 includes one or more processors 112 and a memory 114, which includes a cache 116 for caching data for the storage device 110. The processor 112 may include a single central processing unit (CPU), a core or a group of cores on a single CPU, or a group of processing resources on one or more CPUs. The cache 116 buffers the data stored in the host 102. 1 , 102 2 ……102 nData transferred between volume 108 of storage device 110.
[0019] The memory 114 further includes a storage manager 118 for managing 1 , 102 2 ……102 n and cache manager 120, which manages the transfer of tracks transferred between the host 102 1 , 102 2 ……102 n Data in cache 116 transferred to and from storage device 110. Tracks may include any unit of data configured in storage device 110, such as tracks, logical block addresses (LBAs), storage cells, groups of cells (e.g., columns, rows, or arrays of cells), sectors, fields, etc., which may be part of a larger grouping of tracks (e.g., volumes, logical devices, etc.).
[0020] The cache manager 120 maintains cache management information 122 in the memory 114 to manage read (unmodified) and written (modified) tracks in the cache 116. The cache management information 122 may include: a least recently used (LRU) cache list 200 in which tracks in the cache 116 are indicated; a track index 124 that provides an index of tracks in the cache 116 to cache control blocks in a control block directory 300, wherein there is one cache control block for each track in the cache 116, which provides metadata on the tracks in the cache 116, and the cache list 200 may indicate the cache control blocks 300 in the directory 300. i ; a most recently used (MRU) array 126, also referred to as an MRU list, having tracks added to the cache 116 that are not yet indicated in the cache list 200 to allow a batch of tracks to be added to the cache list 200 at a time to improve cache processing efficiency, because a single lock request can be used to add multiple newly added tracks to the cache 116 in the cache list 200; a demotion preparation list 128, which indicates tracks that are removed from the LRU end 204 of the cache list 200 and are ready to be demoted from the cache 116; region information 400, which has information about different contiguous track regions in the cache list 200; a high access region 132 based on accesses to the region of the cache list 200, in which the accessed track is not re-MRUed but remains in its current position in the cache list 200; and a total number of input / output (I / O) operations in the interval 134 in which such measurement is made.
[0021] The processor 112 executes a destage scan task 130 for scanning the cache list 200 to determine unmodified tracks to add to the destage preparation list 128 .
[0022] As program code is loaded into memory 114 and executed by one or more processors 112, storage manager 118, cache manager 120, and destage scan task 130 are executed in Figure 1 Alternatively, some or all of the functionality may be implemented as microcode or firmware in a hardware device in the storage controller 104, such as in an application specific integrated circuit (ASIC).
[0023] The storage device 110 may include one or more storage devices known in the art, such as a solid-state storage device (SSD) composed of solid-state electronic devices, a NAND storage cell, an EEPROM (electrically erasable programmable read-only memory), a flash memory, a flash disk, a random access memory (RAM) drive, a storage class memory (SCM), a phase change memory (PCM), a resistive random access memory (RRAM), a spin transfer torque memory (STM-RAM), a conductive bridge RAM (CBRAM), a magnetic hard disk drive, an optical disk, a magnetic tape, etc. The storage device may be further configured as a device array, such as a simple bundle of disks (JBOD), a direct access storage device (DASD), a redundant array of independent disks (RAID) array, a virtualization device, etc. In addition, the storage device may include heterogeneous storage devices from different vendors or from the same vendor.
[0024] Memory 114 may include suitable volatile or non-volatile storage devices, including those described above.
[0025] The network 106 may include a storage area network (SAN), a local area network (LAN), a wide area network (WAN), the Internet, an intranet, etc. Alternatively, the host 102 1 , 102 2 ……102 n The connection to the storage controller 104 may be via a bus interface, such as a Peripheral Component Interconnect (PCI) bus interface and other interfaces known in the art.
[0026] Figure 2An embodiment of the cache list 200 is shown as a least recently used (LRU) list 200 having a most recently used (MRU) end 202 and a least recently used (LRU) end 204. The most recently used (MRU) end 202 identifies tracks that were most recently added to the cache 116 or most recently accessed in the cache 116. Tracks identified at the LRU end starting from the least recently used (LRU) end 204 are selected to be demoted from the cache 116. When tracks are added to the MRU end 202, other tracks are moved downward toward the LRU end 204. If there is not enough space for tracks to be added to the MRU end 202, tracks can be demoted from the LRU end 204 to make room for new tracks to be added to the cache list 200.
[0027] Figure 3 Cache control block 300 is shown for one track in cache 116. i In an example embodiment, the cache control block 300 i Including but not limited to: cache control block identifier 302, such as cache control block 300 i cache list 304, which indicates the cache control block 300 associated with the track i ; the location of the track indicated in the LRU cache list 306; a last access timestamp 308 indicating the time when the track was last accessed (e.g., read) in the cache 116; a re-MRU flag 310 indicating, for example, whether the track needs to be indicated at the MRU end 202 of the cache list 200 if it is accessed while indicated in the cache list 200; a degraded state 312 indicating whether the track is accessed at the MRU end 202 of the cache list 200 by the cache control block 300; i The identified track is to be destaged from the cache 116 and is indicated in the destage preparation list 128. The cache control block 300 i Additional information not mentioned herein for managing tracks in cache 116 may be included.
[0028] In some embodiments, the timestamp 308 may be set as a serial number that is periodically incremented, for example, within each clock cycle or a few milliseconds.
[0029] Figure 4 The area information 400 is shown in FIG. i Area Information 400 iThe cache list includes: a region number 402, where the lowest region number may start at the MRU end 202; cache list entries 404 in the cache list, where consecutive entries may be determined by the region number and the number of entries / tracks in the region; and a number of accesses 406 or reads to the region 402. i The cache hit rate may be determined by dividing the number of accesses 406 by the total I / O operations in the interval 134 value.
[0030] Figure 5 An embodiment of an operation performed by the cache manager 120 to determine a highly accessed region 132 starting from the MRU end 202 of the cache list 200 is shown. This determination may be made for the total number of I / O operations 134 after a measurement interval, or may be made in response to each access request to a track to determine whether to re-MRU the track, i.e., move toward the MRU end 202 in response to a hit. (At block 500) When the operation to determine the highly accessed region 132 is initiated, (at block 502) a variable i is set to 1, and (at block 504) the accumulated number of accesses is initialized to the number of accesses 406 in region 1 (the region starting from the MRU end 202). (At block 506) a threshold is determined to be all regions 400. i A threshold percentage of 25% or some other fixed percentage of cumulative accesses in the cache list starting from the MRU end 202 represents a high access area that is likely to experience a cache hit in the future.
[0031] (At box 508) region i is added to a high access region 132, which includes a subset of contiguous regions starting from the MRU end 202. If (at box 510) the cumulative number of accesses does not exceed the threshold, then (at box 512) i is incremented and (at box 514) the number of accesses 406 for region i is added to the cumulative number of accesses. Control proceeds back to box 508 to consider whether to include the next region (i+1) in the high access region 132. If (at box 510) the cumulative number of accesses from the subset of regions exceeds the threshold, then (at box 516) a high access region 132 is determined based on the subset of regions added to the high access region 132. The high access region 132 can be represented as a percentage of the cache list 200 extending from the MRU end 202.
[0032] In one embodiment, determining the high access area 132 based on the area subset added to the high access area can be calculated by dividing the cumulative number of hits in the area subset by the total number of accesses to all areas. In another embodiment, the high access area 132 can be calculated by dividing the total number of entries in the area subset by the total number of entries in the cache list 200. In yet another embodiment, the high access area 132 can be calculated by dividing the difference between the last access timestamp at the MRU end 202 and the last access timestamp of the last track in the last area of the area subset by the difference between the last access timestamp at the MRU end 202 of the cache list 200 and the last access timestamp at the LRU end 204.
[0033] use Figure 5 In the embodiment of the present invention, the number of visits to each region starting from the MRU end is added to the cumulative number of visits until the cumulative number of visits exceeds the threshold. In this way, the high visit area 132 includes each region starting from the MRU end added to the cumulative number of visits until the cumulative number of visits exceeds the threshold. Figure 5 In this embodiment, the highly accessed region 132 is determined to include a subset of regions that contribute a threshold number of accesses to all regions, such as 25% of hits / accesses, indicating a highly accessed region in the cache list 200 that is likely to continue to be accessed.
[0034] Figure 6 An embodiment of operations performed by the cache manager 120 for processing an access request (such as a read or write) to a track is shown. Upon receiving an access request (at block 600), if (at block 602) the track is in the cache 116, then (at block 604) a cache control block 300 is created. i The last access timestamp 308 for the accessed tracks in the cache list 200 is set to the current system timestamp. If (at block 606) the cache 116 size is less than the threshold condition size, then (at block 608) the indication of the accessed tracks in the cache list 200 is removed from the cache list 200, and when a condition is satisfied (such as, the MRU array 126 is full), (at block 610) the indication of the accessed tracks in the MRU array 126 is added to the MRU end 202 in batches. If (at block 606) the cache 116 size is greater than (or greater than or equal to) the threshold cache size, then (at block 612) the accessed region 400 including the accessed tracks is determined. a, the accessed track may include the track cache residency time (the time the accessed track has been in the cache since the last access) as a percentage of the total cache residency time. In one embodiment, the track cache residency time includes the difference between the current timestamp and the last access timestamp 308, which indicates when the processed track was last accessed in the cache. The total cache residency time includes the difference between the last access timestamp 308 when the track at the MRU end was last accessed and the last access timestamp 308 of the track at the LRU end. (At block 614) The accessed region 400 a The number of visits 406 increases.
[0035] At block 616, it is determined that the visited area 400 a is contained within the high access region 132. This determination may be made by determining whether the accessed region, which may be represented as a percentage of the cache list 200, is less than the high access region 132 (which is also a percentage of the cache list 200). If (at block 616) the accessed region 400 a is contained in the high access region 132, then (at block 618) in the cache control block 300 i The re-MRU flag 310 is set for the accessed track to indicate that the track is re-MRUed, and the track is left in its current position in the cache list 200. However, because the last access timestamp 308 of the accessed track is updated, the track is now at the top of the upper portion of the cache residency, i.e., the time period in the cache is the shortest of all tracks. If (at box 616) the accessed area 400a is not in the high access area 132, control proceeds to box 608 to remove the indication of the track from the cache list 200 to add to the MRU array 126.
[0036] If (at block 602) the accessed track is not in cache 116, then (at block 620) the track is staged from volume 108 to cache 116. The cache control block 300 for the staged track is (at block 622) i The accessed tracks are added to the cache control block directory 300, the last access timestamp 308 is set to the current timestamp, and the re-MRU flag 310 is set to indicate that re-MRU is not performed. Then, the accessed tracks indicated in the MRU array 126 are added to the MRU end 202 in batches together with other tracks indicated in the MRU array 126.
[0037] use Figure 6In an embodiment of the present invention, requested tracks indicated in the cache list 200 in a high access region having a threshold number of cache hits in the cache list starting from the MRU end 202 are maintained in their current positions in the cache list 200 without being added to the MRU array 126. This reduces cache access latency because more recently accessed tracks having lower track cache residency times due to their continuously updated accessed timestamps 308 are not continuously moved to the MRU array 126 and indicated in batches at the MRU end 202, but are maintained in their current positions in the cache list 200 with their last access timestamps updated 308. Setting only the re-MRU flag 310 at block 618 and not adding the tracks to the MRU array 126 avoids the latency required to add the tracks to the MRU array 126 and process the MRU array 126 to add the tracks in batches to the MRU end 202, since locking is required to remove tracks from the cache list 200 or add them to the MRU end 202. However, accessed tracks in cache areas outside of the high access area 132 are removed from the cache list 200 and added to the MRU array 126 because they are less likely to be accessed again than the more recently accessed tracks in the upper range. By keeping more recently accessed tracks in the cache list 200 while moving tracks that have been in the cache for a relatively longer time and are less likely to be accessed to the MRU array 126, the cache hit rate is further improved.
[0038] Figure 7An embodiment of the operations performed by the destage scan task 130 is shown, which is periodically called to process tracks for destage from the cache starting from the LRU end 204 of the cache list 200. When a track is processed for destage at the LRU end 204 (at block 700), if (at block 702) the re-MRU flag 310 is not set, indicating that the track has not been recently accessed since it was last added to the cache 116, then (at block 704) the processed track is removed from the cache list 200 and destaged, such as added to the destage preparation list 128, and the track from the destage preparation list 128 is removed from the cache list. If (at block 702) the re-MRU flag 310 indicates re-MRU or moving the track toward the MRU end 202, then (at block 706) the area including the processed track is determined, which area can be calculated as a percentage of the track cache residency time to the total cache residency time. If (at box 708) the determined area or percentage of the cache list 200 that includes the processed track is not within the high access area 132, for example, the determined area of the cache list 200 is less than the high access area percentage of the cache list 200, then based on the number of hits / number of accesses, the track is not in the high access area 132, and control proceeds to box 704 to remove the processed track from the cache list 200 and demote it, for example, adding it to the demotion preparation list 128.
[0039] If (at box 708 ) the determined track is in the high access area 132 , then the indication of the track is removed from the cache list 200 (at box 710 ) and the track is indicated in the MRU array 126 (at box 712 ).
[0040] use Figure 7 In the embodiment of the present invention, if the re-MRU flag 310 is set to indicate that the track is accessed while in the cache list 200 and the track is in the high access region 132 of the cache list 200, the track is not demoted. In this case, the track is accessed while in the cache 116, and because the track is identified as remaining in the high access region, it is added to the MRU array 126 to be re-MRU. Re-MRUing tracks in the high cache hit region improves the cache hit rate.
[0041] In one embodiment, for determining whether to Figure 7 The MRU array 126 adds a high access area of the track to be used to determine whether to set Figure 6 The high access area of the re-MRU mark 310 is different. For example, compared to Figure 7 The high access area used in 132, Figure 6The high access region 132 used in may be calculated based on a lower threshold (e.g., 25%) of cache hits for all regions, where Figure 7 The high access region 132 used in may be calculated based on a higher threshold (eg, 50%) of cache hits for all regions.
[0042] Figure 8 An embodiment of operations performed by the cache manager 120 and / or the destage scan task 130 for processing the MRU array 126 to add tracks to the MRU end 202 of the cache list 200 is shown. When the number of tracks equals a threshold or the MRU array 126 is full, the MRU array 126 may be processed. When processing of tracks in the MRU array 126 is initiated (at block 800), control continues to execute Figure 7 The operation continues until the destage scan task 130 destages a number of tracks equal to the number of tracks in the MRU array 126 that will be added to the cache list 200. Control then continues to obtain a lock on the cache list 200 (at block 804) and add the tracks in the MRU array 126 to the MRU end 202 of the cache list 200.
[0043] use Figure 8 In an embodiment of the present invention, tracks added to the cache 116 or determined to be re-MRU are not immediately indicated to the MRU end 202, which would result in a delay in obtaining a lock on the cache list 200. Instead, tracks added to the cache 116 are indicated in the MRU array 126 and batched to be moved to the MRU end 202, i.e., they are added to the MRU end 202 while the lock is maintained for the cache list 200 to avoid lock contention for indicating tracks at the MRU end 202.
[0044] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0045] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0046] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0047] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, etc., and procedural programming languages such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.
[0048] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.
[0049] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0050] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0051] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0052] Figure 1 The computing components (including the host 102 1 , 102 2 ……102 n and storage controller 104) may be implemented in one or more computer systems, such as Fig. 9 Computer system 902 is shown. Computer system / server 902 may be described in the general context of computer system executable instructions (e.g., program modules) executed by a computer system. In general, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform specific tasks or implement specific abstract data types. Computer system / server 902 may be practiced in a distributed cloud computing environment where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
[0053] like Fig. 9As shown, computer system / server 902 is shown in the form of a general-purpose computing device. Components of computer system / server 902 may include, but are not limited to: one or more processors or processing units 904, system memory 906, and a bus 908 that couples various system components including system memory 906 to processor 904. Bus 908 represents any one or more of a variety of bus structures, including a memory bus or memory controller using any of a variety of bus architectures, a peripheral bus, a graphics acceleration port, and a processor or local bus. By way of example and not limitation, such architectures include an industry standard architecture (ISA) bus, a microchannel architecture (MCA) bus, an enhanced ISA (EISA) bus, a video electronics standard association (VESA) local bus, and a peripheral component interconnect (PCI) bus.
[0054] Computer system / server 902 typically includes a variety of computer system readable media. Such media can be any available media that can be accessed by computer system / server 902, and it includes volatile and nonvolatile media, removable and non-removable media.
[0055] The system memory 906 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 910 and / or cache memory 912. The computer system / server 902 may further include other removable / non-removable volatile / non-volatile computer system storage media. By way of example only, a storage system 913 may be provided for reading and writing non-removable non-volatile magnetic media (not shown and generally referred to as a "hard drive"). Although not shown, a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk") may be provided, as well as an optical drive for reading or writing a removable non-volatile optical disk (CD-ROM, DVD-ROM or other optical media). In such a case, each may be connected to the bus 908 via one or more data media interfaces. As will be further depicted and described below, the memory 906 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of an embodiment of the present invention.
[0056] A program / utility 914 having a set (at least one) of program modules 916 may be stored in memory 906, as an example and not limitation, as well as an operating system, one or more application programs, other program modules, and program data. Each of the operating system, one or more application programs, other program modules, and program data, or some combination thereof, may include an implementation of a networking environment. The components of computer 902 may be implemented as program modules 916, which generally perform the functions and / or methods of embodiments of the invention described herein. Figure 1 The systems may be implemented in one or more computer systems 902, wherein if they are implemented in multiple computer systems 902, the computer systems may communicate via a network.
[0057] The computer system / server 902 may also communicate with one or more external devices 918, such as a keyboard, a pointing device, a display 920, etc.; with one or more devices that enable a user to interact with the computer system / server 902; and / or with any device that enables the computer system / server 902 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may occur via an input / output (I / O) interface 922. However, the computer system / server 902 may still communicate with one or more networks (such as a local area network (LAN), a general wide area network (WAN), and / or a public network (e.g., the Internet)) via a network adapter 924. As shown, the network adapter 924 communicates with other components of the computer system / server 902 via a bus 908. It should be understood that, although not shown, other hardware and / or software components may be used in conjunction with the computer system / server 902. Examples include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0058] Unless expressly stated otherwise, the terms "embodiment," "embodiments," "the embodiment," "the embodiments," "one or more embodiments," "some embodiments," and "one embodiment" mean "one or more (but not all) embodiments of the invention."
[0059] Unless expressly stated otherwise, the terms "including", "comprising", "having" and variations thereof mean "including but not limited to".
[0060] The enumerated listing of items does not imply that any or all of the items are mutually exclusive, unless expressly stated otherwise.
[0061] Unless expressly stated otherwise, the terms "a", "an" and "the" mean "one or more".
[0062] Unless expressly stated otherwise, devices that are in communication with each other need not be in continuous communication with each other. In addition, devices that are in communication with each other may communicate directly or indirectly through one or more intermediate devices.
[0063] The description of an embodiment with multiple components in communication with each other does not imply that all such components are required. Rather, various optional components are described to illustrate the wide range of possible embodiments of the present invention.
[0064] When a single device or article is described herein, it will be apparent that more than one device / article (whether or not they cooperate) may be used to replace a single device / article. Similarly, where more than one device or article is described herein (whether or not they cooperate), it will be apparent that a single device / article may be used to replace more than one device or article, or that a different number of devices / articles may be used to replace the number of devices or programs shown. The functions and / or features of a device may alternatively be embodied by one or more other devices that are not explicitly described as having such functions / features. Therefore, other embodiments of the present invention do not need to include the device itself.
[0065] For the purpose of illustration and description, the foregoing description of various embodiments of the present invention has been given. It is not intended to be exhaustive or to limit the present invention to the disclosed precise form. According to the above teachings, many modifications and variations are possible. The scope of the present invention is not intended to be limited by this detailed description, but by the appended claims. The above description, examples and data provide a complete description of the manufacture and use of the composition of the present invention. Since many embodiments of the present invention can be made without departing from the spirit and scope of the present invention, the present invention is embodied in the appended claims.
Claims
1. A computer program product for managing tracks in a storage device in a cache, the computer program product comprising a computer readable storage medium having computer readable program code embodied therein, the computer readable program code performing operations when executed, the operations comprising: maintaining a cache list for the cache, the cache list having a least recently used (LRU) end and a most recently used (MRU) end, wherein tracks in the cache are indicated in the cache list; determining the high access region based on a number of accesses to the tracks in the high access region of tracks starting from the MRU end of the cache list; determining whether the accessed track is in the high access area of tracks starting from the MRU end; and In response to determining that the accessed track is in the high access area, a flag is set for the accessed track indicating that after the accessed track is processed at the LRU end, the accessed track is at the MRU end, wherein after the flag is set, the accessed track remains in the current position in the cache list before being accessed.
2. The computer program product according to claim 1, wherein: The operations also include: Maintaining the number of accesses to each of a plurality of continuous track areas from the MRU end to the LRU end in the cache list; Determine a subset of regions whose cumulative number of visits from the MRU end exceeds a threshold; and The high access area is determined based on the subset of areas.
3. The computer program product according to claim 2, wherein: Determining the high access area based on the subset of areas includes determining one of: The cumulative number of visits in the subset of regions divided by the total number of visits in all regions; The total number of entries in the region subset divided by the total number of entries in the cache list; as well as The difference between the last access timestamp at the MRU end and the last access timestamp of the last track in the last region of the region subset is divided by the difference between the last access timestamp of the track at the MRU end of the cache list and the last access timestamp of the track at the LRU end.
4. The computer program product according to claim 2, wherein: The threshold comprises a percentage of the total number of visits to all regions.
5. The computer program product according to claim 2, wherein: The operations also include: receiving a read access to a track indicated in the cache list; determining an area including the accessed track; and Increase the number of visits to the identified area.
6. The computer program product of claim 2, wherein: Determining the region subset includes: The number of visits to each area starting from the MRU end is added to the cumulative number of visits until the cumulative number of visits exceeds the threshold, wherein the high-visit area includes each area starting from the MRU end that is added to the cumulative number of visits until the cumulative number of visits exceeds the threshold.
7. The computer program product of claim 1, wherein: Determine whether the accessed track is included in the high access area: determining a cache residency time of a track since the accessed track was last accessed while in the cache list; determining the accessed region as the track cache residency time divided by the total cache residency time; and It is determined whether the accessed area is included in the high access area, wherein, in response to determining that the accessed area is included in the high access area, the accessed track is in the high access area.
8. The computer program product according to claim 7, wherein: in, The track cache residency time comprises a difference between a current timestamp and a last access timestamp, the last access timestamp indicating the time when the accessed track was last accessed in the cache, The entire cache residency time includes a difference between a last access timestamp of the track at the MRU end when the track was last accessed and a last access timestamp of the track at the LRU end.
9. The computer program product of claim 1, wherein: The operations also include: processing tracks at the LRU end of the cache list to account for demotion; determining whether the flag for the track being processed is set to indicate that the track is at the MRU end; and In response to determining that the flag for the processed track is not set to indicate that the track is at the MRU end, the processed track is demoted.
10. The computer program product according to claim 9, wherein: The operations also include: Determining whether the processed track is in the high access area of the track starting from the MRU end; In response to determining that the processed track is in the high access region, indicating that the processed track is at the MRU end of the cache list; and In response to determining that the processed track is not in the high access area, the processed track is demoted.
11. The computer program product of claim 1 , wherein: The operations also include: determining whether a cache size of the cache is less than a threshold cache size; and In response to determining that the cache size is less than the threshold cache size, removing the indication of the accessed track from the cache list to be added to an MRU array, wherein the tracks indicated in the MRU array are added in batches to the MRU end of the cache list, wherein determining whether the accessed track is in the high access area is performed in response to determining that the cache size is greater than the threshold cache size.
12. A system for managing tracks in a storage device, comprising: processor; cache memory in memory devices; A computer program product, comprising a computer-readable storage medium, wherein the computer-readable storage medium has computer-readable program code embodied therein, wherein the computer-readable program code performs operations when executed, the operations comprising: maintaining a cache list for the cache, the cache list having a least recently used (LRU) end and a most recently used (MRU) end, wherein tracks in the cache are indicated in the cache list; determining the high access region based on a number of accesses to the tracks in the high access region of tracks starting from the MRU end of the cache list; determining whether the accessed track is in the high access area of tracks starting from the MRU end; and In response to determining that the accessed track is in the high access area, a flag is set for the accessed track indicating that after the accessed track is processed at the LRU end, the accessed track is at the MRU end, wherein after the flag is set, the accessed track remains in the current position in the cache list before being accessed.
13. The system according to claim 12, wherein: The operations also include: Maintaining the number of accesses to each of a plurality of continuous track areas from the MRU end to the LRU end in the cache list; Determine a subset of regions whose cumulative number of visits from the MRU end exceeds a threshold; and The high access area is determined based on the subset of areas.
14. The system according to claim 13, wherein: Determining the high access area based on the subset of areas includes determining one of: The cumulative number of visits in the subset of regions divided by the total number of visits in all regions; The total number of entries in the region subset divided by the total number of entries in the cache list; as well as The difference between the last access timestamp at the MRU end and the last access timestamp of the last track in the last region of the region subset is divided by the difference between the last access timestamp of the track at the MRU end of the cache list and the last access timestamp of the track at the LRU end.
15. The system of claim 13, wherein: Determining the region subset includes: The number of visits to each area starting from the MRU end is added to the cumulative number of visits until the cumulative number of visits exceeds the threshold, wherein the high-visit area includes each area starting from the MRU end that is added to the cumulative number of visits until the cumulative number of visits exceeds the threshold.
16. The system of claim 12, wherein: Determine whether the accessed track is included in the high access area: determining a cache residency time of a track since the accessed track was last accessed while in the cache list; determining the accessed region as the track cache residency time divided by the total cache residency time; and It is determined whether the accessed area is included in the high access area, wherein, in response to determining that the accessed area is included in the high access area, the accessed track is in the high access area.
17. A method for managing tracks in a storage device in a cache, comprising: maintaining a cache list for the cache, the cache list having a least recently used (LRU) end and a most recently used (MRU) end, wherein tracks in the cache are indicated in the cache list; determining the high access region based on a number of accesses to the tracks in the high access region of tracks starting from the MRU end of the cache list; determining whether the accessed track is in the high access area of tracks starting from the MRU end; and In response to determining that the accessed track is in the high access area, a flag is set for the accessed track indicating that after the accessed track is processed at the LRU end, the accessed track is at the MRU end, wherein after the flag is set, the accessed track remains in the current position in the cache list before being accessed.
18. The method according to claim 17, further comprising: Maintaining the number of accesses to each of a plurality of continuous track areas from the MRU end to the LRU end in the cache list; Determine a subset of regions whose cumulative number of visits from the MRU end exceeds a threshold; as well as The high access area is determined based on the subset of areas.
19. The method according to claim 18, wherein: Determining the high access area based on the subset of areas includes determining one of: The cumulative number of visits in the subset of regions divided by the total number of visits in all regions; The total number of entries in the region subset divided by the total number of entries in the cache list; as well as The difference between the last access timestamp at the MRU end and the last access timestamp of the last track in the last region of the region subset is divided by the difference between the last access timestamp of the track at the MRU end of the cache list and the last access timestamp of the track at the LRU end.
20. The method according to claim 18, wherein: Determining the region subset includes: The number of visits to each area starting from the MRU end is added to the cumulative number of visits until the cumulative number of visits exceeds the threshold, wherein the high-visit area includes each area starting from the MRU end that is added to the cumulative number of visits until the cumulative number of visits exceeds the threshold.
21. The method according to claim 17, wherein: Determine whether the accessed track is included in the high access area: determining a cache residency time of a track since the accessed track was last accessed while in the cache list; determining the accessed region as the track cache residency time divided by the total cache residency time; and It is determined whether the accessed area is included in the high access area, wherein, in response to determining that the accessed area is included in the high access area, the accessed track is in the high access area.
22. A computer system comprising modules respectively configured to execute the steps of the method according to any one of claims 17 to 21.
Citation Information
Patent Citations
Method and system for cache management of track removal in cache for storage
CN103207839A
Mixed cache management
CN105612499A
Decoupling storage controller cache read replacement from write retirement
CN1967507A
Re-MRU of metadata tracks to reduce lock contention
US20160140053A1
Using an access increment number to control a duration during which tracks remain in cache
US20170344493A1
