Managing a least recently used data cache using persistence
Patent Information
- Application Number
- JP2023518956
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-09-29
- Filing Date
- 2021-09-25
- Publication Date
- 2025-03-05
- Estimated Expiration
- 2041-09-25
Smart Images

Figure 0007640208000001 
Figure 0007640208000002 
Figure 0007640208000003
Abstract
Description
[Technical field]
[0001] Some embodiments of the present disclosure relate to managing a data cache, and more particularly, but not exclusively, to managing a data cache using fast access memory. [Background technology]
[0002] In computer science, a data cache is a component that temporarily stores data so that future requests for that data can be served faster than the initial request for that data. A data cache may include hardware, software, or both. The data stored in a data cache may be the result of a previous computation or a copy of data stored elsewhere.
[0003] For brevity, hereafter the term "cache" will be used to mean "data cache", but the terms will be used interchangeably.
[0004] A cache client is an entity, such as a processing unit or application, that accesses data stored in a cache. In some systems, the cache is local to the cache client and separate from the bulk storage in which the data is stored, allowing the cache client faster access to a copy of the data stored in the cache than when accessing the data on the bulk storage. For example, if the data is stored on a hard disk drive (HDD), a portion of the data may be stored in a cache that resides in random access memory (RAM). Access to RAM is significantly faster than access to a HDD, so data stored in the cache in RAM may be served faster than other data stored on the HDD. Another example is to implement the cache using a high-speed memory, which is more expensive than other memory with slower access times, that is used to store the data. Another example is when the data is stored on network-attached storage. The cache client may store a copy of a portion of the data in local storage, which may be volatile or non-volatile. In this example, access to the data on the local storage may be faster because it does not require communication over the network.
[0005] A cache may not store copies of all data stored in bulk storage. Some caches are used to store data that cache clients have recently or frequently accessed, improving the performance of the cache clients by serving such requests faster than they would be served from bulk storage. If a cache stores only copies of a small portion of the data stored in bulk storage, it must determine whether a data access request from a cache client can be served from the cache or whether the bulk storage for the data must be accessed. The term cache metadata refers to information that records multiple data items stored in a cache, e.g., each copy of a data item stored in bulk storage, and is used to manage the cache. Such information may include the time when a copy of the data item was accessed, and the source of the data item on permanent storage, e.g., a memory address or file name.
[0006] Over time, cache clients may frequently access new data items that were not accessed before, and the cache may need to be populated with a copy of the new data item. If the cache has limited capacity, it may be necessary to remove a copy of another data item from the cache in order to make a copy of the new data item in the cache. A least recently used (LRU) cache is a cache in which, when a data item needs to be removed from the cache, the data item that has been used the longest is removed first. Summary of the Invention
[0007] According to an aspect of the invention, there is a method, computer program product, and / or system for managing a data cache that performs the following operations (not necessarily in the following order): (i) storing a cache management list including a plurality of entries, the cache management list including: (a) a tail portion, stored in a first storage, documenting a plurality of recently accessed data items stored in the data cache, and (b) a body portion, stored in a second storage, documenting a plurality of less recently accessed data items stored in the data cache; (ii) in each cache management iteration of the plurality of cache management iterations, (a) receiving a first data access request, (b) recording the first data access request in the tail portion, (c) identifying a plurality of replicated entries associated with the first data access request and present in the body portion and the tail portion, and (d) removing each of the plurality of replicated entries from the body portion in accordance with a physical organization in the second storage of the plurality of replicated entries.
[0008] Some embodiments are herein described, by way of example only, with reference to the accompanying drawings, in which: Specific reference will now be made in detail to the drawings, stressing that the particulars shown are by way of example and for the purposes of illustrative discussion of the embodiments, in which the accompanying description will make apparent to those skilled in the art how the embodiments may be practiced. [Brief description of the drawings]
[0009] [Figure 1] FIG. 2 is a block diagram of a cache management list in accordance with at least one embodiment of the invention. [Diagram 2] 1 is a schematic block diagram of a system in accordance with at least one embodiment of the present invention. [Diagram 3]1 is a flowchart that generally depicts an optional flow of operations for managing a cache, in accordance with at least one embodiment of the present invention. [Figure 4] 1 is a flowchart that generally depicts an optional flow of operations for a cache miss, in accordance with at least one embodiment of the present invention. [Diagram 5] 1 is a flowchart that generally depicts an optional flow of operations for managing access to a plurality of data items. [Figure 6] FIG. 1 is a block diagram of a possible hardware and software environment for software and / or methods in accordance with at least one embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] The following description focuses on using a cache management list containing multiple entries, and more specifically, on managing a least recently used (LRU) cache. However, the following description may be applied to other cache replacement policy schemes other than LRU, and other tests may be applied to distinguish between portions of the cache management list, such as Most Recently Used, First In First Out, and Last In Last Out.
[0011] A cache hit occurs when a cache client accesses a data item that is present in the cache. A cache miss occurs when a cache client requests access to a data item that is not present in the cache (a missed data item). When a cache miss occurs, bulk storage must be accessed to access the missed data item. In addition, a copy of the missed data item may need to be added to the cache.
[0012] Some embodiments of the present disclosure describe systems and methods for managing a memory cache when an amount of metadata recording a plurality of data items in the cache exceeds an amount of a first storage available for the metadata. In such embodiments, the metadata is split between a first storage in which a plurality of recently accessed data items are recorded and a second storage in which a plurality of less recently accessed data items are recorded. Optionally, the metadata in the first and second storages are synchronized during each of a plurality of cache management iterations.
[0013] The above and other objects are achieved by means of the features of the independent claims. Further implementations are evident from the dependent claims, the description and the drawings.
[0014] According to a first aspect of the present invention, a method for managing a data cache includes storing a cache management list including a plurality of entries, the list having a tail portion stored in a first storage, the tail portion recording a plurality of recently accessed data items stored in the data cache, and a body portion stored in a second storage, the body portion recording a plurality of less recently accessed data items stored in the data cache. Optionally, the method includes receiving at least one data access request in each of a plurality of cache management iterations, recording the at least one data access request in the tail portion, identifying a plurality of replicated entries present in the body portion and the tail portion, and removing each of the plurality of replicated entries from the body portion in the second storage according to a physical organization in the second storage of the plurality of replicated entries. Logging data accesses to the tail portion when the tail portion resides in the first storage facilitates increased throughput in managing the cache compared to when the first storage is not large enough to store the entire cache management list and the entire cache management list resides in the second storage, for example when accesses to the first storage are faster than accesses to the second storage. Removing each of the multiple replicated entries from the body portion in accordance with a physical organization of the multiple replicated entries in the second storage reduces the amount of time required to update the body portion compared to removing the multiple replicated entries in a random order.
[0015] According to a second aspect of the present invention, a system for managing a data cache comprises at least one hardware processor, the at least one hardware processor configured to: store a cache management list including a plurality of entries, the list having a tail portion stored in a first storage connected to the at least one hardware processor, the tail portion recording a plurality of recently accessed data items stored in the data cache, and a body portion stored in a second storage connected to the at least one hardware processor, the body portion recording a plurality of less recently accessed data items stored in the data cache; receive at least one data access request in each of a plurality of cache management iterations; record the at least one data access request in the tail portion; identify a plurality of replicated entries present in the body portion and the tail portion; and remove each of the plurality of replicated entries from the body portion in the second storage in accordance with a physical organization in the second storage of the plurality of replicated entries.
[0016] According to a third aspect of the present invention, a system for managing access to a plurality of data items includes a data cache that stores at least a portion of the plurality of data items, and at least one hardware processor coupled to the data cache and configured to manage the data cache by: storing a cache management list including a plurality of entries, the cache management list having a tail portion stored in a first storage, the tail portion recording a plurality of recently accessed data items stored in the data cache, and a body portion stored in a second storage, the body portion recording a plurality of less recently accessed data items stored in the data cache; receiving at least one data access request in each of a plurality of cache management iterations; recording the at least one data access request in the tail portion; identifying a plurality of replicated entries present in the body portion and the tail portion; and removing each of the plurality of replicated entries from the body portion in the second storage according to a physical organization in the second storage of the plurality of replicated entries. Managing the data cache as described above facilitates increased throughput of the system for managing access to a plurality of data items.
[0017] In implementations of the first and second aspects, the cache management list further includes a head portion stored in the first storage, the head portion recording a plurality of least recently accessed data items stored in the data cache. Optionally, the method further includes, during at least a portion of the cache management iterations, identifying a new plurality of least recently used entries in the body portion, recording the new plurality of least recently accessed data items stored in the data cache, and copying the new plurality of least recently used entries from the body portion in the second storage to the head portion in the first storage. Storing the head portion in the first storage facilitates increased throughput of managing the cache when the first storage is not large enough to store the entire cache management list, as compared to storing the entire cache management list in the second storage when, for example, access to the first storage is faster than access to the second storage.
[0018] In another implementation of the first and second aspects, the method further includes copying the tail portion to the second storage. Optionally, the body portion is stored in the second storage in a plurality of files. Optionally, copying the tail portion to the second storage includes adding a file including the tail portion to the plurality of files. Copying the tail portion to the second storage facilitates persisting the tail portion when the second storage is not a volatile storage. Adding a file facilitates reducing the amount of time required to copy the tail portion to the second storage, for example, as compared to updating an existing file.
[0019] In a further implementation of the first and second aspects, recording at least one data access request in the tail section includes at least one of the following: updating an entry in the tail section to record another access request to the respective data item recorded by the entry and moving the updated entry to the end of the tail section; and adding a new entry to the tail section. Optionally, at least one other cache management iteration of the plurality of cache management iterations is performed conditioned on identifying that the tail section is full. Optionally, at least a portion of the plurality of cache management iterations is performed periodically. Performing at least one other cache management iteration conditioned on identifying that the tail section is full facilitates identifying candidates for eviction from the cache from the body section rather than from the tail section, thereby promoting improved throughput of managing the cache by reducing the likelihood of future cache misses. Additionally, performing at least a portion of the plurality of cache management iterations periodically facilitates improved throughput of managing the cache by identifying candidates for eviction from the head section, thereby reducing the likelihood of performing a cache management iteration in responding to a data access request.
[0020] In a further implementation of the first and second aspects, in at least one cache management iteration of the multiple cache management iterations, the method further includes identifying one of the at least one data access requests requesting access to a data item not stored in the data cache and inserting the data item into the data cache. Optionally, the cache management list further includes a head portion stored in the first storage, the head portion recording a plurality of longest unaccessed data items stored in the data cache. Optionally, in at least one cache management iteration, the method further includes identifying at least one entry in the head portion that is not in the tail portion to record access to the at least one data item stored in the data cache and removing the at least one entry from the head portion. Optionally, a further cache management iteration of the at least one cache management iteration of the multiple cache management iterations is performed conditioned on failing to identify at least one entry in the head portion that is not in the tail portion. Contingent on failing to identify at least one entry in the head portion that is not in the tail portion, performing at least one further cache management iteration of the plurality of cache management iterations facilitates identifying candidates for eviction from the cache from the body portion but not from the tail portion, thereby improving throughput of managing the cache by reducing the likelihood of future cache misses.
[0021] In a further implementation of the first and second aspects, a ratio of the first access time of the first storage to the second access time of the second storage is less than an access time ratio threshold. Using a first storage having an access time such that the ratio of the first access time of the first storage to the second access time of the second storage is less than the access time ratio threshold reduces the amount of time to respond to a memory access request compared to having the entire cache management list stored in the second storage.
[0022] In a further implementation of the first and second aspects, the first storage is selected from a first group of digital storage consisting of random access memory (RAM), static RAM (SRAM), dynamic RAM (DRAM), hard disk drive, and solid state drive, and the second storage is selected from a second group of digital storage consisting of DRAM, hard disk drive, solid state drive, electrically erasable programmable read-only memory (EEPROM), NAND type flash memory, network attached storage, and network storage.
[0023] In a further implementation of the first and second aspects, at least one of the at least one data access request is received from a software object executed by the at least one hardware processor. Optionally, at least one other of the at least one data access request is received from at least one other hardware processor connected to the at least one hardware processor. Optionally, the at least one other hardware processor is connected to the at least one hardware processor via at least one digital communication network interface connected to the at least one hardware processor.
[0024] In an implementation of the third aspect, the at least one hardware processor is further configured to: receive at least one other data access request requesting access to at least one data item of the plurality of data items; identify at least one data item of the at least some data items stored in the data cache; and access at least one data item in the data cache in response to the at least one data access request. Accessing the data item in the data cache improves the throughput of the system for accessing the plurality of data items by reducing the number of times the data item is accessed on another storage, for example when the storage is remote from the at least one hardware processor.
[0025] Other systems, methods, features, and advantages of the present disclosure will become apparent to one with skill in the art upon examination of the following figures and detailed description. All such additional systems, methods, features and advantages are intended to be included herein, be within the scope of the present disclosure, and be protected by the accompanying claims.
[0026] Unless otherwise defined, all technical and / or scientific terms used herein have the same meaning as commonly understood by those skilled in the art. Although methods and materials similar or equivalent to those described herein may be used in the practice or testing of the embodiments, exemplary methods and / or materials are described below. In case of conflict, the patent specification, including definitions, controls. In addition, the materials, methods, and examples are merely illustrative and are not necessarily intended to be limiting.
[0027] One possible way to manage the cache is by managing a cache management list that includes a number of entries, each of which records a data item stored in the cache. Each entry may include a record of the most recent time that a particular data item was accessed using the data cache by one or more data clients. The cache management list may be ordered, having a head and a tail, such that new entries are added to a portion of the end of the cache management list, also referred to as the tail portion. At the beginning of such a cache management list, another portion, also referred to as the head portion, contains the oldest entry of the multiple entries. Referring now to FIG. 1, a block diagram of an exemplary cache management list 100 is shown. In this example, the cache management list 100 includes a head portion 101, a body portion 102, and a tail portion 103. In this example, the head portion 101 includes at least one entry 111, and t 1 The entry records accesses to the respective data items associated with the entry at a first time, denoted by t. Additionally, in this example, the body portion 102 includes at least one other entry 121, and 2 In addition, in this example, the tail portion 103 includes at least one other entry 131 and records another access to another individual data item associated with the entry at a second time, denoted by t 3 A further access to a further respective data item associated with the entry is recorded during a third time period indicated by .
[0028] As discussed above, in an LRU cache, when a data item needs to be removed from the cache, the data item that has been used the longest (the least recently accessed) is removed first. An LRU cache may be managed using a cache management list in which a head portion 101 contains one or more entries that record one or more least recently accessed data items, and one or more other entries in a tail portion 103 that record one or more recently accessed data items. For example, in a cache management list 100, t 3 t 1 and 2 It may be equal to or more recent than t 3 t 1 and t 2 is equal to or later than both. In this example, t 1 t 2 and 3 may be equal to or less recent than t 3 t 2 and t 3 The recently accessed data item or items may be one or more most recently accessed data items, i.e., the time associated with any entry in tail portion 103 may not be later than any other time associated with any other entry in body portion 102 or head portion 101. The less recently accessed data items may be recorded by other entries in body portion 102 of the list. For example, t 2 t 3 It may be less recent than or equal to t 2 is 3 is equal to or earlier than.
[0029] According to some cache replacement policies, when a data item in the cache needs to be replaced, i.e., when one or more existing data items need to be removed in order to store another data item in its place, one or more entries are selected from the head portion 101, e.g., entry 131, and the individual data items associated with the selected entries are replaced in the cache. In such policies, when a new data item is added to the cache, an entry recording accesses to the new data item is added to the tail portion 103.
[0030] To improve the throughput of cache clients accessing the cache, the cache management list is typically stored in a memory or storage to which the cache client has fast access. For example, if the cache client is a hardware processor, the cache management list may be stored in a local memory component and electronically coupled to the hardware processor. However, depending on the amount of data items whose copies are stored in the cache, and additionally or alternatively depending on the amount of data describing accesses to each data item in the cache, the size of the cache management list may exceed the amount of storage allocated to store the cache management list. In the above example, the size of the cache management list may exceed the amount of local memory allocated to store the cache management list.
[0031] Since high-speed storage and high-speed memory are typically more expensive than low-speed storage and low-speed memory, increasing the amount of storage or memory for storing the cache management list may be hindered by the cost of such storage or memory. A possible solution is to store the cache management list in a larger storage, such as a hard disk drive. However, the larger storage is typically slower than other storage typically used to store the cache management list. In addition, in some technologies for large storage, such as hard disk drives, the access time to an entry in the cache management list is affected by the physical organization of the entries in the cache management list in the storage. Accessing two or more of the entries without considering the physical organization of the entries in the storage is much slower than if the two or more entries are accessed according to their physical organization in the storage. For example, if the cache management list is stored in a file on the hard disk drive, opening and closing the file at a time to access one entry may be much slower than opening the file and accessing all of the one or more entries in the file before closing the file.
[0032] Some embodiments described herein propose to split the cache management list into two storages, with a tail portion recording a number of recently accessed data items stored in the cache and residing in a first storage, and a body portion recording a number of less recently accessed data items stored in the cache and residing in a second storage. The first storage may be faster than the second storage such that a first access time indicating the length of time required to retrieve data from the first storage is shorter than a second access time indicating the length of time required to retrieve data from the second storage. The first storage may be significantly faster than the second storage such that a ratio between the first access time and the second access time is less than an access time ratio threshold, e.g., less than 0.1, or less than 0.01, i.e., the first storage is at least 10 times, or 100 times faster than the second storage. For example, the first storage may be a static RAM (SRAM) and the second storage may be a RAM. In another example, the first storage is RAM and the second storage is a HDD or a solid-state drive (SSD). In another example, the first storage is an SSD that has a faster access time than another SSD used for the second storage.
[0033] In such an embodiment, one or more data access requests are recorded in the tail section. If the accessed data item is in the cache (a cache hit), the access is recorded by adding an entry to the tail section or by updating an existing entry, e.g., by moving it to the end of the tail section. When a data item is added to the cache, an entry recording the access to the data item is added to the tail section. An entry is considered a duplicate of another entry if both the entry and the other entry record accesses to the same data item. The entry and the other entry may record separate accesses to the same data item. Recording data accesses in the tail section when the tail section resides in the first storage facilitates increased throughput in managing the cache, e.g., when accesses to the first storage are faster than accesses to the second storage, as compared to when the first storage is not large enough to store the entire cache management list and the entire cache management list resides in the second storage.
[0034] Since data accesses are recorded only in the tail part, over time, the tail may include one or more entries that are duplicates of one or more entries in the body part. In some embodiments described herein, the present disclosure proposes identifying the duplicated entries present in the body part and the tail part, and removing each of the duplicated entries from the body part in the second storage. Optionally, removing each of the duplicated entries from the body part follows a physical organization of the duplicated entries in the second storage. For example, if the duplicated entries are located in multiple files in the second storage, removing each of the duplicated entries includes opening each of the multiple files at a time and removing all of the duplicated entries in the file before closing the file. Removing each of the duplicated entries from the body part according to a physical organization of the duplicated entries in the second storage reduces the amount of time required to update the body part compared to removing the duplicated entries in a random order.
[0035] Optionally, identifying the duplicated entries and removing the duplicated entries from the body portion is performed in each of a plurality of cache management iterations (sometimes referred to herein as management iterations). Optionally, one or more of the plurality of management iterations are performed periodically. Optionally, one or more other management iterations of the plurality of management iterations are performed conditional on identifying the tail portion as full, e.g., when a new entry needs to be added to the tail portion, or after adding a new entry to the tail portion. Optionally, the tail portion is copied to the second storage, e.g., when the second storage is a non-volatile storage, e.g., HDD or SSD, and the first storage is volatile, e.g., RAM.
[0036] Additionally, in some embodiments, a head portion of the cache management list is stored in the first storage. Optionally, a copy of the head portion is stored in the first storage. Optionally, when a data item needs to be removed from the cache, one or more entries in the head portion that are not in the tail portion are identified, where one or more entries record accesses to the data item. Optionally, when the data item is removed from the cache, one or more entries are removed from the head portion. Storing the head portion in the first storage facilitates improved throughput of managing the cache compared to storing the entire cache management list in the second storage when the first storage is not large enough to store the entire cache management list, e.g., when accesses to the first storage are faster than accesses to the second storage.
[0037] Optionally, one or more further management iterations of the plurality of management iterations are executed conditional on identifying the head portion as empty.
[0038] Before describing at least one embodiment in detail, it is to be understood that the embodiments are not necessarily limited in their application to the details of construction and the arrangement of components and / or methods set forth in the following description or illustrated in the drawings and / or examples. Implementations described herein are capable of other embodiments or of being practiced or carried out in various ways.
[0039] The embodiments may be a system, a method, and / or a computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions for causing a processor to perform aspects of the embodiments.
[0040] A computer-readable storage medium may be a tangible device capable of holding and storing instructions for use by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electronic 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. A non-exhaustive list of more specific examples of computer-readable storage media includes: portable computer diskettes, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROMs or flash memories), static random access memories (SRAMs), portable compact disk read-only memories (CD-ROMs), digital versatile disks (DVDs), memory sticks, floppy disks, and any suitable combinations of the foregoing. As used herein, computer-readable storage media should not be construed as being ephemeral signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., light pulses passing through a fiber optic cable), or electrical signals transmitted over electrical wires.
[0041] The computer readable program instructions described herein may be downloaded from a computer readable storage medium to an individual computing / processing device or to an external computer or storage device over a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network may include copper transmission cables, optical transmission fiber, wireless transmission, routers, firewalls, switches, gateway computers, or edge servers, or a combination thereof. A network adapter card or network interface of each computing / processing device receives the computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the individual computing / processing device.
[0042] The computer readable program instructions for carrying out the operations of the present embodiment may be either source code or object code written in any combination of one or more programming languages, including assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state setting data, or object oriented programming languages such as Smalltalk, C++, and traditional procedural programming languages such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer as a standalone software package, partly on the user's computer and partly on a remote computer, or all on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or wide area network (WAN), or the connection may be made to an external computer (e.g., via the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) can execute computer readable program instructions to individualize the electronic circuitry by utilizing state information of the computer readable program instructions to perform aspects of the embodiments.
[0043] Aspects of the present embodiments are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to the embodiments. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer readable program instructions.
[0044] These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute on the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams. These computer readable program instructions may also be stored on a computer readable storage medium capable of directing a computer, programmable data processing apparatus, or other device, or combination thereof, to function in a particular manner, such that the computer readable storage medium on which the instructions are stored comprises an article of manufacture including instructions for implementing aspects of the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.
[0045] The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to produce a computer-implemented process and cause the computer, other programmable apparatus, or other device to perform a series of operational steps, such that the instructions executing on the computer, other programmable apparatus, or other device implement the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.
[0046] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments. In this regard, each block of the flowcharts or block diagrams may represent a module, segment, or portion of instructions, including one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions shown in the blocks may occur out of the order shown in the figures. For example, two blocks shown in succession may in fact be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order depending on the functionality involved. It should also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations of blocks in the block diagrams and / or flowchart illustrations, may be implemented by a special-purpose hardware-based system that performs the specified functions or actions or executes a combination of special-purpose hardware and computer instructions.
[0047] 2, a schematic block diagram of an example system 200 is shown, according to some embodiments. In such an embodiment, at least one hardware processor 211 is connected to a first storage 201 and a second storage 202. Optionally, the first storage 201 is selected from a first group of storages including RAM, SRAM, dynamic random access memory (DRAM), HDD, and SSD. Optionally, the second storage 202 is selected from a second group of storages including DRAM, HDD, SSD, electrically erasable programmable read-only memory (EEPROM), NAND type flash memory, network attached storage, and network storage. Optionally, the first storage 201 is faster than the second storage 202, such that a first access time of the first storage 201 is less than a second access time of the second storage 202. Optionally, a ratio between the first access time and the second access time is less than an access time ratio threshold. Some examples of access time ratio thresholds are 0.1, 0.5, 0.01, 0.035, and 0.0001.
[0048] For brevity, hereinafter the term "processor" will be used to mean "at least one hardware processor", although these terms may be used interchangeably.
[0049] Optionally, the processor 211 is connected to a data cache 210. Optionally, the data cache 210 includes a plurality of data items. Optionally, the data cache 210 is stored in the first storage 201. Optionally, the data cache 210 is stored in the second storage 202. Optionally, the data cache 210 is stored in another storage (not shown) connected to the processor 211. Optionally, the processor 211 manages the data cache 210, optionally using a cache management list 100. Optionally, the cache management list 100 includes a tail portion 103 that records a plurality of recently accessed data items stored in the data cache 210. Optionally, the tail portion 103 is stored in the first storage 201. Optionally, the cache management list 100 includes a body portion 102 that records a plurality of less recently accessed data items stored in the data cache 210. Optionally, the body portion 102 is stored in the second storage 202. Optionally, the cache management list 100 includes a head portion 101 that records a number of the longest recently accessed data items stored in the data cache 210. Optionally, the head portion 101 is stored in the first storage 201.
[0050] Optionally, the processor 211 is connected to one or more digital communication network interfaces 205. For brevity, the term "network interface" is used to mean "one or more digital communication network interfaces", but these terms are used interchangeably. Optionally, the network interface 205 is connected to a local area network (LAN), such as a wireless LAN or an Ethernet LAN. Optionally, the network interface 205 is connected to a wide area network (WAN), such as a cellular network or the Internet. Optionally, the first storage 201 is connected to the processor 211 via the network interface 205. Optionally, the second storage 202 is connected to the processor 211 via the network interface 205.
[0051] Optionally, another processor 220 is connected to the processor 211, optionally via a network interface 205. Optionally, the other processor 220 accesses the data cache 210, optionally by sending one or more access requests to the processor 211.
[0052] To manage the data cache 210, in some embodiments, the system 200 implements the following optional methods.
[0053] 3, a flow chart is shown that generally depicts an optional flow of a method 300 for managing a cache, according to some embodiments. In such an embodiment, at 301, the processor 211 receives one or more data access requests. Optionally, at least one of the one or more data access requests is received from a software object, e.g., an application, executed by the processor 211. Optionally, at least one other of the one or more data access requests is received from another processor 220, optionally via the network interface 205.
[0054] At 302, the processor 211 optionally records one or more data access requests in the tail portion 103. Optionally, recording the one or more data access requests in the tail portion 103 includes updating an entry in the tail portion 103, where the entry records another access request to the respective data item recorded by the entry. Optionally, recording the one or more data access requests in the tail portion 103 further includes moving the updated entry to the tail of the tail portion 103. Optionally, recording the one or more data access requests in the tail portion 103 includes adding a new entry to the tail portion 103, optionally to the tail of the tail portion 103.
[0055] Over time, synchronization may need to occur between the body part 102 and the tail part 103. At 311, the processor 211 optionally identifies multiple replicated entries present in the body part 102 and the tail part 103. At 312, the processor 211 optionally removes each of the multiple replicated entries from the body part 102 in the second storage 202 according to a physical organization of the multiple replicated entries in the second storage 202.
[0056] Optionally, 301, 302, 311, and 312 are performed in each of the multiple management iterations. Optionally, at least some of the multiple management iterations are performed periodically. Optionally, one or more of the multiple management iterations are performed conditional on identifying the tail portion 103 as full. Optionally, in one or more of the multiple management iterations, the processor 211 copies the tail portion 103 to the second storage 202 at 313, for the purpose of creating a persistent copy of the tail portion 103, for example when the second storage 202 is non-volatile. Optionally, the body portion 102 is stored in the second storage 202 in a plurality of files. Optionally, copying the tail portion 103 to the second storage 202 includes appending a file including the tail portion 103 to the plurality of files.
[0057] In at least one management iteration of the multiple management iterations, at least one of the one or more data access requests may result in a cache miss, where the at least one data access request is a request to access a data item that is not stored in the data cache 210.
[0058] 4, a flow chart is shown that generally depicts an optional flow of operations 400 for a cache miss, according to some embodiments. In such an embodiment, at 401, the processor 211 identifies one or more data access requests that request access to a data item that is not stored in the data cache 210. Optionally, at 402, the processor 211 inserts the data item into the data cache. Optionally, one or more data items need to be evicted from the data cache 210 in order to record the data access request. Optionally, at 411, the processor 211 identifies one or more entries in the head portion 101 that are not in the tail portion 103, where the one or more entries record access to at least one data item stored in the data cache 210. For example, processor 211 may check whether the entry in head portion 101 that records the first accessed data item is in tail portion 103, and continue in ascending order of access time until it identifies one or more entries in head portion 101 that are not in tail portion 103. Optionally, one or more entries in head portion 101 are not in tail portion 103 and are not in body portion 102. At 413, processor 211 optionally removes one or more entries from head portion 101.
[0059] Referring again to Fig. 3, it may be necessary to update the head portion 101 stored in the first storage 201. In at least a portion of the management iterations, in 321, the processor 211 optionally identifies new least recently used entries in the body portion 102, and in 322, the processor 211 optionally copies the new least recently used entries from the body portion 102 in the second storage 202 to the head portion 101 in the first storage 201. Optionally, upon copying the new least recently used entries from the body portion 102 to the head portion 101, the processor 211 additionally removes the new least recently used entries from the body portion 102, in effect moving the new least recently used entries from the body portion 102 to the head portion 101. Optionally, the processor 211 removes the new least recently used entries from the body portion 102 in another management iteration of the management iterations. Optionally, in 411, the processor 211 performs at least some of the multiple management iterations on condition that it fails to identify one or more entries in the head portion 101 that are not in the tail portion 103, for example if the head portion 101 is empty.
[0060] In some embodiments, the system 200 manages access to a plurality of data items, for example, a plurality of data items stored in a cloud-based object storage service. In this example, a majority of the plurality of data items are stored in storage remote to the processor 211. In such an embodiment, the data cache 210 stores a plurality of copies, each of at least a portion of the plurality of data items. Optionally, the copies stored in the data cache 210 include 100 terabytes or more of storage. Optionally, the data cache 210 is stored in one or more HDDs, additionally or alternatively, in one or more SSDs. Optionally, the second storage 202 that stores the body portion 102 is one or more other HDDs, additionally or alternatively, one or more other SSDs. Optionally, the first storage 201 that stores the head portion 101 and the tail portion 103 is a memory component coupled to the processor 211.
[0061] In some embodiments, to manage access to multiple data items, the system 200 implements the following non-mandatory methods.
[0062] Further referring now to FIG. 5, a flow chart is shown that generally represents an optional flow of operations 500 for managing access to a plurality of data items, according to some embodiments. In such an embodiment, at 501, the processor 211 manages the data cache 210, optionally using the method 300. At 510, the processor 211 optionally receives one or more data access requests, for example from other processors 220 or from software objects executed by the processor 211. Optionally, the one or more data access requests request access to at least one data item of the plurality of data items. At 511, the processor 211 optionally identifies at least one data item within the data cache 210, i.e., within at least a partial copy of the plurality of data items stored in the data cache 210. At 512, the processor 211 optionally accesses the at least one data item within the data cache 210 in response to the one or more data access requests.
[0063] Although the description of various embodiments has been presented for illustrative purposes, it is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used in this specification is chosen to best explain the principles of the embodiments, practical applications, or technical improvements over the art found in the market, or to allow others skilled in the art to understand the embodiments disclosed herein.
[0064] It is expected that between the expiration of this application and the expiration of the patent, many related storages will be developed, and the scope of the term "storage" is intended to include all such new technologies. In addition, it is expected that between the expiration of this application and the expiration of the patent, many related data items and cache entries will be developed, and the scope of the terms "data item" and "entry" is intended to include all such new technologies.
[0065] As used herein, the term "about" refers to ±10%.
[0066] The terms "comprises," "comprising," "includes," "including," "having," and variations thereof mean "including but not limited to." This term encompasses the terms "consisting of" and "consisting essentially of."
[0067] The phrase "consisting essentially of" means that the composition or method may include additional components and / or steps, but only if the additional components and / or steps do not materially alter the basic and novel characteristics of the claimed composition or method.
[0068] As used herein, the singular forms "a," "an," and "the" include plural references unless the context clearly dictates otherwise. For example, the term "a compound" or "at least one compound" may include a plurality of compounds, including mixtures thereof.
[0069] The word "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any embodiment described as "exemplary" should not necessarily be construed as preferred or advantageous over other embodiments, or as excluding the incorporation of features from other embodiments, or both.
[0070] The phrase "optionally" is used herein to mean "provided in some embodiments and not provided in other embodiments." Any particular embodiment may include multiple "optional" features, unless such features are inconsistent with one another.
[0071] Throughout this application, various embodiments may be presented in a range format. It should be understood that the description in range format is merely for convenience and brevity and should not be construed as an inflexible limitation on the scope of the embodiments. Thus, a description of a range should be considered to have all possible subranges specifically disclosed, as well as individual numerical values within that range. For example, a description of a range such as 1-6 should be considered to have specifically disclosed subranges such as 1-3, 1-4, 1-5, 2-4, 2-6, 3-6, etc., as well as individual numbers within that range, for example, 1, 2, 3, 4, 5, and 6. This applies regardless of the breadth of the range.
[0072] Whenever a numerical range is given herein, it is meant to include every recited number (fractional or integer) within the range given. The phrases "ranging from" between a first designated number and a second designated number, and "ranging from" from the first designated number to a second designated number, are used interchangeably herein and are meant to include the first designated number, the second designated number, and all fractions and integers in between.
[0073] It will be appreciated that, for clarity, certain features of embodiments that are described in the context of separate embodiments may also be provided in combination in a single embodiment. Conversely, for brevity, various features of an embodiment that are described in the context of a single embodiment may also be provided separately or in any suitable subcombination or as preferred in any other described embodiment. Certain features described in the context of various embodiments should not be construed as essential features to those embodiments unless the embodiment would not operate without those elements.
[0074] While the embodiment has been described in conjunction with specific embodiments thereof, it is evident that many alternatives, modifications, and variations will be apparent to those skilled in the art. Accordingly, it is intended to embrace all such alternatives, modifications, and variations that fall within the spirit and broad scope of the appended claims.
[0075] All publications, patents, and patent applications mentioned in this specification are incorporated herein by reference in their entirety to the same extent as if each individual publication, patent, or patent application was specifically and individually indicated to be incorporated herein by reference. In addition, citation or identification of any reference in this application should not be construed as an admission that such reference is available as prior art to the present invention. To the extent section headings are used, they should not be construed as necessarily limiting. In addition, any priority documents of this application are incorporated herein by reference in their entirety.
[0076] Next, embodiments of possible hardware and software environments for the software and / or methods according to the present invention will be described in detail with reference to the drawings. Figure 6 is a functional block diagram illustrating various parts of a networked computer system 600, including: a client computer 602, a communication network 604, a storage subsystem 606, a server computer 608, a communication unit 610, a processor set 612, an input / output (I / O) interface set 614, a display device 616, an external device 618, a memory 620, a random access memory (RAM 622), a cache 624, a persistent storage 626, and a cache manager 628.
[0077] Storage subsystem 606 is in many ways representative of various computer subsystems in the present invention, and therefore several portions of storage subsystem 606 will now be considered in the following paragraphs.
[0078] The storage subsystem 606 may be a laptop computer, tablet computer, netbook computer, personal computer (PC), desktop computer, personal digital assistant (PDA) smart phone, or any programmable electronic device capable of communicating with client subsystems over the communications network 604. The cache manager 628 is a collection of machine-readable instructions and / or data used to create, manage, and control certain software functions, discussed in detail below in the "Example Embodiments" subsection of this "Description of the Invention" section.
[0079] The storage subsystem 606 can communicate with other computer subsystems via a communications network 604. The communications network 604 can be, for example, a local area network (LAN), a wide area network (WAN) such as the Internet, or a combination of the two, and can include wired, wireless, or fiber optic connections. In general, the communications network 604 can be any combination of connections and protocols that support communication between server and client subsystems.
[0080] Storage subsystem 606 is shown as a block diagram with many double-headed arrows. These double-headed arrows (without separate labels) represent a communications fabric that enables communication between the various components of storage subsystem 606. This communications fabric may be implemented with any architecture designed to pass data and / or control information between processors (e.g., microprocessors, communications and network processors), system memory, peripheral devices, and any other hardware components in the system. For example, the communications fabric may be implemented, at least in part, with one or more buses.
[0081] Memory 620 and persistent storage 626 are computer-readable storage media. In general, memory 620 may include any suitable volatile or non-volatile computer-readable storage media. It is further noted that currently, or in the foreseeable future, or both: (i) external device 618 may provide some or all of the memory for storage subsystem 606, and / or (ii) devices external to storage subsystem 606 may provide memory for storage subsystem 606.
[0082] The cache management program 628 is stored in persistent storage 626 for access and / or execution by one or more of the individual computer processor sets 612, typically through one or more of the memories of memory 620. Persistent storage 626: (i) is at least more persistent than signals in motion, (ii) stores programs (including soft logic and / or data) in a tangible medium (such as the magnetic or optical domain), and (iii) is substantially less persistent than permanent storage. Alternatively, data storage may be more persistent and / or permanent than the type of storage provided by persistent storage 626.
[0083] Cache management program 628 may include machine-readable executable instructions and / or tangible data (i.e., the type of data stored in a database). In this particular embodiment, persistent storage 626 includes a magnetic hard disk drive. As an example of some possible variations, persistent storage 626 may include a solid state hard drive, a semiconductor storage device, a read only memory (ROM), an erasable programmable read only memory (EPROM), a flash memory, or any other computer readable storage medium capable of storing program instructions or digital information.
[0084] The media used by persistent storage 626 may also be removable. For example, a removable hard drive may be used for persistent storage 626. Other examples include optical and magnetic disks, thumb drives, and smart cards that are inserted into a drive for transfer to another computer-readable storage medium that is also part of persistent storage 626.
[0085] The communications unit 610, in these examples, provides for communication with other data processing systems or devices external to the storage subsystem 606. In these examples, the communications unit 610 includes one or more network interface cards. The communications unit 610 may provide communications through the use of either physical communications links, wireless communications links, or both. Any software modules discussed herein may be downloaded to a persistent storage device (such as persistent storage 626) through a communications unit (such as communications unit 610).
[0086] The I / O interface set 614 allows for input and output of data with other devices that may be locally connected in data communication to the server computer 608. For example, the I / O interface set 614 provides a connection to external devices 618. The external devices 618 may include devices such as a keyboard, a keypad, a touch screen, or any other suitable input device or combination thereof. The external devices 618 may also include portable computer-readable storage media, such as thumb drives, portable optical or magnetic disks, and memory cards. Software and data used to practice embodiments of the invention, such as the cache management program 628, may be stored on such portable computer-readable storage media. In such an embodiment, the associated software may (or may not) be loaded, in whole or in part, into the persistent storage 626 via the I / O interface set 614. The I / O interface set 614 also connects in data communication to a display device 616.
[0087] Display device 616 provides a mechanism for displaying data to a user and may be, for example, a computer monitor or a display screen on a smartphone.
[0088] The programs described herein are identified based on the applications in which they are implemented in specific embodiments of the invention, however, it should be appreciated that any specific program nomenclature herein is used merely as a matter of convenience, and thus the invention should not be limited to use with any particular application identified and / or implied by such nomenclature.
[0089] The description of various embodiments of the present invention has been presented for illustrative purposes, but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used in this specification is selected to best explain the principles of the embodiments, practical applications, or technical improvements over the art found in the market, or to allow others skilled in the art to understand the embodiments disclosed herein.
[0090] Corresponding structures, materials, acts, and equivalents of all mean-plus-function or step-plus-function elements in the following claims are intended to include any structure, material, or act for performing a function in combination with other claimed elements as specifically claimed. The description of the disclosure has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the disclosure in the form disclosed. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the disclosure. The embodiments have been chosen and described in order to best explain the principles and practical applications of the disclosure, and to enable others skilled in the art to understand the disclosure in various embodiments with various modifications tailored to the specific uses contemplated.
Claims
1. 1. A computer-implemented method for managing a data cache, comprising: Storing a cache management list including a plurality of entries, the cache management list comprising: a tail portion stored in the first storage, the tail portion recording a number of recently accessed data items stored in the data cache; and a body portion stored in a second storage, the body portion recording a plurality of least recently accessed data items stored in the data cache; said storing and In each cache management iteration of the plurality of cache management iterations, Receiving a first data access request; recording the first data access request in the tail portion; identifying a plurality of replicated entries associated with the first data access request and present in the body portion and the tail portion; removing each of the plurality of replicated entries from the body portion in accordance with a physical organization of the plurality of replicated entries in the second storage; A method comprising:
2. the cache management list further comprising a head portion stored in the first storage, the head portion recording a first plurality of longest recently accessed data items stored in the data cache, and in at least one cache management iteration of the plurality of cache management iterations, the method further comprising: identifying, in the body portion, a second plurality of least recently used entries recording a second plurality of least recently accessed data items stored in the data cache; copying the second plurality of least recently used entries from the body portion to the head portion; The method of claim 1 further comprising:
3. The method of claim 1 or 2, further comprising copying the tail portion to the second storage.
4. In at least one cache management iteration of the plurality of cache management iterations, the method further comprises: identifying a data item not stored in the data cache based on the first data access request; inserting said data item into said data cache; The method of any one of claims 1 to 3, further comprising:
5. The cache management list further includes a head portion stored in the first storage, the head portion recording a plurality of longest recently accessed data items stored in the data cache, and in at least one cache management iteration of the plurality of cache management iterations, the method further comprising: identifying at least one entry in the head portion and not in the tail portion, the at least one entry recording an access to at least one data item stored in the data cache; removing said at least one entry from said head portion; The method of claim 4 further comprising:
6. recording the first data access request in the tail portion; updating a first entry in the tail section, the first entry recording another access request to the respective data item recorded by the first entry, and moving the updated first entry to the end of the tail section; adding a second entry to the tail; The method of any one of claims 1 to 5, comprising an operation selected from the group consisting of:
7. The method according to any one of claims 1 to 6, wherein at least one cache management iteration of the plurality of cache management iterations is performed periodically.
8. determining whether the tail is full; performing at least one cache management iteration of the plurality of cache management iterations in response to determining that the tail is full; The method of any one of claims 1 to 7, further comprising:
9. determining whether the at least one entry present in the head portion is not included in the tail portion; performing at least one cache management iteration of the plurality of cache management iterations in response to determining that the at least one entry present in the head portion is not included in the tail portion; The method of claim 5 further comprising:
10. The method of any one of claims 1 to 9, wherein a ratio of a first access time of the first storage to a second access time of the second storage is less than an access time ratio threshold.
11. the first storage is selected from a first group of digital storage consisting of a random access memory (RAM), a static RAM (SRAM), a first dynamic RAM (DRAM), a first hard disk drive, and a first solid state drive; 11. The method of claim 1, wherein the second storage is selected from a second group of digital storage consisting of the first DRAM, the second DRAM, the first hard disk drive, the second hard disk drive, the first solid-state drive, the second solid-state drive, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a NAND type flash memory, a network attached storage, and a network storage.
12. the body portion is stored in the second storage in a plurality of files; copying the tail portion to the second storage includes adding a file including the tail portion to the plurality of files. The method according to claim 3.
13. 1. A computer system for managing a data cache, comprising: a processor set including a first processor and a second processor; one or more computer readable storage media; Equipped with the set of processors is structured, arranged, connected, or programmed, or any combination thereof, to execute program instructions collectively stored in the one or more computer-readable storage media; The program instructions include: Storing a cache management list including a plurality of entries, the cache management list comprising: a tail portion stored in a first storage coupled to the first processor, the tail portion recording a number of recently accessed data items stored in the data cache; and a body portion stored in a second storage coupled to the first processor, the body portion recording a plurality of least recently accessed data items stored in the data cache; said storing and In each cache management iteration of the plurality of cache management iterations, receiving at least one data access request; recording said data access requests in said tail portion; identifying a plurality of duplicate entries present in said body portion and said tail portion; removing each replicated entry of the plurality of replicated entries from the body portion according to a physical organization of the plurality of replicated entries in the second storage; A computer system comprising instructions programmed to execute the steps of:
14. receiving a data access request for the at least one data access request from a software object executed by the first processor; 14. The computer system of claim 13, further comprising instructions programmed to execute:
15. receiving a data access request for the at least one data access request from the second processor; 15. A computer system according to claim 13 or 14, further comprising instructions programmed to execute:
16. 16. The computer system of claim 15, wherein the second processor is connected to the first processor via at least one digital communications network interface connected to the first processor.
17. The computer system of any one of claims 13 to 16, wherein the computer system comprises a computer program.
18. 1. A computer system for managing access to a plurality of data items, comprising: A processor set; one or more computer readable storage media; Equipped with the set of processors is structured, arranged, connected, or programmed, or any combination thereof, to execute program instructions collectively stored in the one or more computer-readable storage media; The program instructions include: storing a first data item with a data cache; Storing a cache management list including a plurality of entries, the cache management list comprising: a tail portion stored in a first storage, the tail portion recording a number of recently accessed data items stored in the data cache; and a body portion stored in a second storage, the body portion recording a plurality of least recently accessed data items stored in the data cache; said storing comprising: performing a data access management operation, Receiving a first data access request; recording the first data access request in the tail portion; identifying a plurality of replicated entries present in the body portion and the tail portion for the first data access request; removing each replicated entry of the plurality of replicated entries from the body portion according to a physical organization of the plurality of replicated entries in the second storage; performing said data access management operations, A computer system comprising instructions programmed to execute the steps of:
19. receiving a second data access request requesting access to the first data item; In response to receiving the second data access request, identifying the first data item stored in the data cache; accessing the first data item; 20. The computer system of claim 18, further comprising instructions programmed to execute:
20. 20. A computer system according to claim 18 or 19, wherein the computer system comprises a computer program.
Citation Information
Patent Citations
Method and device for controlling cash
JP1992077844A
Write cache control method of storage device, and storage device
JP2003196032A
Information processing device, program, and information processing method
JP2019020965A
Maintaining a separate LRU linked list for each thread for multi-threaded access
US9460025B1