US10740241B2ActiveUtilityA1

Method and devices for managing cache

80
Assignee: EMC IP HOLDING CO LLCPriority: Jun 2, 2017Filed: Jun 1, 2018Granted: Aug 11, 2020
Est. expiryJun 2, 2037(~10.9 yrs left)· nominal 20-yr term from priority
G06F 12/0868G06F 2212/312G06F 2212/502G06F 2212/1024G06F 3/0638G06F 3/061G06F 11/3419G06F 2201/81G06F 12/0815G06F 12/0804G06F 12/0891G06F 2201/885G06F 12/0871G06F 2212/262
80
PatentIndex Score
2
Cited by
5
References
17
Claims

Abstract

Embodiments of the present disclosure relate to a method and apparatus for managing cache. The method comprises determining a cache flush time period of the cache for a lower-layer storage device associated with the cache. The method further comprises: in response to a length of the cache flush time period being longer than a threshold length of time, in response to receiving a write request, determining whether data associated with the write request has been stored into the cache. The method further comprises: in response to a miss of the data in the cache, storing the write request and the data in the cache without returning a write completion message for the write request.

Claims

exact text as granted — not AI-modified
We claim: 
     
       1. A method of managing cache, comprising:
 determining a cache flush time period of the cache for a lower-layer storage device associated with the cache; 
 in response to determining the cache flush time period, comparing the determined cache flush time period to a preset threshold amount of time; 
 in response to receiving a write request, determining whether data associated with the write request has been stored into the cache; 
 in response to a miss of the data in the cache, storing the write request and the data in the cache without returning a write completion message for the write request; and 
 in response to the length of the cache flush time period being longer than the threshold length of time, marking the storage device for processing the write request. 
 
     
     
       2. The method according to  claim 1 , further comprising:
 determining a first number of storage blocks in the cache that are released by a flush to the storage device and are available for the storage device; and 
 in response to the number being greater than a second number of storage blocks occupied by the data, sending the write completion message for the write request. 
 
     
     
       3. The method according to  claim 1 , wherein determining the cache flush time period for the storage device comprises:
 obtaining a plurality of historical flush time periods for a plurality of previous flushes from the cache to the storage device; and 
 determining the cache flush time period by averaging the plurality of historical flush time periods. 
 
     
     
       4. The method according to  claim 2 , further comprising:
 in response to sending the write completion message, subtracting the second number from the first number. 
 
     
     
       5. The method according to  claim 1 , further comprising:
 comparing a first length of time of the write request being stored in the cache and a predefined second length of time; 
 in response to the first length of time exceeding the second length of time, determining a dirty block rate in the cache associated with the storage device; and 
 in response to the dirty block rate being lower than a predetermined threshold, sending the write completion message for the write request. 
 
     
     
       6. The method according to  claim 5 , further comprising:
 determining a first number of storage blocks in the cache that are released by a flush to the storage device and are available for the storage device; 
 obtaining the number of storage blocks in the cache and the number of dirty blocks in the cache; and 
 determining the dirty block rate based on the first number, the number of storage blocks in the cache, and the number of dirty blocks in the cache. 
 
     
     
       7. A cache manager, the cache comprising a plurality of storage blocks, the cache manager comprising:
 a processor; and 
 a memory having computer program instructions stored thereon, the processor executing the computer program instructions in the memory to control the memory system to perform acts comprising: 
 determining a cache flush time period of the cache for a lower-layer storage device associated with the cache; 
 in response to determining the cache flush time period, comparing the determined cache flush time period to a preset threshold amount of time; 
 in response to receiving a write request, determining whether data associated with the write request has been stored into the cache; 
 in response to a miss of the data in the cache, storing the write request and the data in the cache without returning a write completion message for the write request; and 
 in response to the length of the cache flush time period being longer than the threshold length of time, marking the storage device for processing the write request. 
 
     
     
       8. The manager according to  claim 7 , further comprising:
 determining a first number of storage blocks in the cache that are released by a flush to the storage device and are available for the storage device; 
 in response to the number being greater than a second number of storage blocks occupied by the data, sending the write completion message for the write request. 
 
     
     
       9. The manager according to  claim 7 , wherein determining the cache flush time period for the storage device comprises:
 obtaining a plurality of historical flush time periods for a plurality of previous flushes from the cache to the storage device; and 
 determining the cache flush time period by averaging the plurality of historical flush time periods. 
 
     
     
       10. The manager according to  claim 8 , further comprising:
 in response to sending the write completion message, subtracting the second number from the first number. 
 
     
     
       11. The manager according to  claim 7 , further comprising:
 comparing a first length of time of the write request being stored in the cache and a predefined second length of time; 
 in response to the first length of time exceeding the second length of time, determining a dirty block rate in the cache associated with the storage device; and 
 in response to the dirty block rate being lower than a predetermined threshold, sending the write completion message for the write request. 
 
     
     
       12. The manager according to  claim 11 , further comprising:
 determining a first number of storage blocks in the cache that are released by a flush to the storage device and are available for the storage device; 
 obtaining the number of storage blocks in the cache and the number of dirty blocks in the cache; and 
 determining the dirty block rate based on the first number, the number of storage blocks in the cache, and the number of dirty blocks in the cache. 
 
     
     
       13. A computer program product for managing cache, comprising:
 a non-transitory computer readable medium encoded with computer-executable code, the code configured for the execution of: 
 determining a cache flush time period of the cache for a lower-layer storage device associated with the cache; 
 in response to determining the cache flush time period, comparing the determined cache flush time period to a preset threshold amount of time; 
 in response to receiving a write request, determining whether data associated with the write request has been stored into the cache; 
 in response to a miss of the data in the cache, storing the write request and the data in the cache without returning a write completion message for the write request; and 
 in response to the length of the cache flush time period being longer than the threshold length of time, marking the storage device for processing the write request. 
 
     
     
       14. The computer program product of  claim 13 , the code further configured for the execution of:
 determining a first number of storage blocks in the cache that are released by a flush to the storage device and are available for the storage device; and 
 in response to the number being greater than a second number of storage blocks occupied by the data, sending the write completion message for the write request. 
 
     
     
       15. The computer program product of  claim 13 , wherein determining the cache flush time period for the storage device comprises:
 obtaining a plurality of historical flush time periods for a plurality of previous flushes from the cache to the storage device; and 
 determining the cache flush time period by averaging the plurality of historical flush time periods. 
 
     
     
       16. The computer program product of  claim 14 , the code further configured for the execution of:
 in response to sending the write completion message, subtracting the second number from the first number. 
 
     
     
       17. The computer program product of  claim 13 , the code further configured for the execution of:
 comparing a first length of time of the write request being stored in the cache and a predefined second length of time; 
 in response to the first length of time exceeding the second length of time, determining a dirty block rate in the cache associated with the storage device; and 
 in response to the dirty block rate being lower than a predetermined threshold, sending the write completion message for the write request.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.