[go: up one dir, main page]

CN111857601B - Solid-state disk cache management method based on garbage collection and channel parallelism - Google Patents

Solid-state disk cache management method based on garbage collection and channel parallelism Download PDF

Info

Publication number
CN111857601B
CN111857601B CN202010750861.7A CN202010750861A CN111857601B CN 111857601 B CN111857601 B CN 111857601B CN 202010750861 A CN202010750861 A CN 202010750861A CN 111857601 B CN111857601 B CN 111857601B
Authority
CN
China
Prior art keywords
page
cache
write
garbage collection
logic
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
Application number
CN202010750861.7A
Other languages
Chinese (zh)
Other versions
CN111857601A (en
Inventor
邓玉辉
曾祥伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan University
Original Assignee
Jinan University
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 Jinan University filed Critical Jinan University
Priority to CN202010750861.7A priority Critical patent/CN111857601B/en
Publication of CN111857601A publication Critical patent/CN111857601A/en
Application granted granted Critical
Publication of CN111857601B publication Critical patent/CN111857601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

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)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a solid-state disk cache management method based on garbage collection and channel parallelism, which manages a cache region through a garbage collection detection write mechanism and a channel parallel write mechanism. Before the cache write-back, a garbage collection probe write mechanism is adopted to avoid the I/O conflict as far as possible, and meanwhile, the cache miss cost is reduced. When the cache is written back, a channel parallel writing mechanism is adopted as much as possible, the time cost of write-once operation is hidden by write-once operation, and the writing bandwidth of the solid-state disk is improved. According to the solid-state disk cache management method, by reasonably utilizing the garbage collection detection writing mechanism and the channel parallel writing mechanism, the cache writing time is saved while the conflict between the user I/O and the internal I/O of the solid-state disk is reduced, and the integral writing performance of the solid-state disk is improved.

Description

一种基于垃圾回收与通道并行性的固态盘缓存管理方法A Solid State Disk Cache Management Method Based on Garbage Collection and Channel Parallelism

技术领域technical field

本发明涉及存储系统技术领域,具体涉及一种基于垃圾回收与通道并行性的固态盘缓存管理方法。The invention relates to the technical field of storage systems, in particular to a solid state disk cache management method based on garbage collection and channel parallelism.

背景技术Background technique

固态盘缓存管理是在适应闪存物理特性的情况下提高固态盘存储性能的重要技术手段。固态盘内部具有与磁盘截然不同的行为方式,因此,对固态盘内部的缓存管理方法进行重新设计是很有必要的。传统缓存方法主要有LRU、LFU及其衍生算法,主要是利用负载的时间局部性,提高缓存命中率。而固态盘缓存方法除了提高缓存命中率,还要针对固态盘读写性能不一致、写性能不稳定以及降低垃圾回收数量等情况进行优化。SSD cache management is an important technical means to improve the storage performance of SSD while adapting to the physical characteristics of flash memory. SSDs internally behave differently from disks, so a redesign of cache management methods within SSDs is necessary. Traditional caching methods mainly include LRU, LFU and their derivative algorithms, which mainly use the time locality of the load to improve the cache hit rate. In addition to improving the cache hit rate, the solid-state disk caching method also needs to be optimized for situations such as inconsistent read and write performance of solid-state disks, unstable write performance, and reduced garbage collection.

垃圾回收探测写机制是针对缓存写回过程中可能与固态盘垃圾回收造成的内部I/O冲突问题重新设计缓存回写策略。因为垃圾回收造成的内部I/O将使得上层I/O请求必须等待,所以触发回写时先探测待回写的逻辑页映射到的固态盘芯片是否正在做垃圾回收操作,以此避免上层I/O与底层I/O之间的冲突。通过降低缓存缺失代价来缓存效率,同时提高固态盘存储系统整体写性能。The garbage collection detection write mechanism is to redesign the cache write-back strategy for the internal I/O conflicts that may be caused by the garbage collection of the solid-state disk during the cache write-back process. Because the internal I/O caused by garbage collection will make the upper-layer I/O requests have to wait, so when triggering writeback, first detect whether the solid-state disk chip to which the logical page to be written back is mapped is performing garbage collection operations, so as to avoid upper-layer I/O requests. /O conflicts with underlying I/O. Improve cache efficiency by reducing the cost of cache misses, while improving the overall write performance of the SSD storage system.

通道并行写机制是针对固态盘内部通道之间具有独立的数据和信号总线,可以并发执行读写操作等情况,提出利用通道间并行写回方式提高固态盘整体写带宽。在触发通道并行写机制时,搜索多个并行回写的合适逻辑页时,结合垃圾回收探测写机制提供的信息,选择不超过固态盘通道数量并且属于不同通道的逻辑页进行回写。通过一次写操作隐藏多个写操作,提高了固态盘存储系统的写性能。The channel parallel write mechanism is aimed at the situation that there are independent data and signal buses between the internal channels of the solid state disk, and read and write operations can be performed concurrently. It is proposed to use the parallel write back method between channels to improve the overall write bandwidth of the solid state disk. When triggering the channel parallel writing mechanism, when searching for multiple suitable logical pages for parallel writing back, combined with the information provided by the garbage collection detection writing mechanism, select logical pages that do not exceed the number of SSD channels and belong to different channels for writing back. The write performance of the solid state disk storage system is improved by hiding multiple write operations through one write operation.

在实现本发明的过程中,发明人发现现有技术中至少存在如下技术问题:传统基于LRU的缓存优化算法没有充分考虑到固态盘内部垃圾回收可能产生的I/0冲突,也未能考虑到固态盘内部通道间的并行读写特性。因此,合理考虑固态盘内部特性能够提高固态盘整体存储性能。In the process of realizing the present invention, the inventor found that there are at least the following technical problems in the prior art: the traditional LRU-based cache optimization algorithm does not fully consider the I/O conflicts that may be generated by garbage collection in the solid state Parallel read and write characteristics between internal channels of SSDs. Therefore, a reasonable consideration of the internal characteristics of the solid state disk can improve the overall storage performance of the solid state disk.

发明内容Contents of the invention

本发明的目的是针对固态盘内部垃圾回收可能造成I/O冲突以及合理利用固态盘内部通道间的并行特性,提出一种基于垃圾回收与通道并行性的固态盘缓存管理方法,其技术方案主要为每个进入固态盘缓存的逻辑页设置温度属性和脏属性,根据命中次数和映射调整这两个属性值,当缓存空间不足需要触发缓存回写时,合理选择回写的逻辑页。在进行逻辑页选择时,首先根据垃圾回收探测写机制进行探测该逻辑页所在物理位置是否正在进行垃圾回收操作,其次判断该逻辑页是否是冷脏页,当寻找到的逻辑页满足通道并行写机制时将搜索到的逻辑页一次性写回。当不满足通道并行写机制时,按照预设优先级顺序回写相应逻辑页,该方法降低缓存缺失代价的同时提高整体写带宽。The purpose of the present invention is to propose a solid-state disk cache management method based on garbage collection and channel parallelism for the I/O conflicts that may be caused by garbage collection inside the solid-state disk and the rational use of the parallel characteristics between the internal channels of the solid-state disk. The technical solution is mainly Set the temperature attribute and dirty attribute for each logical page that enters the SSD cache, and adjust the values of these two attributes according to the number of hits and mapping. When the cache space is insufficient and the cache writeback is triggered, the logical page for writeback is reasonably selected. When selecting a logical page, first detect whether the physical location of the logical page is being garbage collected according to the garbage collection detection writing mechanism, and then judge whether the logical page is a cold dirty page. When the found logical page satisfies the channel parallel write When the mechanism is used, the searched logical pages are written back at one time. When the channel parallel write mechanism is not satisfied, the corresponding logical pages are written back according to the preset priority order. This method reduces the cost of cache misses and improves the overall write bandwidth.

本发明的目的可以通过采取如下技术方案达到:The purpose of the present invention can be achieved by taking the following technical solutions:

一种基于垃圾回收与通道并行性的固态盘缓存管理方法,该方法考虑到了上层应用请求与固态盘内部垃圾回收I/O的资源冲突问题以及固态盘内部通道级并行特性,提出了两种应对处理机制:垃圾回收探测写机制和通道并行写机制。垃圾回收探测写机制将探测该逻辑页映射到的芯片是否正在做垃圾回收操作,避免I/O冲突,降低缓存缺失代价。通道并行写机制一次性合理回写最多通道数量个不同通道的逻辑页,通过一次写操作隐藏多个写操作,提高固态盘写带宽。A solid-state disk cache management method based on garbage collection and channel parallelism. This method takes into account the resource conflict between upper-layer application requests and solid-state disk internal garbage collection I/O and the channel-level parallel characteristics of solid-state disks. Two solutions are proposed. Processing mechanism: Garbage collection detection write mechanism and channel parallel write mechanism. The garbage collection detection write mechanism will detect whether the chip to which the logical page is mapped is performing garbage collection operations to avoid I/O conflicts and reduce the cost of cache misses. The channel parallel writing mechanism reasonably writes back the logical pages of the maximum number of channels and different channels at one time, hides multiple write operations through one write operation, and improves the write bandwidth of the SSD.

一种基于垃圾回收与通道并行性的固态盘缓存管理方法,在固态盘板载缓存队列中的逻辑页按照预先设置的垃圾回收探测写机制和通道并行写机制进行回写操作,其中,下发至底层的I/O被切分成物理页大小后进入缓存区,称之为逻辑页,所述的固态盘缓存管理方法包括以下步骤:A solid-state disk cache management method based on garbage collection and channel parallelism. Logical pages in the onboard cache queue of the solid-state disk perform write-back operations according to the preset garbage collection detection write mechanism and channel parallel write mechanism. The I/O to the bottom layer is cut into the physical page size and enters the cache area, which is called a logical page. The described solid state disk cache management method includes the following steps:

S1、在操作系统将上层应用请求从块设备层下发至闪存板载缓存中后,为每个逻辑页维护一个温度属性,用于动态标识该逻辑页的冷热状态,同时根据映射关系为逻辑页维护一个干净/脏属性,用于动态标识该逻辑页的干净/脏状态;S1. After the operating system sends the upper-layer application request from the block device layer to the flash onboard cache, it maintains a temperature attribute for each logical page, which is used to dynamically identify the hot and cold status of the logical page, and at the same time according to the mapping relationship The logical page maintains a clean/dirty attribute, which is used to dynamically identify the clean/dirty state of the logical page;

S2、当固态盘缓存空间不足时将触发缓存回写操作,在遍历每个逻辑页时,利用垃圾回收探测写机制探测该逻辑页映射的物理位置所在芯片是否正在做垃圾回收操作;S2. When the cache space of the solid-state disk is insufficient, the cache write-back operation will be triggered. When traversing each logical page, use the garbage collection detection writing mechanism to detect whether the chip where the physical location of the logical page mapping is located is performing garbage collection operations;

S3、在遍历缓存队列时,根据垃圾回收探测写机制提供的信息、逻辑页的冷/热状态和干净/脏属性,以固态盘内部通道数N为上限,选择不超过N的属于不同通道的多个逻辑页,数量为n。当n大于1时,触发通道并行写操作将选择的这n个逻辑页一次性写回;当n小于等于1时,按照预定优先级顺序寻找合适的逻辑页进行写回。S3. When traversing the cache queue, according to the information provided by the garbage collection detection writing mechanism, the cold/hot status and clean/dirty attributes of the logical page, the number of internal channels N of the solid state disk is taken as the upper limit, and the number of channels not exceeding N is selected. Multiple logical pages, the number is n. When n is greater than 1, trigger channel parallel write operation to write back the selected n logical pages at one time; when n is less than or equal to 1, find a suitable logical page to write back according to the predetermined priority order.

进一步地,所述的步骤S1中逻辑页的冷热状态和干净/脏标志调整的规则如下:Further, the rules for adjusting the hot and cold states and clean/dirty flags of the logical pages in step S1 are as follows:

当每个逻辑页进入缓存时,为其设置一个整型温度属性,用于标识温度状态,然后根据缓存命中次数调整该逻辑页的温度属性值;When each logical page enters the cache, set an integer temperature attribute for it to identify the temperature state, and then adjust the temperature attribute value of the logical page according to the number of cache hits;

当每个逻辑页进入缓存时,为其设置一个布尔型脏属性,用于标识该逻辑页的干净/脏状态,初始进入缓存中的逻辑页默认是干净页,根据映射关系调整脏属性状态。When each logical page enters the cache, a Boolean dirty attribute is set for it to identify the clean/dirty status of the logical page. The logical page initially entered into the cache is a clean page by default, and the dirty attribute status is adjusted according to the mapping relationship.

进一步地,所述的步骤S2中,当上层请求进入缓存区时,需要进行缓存服务或者因空间不足需要腾出缓存空间,在遍历缓存队列时垃圾回收探测写机制将开始工作,主要步骤如下:Further, in the step S2, when the upper-layer request enters the cache area, cache service needs to be performed or cache space needs to be vacated due to insufficient space, and the garbage collection detection writing mechanism will start to work when traversing the cache queue. The main steps are as follows:

S21、当有请求到达时,首先在缓存区判断是否命中;S21. When a request arrives, first judge whether it is a hit in the cache area;

S22、当缓存区未能命中时,根据缓存剩余空间判断是否能够进行先插入缓存;S22. When the cache area fails to hit, judge whether it is possible to insert the cache first according to the remaining space of the cache;

S23、当缓存空间不足时,需要触发缓存回写操作,在寻找合适逻辑页时,对遍历到的每个逻辑页都触发垃圾回收探测写机制,如图1所示,通过垃圾回收探测写机制可知,逻辑页P8映射到的物理位置所在的芯片正在做垃圾回收操作(P8页是GC页),此时应先将P8暂留在缓存中,从P7开始再次判断该逻辑页是否是GC页,再结合通道并行写机制进行逻辑页搜寻。S23. When the cache space is insufficient, a cache write-back operation needs to be triggered. When searching for a suitable logical page, a garbage collection detection write mechanism is triggered for each logical page traversed. As shown in Figure 1, the garbage collection detection write mechanism is used It can be seen that the chip where the physical location of the logical page P8 is mapped to is doing garbage collection (P8 page is a GC page), at this time, P8 should be temporarily stored in the cache, and start from P7 to judge whether the logical page is a GC page again , combined with channel parallel write mechanism for logical page search.

进一步地,在逻辑页搜寻过程中,按照预定优先级进行逻辑页查找,通道并行写机制操作步骤如下:Furthermore, during the logical page search process, the logical page search is performed according to the predetermined priority, and the operation steps of the channel parallel writing mechanism are as follows:

S31、在寻找合适的逻辑页时,从缓存队列尾部往前开始遍历,根据垃圾回收探测写机制提供的信息判断该逻辑页是否是GC页,是则直接遍历下一个缓存节点;S31. When looking for a suitable logical page, start traversing from the end of the cache queue forward, judge whether the logical page is a GC page according to the information provided by the garbage collection detection writing mechanism, and if so, directly traverse the next cache node;

S32、当遍历到的逻辑页不是GC页时,按照缓存中每个逻辑页的温度值和脏属性值判断该逻辑页是否是冷脏页,如果该逻辑页不是冷脏页,则继续遍历下一个逻辑页;如果该逻辑页是冷脏页,则继续判断该逻辑页映射到的通道是否与预备回写的逻辑页集合中的逻辑页映射到的通道重复,不重复则将该逻辑页加入逻辑页集合中,直至寻找到通道数量个逻辑页或者遍历完整个缓存队列;S32. When the logical page traversed is not a GC page, judge whether the logical page is a cold dirty page according to the temperature value and the dirty attribute value of each logical page in the cache, if the logical page is not a cold dirty page, continue to traverse A logical page; if the logical page is a cold and dirty page, continue to judge whether the channel mapped to the logical page is the same as the channel mapped to the logical page in the set of logical pages to be written back, if not, add the logical page In the logical page collection, until the number of logical pages of the channel is found or the entire cache queue is traversed;

S33、当预备回写的逻辑页集合元素个数大于1时,触发通道并行写机制,将该集合内的所有逻辑页一次性写回;S33. When the number of logical page set elements to be written back is greater than 1, trigger the channel parallel write mechanism to write back all the logical pages in the set at one time;

S34、当预备回写的逻辑页集合的元素个数小于等于1时,按照优先级顺序在缓存队列中从队尾节点开始依次寻找冷页、热页和GC页,每寻找到一个则停止搜寻,最后将搜寻到的逻辑页写回。如图1所示,因为逻辑页P8是GC页,将直接跳过该页,从P7开始搜寻,优先级顺序是:多个冷脏页>单个冷页>单个热页>GC页,逻辑页P7、P4和P1符合最高优先级,此次缓存腾空操作将一次性回写这三个逻辑页,同理,最高优先级不满足时,一次触发下一优先级逻辑页的查找过程。S34. When the number of elements in the set of logical pages to be written back is less than or equal to 1, search for cold pages, hot pages, and GC pages in order from the tail node in the cache queue according to the priority order, and stop searching each time one is found. , and finally write back the found logical pages. As shown in Figure 1, because the logical page P8 is a GC page, it will skip this page directly and start searching from P7. The priority order is: multiple cold and dirty pages>single cold page>single hot page>GC page, logical page P7, P4, and P1 meet the highest priority. This cache emptying operation will write back these three logical pages at one time. Similarly, when the highest priority is not satisfied, the search process of the next priority logical page is triggered at one time.

进一步地,所述的板载缓存是由厂商内置的DRAM易失性存储器,用于缓存写请求。Further, the onboard cache is a DRAM volatile memory built by the manufacturer, and is used to cache write requests.

进一步地,所述的缓存队列节点是指上层应用请求经操作系统和块设备层下发至固态盘缓存时的写请求被切分成若干个物理页大小的逻辑页,每个缓存节点对应一个逻辑页,缓存队列用于缓存写请求以及服务读写请求是否缓存命中情况。Further, the cache queue node refers to that when the upper-layer application request is sent to the solid-state disk cache through the operating system and the block device layer, the write request is divided into several logical pages of physical page size, and each cache node corresponds to a logical page. Pages, cache queues are used to cache write requests and service read and write requests for cache hits.

进一步地,所述的垃圾回收探测写机制是指在缓存区中检测即将发生回写的逻辑页所映射到的物理芯片是否正在做垃圾回收操作,是则延迟该逻辑页的写回,否则进一步使用通道并行写机制进行条件判定。Further, the garbage collection detection writing mechanism refers to detecting whether the physical chip to which the logical page that is about to be written back is mapped to is doing garbage collection in the cache area, and if so, delays the writing back of the logical page, otherwise further Use the channel parallel write mechanism for conditional judgment.

进一步地,所述的通道并行写机制即利用固态盘内部通道的数据传输并行特性,将缓存区中的多个属于不同通道的逻辑页进行一次性回写。Further, the channel parallel writing mechanism utilizes the data transmission parallel characteristic of the internal channel of the solid state disk to write back multiple logical pages belonging to different channels in the cache area at one time.

该基于垃圾回收与通道并行性的固态盘缓存管理方法,结合垃圾回收探测写机制与通道并行写机制,以降低缓存缺失代价来提高缓存效率,同时将多个逻辑页进行按一次写操作时间回写,提高了固态盘整体写带宽。The solid-state disk cache management method based on garbage collection and channel parallelism combines the garbage collection detection writing mechanism and the channel parallel writing mechanism to reduce the cost of cache misses to improve cache efficiency. Write, which improves the overall write bandwidth of the SSD.

本发明相对于现有技术具有如下的优点及效果:Compared with the prior art, the present invention has the following advantages and effects:

(1)本发明在LRU算法的基础上适应固态盘的内部垃圾回收特性提出垃圾回收探测写机制,尽可能避免上层应用请求I/O与固态盘内部垃圾回收I/O之间的资源冲突,降低了缓存缺失代价同时提高了缓存效率。(1) On the basis of the LRU algorithm, the present invention adapts to the internal garbage collection characteristics of the solid state disk and proposes a garbage collection detection and writing mechanism, so as to avoid resource conflicts between the upper layer application request I/O and the internal garbage collection I/O of the solid state disk, It reduces the cost of cache misses and improves cache efficiency.

(2)本发明依据垃圾回收探测写机制提供的逻辑页信息,结合固态盘内部通道间的并行读写特性,提出了通道并行写机制,用一次写操作时间回写不超过固态盘通道数的多个逻辑页,隐藏了大量写操作,提高了固态盘整体写性能。(2) Based on the logical page information provided by the garbage collection detection writing mechanism, combined with the parallel read and write characteristics between the internal channels of the solid state disk, the present invention proposes a channel parallel writing mechanism, which can be written back with a write operation time not exceeding the number of channels of the solid state disk Multiple logical pages hide a large number of write operations and improve the overall write performance of the SSD.

附图说明Description of drawings

图1是本发明公开的一种基于垃圾回收与通道并行性的固态盘缓存方法中的通道并行回写机制示例图;Fig. 1 is an example diagram of channel parallel write-back mechanism in a solid-state disk cache method based on garbage collection and channel parallelism disclosed by the present invention;

图2是本发明公开的一种基于垃圾回收与通道并行性的固态盘缓存方法的系统架构图。FIG. 2 is a system architecture diagram of a solid state disk caching method based on garbage collection and channel parallelism disclosed by the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

实施例Example

如图1和图2所示,本实施例公开了一种基于垃圾回收与通道并行性的固态盘缓存方法,应用在固态盘存储系统中,利用垃圾回收探测写机制充分考虑到固态盘底层垃圾回收I/O与上层应用写请求I/O之间的资源竞争问题,隐藏垃圾回收等待时间。考虑固态盘内部通道间的并行特性,用一次写回操作同时写回最多通道数的多个数据页,用一次写操作时间隐藏多次写操作时间。此外,在不满足通道并行写机制条件时按照预定优先级顺序回写逻辑页。同时对缓存中的所有数据页维持冷热属性和脏属性,采用优先级回写方式进行缓存内数据页的页面置换操作。最后对这种固态盘缓存管理方法进行性能测试,从多角度评估本发明对闪存系统的性能影响。本发明在固态盘板载缓存DRAM中为每个逻辑页设置了温度属性和干净/脏属性,用于动态标识逻辑页冷热状态和干净/脏状态,对属性值动态调整,同时对属性值动态调整,将垃圾回收探测写机制与通道并行写机制相结合,主要分为三个步骤:As shown in Figure 1 and Figure 2, this embodiment discloses a solid-state disk caching method based on garbage collection and channel parallelism, which is applied in a solid-state disk storage system and uses garbage collection to detect and write mechanisms to fully consider the underlying garbage of solid-state disks. The problem of resource competition between recycling I/O and upper-layer application write request I/O hides the waiting time of garbage collection. Considering the parallel characteristics among the internal channels of the solid-state disk, use one write-back operation to write back multiple data pages with the largest number of channels at the same time, and use the time of one write operation to hide the time of multiple write operations. In addition, when the conditions of the channel parallel writing mechanism are not met, the logical pages are written back according to a predetermined priority order. At the same time, all data pages in the cache maintain the hot and cold attributes and dirty attributes, and use the priority write-back method to perform page replacement operations for data pages in the cache. Finally, a performance test is performed on this solid-state disk cache management method, and the impact of the present invention on the performance of the flash memory system is evaluated from multiple perspectives. The present invention sets a temperature attribute and a clean/dirty attribute for each logical page in the on-board cache DRAM of the solid-state disk, which are used to dynamically identify the hot and cold state and the clean/dirty state of the logical page, dynamically adjust the attribute value, and simultaneously adjust the attribute value Dynamic adjustment, which combines the garbage collection detection writing mechanism with the channel parallel writing mechanism, is mainly divided into three steps:

1)逻辑页冷热属性值和干净/脏属性值的调整。修改逻辑页数据结构,新增整型温度属性,默认值设置为0,表示该逻辑页为冷逻辑页。在缓存中逻辑页被命中时,将该逻辑页温度值自增1,在温度值到达2后停止自增。逻辑页温度值分为两个等级,0和1表示冷逻辑页,2表示热逻辑页。修改逻辑页数据结构,新增布尔型脏属性,默认值设置为false,表示该逻辑页为干净页,干净/脏属性依据映射信息进行动态调整,当逻辑页与映射到的物理页有效数据不一致时,脏属性调整为true,表示该逻辑页为脏页。1) Adjustment of hot and cold attribute values and clean/dirty attribute values of logical pages. Modify the logical page data structure, add an integer temperature attribute, and set the default value to 0, indicating that the logical page is a cold logical page. When a logical page in the cache is hit, the temperature value of the logical page is incremented by 1, and the increment is stopped after the temperature value reaches 2. The logical page temperature value is divided into two levels, 0 and 1 for cold logical pages, and 2 for hot logical pages. Modify the logical page data structure and add a Boolean dirty attribute. The default value is set to false, indicating that the logical page is a clean page. The clean/dirty attribute is dynamically adjusted according to the mapping information. When the logical page is inconsistent with the valid data of the mapped physical page , the dirty attribute is adjusted to true, indicating that the logical page is a dirty page.

2)触发垃圾回收探测写机制。当板载缓存DRAM空间足够时,写请求直接写入缓存中;当板载缓存DRAM空间不足时,需要触发缓存回写操作。在缓存队列中对逻辑页进行遍历时,触发垃圾回收探测写机制,判断该逻辑页是否是GC页(其中,GC页是指此时该逻辑页映射到的物理页所在芯片正在做垃圾回收操作),为通道并行写机制提供信息依据。2) Trigger garbage collection detection write mechanism. When the onboard cache DRAM space is sufficient, the write request is directly written into the cache; when the onboard cache DRAM space is insufficient, a cache write-back operation needs to be triggered. When traversing the logical page in the cache queue, the garbage collection detection write mechanism is triggered to determine whether the logical page is a GC page (wherein, the GC page refers to the chip where the physical page mapped to the logical page is currently performing garbage collection operations. ), providing information basis for channel parallel writing mechanism.

3)触发通道并行写机制。在遍历缓存队列时依据垃圾回收探测写机制提供的信息,首先从缓存队列中查找不超过固态盘通道总数、属于不同通道并且不是GC页的冷脏页(逻辑页),当查找到的冷脏页数量大于1时,停止查找过程,直接将查到的多个冷脏页写回,同时在缓存队列中删除第一个冷脏页,其余冷脏页直接调整为干净页。若查找到的冷脏页数量小于等于1,则按照多个冷脏页>单个冷页>单个热页>GC页顺序依次查找冷页、热页和GC页,其中按顺序任意一个查找成功则直接终止,最后将查到的逻辑页写回,此时,通道并行写机制执行完毕。3) Trigger channel parallel writing mechanism. When traversing the cache queue, according to the information provided by the garbage collection detection writing mechanism, first search the cache queue for cold dirty pages (logical pages) that do not exceed the total number of SSD channels, belong to different channels, and are not GC pages. When the found cold dirty pages When the number of pages is greater than 1, stop the search process, directly write back multiple found cold dirty pages, delete the first cold dirty page in the cache queue at the same time, and directly adjust the remaining cold dirty pages to clean pages. If the number of found cold and dirty pages is less than or equal to 1, then search for cold pages, hot pages, and GC pages in sequence in the order of multiple cold dirty pages>single cold page>single hot page>GC page, and any one of them is searched successfully in order Terminate directly, and finally write back the found logical page. At this time, the channel parallel writing mechanism is completed.

综上所述,本实施例提出的一种基于垃圾回收与通道并行性的固态盘缓存管理方法是在固态盘板载缓存DRAM中的缓存队列中,考虑固态盘内部垃圾回收I/O资源占用情况和固态盘内部通道间的并行特性,引入垃圾回收探测写机制与通道并行写机制,避免I/O冲突的同时将多个逻辑页以一次写操作的时间写回,隐藏了多个写操作时间,充分利用了固态盘通道间的并行写特性,降低缓存缺失代价,提高了固态盘存储系统的缓存效率和写带宽,进而提高整体性能。To sum up, a solid-state disk cache management method based on garbage collection and channel parallelism proposed in this embodiment is to consider the internal garbage collection I/O resource occupation of the solid-state disk in the cache queue in the onboard cache DRAM of the solid-state disk Due to the parallel characteristics between the environment and the internal channels of the solid state disk, the garbage collection detection writing mechanism and the channel parallel writing mechanism are introduced to avoid I/O conflicts and write back multiple logical pages in the time of one write operation, hiding multiple write operations Time, making full use of the parallel write feature between SSD channels, reducing the cost of cache misses, improving the cache efficiency and write bandwidth of the SSD storage system, and improving overall performance.

上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受上述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above-mentioned embodiment is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited by the above-mentioned embodiment, and any other changes, modifications, substitutions, combinations, Simplifications should be equivalent replacement methods, and all are included in the protection scope of the present invention.

Claims (6)

1. A solid state disk buffer memory management method based on garbage collection and channel parallelism carries out write-back operation on a logic page in a solid state disk on-board buffer memory queue according to a garbage collection detection write mechanism and a channel parallel write mechanism which are preset, wherein I/O issued to a bottom layer is segmented into physical page sizes and then enters a buffer memory area, namely the logic page, and the method is characterized by comprising the following steps:
s1, after an upper layer application request is issued from a block device layer to a flash memory board cache by an operating system, maintaining a temperature attribute for each logic page for dynamically identifying the cold and hot states of the logic page, and maintaining a clean/dirty attribute for the logic page according to a mapping relation for dynamically identifying the clean/dirty states of the logic page; wherein, the regulation of the cold and hot states and the clean/dirty states of the logical pages is as follows:
when each logic page enters the cache, setting an integer temperature attribute for each logic page, marking a temperature state, and then adjusting the temperature attribute value of the logic page according to the cache hit times;
when each logic page enters the cache, setting a Boolean dirty attribute for each logic page, and marking the clean/dirty state of the logic page, wherein the logic page initially entering the cache is a clean page by default, and the dirty attribute state is adjusted according to the mapping relation;
s2, triggering cache write-back operation when the cache space of the solid disk is insufficient, and detecting whether a chip where the physical position mapped by each logic page is located is doing garbage collection operation by utilizing a garbage collection detection write mechanism when each logic page is traversed; the process is as follows:
s21, when a request arrives, firstly judging whether the request hits in a cache area;
s22, when the cache area fails to hit, judging whether the first cache insertion can be performed according to the residual cache space;
s23, when the cache space is insufficient, a cache write-back operation is required to be triggered, when a proper logic page is searched, a garbage collection detection write mechanism is triggered for each traversed logic page, and whether the solid-state disk chip mapped by the logic page is doing garbage collection operation or not is judged;
s3, when traversing the cache queue, according to information provided by a garbage collection detection writing mechanism, the cold/hot state and the clean/dirty attribute of the logic pages, selecting a plurality of logic pages belonging to different channels, the number of which is not more than N, by taking the number N of internal channels of the solid-state disk as the upper limit, wherein the number is N, n=0, 1,2 and …, and when N is greater than 1, triggering the channel parallel writing operation to write back the N selected logic pages once; when n is less than or equal to 1, searching proper logic pages according to a preset priority order for writing back; the process is as follows:
s31, when a proper logic page is found, traversing is started from the tail part of the cache queue, whether the logic page is a GC page is judged according to information provided by a garbage collection detection writing mechanism, if yes, the next cache node is traversed directly, wherein the GC page means that a chip where a physical page mapped to the logic page is located is doing garbage collection operation;
s32, when the traversed logical page is not a GC page, judging whether the logical page is a cold dirty page according to the temperature attribute value and the clean/dirty attribute value of each logical page in the cache, if the logical page is the cold dirty page, continuing judging whether a channel mapped by the logical page is repeated with a logical page mapping channel in a logical page set for write-back, if not, adding the logical page into the logical page set until the number of the logical pages in the logical page set is equal to the number of channels in the solid disk or traversing the whole cache queue;
s33, when the number of the elements of the logic page set to be written back is larger than 1, triggering a channel parallel writing mechanism, and writing back all logic pages in the set at one time;
and S34, when the number of the logical page set elements prepared for write-back is less than or equal to 1, sequentially searching the cold page, the hot page and the GC page according to the priority order, stopping searching when one is searched, and finally writing back the searched logical page.
2. The method for managing solid-state disk cache based on garbage collection and channel parallelism according to claim 1, wherein the priority is as follows: multiple cold dirty pages > single cold page > single hot page > GC page.
3. The method for managing solid-state disk cache based on garbage collection and channel parallelism according to claim 1, wherein the on-board cache is a DRAM volatile memory built in by a manufacturer for caching write requests.
4. The method for managing solid-state disk cache based on garbage collection and channel parallelism according to claim 1, wherein the cache queue node refers to a logical page with a plurality of physical page sizes when a write request issued to the solid-state disk cache by an operating system and a block device layer is split into an upper layer application request, each cache node corresponds to one logical page, and the cache queue is used for caching the write request and serving whether the read-write request has a cache hit condition.
5. The method for managing solid-state disk cache based on garbage collection and channel parallelism according to claim 1, wherein the garbage collection detection writing mechanism is to detect whether a physical chip mapped to a logical page to which a write-back is about to occur is doing garbage collection operation in a cache region, if so, the write-back of the logical page is delayed, otherwise, the channel parallelism writing mechanism is further used for making a condition determination.
6. The method for managing solid-state disk cache based on garbage collection and channel parallelism according to claim 1, wherein the channel parallelism writing mechanism uses the data transmission parallelism of the internal channel of the solid-state disk to write back a plurality of logical pages belonging to different channels in the cache area at one time.
CN202010750861.7A 2020-07-30 2020-07-30 Solid-state disk cache management method based on garbage collection and channel parallelism Active CN111857601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010750861.7A CN111857601B (en) 2020-07-30 2020-07-30 Solid-state disk cache management method based on garbage collection and channel parallelism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010750861.7A CN111857601B (en) 2020-07-30 2020-07-30 Solid-state disk cache management method based on garbage collection and channel parallelism

Publications (2)

Publication Number Publication Date
CN111857601A CN111857601A (en) 2020-10-30
CN111857601B true CN111857601B (en) 2023-09-01

Family

ID=72945651

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010750861.7A Active CN111857601B (en) 2020-07-30 2020-07-30 Solid-state disk cache management method based on garbage collection and channel parallelism

Country Status (1)

Country Link
CN (1) CN111857601B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12367137B2 (en) * 2023-12-27 2025-07-22 Sk Hynix Nand Product Solutions Corp. Free space and input/output stability management for non-uniform workloads

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136121A (en) * 2013-03-25 2013-06-05 中国人民解放军国防科学技术大学 Cache management method for solid-state disc
CN104090847A (en) * 2014-06-25 2014-10-08 华中科技大学 Address distribution method of solid-state storage device
CN110515859A (en) * 2019-07-09 2019-11-29 杭州电子科技大学 A method for parallel processing of read and write requests for solid state disks
CN111008158A (en) * 2019-11-08 2020-04-14 暨南大学 A flash cache management method based on page reconstruction and data temperature identification

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9652157B2 (en) * 2015-03-19 2017-05-16 International Business Machines Corporation Accelerated non-volatile memory recirculation processing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136121A (en) * 2013-03-25 2013-06-05 中国人民解放军国防科学技术大学 Cache management method for solid-state disc
CN104090847A (en) * 2014-06-25 2014-10-08 华中科技大学 Address distribution method of solid-state storage device
CN110515859A (en) * 2019-07-09 2019-11-29 杭州电子科技大学 A method for parallel processing of read and write requests for solid state disks
CN111008158A (en) * 2019-11-08 2020-04-14 暨南大学 A flash cache management method based on page reconstruction and data temperature identification

Also Published As

Publication number Publication date
CN111857601A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
US8214595B2 (en) Storage system which utilizes two kinds of memory devices as its cache memory and method of controlling the storage system
CN110147331B (en) Cache data processing method and system and readable storage medium
CN104090852B (en) The method and apparatus of management hybrid cache
CN103902474B (en) Mixed storage system and method for supporting solid-state disk cache dynamic distribution
CN102165425B (en) Buffer memory device, memory system and data transmission method
CN105930282B (en) A kind of data cache method for NAND FLASH
US7039765B1 (en) Techniques for cache memory management using read and write operations
JP2019096309A (en) Execution of maintenance operation
CN107423229B (en) Buffer area improvement method for page-level FTL
CN110888600B (en) Buffer area management method for NAND flash memory
CN110413211B (en) Storage management method, electronic device, and computer-readable medium
CN107590084A (en) A kind of page level buffering area improved method based on classification policy
CN109446117A (en) A kind of solid state hard disk page grade flash translation layer (FTL) design method
CN111639037B (en) A cache dynamic allocation method, device and DRAM-Less solid-state hard disk
CN108959500A (en) A kind of object storage method, device, equipment and computer readable storage medium
JP2021135538A (en) Storage controller and storage control program
CN117591441A (en) Circuit and method
CN111008158B (en) Flash memory cache management method based on page reconstruction and data temperature identification
CN116150047A (en) technique for operating a cache storage device to cache data associated with a memory address
US8732404B2 (en) Method and apparatus for managing buffer cache to perform page replacement by using reference time information regarding time at which page is referred to
CN111857601B (en) Solid-state disk cache management method based on garbage collection and channel parallelism
CN109002400A (en) A kind of perception of content type Computer Cache management system and method
CN117222989B (en) DRAM aware cache
CN119988255A (en) A method, device, equipment and storage medium for memory access cache management
JP2005258789A (en) Storage apparatus, storage controller, and write-back cache control method

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