WO2018121455A1 - 一种缓存数据处理方法、装置和存储控制器 - Google Patents

一种缓存数据处理方法、装置和存储控制器 Download PDF

Info

Publication number
WO2018121455A1
WO2018121455A1 PCT/CN2017/118147 CN2017118147W WO2018121455A1 WO 2018121455 A1 WO2018121455 A1 WO 2018121455A1 CN 2017118147 W CN2017118147 W CN 2017118147W WO 2018121455 A1 WO2018121455 A1 WO 2018121455A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
stripe
cache
target
size
Prior art date
Application number
PCT/CN2017/118147
Other languages
English (en)
French (fr)
Inventor
江武汉
门勇
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018121455A1 publication Critical patent/WO2018121455A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements

Definitions

  • the invention relates to the invention of storage technology, in particular to the field of logging in the field of storage technology.
  • Cache is an important technology used to solve the speed mismatch between high and low speed devices. It is widely used in various fields such as storage systems to reduce application response time and improve efficiency.
  • a cache layer (also called a write-back cache) is usually added between the processing device and the hard disk.
  • the cache layer can improve system read and write performance, so sometimes the cache layer is called the performance layer.
  • the medium used for caching is, for example, a solid state disk (SSD), which has better read and write performance than a persistent storage medium (such as a hard disk).
  • SSD solid state disk
  • a persistent storage medium such as a hard disk.
  • writes from host applications can be processed more quickly than hard disks.
  • the storage capacity of the cache is limited. Therefore, when the free space is insufficient, a part of the cached media data needs to be eliminated to the hard disk according to the elimination algorithm, so as to make room for subsequent write requests. This part of the data sent from the cache to the hard disk is called dirty data.
  • Striping is a logical concept, similar to a container for loading data. If the delivered data is less than one stripe, it means that only part of the stripe is valid data, and there is a free position in the stripe. Referring to the stripe in Figure 1, the utilization rate is only 50%. Such a stripe that is not "filled up” by valid data, like the stripe that is "filled” with valid data, occupies a complete strip of storage space on the hard disk and produces a set of metadata. Therefore, if the ratio of valid data to free position in the stripe is larger. You can save more hard disk storage space and reduce the amount of metadata. If the strips are completely "filled” with valid data and then delivered, you can maximize the use of hard disk storage space and generate the least amount of metadata.
  • the embodiment of the invention provides a method, a device and a storage controller for buffer data, which can alleviate severe fluctuations of the IOPS and make the performance of the storage system more stable.
  • a method for processing cache data includes: obtaining a compression ratio D of data, a deduplication ratio C, and an average stripe filling rate I, a target strip size S in a cache, and a The effective data size W in the target strip; according to the formula Obtaining the eliminated data amount N, in the case of T min ⁇ N ⁇ T max , writing data of size N into the target strip, and eliminating the data of the target stripe to the storage medium, wherein when T min is The preset first threshold, T max is a preset second threshold. In another alternative, in the case of N > T max , data of size N is written to the target strip.
  • the data of the target strip is eliminated to the storage medium. All three options are optional, and any one of them can be used to form a complete process. Based on this method, in the case that there is no significant impact on the cache, the stripe accommodates as much data as possible and then is eliminated into the storage medium. Balancing the two conflicting needs of getting free cache space and increasing disk utilization as early as possible.
  • the cache data is smoothed out to the storage medium, which reduces the severe fluctuation of IOPS and makes the storage system more stable.
  • the method further includes: after the target strip is filled with subsequent data, the target is Striping is eliminated to the storage medium.
  • This possible implementation proposes a scheme for eliminating data in the case of N>T m .
  • the cache data elimination method according to claim 1, wherein the D, C, and I are statistical values, and the initial values are all 1.
  • S is described by the number of minimum units (or integer multiples of the smallest unit) from which data is sent from the cache to the storage medium, such as by the number of cache pages.
  • a second aspect of the present invention provides a cache data processing apparatus.
  • the apparatus includes: an acquisition module, which can be used to obtain a compression ratio D of data, a deduplication ratio C, and an average stripe filling rate I, and can also be used to obtain a cache.
  • a target stripe size S a valid data size W in the target stripe
  • a calculation module for using a formula Calculating the slave data amount N
  • the data processing module is configured to write the data of size N into the target stripe in the case of T min ⁇ N ⁇ T max , and eliminate the data of the target stripe to the storage Medium, wherein when Tmin is a preset first threshold, Tmax is a preset second threshold.
  • the data processing module is configured to write data of size N to the target stripe in the case of N>T max .
  • the data processing module is configured to phase out the data of the target stripe to the storage medium. All three options are optional, and any one of them can be used to form a complete process. Based on the cache data processing device, if there is no significant impact on the cache, the stripe accommodates as much data as possible and then is eliminated into the storage medium. Balancing the two conflicting needs of getting free cache space and increasing disk utilization as early as possible. The cache data is smoothed out to the storage medium, which reduces the severe fluctuation of IOPS and makes the storage system more stable.
  • the processing module is further configured to: after the target strip is written by the data of size N, after the target strip is filled by the subsequent data, The target strip is eliminated to the storage medium.
  • This possible implementation proposes a scheme for eliminating data in the case of N>T m .
  • the D, C, and I are statistical values, and the initial values are all 1.
  • a third possible implementation of the second aspect of the present invention, S is described by the number of minimum units (or integer multiples of the smallest unit) from which data is sent from the cache to the storage medium, such as by the number of cache pages.
  • a third aspect of the present invention provides a storage controller, which includes a processor and a cache, the cache is used to temporarily store data, and optionally includes a storage medium (such as a hard disk or a solid state hard disk) that stores the eliminated data.
  • the processor executes the following steps by running a program: obtaining a compression ratio D of the data, a deduplication ratio C, and an average stripe filling rate I, and also acquiring the target stripe size S in the cache, and the target stripe.
  • Effective data size W according to the formula Obtaining the amount of eliminated data N; in the case of T min ⁇ N ⁇ T max , writing data of size N into the target stripe, and eliminating the data of the target stripe to the storage medium, wherein when T min is The preset first threshold, T max is a preset second threshold.
  • T min is The preset first threshold
  • T max is a preset second threshold.
  • N > T max data of size N is written to the target strip.
  • N ⁇ T min the data of the target strip is eliminated to the storage medium. All three options are optional, and any one of them can be used to form a complete process. Based on the storage controller, if there is no significant impact on the cache, the stripe accommodates as much data as possible and then is eliminated into the storage medium. Balancing the two conflicting needs of getting free cache space and increasing disk utilization as early as possible.
  • the processor is further configured to: after the target stripe is written by the subsequent data, after the data of size N is written to the target stripe, The target strip is eliminated to the storage medium.
  • This possible implementation proposes a scheme for eliminating data in the case of N>T m .
  • the D, C, and I are statistical values, and the initial values are all 1.
  • a third possible implementation of the third aspect of the present invention, S is described by the number of minimum units (or integer multiples of the smallest unit) from which data is sent from the cache to the storage medium, such as by the number of cache pages.
  • a storage system including the foregoing storage controller and a storage medium (for example, a hard disk, a solid state hard disk), and the storage medium is configured to store the eliminated data.
  • a storage medium for example, a hard disk, a solid state hard disk
  • a storage system includes the above data processing apparatus and a storage medium (such as a hard disk or a solid state hard disk) for storing the eliminated data.
  • a storage medium such as a hard disk or a solid state hard disk
  • Figure 1 is a schematic diagram of the use of strips
  • FIG. 2 is a structural diagram of an embodiment of a storage system of the present invention.
  • FIG. 3 is a flow chart of an embodiment of a cache data processing method of the present invention.
  • FIG. 4 is a topological diagram of an embodiment of a cache data processing apparatus.
  • the solution of the present application can be applied to a storage device.
  • the storage device is for example a storage controller.
  • the storage controller and the storage medium (such as a hard disk, a solid state hard disk, etc.) are relatively independent, and together they constitute a storage system. Unless otherwise stated, the following embodiments take the case of the embodiment of the present invention as an example, and the storage medium is exemplified by a hard disk.
  • the storage device may also be a storage device that has both computing management capabilities and a storage medium, such as a server.
  • the part of the server that has operational management capabilities is equivalent to the storage controller.
  • the storage controller communicates with a storage medium internal to the storage device or with a storage medium external to the storage device. Since the principle is similar, it will not be described in detail.
  • the host 11 is in communication with a storage system 12 that includes a storage controller 12 and a storage medium 13.
  • the storage controller 12 has a processor 121, a cache 122, and a memory 123.
  • the memory 123 can provide a storage space for the processor 121 to run the program. By running the program, the processor can execute the cache data processing method embodiment provided by the present invention.
  • the memory 123 and the cache 122 can be integrated or separated.
  • the storage controller 12 and the property medium 13 are independent in the figure. In other embodiments, storage medium 13, such as a general purpose server, may also be integrated into storage controller 12.
  • the cache can be read and written by the host 11. Since the buffer space is limited, when the cache space becomes small, it is necessary to migrate the data in the cache to the storage medium 13. Specifically, the effective data of the strips located in the cache 121 is migrated to the storage medium 13 in units of strips. This migration is also called the lower disc. The earlier the lower disc is, the earlier the cache can be vacated. space.
  • the cache data is disk-sliced as a granularity
  • the stripe is a logical unit
  • each stripe is composed of a plurality of strips.
  • Each of the sets of hard disks stores a strip of the stripe as the data is ejected from the cache.
  • the process of migrating the cache to the hard disk by using stripe as the granularity does not mean that the entire stripe is valid data, and part of the stripe may have no valid data, for example, only some strips are valid data, and the remaining strips No valid data.
  • the early release of the disk allows the cache to acquire free storage space as early as possible; on the other hand, after striping the disk, the valid data and invalid data in the stripe will occupy disk space, if the stripe does not contain as much valid data as possible.
  • the utilization rate of the hard disk will not be high. Therefore, from the perspective of improving the disk utilization rate, it is better not to drop the disk as soon as possible, but to get the full score and then the next disk. Applying the algorithm according to the embodiment of the present invention can make a better balance between these two contradictory requirements.
  • FIG. 3 it is a flowchart of an embodiment of a cache data processing method of the present invention, which can be executed by a memory controller.
  • the deduplication ratio C, the compression ratio D, and the average allocation fill rate I are statistical values for historical data. When initializing, it is 1; but as the system runs, these three values will change dynamically due to the continuous deletion, compression, and filling of new stripes. These data can be stored in memory after being counted, or they can be stored in other media.
  • the deduplication ratio C is a ratio of the amount of data before and after deduplication in the cache in the past period of time.
  • the range of statistics can be all the strips in the cache; or it can be a part of the stripe, for example, the data after the disc is part of a specific LUN.
  • the deduplication ratio C minimum value is 1 (in the deduplication process, no data block is deleted because of duplication, or no deduplication is performed). Deduplicating the stripe data before the stripe can save disk space.
  • the valid data in the stripe can be compressed. Compression can be performed after a deduplication operation.
  • the compression ratio D is a ratio of the amount of data before and after compression of the stripe in the cache over a period of time. In theory, the minimum value of the compression ratio D is 1 (the compression operation is performed, but no data is successfully compressed; or the compression operation is not performed). Compressing the stripe data in front of the stripe can save disk space.
  • the range of statistics can be all the strips in the cache; or it can be a part of the stripe, for example, the data after the disc is part of a specific LUN.
  • the average stripe filling rate I is the average of the ratio of the effective data of each stripe in the cache to the total length of the stripe in the past period of time.
  • the valid data of the statistics may be valid data after the compression operation and the deduplication operation are performed.
  • the range of statistics can be all the strips in the cache; or it can be a part of the stripe, for example, the data after the disc is part of a specific LUN.
  • the memory in the embodiment of the present invention is, for example, a RAM, which can temporarily store the operational data in the CPU and provide space for the computer to run the program. Storage can be part of memory or physically separate from memory.
  • the cache may be used to temporarily store the stripe in the embodiment of the present invention; the cache may be the same as the RAM, or may be another medium such as a solid state drive SSD.
  • the target stripe size S can be described by the length of the target stripe, for example, a byte (Byte). It can also be described by the number of units of length, such as the number of cache pages occupied by the target strip.
  • the effective data size W in the target stripe can be described by the length of the target stripe, in bytes (Byte); it can also be described by the number of units of length.
  • the description of the effective data size W in the target stripe is consistent with the description of the target stripe size S.
  • N (S*D*C-W)/I, and perform one of the following operations according to the value range of N:
  • the compression ratio C and the deduplication ratio D are optional. If there is no compression, there is no compression ratio C; if there is no deduplication, there is no deduplication ratio D.
  • the unit of N is consistent with S and W.
  • the unit of S is a byte
  • the unit of N is also a byte.
  • the actual value of N may be an integer multiple of the smallest unit of the lower disk, and the difference from (S*D*C-W)/I is less than a minimum unit.
  • the minimum unit of the lower disk is 10 bytes
  • the calculation result of (S*D*CW)/I is 54 bytes.
  • an alternative method is that the value of N is 50 bytes; another alternative is The value of N is 60 bytes.
  • N is also the number of cached pages.
  • the calculation result of (S*D*CW)/I is a decimal
  • the actual value of N may be the value after (S*D*CW)/I is rounded, and an optional method is downward.
  • the value of N may be 10 cache pages.
  • the rounding up may also be performed, and 10.3 cache pages are rounded to 11 cache pages.
  • T min ⁇ N ⁇ T max data of size N is written into the target strip, and then the data of the target strip is eliminated to a persistent storage medium (SSD, hard disk, etc.) .
  • the current data of the target stripe data of size N + original data of the target stripe.
  • T min is a preset first threshold and T max is a preset second threshold.
  • T min and T max are the same as N.
  • T min and T max can be different in different scenarios, and can have different settings, so they are not limited.
  • the value of T min may be 10% of the strip length *C*D
  • the value of T max may be 80% of the strip length *C*D.
  • both (1) and (2) above involve writing the cached data into the target strip.
  • This kind of write operation can be understood as attributed to data that is not part of the target stripe to the target strip.
  • the data being written is still physically located in the cache.
  • writing data of size N to the target stripe writes the data at the cache layer to the storage pool layer.
  • the cache layer is used to provide read and write for the host, and mainly interacts with the host.
  • the storage pool is used for temporarily storing data to be written to the hard disk, and mainly interacts with the hard disk, so this is two different functional layers.
  • the current deduplication rate is 2
  • the current compression ratio is 4
  • the size of the cache page is 4 KB
  • the present invention also provides an embodiment of a cache data processing apparatus.
  • the cache data processing device 3 is a hardware or program virtual device, and the above method can be executed.
  • the cache data processing apparatus 3 includes a parameter acquisition module, a calculation module 32 connected to the parameter acquisition module, and a data processing module 33 connected to the calculation module 32.
  • the parameter obtaining module is configured to obtain a compression ratio D, a deduplication ratio C, and an average stripe filling ratio I of the data, and is also used to obtain a target stripe size S in the cache, and a valid data size in the target stripe. .
  • the calculation module 32 is configured to follow a formula Obtain the amount of data N eliminated.
  • the data processing module 33 is configured to perform one of the following operations according to the value of N: in the case of T min ⁇ N ⁇ T max , write data of size N into the target strip, and The data of the target strip is eliminated to the storage medium, wherein when T min is a preset first threshold, T max is a preset second threshold; in the case of N>T max , data of size N is written The target striping; in the case of N ⁇ T min , the data of the target strip is eliminated to the storage medium.
  • the parameter acquisition module is configured to acquire the data deduplication ratio C from the memory, the data compression ratio D, and the average stripe filling rate I.
  • the deduplication ratio C, the compression ratio D, and the average allocation fill rate I are statistical values for historical data. When initializing, it is 1; but as the system runs, these three values will change dynamically due to the continuous deletion, compression, and filling of new stripes. These data can be stored in memory after being counted, or they can be stored in other media.
  • the deduplication ratio C is a ratio of the amount of data before and after deduplication in the cache in the past period of time.
  • the range of statistics can be all the strips in the cache; or it can be a part of the stripe, for example, the data after the disc is part of a specific LUN.
  • the deduplication ratio C minimum value is 1 (in the deduplication process, no data block is deleted because of duplication, or no deduplication is performed). Deduplicating the stripe data before the stripe can save disk space.
  • the valid data in the stripe can be compressed. Compression can be performed after a deduplication operation.
  • the compression ratio D is a ratio of the amount of data before and after compression of the stripe in the cache over a period of time. In theory, the minimum value of the compression ratio D is 1 (the compression operation is performed, but no data is successfully compressed; or the compression operation is not performed). Compressing the stripe data in front of the stripe can save disk space.
  • the range of statistics can be all the strips in the cache; or it can be a part of the stripe, for example, the data after the disc is part of a specific LUN.
  • the average stripe filling rate I is the average of the ratio of the effective data of each stripe in the cache to the total length of the stripe in the past period of time.
  • the valid data of the statistics may be valid data after the compression operation and the deduplication operation are performed.
  • the range of statistics can be all the strips in the cache; or it can be a part of the stripe, for example, the data after the disc is part of a specific LUN.
  • the memory in the embodiment of the present invention is, for example, a RAM, which can temporarily store the operational data in the CPU and provide space for the computer to run the program. Storage can be part of memory or physically separate from memory.
  • the cache may be used to temporarily store the stripe in the embodiment of the present invention; the cache may be the same as the RAM, or may be another medium such as a solid state drive SSD.
  • the parameter obtaining module is configured to obtain a target stripe size S in the memory and a valid data size W in the target stripe.
  • the target stripe size S can be described by the length of the target stripe, for example, a byte (Byte). It can also be described by the number of units of length, such as the number of cache pages occupied by the target strip.
  • the effective data size W in the target stripe can be described by the length of the target stripe, in bytes (Byte); it can also be described by the number of units of length.
  • the description of the effective data size W in the target stripe is consistent with the description of the target stripe size S.
  • N (S*D*C-W)/I, and perform one of the following operations according to the value range of N:
  • Calculation module 32 for following the formula Obtain the amount of data N eliminated.
  • the compression ratio C and the deduplication ratio D are optional. If there is no compression, there is no compression ratio C; if there is no deduplication, there is no deduplication ratio D.
  • the unit of N is consistent with S and W.
  • the unit of S is a byte
  • the unit of N is also a byte.
  • the actual value of N may be an integer multiple of the smallest unit of the lower disk, and the difference from (S*D*C-W)/I is less than a minimum unit.
  • the minimum unit of the lower disk is 10 bytes
  • the calculation result of (S*D*CW)/I is 54 bytes.
  • an alternative method is that the value of N is 50 bytes; another alternative is The value of N is 60 bytes.
  • N is also the number of cached pages.
  • the calculation result of (S*D*CW)/I is a decimal
  • the actual value of N may be the value after (S*D*CW)/I is rounded, and an optional method is downward.
  • the value of N may be 10 cache pages.
  • the rounding up may also be performed, and 10.3 cache pages are rounded to 11 cache pages.
  • T min ⁇ N ⁇ T max data of size N is written into the target strip, and then the data of the target strip is eliminated to a persistent storage medium (SSD, hard disk, etc.) .
  • the current data of the target stripe data of size N + original data of the target stripe.
  • T min is a preset first threshold and T max is a preset second threshold.
  • T min and T max are preset second threshold.
  • the unit is the same as N.
  • T min and T max can be different in different scenarios, and can have different settings, so they are not limited. E.g. T min values may be stripe length * 10% C * D, and T max values may be a stripe length * 80% C * D is.
  • the above (1) and (2) all involve writing the buffered data into the stripe.
  • This write operation logically attributes data that is not part of the target strip to the target strip. After the write operation is completed, the data being written is still physically located in the cache. But at the logical level, this is to write the data of the cache layer to the storage pool.
  • the cache layer is used to provide read and write for the host, and mainly interacts with the host.
  • the storage pool is used for temporarily storing data to be written to the hard disk, and mainly interacts with the hard disk, so this is two different functional layers. Steps 31, 32 and 33 are performed by the cache pool layer.
  • the current deduplication rate is 2
  • the current compression ratio is 4
  • the size of the cache page is 4 KB

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

揭露一种数据处理方法,以及对应的装置和存储控制器。其中,数据处理方法包括:获取数据的压缩比D、重删比C、平均分条填充率I、缓存中目标分条大小S、所述目标分条中有效数据大小W;根据获取的这几项参数,使用公式(A)获取淘汰数据量N,根据N的取值执行下述操作中的一个:在Tmin≤N≤Tmax 的情况下,将大小为N的数据写入所述目标分条,把所述目标分条的数据淘汰给存储介质,其中当Tmin是预设的第一阈值,Tmax是预设的第二阈值;在N>Tmax的情况下,将大小为N的数据写入所述目标分条;在N<Tmin的情况下,把所述目标分条的数据淘汰给所述存储介质。使用该方案对缓存数据下盘的时间点进行了更合理的设计。

Description

一种缓存数据处理方法、装置和存储控制器 技术领域
本发明涉发明存储技术,特别涉及于存储领域技术的日志领域。
背景技术
缓存(cache)是一种为了解决高、低速设备之间速度不匹配而采用的一项重要技术,广泛应用于各种领域如存储系统中,可以减少应用响应时间、提升效率。
在存储系统中,为了提升存储系统的性能,通常在处理设备和硬盘之间增加一个缓存层(也称为回写缓存,write-back cache)。缓存层可以提高系统读写性能,所以有时候也把缓存层称为性能层。
缓存使用的介质例如是固态硬盘(solid state disk,SSD),其其读写性能优于持久化存储介质(例如硬盘)。相对于硬盘,可以更快速处理来自主机应用程序的写请求。缓存的存储容量有限,因此当空闲空间不足时,需要根据淘汰算法把一部分缓存介质数据淘汰到硬盘中,以便腾出空间为后续的写请求使用。这部分从缓存下发到硬盘的数据称为脏数据。
为了尽快的让缓存拥有足够的空闲空间,在空闲空间不足时需要尽快把脏数据淘汰到硬盘中去。否则会造成写请求难以被及时处理。
存储领域中,缓存中脏数据通常是以分条作为粒度下发到硬盘。分条是逻辑概念,类似于一个装数据的容器。如果下发的数据不足一个分条,意味着分条中仅有部分位置有效数据,分条中存在空闲位置。参见图1中的分条,其利用率只有50%。这种没有被有效数据“装满”的分条,和被有效数据“装满”的分条一样,都会占用硬盘中一个完整分条的存储空间,而且会产生一组元数据。因此,如果分条中有效数据和空闲位置的比例越大。可以节约越多的硬盘存储空间,以及减少元数据的数量。如果分条完全“装满”有效数据后再下发,可以最大化的利用硬盘存储空间,以及产生最少的元数据。
由此可见,脏数据的淘汰方式存在两个矛盾的需求:从尽快获取更多空闲缓存空间这个需求考虑,脏数据需要尽快淘汰到硬盘,最好是一旦空闲空间不足,立刻执行淘汰操作;而从提高硬盘利用率和减少元数据这个需求考虑,需要尽量凑满分条后再把脏数据淘汰到硬盘,最好是把脏数据凑满完整的分条后再执行淘汰操作。如何在二者中寻求一个平衡,是业界需要解决的问题。
现有技术中并没有很好的解决这个问题。每秒读写次数(IOPS)抖动过大,以及硬盘存储空间利用不足的情况时有发生。
发明内容
本发明实施例提供一种缓存数据处理方法、装置和存储控制器,可以缓解IOPS的严重波动,使存储系统的性能越稳定。
本发明第一方面,本发明提供一种缓存数据处理方法,该方法包括:获取数据的压缩比D、重删比C、以及平均分条填充率I、缓存中目标分条大小S、以及所述目标分条中有效数据大小W;按照公式
Figure PCTCN2017118147-appb-000001
获取淘汰数据量N,在T min≤N≤T max的情况下,将大小为N的数据写入所述目标分条,把所述目标分条的数据淘汰给存储介质,其中当T min是预设的第一阈值,T max是预设的第二阈值。在另外一种可选方式中,在N>T max 的情况下,将大小为N的数据写入所述目标分条。在另外一种可选方式中,在N<T min的情况下,把所述目标分条的数据淘汰给所述存储介质。这三种可选方式都是可选的,执行其中任意一个即可形成一个完整的流程。基于该方法,在对缓存没有明显影响的情况下,分条容纳尽量多的数据后再淘汰到存储介质中。在尽早获得空闲的缓存空间以及提高磁盘利用率这两个互相矛盾的需求之间获得平衡。使得缓存数据更平滑的淘汰给存储介质,减少了IOPS严重波动的情况,使存储系统更加稳定。
在第一方面的第一种可能实现方式中,其中,将大小为N的数据写入所述目标分条之后,进一步包括:在所述目标分条被后续数据写满以后,把所述目标分条淘汰到所述存储介质。该可能实现方式提出了N>T m的情况下,淘汰数据的方案。
在第一方面的第二种可能实现方式中,根据权利要求1所述的缓存数据淘汰方法,所述D、C和I是统计值,其初始值均为1。
在第一方面的第三种可能实现方式中,其中S用从缓存下发数据到存储介质的最小单位(或者最小单位的整数倍)的数量进行描述,例如用缓存页的数量描述。
本发明第二方面,提供一种缓存数据处理装置,该装置包括:获取模块,可以用于获取数据的压缩比D、重删比C以及平均分条填充率I,还可以用于获取缓存中目标分条大小S、所述目标分条中有效数据大小W;计算模块,用于按照公式
Figure PCTCN2017118147-appb-000002
计算从淘汰数据量N;数据处理模块,用于在T min≤N≤T max的情况下,将大小为N的数据写入所述目标分条,把所述目标分条的数据淘汰给存储介质,其中当T min是预设的第一阈值,T max是预设的第二阈值。在另外一种可选方式中,数据处理模块用于在N>T max的情况下,将大小为N的数据写入所述目标分条。在另外一种可选方式中,在N<T min的情况下,数据处理模块用于把所述目标分条的数据淘汰给所述存储介质。这三种可选方式都是可选的,执行其中任意一个即可形成一个完整的流程。基于该缓存数据处理装置,在对缓存没有明显影响的情况下,分条容纳尽量多的数据后再淘汰到存储介质中。在尽早获得空闲的缓存空间以及提高磁盘利用率这两个互相矛盾的需求之间获得平衡。使得缓存数据更平滑的淘汰给存储介质,减少了IOPS严重波动的情况,使存储系统更加稳定。
本发明第二方面的第一种可能实现方式,所述处理模块还用于:在大小为N的数据写入所述目标分条之后,如果所述目标分条被后续数据写满以后,把所述目标分条淘汰到所述存储介质。该可能实现方式提出了N>T m的情况下,淘汰数据的方案。
本发明第二方面的第二种可能实现方式,所述D、C和I是统计值,其初始值均为1。
本发明第二方面的第三种可能实现方式,S用从缓存下发数据到存储介质的最小单位(或者最小单位的整数倍)的数量进行描述,例如用缓存页的数量描述。
本发明第三方面提供一种存储控制器,所述存储控制器包括处理器和缓存,缓存用于暂存数据,可选的还可以包括存储淘汰数据的存储介质(例如硬盘或者固态硬盘)。所述处理器通过运行程序执行下面的步骤:获取数据的压缩比D、重删比C、以及平均分条填充率I,还用于获取缓存中目标分条大小S、所述目标分条中有效数据大小W;按照公式
Figure PCTCN2017118147-appb-000003
获取淘汰数据量N;在T min≤N≤T max的情况下,将大小为N的数据写入所述目标分条,把所述目标分条的数据淘汰给存储介质,其中当T min是预设的第一阈值,T max是预设的第二阈值。在另外一种可选方式中,在N>T max的情况下,将大小为N的数据写入所述目标分条。在另外一种可选方式中,在N<T min的情况下,把所述目标分条的 数据淘汰给所述存储介质。这三种可选方式都是可选的,执行其中任意一个即可形成一个完整的流程。基于该存储控制器,在对缓存没有明显影响的情况下,分条容纳尽量多的数据后再淘汰到存储介质中。在尽早获得空闲的缓存空间以及提高磁盘利用率这两个互相矛盾的需求之间获得平衡。
本发明第三方面的第一种可能实现方式,所述处理器还用于执行:在大小为N的数据写入所述目标分条之后,如果所述目标分条被后续数据写满以后,把所述目标分条淘汰到所述存储介质。该可能实现方式提出了N>T m的情况下,淘汰数据的方案。
本发明第三方面的第二种可能实现方式,所述D、C和I是统计值,其初始值均为1。
本发明第三方面的第三种可能实现方式,S用从缓存下发数据到存储介质的最小单位(或者最小单位的整数倍)的数量进行描述,例如用缓存页的数量描述。
本发明第四方面,还提供一种存储系统,包括上述的存储控制器和存储介质(例如硬盘、固态硬盘),存储介质用于存储被淘汰的数据。
本发明第五方面,还提供一种存储系统,包括上述的数据处理装置和存储介质(例如硬盘、固态硬盘),存储介质用于存储被淘汰的数据。
附图说明
图1是分条使用情况示意图;
图2是本发明存储系统实施例结构图;
图3是本发明缓存数据处理方法一种实施例流程图;
图4是一种缓存数据处理装置实施例拓扑图。
具体实施方式
本申请方案可以适用于存储设备。存储设备例如是存储控制器。存储控制器和存储介质(例如硬盘、固态硬盘等)相对独立,它们共同组成存储系统。除非特别说明,后续实施例以这种情况为例介绍本发明实施例方案,存储介质以硬盘进行举例。
需要说明的是,存储设备还可以是既有运算管理能力又有存储介质的存储设备,例如服务器。服务器中拥有运算管理能力的那部分相当于存储控制器。存储控制器和存储设备内部的存储介质通信,或者和存储设备外部的存储介质通信。由于原理类似,因此不做详述。
参见图2是本发明存储系统实施例结构图。主机11和存储系统12通信,存储系统包括存储控制器12和存储介质13。存储控制器12中有处理器121,缓存122,还可以有内存123。内存123可以为处理器121运行程序提供存储空间,通过运行程序,处理器可以执行本发明提供的缓存数据处理方法实施例。内存123和缓存122可以集成在一起,也可以分开。在图中存储控制器12和财产介质13是独立的。在其他实施例中,存储控制器12中也可以集成存储介质13,例如通用服务器。
缓存可以供主机11读写。由于缓存空间有限,因此在缓存空间变小时,需要把缓存中数据迁移到存储介质13中。具体而言是以分条为单位,把位于缓存121的分条的有效数据迁移到存储介质13中,这种迁移也称为下盘,下盘的越早,缓存能越早的腾出来空隙空间。
在块(block)存储技术中,把缓存数据下盘是以分条作为粒度的,分条是逻辑单位,每个分条(stripe)由多个条带(strip)组成。在把数据从缓存下盘时,每个/每组硬盘存储所述分条的一个条带。以分条作为粒度把把缓存迁移到硬盘的过程中,并不意味着整 个分条都是有效数据,可能分条的一部分是没有有效数据的,例如只有部分条带是有效数据,其余条带无有效数据。
一方面,是尽早下盘可以让缓存尽早获取空闲存储空间;另一方面,分条下盘后,分条中的有效数据和无效数据都会占用磁盘空间,如果分条尚未容纳尽量多的有效数据就下盘,会造成硬盘的利用率不高,因此从提高磁盘利用率的角度考虑,最好是不要尽早下盘,而是凑满分条再下盘。应用本发明实施例按照的算法,可以在这两个矛盾的需求之间做出更好的平衡。
参见附图3,是本发明缓存数据处理方法一种实施例流程图,可以由存储控制器执行。
21,从内存中获取数据的重删比C,数据的压缩比D、以及平均分条填充率I。
重删比C、压缩比D和平均分摊填充率I都是对历史数据的统计值。初始化的时候,都是1;但是随着系统的运行,由于不断有新分条被重删、压缩、填充处理,这3个值会动态变化的。这些数据被统计后可以存储在内存中,也可以存储在其他介质。
对缓存中的各个分条而言,在被下盘前,可以对分条内的有效数据进行重复数据删除。对于分条中的每个块,如果硬盘中已经存在相同的块,说明这个块和硬盘现有的块重复,这个块可以不用下盘。这样可以减少下盘的数据量以及节约磁盘的存储空间。重删比C是统计过去一段时间内,缓存中分条重删前和重删后的数据量的比值。统计的分条范围可以是缓存中所有分条;也可以是一部分分条,例如下盘后的数据属于特定LUN的分条。重删比C最小值为1(在重复数据删除过程中,没有数据块因为重复被被删除,或者不执行重删)。在分条下盘前对分条数据进行重删,可以节约磁盘空间。
对缓存中的各个分条而言,在被下盘前,除了进行重复数据删除,还可以对分条内的有效数据进行压缩。压缩可以在重复数据删除操作之后执行。压缩比D是统计过去一段时间内,缓存中的分条压缩前和压缩后的数据量的比值。理论上,压缩比D的最小值是1(执行了压缩操作,但是没有数据被压缩成功;或者没有执行压缩操作)。在分条下盘前对分条数据进行压缩,可以节约磁盘空间。统计的分条范围可以是缓存中所有分条;也可以是一部分分条,例如下盘后的数据属于特定LUN的分条。
平均分条填充率I,是统计过去一段时间内,缓存中各分条有效数据占分条总长度的比值的平均值。其中,计算平均分条填充率I时,统计的有效数据可以是执行完压缩操作和重删操作之后的有效数据。统计的分条范围可以是缓存中所有分条;也可以是一部分分条,例如下盘后的数据属于特定LUN的分条。
需要说明的是,本发明实施例描述了内存和缓存这两个概念。缓本发明实施例中的内存(memory)例如是RAM,可以暂时存放CPU中的运算数据,为计算机运行程序提供空间。存可以是内存的一部分,也可以和内存是在物理上分开。缓存(cache)在本发明实施例中可以用于暂时存放分条;缓存可以同样是RAM,也可以是固态硬盘SSD等其他介质。
22,获取内存中目标分条大小S、所述目标分条中有效数据大小W。
目标分条大小S可以用目标分条的长度进行描述,单位例如是字节(Byte)。也可以用单位长度的数量描述,比如用目标分条占用的缓存页(cache page)的数量来描述。
类似的,目标分条中有效数据大小W可以用目标分条的长度进行描述,单位是字节(Byte);也可以用单位长度的数量描述。目标分条中有效数据大小W的描述方式和目标分条大小S的描述方式保持一致。
按照公式N=(S*D*C-W)/I,获取淘汰数据量N,按照N的取值范围执行下述操作中的一个:
23,按照公式
Figure PCTCN2017118147-appb-000004
获取淘汰数据量N。
其中,压缩比C、重删比D是可选的。如果没有压缩,则没有压缩比C;如果没有重删,则没有重删比D。
在首次对缓存中的的数据使用本实施例进行处理时,由于历史上没有分条被处理,因此可以缺省为D=1,C=1,I=1。
显然,N的单位和S、W保持一致。当S的单位是字节时,N的单位也是字节。N的实际取值可以是下盘的最小单位的整数倍,并且与(S*D*C-W)/I的差值小于一个最小单位。例如下盘的最小单位是10字节,(S*D*C-W)/I的计算结果是54字节,那么一种可选方式是N的值是50字节;另外一种可选方式是N的值是60字节。
当S由缓存页的数量描述时,N也是缓存页的数量。此时,如果(S*D*C-W)/I的计算结果是小数,N的实际取值可以是(S*D*C-W)/I进行取整后的值,一种可选方式是向下取整例如(S*D*C-W)/I的计算结果是10.3个缓存页,那么N的取值可以是10个缓存页。在另外一种实施方式中,也可以是向上取整,10.3个缓存页取整为11个缓存页。
24,按照淘汰数据量N的值,执行相应的操作。
(1)在T min≤N≤T max的情况下,将大小为N的数据写入所述目标分条,然后把所述目标分条的数据淘汰到持久化存储介质(SSD、硬盘等)。在把大小为N的数据写入所述目标分条后,目标分条的当前数据=大小为N的数据+目标分条原有数据。
其中T min是预设的第一阈值,T max是预设的第二阈值。T min和T max。的单位和N一致。T min和T max在不同的场景下,可以需求的不同,可以有不同的设置,因此不做限定。例如T min的取值可以为分条长度*C*D的10%,而T max的取值可以为分条长度*C*D的80%。
(2)在N>T max的情况下,将大小为N的数据写入所述目标分条。和(1)的区别是,可以暂时不对目标分条执行下盘操作。在后续有新的数据被写入这个分条,使得分条被写满后再把这个分条淘汰到持久化存储介质存储介质。
(3)在N<T min的情况下,把所述目标分条的数据淘汰到持久化存储介质。和(1)的区别是,不把大小为N的数据的数据写入目标分条,直接对目标分条进行下盘。
需要说明的是,上述(1)和(2)都涉及把缓存的数据写入目标分条。这种写操作逻辑上的,可以理解为把不属于目标分条的数据归属于目标分条。写操作执行完以后,被写的数据在物理上仍然位于缓存中。但是在逻辑层面,把大小为N的数据写入目标分条,是把位于缓存层的数据写入了存储池(storage pool)层。缓存层用于为主机提供读写,主要和主机进行交互;而存储池是用于暂存准备写入硬盘的数据,主要和硬盘进行交互,因此这是两个不同的功能层。
为了方便理解,下面以一个具体的示例对上述实施例进行介绍。
例如:从内存中获取:当前的重删率为2,当前的压缩率为4,当前的统计的分条平均填充率I=0.9。缓存页的大小为4KB,分条大小为8MB,即S=(8MB/4KB)=2K,当前分条已经写入了15K个缓存页,假设T min=128,T max=4K。
根据公式(S*D*C-W)/I=(2K*2*4-15K)/0.9≈1137.8。向下取整为N=1137。
符合第(2)种情形T min<N<T max。因此,按照本发明实施例,将1137个缓存页的数 据写入当前分条,然后把当前分条中的所有数据发送到硬盘中去。发送完成后,释放目标分条在缓存中占用的存储空间。在这个示例中,之所以使用缓存页的数量作为S,是考虑到把缓存中的数据下发到硬盘中时,以缓存页作为粒度是一种常见的做法。在其他实施例中可以有其他方案,例如以分条大小除以缓存页的倍数作为S。在另外的实施例中,可能没有缓存页的概念,以分条大小下盘的最小粒度或者最小粒度的整数倍即可。或者直接以分条大小作为S,在算出来N的值以后,再换算成缓存页的数量。
参见图4,本发明还提供一种缓存数据处理装置实施例。缓存数据处理装置3是硬件或者程序虚拟装置,可以执行上述方法。缓存数据处理装置3包括:参数获取模块,和参数获取模块连接的计算模块32,和计算模块32连接的数据处理模块33。
所述参数获取模块,用于获取数据的压缩比D、重删比C、以及平均分条填充率I,还用于获取缓存中目标分条大小S、所述目标分条中有效数据大小W。
所述计算模块32,用于按照公式
Figure PCTCN2017118147-appb-000005
获取淘汰数据量N。
所述数据处理模块33,用于根据N的取值执行下述操作中的一个:在T min≤N≤T max的情况下,将大小为N的数据写入所述目标分条,把所述目标分条的数据淘汰给存储介质,其中当T min是预设的第一阈值,T max是预设的第二阈值;在N>T max的情况下,将大小为N的数据写入所述目标分条;在N<T min的情况下,把所述目标分条的数据淘汰给所述存储介质。
下面对各模块功能进行具体介绍。
参数获取模块,用于从内存中获取数据的重删比C,数据的压缩比D、以及平均分条填充率I。
重删比C、压缩比D和平均分摊填充率I都是对历史数据的统计值。初始化的时候,都是1;但是随着系统的运行,由于不断有新分条被重删、压缩、填充处理,这3个值会动态变化的。这些数据被统计后可以存储在内存中,也可以存储在其他介质。
对缓存中的各个分条而言,在被下盘前,可以对分条内的有效数据进行重复数据删除。对于分条中的每个块,如果硬盘中已经存在相同的块,说明这个块和硬盘现有的块重复,这个块可以不用下盘。这样可以减少下盘的数据量以及节约磁盘的存储空间。重删比C是统计过去一段时间内,缓存中分条重删前和重删后的数据量的比值。统计的分条范围可以是缓存中所有分条;也可以是一部分分条,例如下盘后的数据属于特定LUN的分条。重删比C最小值为1(在重复数据删除过程中,没有数据块因为重复被被删除,或者不执行重删)。在分条下盘前对分条数据进行重删,可以节约磁盘空间。
对缓存中的各个分条而言,在被下盘前,除了进行重复数据删除,还可以对分条内的有效数据进行压缩。压缩可以在重复数据删除操作之后执行。压缩比D是统计过去一段时间内,缓存中的分条压缩前和压缩后的数据量的比值。理论上,压缩比D的最小值是1(执行了压缩操作,但是没有数据被压缩成功;或者没有执行压缩操作)。在分条下盘前对分条数据进行压缩,可以节约磁盘空间。统计的分条范围可以是缓存中所有分条;也可以是一部分分条,例如下盘后的数据属于特定LUN的分条。
平均分条填充率I,是统计过去一段时间内,缓存中各分条有效数据占分条总长度的比值的平均值。其中,计算平均分条填充率I时,统计的有效数据可以是执行完压缩操作和重删操作之后的有效数据。统计的分条范围可以是缓存中所有分条;也可以是一部分分条, 例如下盘后的数据属于特定LUN的分条。
需要说明的是,本发明实施例描述了内存和缓存这两个概念。缓本发明实施例中的内存(memory)例如是RAM,可以暂时存放CPU中的运算数据,为计算机运行程序提供空间。存可以是内存的一部分,也可以和内存是在物理上分开。缓存(cache)在本发明实施例中可以用于暂时存放分条;缓存可以同样是RAM,也可以是固态硬盘SSD等其他介质。
参数获取模块,用于获取内存中目标分条大小S、所述目标分条中有效数据大小W。
目标分条大小S可以用目标分条的长度进行描述,单位例如是字节(Byte)。也可以用单位长度的数量描述,比如用目标分条占用的缓存页(cache page)的数量来描述。
类似的,目标分条中有效数据大小W可以用目标分条的长度进行描述,单位是字节(Byte);也可以用单位长度的数量描述。目标分条中有效数据大小W的描述方式和目标分条大小S的描述方式保持一致。
按照公式N=(S*D*C-W)/I,获取淘汰数据量N,按照N的取值范围执行下述操作中的一个:
计算模块32,用于按照公式
Figure PCTCN2017118147-appb-000006
获取淘汰数据量N。
其中,压缩比C、重删比D是可选的。如果没有压缩,则没有压缩比C;如果没有重删,则没有重删比D。
在首次对缓存中的的数据使用本实施例进行处理时,由于历史上没有分条被处理,因此可以缺省为D=1,C=1,I=1。
显然,N的单位和S、W保持一致。当S的单位是字节时,N的单位也是字节。N的实际取值可以是下盘的最小单位的整数倍,并且与(S*D*C-W)/I的差值小于一个最小单位。例如下盘的最小单位是10字节,(S*D*C-W)/I的计算结果是54字节,那么一种可选方式是N的值是50字节;另外一种可选方式是N的值是60字节。
当S由缓存页的数量描述时,N也是缓存页的数量。此时,如果(S*D*C-W)/I的计算结果是小数,N的实际取值可以是(S*D*C-W)/I进行取整后的值,一种可选方式是向下取整例如(S*D*C-W)/I的计算结果是10.3个缓存页,那么N的取值可以是10个缓存页。在另外一种实施方式中,也可以是向上取整,10.3个缓存页取整为11个缓存页。
34,按照淘汰数据量N的值,执行相应的操作。
(1)在T min≤N≤T max的情况下,将大小为N的数据写入所述目标分条,然后把所述目标分条的数据淘汰到持久化存储介质(SSD、硬盘等)。在把大小为N的数据写入所述目标分条后,目标分条的当前数据=大小为N的数据+目标分条原有数据。
其中T min是预设的第一阈值,T max是预设的第二阈值。T min和T max。的单位和N一致。T min和T max在不同的场景下,可以需求的不同,可以有不同的设置,因此不做限定。例如T min的取值可以为分条长度*C*D的10%,而T max的取值可以为分条长度*C*D的80%。
(2)在N>T max的情况下,将大小为N的数据写入所述目标分条。和(1)的区别是,可以暂时不对目标分条执行下盘操作。在后续有新的数据被写入这个分条,使得分条被写满后再把这个分条淘汰到持久化存储介质存储介质。
(3)在N<T min的情况下,把所述目标分条的数据淘汰到持久化存储介质。和(1)的区别是,不把大小为N的数据的数据写入目标分条,直接对目标分条进行下盘。
需要说明的是,上述(1)和(2)都涉及把缓存的数据写入分条。这种写操作逻辑上 的,把不属于目标分条的数据归属于目标分条。写操作执行完以后,被写的数据在物理上仍然位于缓存中。但是在逻辑层面,这是把缓存层的数据写入了存储池(storage pool)。缓存层用于为主机提供读写,主要和主机进行交互;而存储池是用于暂存准备写入硬盘的数据,主要和硬盘进行交互,因此这是两个不同的功能层。步骤31、32和33是由缓存池层执行的。
为了方便理解,下面以一个具体的示例对上述实施例进行介绍。
例如:从内存中获取:当前的重删率为2,当前的压缩率为4,当前的统计的分条平均填充率I=0.9。缓存页的大小为4KB,分条大小为8MB,即S=(8MB/4KB)=2K,当前分条已经写入了15K个缓存页,假设T min=128,T max=4K。
根据公式(S*D*C-W)/I=(2K*2*4-15K)/0.9≈1137.8。向下取整为N=1137。
符合第(2)种情形T min<N<T max。因此,按照本发明实施例,将1137个缓存页的数据写入当前分条,然后把当前分条中的所有数据发送到硬盘中去。发送完成后,释放目标分条在缓存中占用的存储空间。在这个示例中,之所以使用缓存页的数量作为S,是考虑到把缓存中的数据下发到硬盘中时,以缓存页作为粒度是一种常见的做法。在其他实施例中可以有其他方案,例如以分条大小除以缓存页的倍数作为S。在另外的实施例中,可能没有缓存页的概念,以分条大小下盘的最小粒度或者最小粒度的整数倍即可。或者直接以分条大小作为S,在算出来N的值以后,再换算成缓存页的数量。
结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,基于本发明的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。

Claims (10)

  1. 一种缓存数据处理方法,其特征在于,该方法包括:
    获取数据的压缩比D、重删比C、以及平均分条填充率I,获取缓存中目标分条大小S、所述目标分条中有效数据大小W;
    按照公式
    Figure PCTCN2017118147-appb-100001
    获得淘汰数据量N,根据N的取值执行下述操作中的一个:
    在T min≤N≤T max的情况下,将大小为N的数据写入所述目标分条,把所述目标分条的数据淘汰给存储介质,其中当T min是预设的第一阈值,T max是预设的第二阈值;
    在N>T max的情况下,将大小为N的数据写入所述目标分条;
    在N<T min的情况下,把所述目标分条的数据淘汰给所述存储介质。
  2. 根据权利要求1所述的缓存数据淘汰方法,其中,将大小为N的数据写入所述目标分条之后,进一步包括:
    在所述目标分条被后续数据写满以后,把所述目标分条淘汰到所述存储介质。
  3. 根据权利要求1所述的缓存数据淘汰方法,其中:
    所述D、C和I的初始值均为1。
  4. 根据权利要求1所述的缓存数据淘汰方法,该方法还包括:
    其中S用缓存页的数量描述。
  5. 一种缓存数据处理装置,其特征在于,该装置包括:
    获取模块,用于获取数据的压缩比D、重删比C、以及平均分条填充率I,还用于获取缓存中目标分条大小S、所述目标分条中有效数据大小W;
    计算模块,用于按照公式
    Figure PCTCN2017118147-appb-100002
    获得淘汰数据量N;
    数据处理模块,用于根据N的取值执行下述操作中的一个:
    在T min≤N≤T max的情况下,将大小为N的数据写入所述目标分条,把所述目标分条的数据淘汰给存储介质,其中当T min是预设的第一阈值,T max是预设的第二阈值;
    在N>T max的情况下,将大小为N的数据写入所述目标分条;
    在N<T min的情况下,把所述目标分条的数据淘汰给所述存储介质。
  6. 根据权利要求5所述的缓存数据淘汰装置,其中,所述处理模块还用于:
    在大小为N的数据写入所述目标分条之后,如果所述目标分条被后续数据写满以后,把所述目标分条淘汰到所述存储介质。
  7. 根据权利要求1所述的缓存数据淘汰装置,其中:
    所述D、C和I的初始值均为1。
  8. 根据权利要求5所述的缓存数据淘汰装置,其中:
    所述S用缓存页的数量描述。
  9. 一种存储控制器,其特征在于,包括处理器,以及用于暂存数据的缓存,其中所述处理器通过运行程序执行:
    获取数据的压缩比D、重删比C、以及平均分条填充率I,还用于获取缓存中目标分条大小S、所述目标分条中有效数据大小W;
    按照公式
    Figure PCTCN2017118147-appb-100003
    获得淘汰数据量N;
    根据N的取值执行下述操作中的一个:在T min≤N≤T max的情况下,将大小为N的数据写入所述目标分条,把所述目标分条的数据淘汰给存储介质,其中当T min是预设的第一阈值,T max是预设的第二阈值;在N>T max的情况下,将大小为N的数据写入所述目标分条;在N<T min的情况下,把所述目标分条的数据淘汰给所述存储介质。
  10. 根据权利要求9所述的存储控制器,所述处理器还用于:
    在大小为N的数据写入所述目标分条之后,如果所述目标分条被后续数据写满以后,把所述目标分条淘汰到所述存储介质。
PCT/CN2017/118147 2016-12-29 2017-12-23 一种缓存数据处理方法、装置和存储控制器 WO2018121455A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611248587.3 2016-12-29
CN201611248587.3A CN106648469B (zh) 2016-12-29 2016-12-29 一种缓存数据处理方法、装置和存储控制器

Publications (1)

Publication Number Publication Date
WO2018121455A1 true WO2018121455A1 (zh) 2018-07-05

Family

ID=58836364

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/118147 WO2018121455A1 (zh) 2016-12-29 2017-12-23 一种缓存数据处理方法、装置和存储控制器

Country Status (2)

Country Link
CN (1) CN106648469B (zh)
WO (1) WO2018121455A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086172A (zh) * 2018-09-21 2018-12-25 郑州云海信息技术有限公司 一种数据处理的方法以及相关装置
CN110222048A (zh) * 2019-05-06 2019-09-10 平安科技(深圳)有限公司 序列生成方法、装置、计算机设备及存储介质
CN110765031A (zh) * 2019-09-27 2020-02-07 Oppo(重庆)智能科技有限公司 数据存储方法、装置、移动终端及存储介质
CN111124307A (zh) * 2019-12-20 2020-05-08 北京浪潮数据技术有限公司 一种数据下刷方法、装置、设备及可读存储介质
CN112799978A (zh) * 2021-01-20 2021-05-14 网易(杭州)网络有限公司 缓存设计管理方法、装置、设备和计算机可读存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648469B (zh) * 2016-12-29 2020-01-17 华为技术有限公司 一种缓存数据处理方法、装置和存储控制器
CN107153619A (zh) * 2017-06-14 2017-09-12 湖南国科微电子股份有限公司 固态硬盘数据缓存方法及装置
WO2019084917A1 (zh) 2017-11-03 2019-05-09 华为技术有限公司 存储系统可用容量计算方法及装置
CN113726341B (zh) * 2021-08-25 2023-09-01 杭州海康威视数字技术股份有限公司 一种数据处理方法、装置、电子设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087822A1 (en) * 2000-08-19 2002-07-04 International Business Machines Corporaiton Free space collection in information storage systems
CN102223510A (zh) * 2011-06-03 2011-10-19 杭州华三通信技术有限公司 缓存调度方法和装置
CN103729149A (zh) * 2013-12-31 2014-04-16 创新科存储技术有限公司 一种存储数据的方法
CN103902465A (zh) * 2014-03-19 2014-07-02 华为技术有限公司 一种固态硬盘垃圾回收的方法、系统和固态硬盘控制器
CN105389387A (zh) * 2015-12-11 2016-03-09 上海爱数信息技术股份有限公司 一种基于压缩的重复数据删除性能及重删率提升的方法和系统
CN106648469A (zh) * 2016-12-29 2017-05-10 华为技术有限公司 一种缓存数据处理方法、装置和存储控制器

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8060715B2 (en) * 2009-03-31 2011-11-15 Symantec Corporation Systems and methods for controlling initialization of a fingerprint cache for data deduplication
CN102023810B (zh) * 2009-09-10 2012-08-29 成都市华为赛门铁克科技有限公司 一种写数据的方法、装置以及廉价冗余磁盘阵列

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087822A1 (en) * 2000-08-19 2002-07-04 International Business Machines Corporaiton Free space collection in information storage systems
CN102223510A (zh) * 2011-06-03 2011-10-19 杭州华三通信技术有限公司 缓存调度方法和装置
CN103729149A (zh) * 2013-12-31 2014-04-16 创新科存储技术有限公司 一种存储数据的方法
CN103902465A (zh) * 2014-03-19 2014-07-02 华为技术有限公司 一种固态硬盘垃圾回收的方法、系统和固态硬盘控制器
CN105389387A (zh) * 2015-12-11 2016-03-09 上海爱数信息技术股份有限公司 一种基于压缩的重复数据删除性能及重删率提升的方法和系统
CN106648469A (zh) * 2016-12-29 2017-05-10 华为技术有限公司 一种缓存数据处理方法、装置和存储控制器

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086172A (zh) * 2018-09-21 2018-12-25 郑州云海信息技术有限公司 一种数据处理的方法以及相关装置
CN110222048A (zh) * 2019-05-06 2019-09-10 平安科技(深圳)有限公司 序列生成方法、装置、计算机设备及存储介质
CN110222048B (zh) * 2019-05-06 2023-06-23 平安科技(深圳)有限公司 序列生成方法、装置、计算机设备及存储介质
CN110765031A (zh) * 2019-09-27 2020-02-07 Oppo(重庆)智能科技有限公司 数据存储方法、装置、移动终端及存储介质
CN110765031B (zh) * 2019-09-27 2022-08-12 Oppo广东移动通信有限公司 数据存储方法、装置、移动终端及存储介质
CN111124307A (zh) * 2019-12-20 2020-05-08 北京浪潮数据技术有限公司 一种数据下刷方法、装置、设备及可读存储介质
CN111124307B (zh) * 2019-12-20 2022-06-07 北京浪潮数据技术有限公司 一种数据下刷方法、装置、设备及可读存储介质
CN112799978A (zh) * 2021-01-20 2021-05-14 网易(杭州)网络有限公司 缓存设计管理方法、装置、设备和计算机可读存储介质
CN112799978B (zh) * 2021-01-20 2023-03-21 网易(杭州)网络有限公司 缓存设计管理方法、装置、设备和计算机可读存储介质

Also Published As

Publication number Publication date
CN106648469A (zh) 2017-05-10
CN106648469B (zh) 2020-01-17

Similar Documents

Publication Publication Date Title
WO2018121455A1 (zh) 一种缓存数据处理方法、装置和存储控制器
US8782335B2 (en) Latency reduction associated with a response to a request in a storage system
US10031703B1 (en) Extent-based tiering for virtual storage using full LUNs
US10747440B2 (en) Storage system and storage system management method
US10216446B2 (en) Method for deduplication in storage system, storage system, and controller
JP5944587B2 (ja) 計算機システム及び制御方法
US20150363134A1 (en) Storage apparatus and data management
JPWO2017149592A1 (ja) ストレージ装置
CN112631520B (zh) 分布式块存储系统、方法、装置、设备和介质
US9104317B2 (en) Computer system and method of controlling I/O with respect to storage apparatus
US10678431B1 (en) System and method for intelligent data movements between non-deduplicated and deduplicated tiers in a primary storage array
WO2023065654A1 (zh) 一种数据写入方法以及相关设备
US11842051B2 (en) Intelligent defragmentation in a storage system
US11513849B2 (en) Weighted resource cost matrix scheduler
US10146780B1 (en) Data storage system using paced deallocation of truncated file blocks
WO2015145667A1 (ja) ストレージシステム
US10853257B1 (en) Zero detection within sub-track compression domains
US11907541B2 (en) Adaptive read prefetch to reduce host latency and increase bandwidth for sequential read streams
US11740792B2 (en) Techniques for data storage management
US11886730B2 (en) Compression ratio-aware data deduplication
WO2017113329A1 (zh) 一种主机集群中缓存管理方法及主机

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17887181

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17887181

Country of ref document: EP

Kind code of ref document: A1