CN113111014B - Method, device and equipment for cleaning non-hot data in cache and storage medium - Google Patents
Method, device and equipment for cleaning non-hot data in cache and storage medium Download PDFInfo
- Publication number
- CN113111014B CN113111014B CN202110372309.3A CN202110372309A CN113111014B CN 113111014 B CN113111014 B CN 113111014B CN 202110372309 A CN202110372309 A CN 202110372309A CN 113111014 B CN113111014 B CN 113111014B
- Authority
- CN
- China
- Prior art keywords
- data
- cache
- cleaning
- time
- execution
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0891—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5022—Mechanisms to release resources
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The invention discloses a method, a device, equipment and a storage medium for cleaning non-hot data in a cache, wherein the method for cleaning the non-hot data in the cache comprises the following steps: partitioning cache data; setting an execution frequency HZ and TIME limit of each execution TIME; and step three, randomly extracting the data in the partition in the step one according to the execution frequency HZ set in the step two and the TIME limit of each execution TIME to clean the non-hotspot data. The method adopts a strategy of timing cleaning to clean the cache non-hotspot data of the storage system, ensures the friendliness to CPU and storage space by setting frequency and maximum execution time, and ensures the efficiency of cleaning the data block and the smoothness of the whole cache space by partitioning the data block and randomly selecting the data block.
Description
Technical Field
The invention relates to the technical field of cache data cleaning, in particular to a method, a device, equipment and a storage medium for cleaning non-hot data in a cache.
Background
In a storage system, storage media are various, and there is a large gap in read/write performance, and in order to improve the access performance of the entire system, a high-performance device is often used as a cache device of a low-performance device. Meanwhile, due to the cost problem of the high-new-energy device, the capacity of the cache device is often small, so that hot statistics needs to be performed on cache data, and non-hot data is cleaned by using a certain strategy. Generally there are three different cleaning strategies, immediate cleaning, inert cleaning and timed cleaning.
Immediate cleanup, that is, when the data heat is set, a callback condition is created, and when the heat falls to a threshold, the data cleanup is automatically performed by the processing logic. This solution is not very cpu friendly and takes up a lot of cpu time.
Lazy scrubbing refers to data being outdated and not processed until the next time that portion of data is accessed, if the data is found to be cold, then data scrubbing is performed. This scheme is not very memory friendly and takes up a lot of memory space.
The timing cleaning is to check the data at intervals and clean the cooling data. This reduces the impact of the clean-up on the cpu and memory space. However, if the execution is too frequent or the execution time is too long, the periodic cleaning strategy is degenerated to an immediate cleaning strategy, which consumes a large amount of cpu time. If the execution is too little or the execution time is too short, the timing cleaning strategy is degraded into a lazy cleaning strategy, and the condition of wasting the storage space occurs.
Disclosure of Invention
The present invention aims to solve the above problems, and provides a method, an apparatus, a device, and a storage medium for cleaning non-hotspot data in a cache. The data blocks are cleaned regularly in a mode of partitioning the data blocks and randomly selecting the data blocks, and therefore the efficiency of cleaning the data blocks and the smoothness of the whole cache space are guaranteed.
In order to achieve the purpose, the invention adopts the following technical scheme:
the method for cleaning the non-hot data in the cache comprises the following steps:
partitioning cache data;
setting an execution frequency HZ and TIME limit of each execution TIME;
and step three, randomly extracting the data in the partition in the step one according to the execution frequency HZ set in the step two and the TIME limit of each execution TIME to clean the non-hotspot data.
In the first step, the cache data is partitioned, and the data in the partition is divided into a plurality of data blocks.
The execution TIME per TIME limit TIME =10000 ×, the number of data blocks per maximum detection/HZ that can be accepted, and the execution frequency is inversely proportional to the execution TIME per TIME limit. This ensures that each eviction does not block too many requests.
In the third step, one partition is checked each time according to the set execution frequency HZ, and each partition randomly extracts the set data blocks for checking, and if the heat is out of date, the data blocks are cleaned; and ending if the cleaning is completed or the longest execution time is reached.
In the third step, if the data blocks with the number larger than the set value in the random set number of the data blocks in the partition to be cleaned at this time need to be cleaned, the data blocks in the partition to be cleaned at this time are continuously cleaned in the next cleaning period.
Each data block is checked at most 3 times in succession.
A cleaning device for non-hotspot data in a cache comprises:
the data area division module is used for dividing the cache data into partitions;
the limit setting module is used for setting an execution frequency HZ and a TIME limit for each execution TIME;
and the non-hotspot data cleaning module is used for randomly extracting data in the partition according to the set execution frequency HZ and the TIME limit of each execution TIME to clean the non-hotspot data.
An apparatus comprising a memory storing a computer program and a processor implementing the steps of the method for scrubbing non-hotspot data in the cache when the computer program is executed.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for scrubbing non-hotspot data in the cache.
The invention has the beneficial effects that:
the method adopts a strategy of timing cleaning to clean the cache non-hot data of the storage system, ensures the friendliness to a cpu and a storage space by setting frequency and maximum execution time, and ensures the efficiency of cleaning the data block and the smoothness of the whole cache space by partitioning the data block and randomly selecting the data block.
The influence of the delete operation on the cpu and the waste of the storage space are reduced by performing the scrubbing operation once every a period of time and by limiting the duration and frequency of execution of the scrubbing operation.
Detailed Description
The present invention will be further described with reference to the following examples.
The method for cleaning the non-hot data in the cache comprises the following steps:
(1) The execution frequency HZ is set.
(2) By the formula: the acceptable maximum number of data blocks per TIME/HZ per TIME for each TIME for TIME limit TIME =10000 ×, obtains the TIME limit per TIME, and the execution frequency is in inverse proportion to the TIME limit per TIME, thus ensuring that the requests are not blocked by each elimination.
(3) The cache data is partitioned into, for example, ten partitions 0-9.
(4) And checking the data blocks in time according to the execution frequency.
(5) Each time a partition is checked, each partition randomly picks up 20 blocks of data to check, and if the heat is out of date, the blocks are cleared. And ending if the cleaning is completed or the longest execution time is reached.
(6) If more than 15 of the random 20 cleaning areas need to be cleaned (other values can be configured), the next cleaning period continues to clean the data block, and each data block is continuously checked for 3 times at most. The remaining cases examine the next data block.
In the invention, in the cache management of the storage system, a fixed-frequency, fixed-time and long-time cleaning strategy for randomly extracting data detection by using data partitions according to regions is used to complete the cache space management and reduce the resource consumption.
A cleaning device for non-hotspot data in a cache comprises:
the data area division module is used for dividing the cache data into partitions;
the limit setting module is used for setting an execution frequency HZ and a TIME limit for each execution TIME;
and the non-hotspot data cleaning module is used for randomly extracting the data in the partition according to the set execution frequency HZ and the TIME limit of each execution TIME to clean the non-hotspot data.
By using the scheme of randomly extracting and cleaning the cache data in a partition mode and setting the timing cleaning strategy of frequency and maximum execution time to clean the non-hot data in the cache equipment in the storage system, the efficiency of cleaning the data can be improved, and the performance of a CPU (Central processing Unit) and the cache space can be effectively utilized.
An apparatus comprising a memory storing a computer program and a processor implementing the steps of the method for scrubbing non-hotspot data in the cache when the computer program is executed.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for cleaning up non-hotspot data in a cache.
Although the present invention has been described with reference to the specific embodiments, it should be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.
Claims (7)
1. The method for cleaning the non-hot data in the cache is characterized by comprising the following steps:
partitioning cache data;
setting an execution frequency HZ and TIME limit of each execution TIME;
step three, randomly extracting the data in the partition in the step one according to the execution frequency HZ set in the step two and the TIME limit of each execution TIME to clean the non-hotspot data;
in the first step, the cache data is partitioned, and the data in the partition is divided into a plurality of data blocks;
the execution TIME per TIME limit TIME =10000 ×, the number of data blocks per maximum detection/HZ that can be accepted, and the execution frequency is inversely proportional to the execution TIME per TIME limit.
2. The method for clearing non-hot-spot data in cache of claim 1, wherein in the third step, one partition is checked at a time according to the set execution frequency HZ, and each partition randomly extracts a set number of data blocks for checking, and clears the data blocks if the heat degree is expired; and ending if the cleaning is completed or the longest execution time is reached.
3. The method according to claim 1, wherein in the third step, if any data block with a number greater than a predetermined value in the randomly set number of data blocks in the partition to be cleaned at this time needs to be cleaned, the next cleaning cycle continues to clean the data blocks in the current partition.
4. The method of claim 3, wherein each block is checked at most 3 times in succession.
5. A device for cleaning non-hot data in a cache by using the method for cleaning non-hot data in a cache according to claim 1, comprising:
the data area division module is used for dividing the cache data into partitions;
the limit setting module is used for setting an execution frequency HZ and a TIME limit for each execution TIME;
and the non-hotspot data cleaning module is used for randomly extracting data in the partition according to the set execution frequency HZ and the TIME limit of each execution TIME to clean the non-hotspot data.
6. An apparatus comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the method for cleaning up non-hot data in a cache according to any one of claims 1 to 4.
7. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for cleaning up non-hotspot data in a cache memory of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110372309.3A CN113111014B (en) | 2021-04-07 | 2021-04-07 | Method, device and equipment for cleaning non-hot data in cache and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110372309.3A CN113111014B (en) | 2021-04-07 | 2021-04-07 | Method, device and equipment for cleaning non-hot data in cache and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113111014A CN113111014A (en) | 2021-07-13 |
CN113111014B true CN113111014B (en) | 2023-01-06 |
Family
ID=76714301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110372309.3A Active CN113111014B (en) | 2021-04-07 | 2021-04-07 | Method, device and equipment for cleaning non-hot data in cache and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113111014B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5875464A (en) * | 1991-12-10 | 1999-02-23 | International Business Machines Corporation | Computer system with private and shared partitions in cache |
JP2016157278A (en) * | 2015-02-25 | 2016-09-01 | Necエンジニアリング株式会社 | Cache memory, access method in cache memory and program for accessing cache memory |
CN109977129A (en) * | 2019-03-28 | 2019-07-05 | 中国联合网络通信集团有限公司 | Multi-stage data caching method and equipment |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4183400B2 (en) * | 2001-06-27 | 2008-11-19 | 株式会社日立製作所 | Database system, database management method and program |
US20100262687A1 (en) * | 2009-04-10 | 2010-10-14 | International Business Machines Corporation | Dynamic data partitioning for hot spot active data and other data |
EP2476055B1 (en) * | 2009-09-08 | 2020-01-22 | SanDisk Technologies LLC | Apparatus, system, and method for caching data on a solid-state storage device |
US9569134B2 (en) * | 2010-08-23 | 2017-02-14 | Quantum Corporation | Sequential access storage and data de-duplication |
US8838897B2 (en) * | 2011-06-29 | 2014-09-16 | New Jersey Institute Of Technology | Replicating tag entries for reliability enhancement in cache tag arrays |
US10108690B1 (en) * | 2013-06-06 | 2018-10-23 | Amazon Technologies, Inc. | Rolling subpartition management |
CN105468473B (en) * | 2014-07-16 | 2019-03-01 | 北京奇虎科技有限公司 | Data migration method and data migration device |
CN105302493B (en) * | 2015-11-19 | 2018-04-17 | 浪潮(北京)电子信息产业有限公司 | The swapping in and out control method and system that SSD is cached in a kind of mixing storage array |
US10198461B2 (en) * | 2016-05-06 | 2019-02-05 | Masergy Communications, Inc. | Data storage system |
CN106599113B (en) * | 2016-11-30 | 2019-12-10 | 武汉虹信通信技术有限责任公司 | Database reading and writing method for mass performance data of network management system |
CN106604111A (en) * | 2016-12-16 | 2017-04-26 | 深圳市九洲电器有限公司 | Set-top box Flash data storage method and set-top box Flash data storage system |
CN109857725A (en) * | 2019-02-20 | 2019-06-07 | 北京百度网讯科技有限公司 | Data base management method and device, server and computer-readable medium |
CN110187836B (en) * | 2019-05-29 | 2022-09-02 | 北京奇艺世纪科技有限公司 | Data deleting method and device, computer and storage medium |
EP3968173A4 (en) * | 2019-09-25 | 2022-05-11 | Huawei Cloud Computing Technologies Co., Ltd. | Method and device for managing data in partition table, management node, and storage medium |
CN111309251A (en) * | 2020-01-21 | 2020-06-19 | 青梧桐有限责任公司 | Data storage method, system, electronic device and readable storage medium |
CN111858403B (en) * | 2020-07-17 | 2022-07-08 | 苏州浪潮智能科技有限公司 | Cache data heat management method and system based on probability to access frequency counting |
CN112527786A (en) * | 2020-12-17 | 2021-03-19 | 平安银行股份有限公司 | Data table partition adding method and device, computer equipment and storage medium |
-
2021
- 2021-04-07 CN CN202110372309.3A patent/CN113111014B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5875464A (en) * | 1991-12-10 | 1999-02-23 | International Business Machines Corporation | Computer system with private and shared partitions in cache |
JP2016157278A (en) * | 2015-02-25 | 2016-09-01 | Necエンジニアリング株式会社 | Cache memory, access method in cache memory and program for accessing cache memory |
CN109977129A (en) * | 2019-03-28 | 2019-07-05 | 中国联合网络通信集团有限公司 | Multi-stage data caching method and equipment |
Non-Patent Citations (3)
Title |
---|
8th International Conference on Integrated Power Electronics Systems>.2014, * |
Marco DenkA.Efficient online-algorithm for the temperature cycle recording of an IGBT power module in a hybrid car during inverter operation.< CIPS 2014 * |
一种支持大页的层次化DRAM/NVM混合内存系统;陈吉等;《计算机研究与发展》;20180915(第09期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113111014A (en) | 2021-07-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9471495B2 (en) | Method and apparatus for constructing memory access model | |
US8214608B2 (en) | Behavioral monitoring of storage access patterns | |
CN109154917B (en) | Storage system and solid state disk | |
US8996824B2 (en) | Memory reorder queue biasing preceding high latency operations | |
JP5073673B2 (en) | Prioritizing performance on multithreaded processors | |
Lee et al. | Characterizing memory write references for efficient management of hybrid PCM and DRAM memory | |
US9720820B2 (en) | Data storage device and flash memory control method | |
CN104809076B (en) | Cache management method and device | |
US20070011421A1 (en) | Method and system for decreasing power consumption in memory arrays having usage-driven power management | |
CN105677236B (en) | A kind of storage device and its method for storing data | |
US20130138889A1 (en) | Cache Optimization Via Predictive Cache Size Modification | |
Wu et al. | zexpander: A key-value cache with both high performance and fewer misses | |
CN108572799B (en) | Data page migration method of heterogeneous memory system of bidirectional hash chain table | |
CN105404595B (en) | Buffer memory management method and device | |
US20180004409A1 (en) | Method and apparatus for managing storage device | |
CN113111014B (en) | Method, device and equipment for cleaning non-hot data in cache and storage medium | |
Tan et al. | Uimigrate: Adaptive data migration for hybrid non-volatile memory systems | |
Tian et al. | An effectiveness-based adaptive cache replacement policy | |
TWI610163B (en) | Utilizing grouping to facilitate fast switching | |
CN106155923B (en) | The method and apparatus of memory sharing | |
CN114237501B (en) | Method for rapidly identifying cold data and computer readable storage medium | |
Uppal et al. | Towards workload-aware page cache replacement policies for hybrid memories | |
WO2016147279A1 (en) | Data management control program, data management control device, and data management control method | |
US7080212B1 (en) | Closed loop adaptive prestage method, system, and product for prestaging cache blocks | |
Baranwal et al. | DAMUS: Dynamic Allocation based on Write Frequency in MUlti-Retention STT-RAM based Last Level Caches |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |