WO2014127684A1 - 内存回收方法及装置 - Google Patents

内存回收方法及装置 Download PDF

Info

Publication number
WO2014127684A1
WO2014127684A1 PCT/CN2014/070515 CN2014070515W WO2014127684A1 WO 2014127684 A1 WO2014127684 A1 WO 2014127684A1 CN 2014070515 W CN2014070515 W CN 2014070515W WO 2014127684 A1 WO2014127684 A1 WO 2014127684A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
nvm
inactive
page
recycling
Prior art date
Application number
PCT/CN2014/070515
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 华为技术有限公司
Priority to EP14753914.2A priority Critical patent/EP2921963B1/en
Priority to JP2015552994A priority patent/JP6014925B2/ja
Priority to KR1020157018254A priority patent/KR20150095781A/ko
Publication of WO2014127684A1 publication Critical patent/WO2014127684A1/zh
Priority to US14/798,094 priority patent/US20150317246A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/20Employing a main memory using a specific memory technology
    • G06F2212/202Non-volatile memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/70Details relating to dynamic memory management
    • G06F2212/702Conservative garbage collection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7211Wear leveling

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a memory recovery method and apparatus. Background technique
  • the memory devices that make up the memory unit usually include dynamic random access memory (English full name)
  • DRAM Dynamic Random Access Memory
  • NVM Non-Volatile Memory
  • DRAM can withstand high write times, but low integration, limited storage space
  • NVM integration Higher memory, can integrate memory units with larger memory capacity, but can withstand relatively low write times.
  • DRAM and NVM can increase the storage capacity of the storage device.
  • the operating system of the storage device of the DRAM and the NVM hybrid structure selects the Least Recently Used (LRU) from the head of the inactive NVM page list when performing the page reclaiming operation.
  • LRU Least Recently Used
  • This method may cause the NVM pages that are frequently written to be recycled first, which causes the NVMs that are frequently written to be worn out seriously, which affects the stability and reliability of the entire storage unit.
  • An object of the embodiments of the present invention is to provide a memory recycling method, which aims to solve the problem of uneven wear of memory pages of the NVM.
  • the present invention provides a memory recycling method, including:
  • the memory recycle request message includes a recycle identifier, where the recycle identifier is used to indicate the number of memory pages requested to be reclaimed; According to the recycling identifier, the NVM inactive pages are reclaimed in order of the number of times the non-volatile memory NVM inactive memory pages are written from small to large.
  • the recovering the NVM inactive according to the recycling identifier according to the non-volatile memory NVM inactive memory page being written from small to large Before the page it also includes:
  • the NVM inactive memory page into a corresponding segment in the inactive memory page linked list, where the inactive memory page linked list includes multiple segments, each segment Used to store NVM inactive memory pages that set the range of times to be written.
  • the multiple segments included in the inactive memory page linked list are written in a small number according to a corresponding setting.
  • the order to the big is arranged in the linked list of inactive memory pages.
  • Lost Memory NVM Inactive Memory Pages are used to reclaim NVM inactive pages from small to large, including:
  • the NVM inactive memory page in the one or more segments matching the number of memory pages reclaimed by the recycling identifier request is returned in an order of setting the number of times of writing to be small to large.
  • the recovering the NVM inactive according to the recycling identifier according to the non-volatile memory NVM inactive memory page being written from small to large Before the page it also includes:
  • the page list includes a plurality of page groups, and each page group includes a fourth possible implementation that combines the first aspect according to the number of times written
  • the multiple page groups included in the inactive memory page linked list are arranged in the inactive memory page linked list in the order of establishment time.
  • the recovering the NVM inactive pages according to the recycling identifier according to the number of times the non-volatile memory NVM inactive memory pages are written from small to large include:
  • the NVM inactive memory pages in the one or more page groups matching the number of memory pages requested by the recycling identifier request are recovered in the inactive memory page linked list in the order of establishment time.
  • an embodiment of the present invention provides a memory recovery device, including:
  • a receiving module configured to receive a memory reclamation request message, where the memory reclamation request message includes a return identifier, where the reclaim identifier is used to indicate a number of memory pages requested to be reclaimed;
  • the memory recovery module is configured to recover the NVM ⁇ activity page according to the recycling identifier according to the number of times the non-volatile memory NVM inactive memory page is written from 'J to large.
  • the method further includes: a determining module, configured, by the memory recycling module according to the recycling identifier, according to a non-volatile memory NVM inactive memory page Determining the number of times the NVM inactive memory page is written before reclaiming the NVM inactive page in a sequence from being small to large;
  • a first inserting module configured to include, according to the number of times the NVM inactive memory page is written, a plurality of segments in the linked list of memory pages, each segment for storing an NVM inactive memory page that sets a range of times of writing .
  • the multiple segments included in the inactive memory page linked list are written in a small number according to a corresponding setting.
  • the order to the big is arranged in the linked list of inactive memory pages.
  • the memory recovery module is specifically configured to: in the inactive memory page linked list, the number of memory pages that are reclaimed by the recycling identifier request in the one or more segments in an order of setting the number of times of writing to be small to large. N ⁇ Active memory page.
  • the method further includes: a determining module, configured, by the memory recycling module according to the recycling identifier, according to the non-volatile memory NVM inactive memory page Recycling NVM inactive pages in ascending order Pre-determining the number of times the NVM inactive memory page is written; in the last page group in the linked list, the page list includes a plurality of page groups, and each page group is combined with the fourth possible fourth aspect
  • the plurality of page groups included in the inactive memory page linked list are arranged in the inactive memory page linked list in the order of establishment time.
  • the memory recovery module is configured to: in the inactive memory page linked list, reclaim the NVM ⁇ active memory page in the one or more page groups that matches the number of memory pages requested by the recycling identifier request in the order of establishment time. .
  • the memory recovery method and device of the embodiment receive a memory recovery request message, where the memory recovery request message includes a recycling identifier, and the recycling identifier is used to indicate the number of memory pages requested to be recycled, according to the recycling identifier, according to the non-volatile memory NVM non-
  • the active memory page is reclaimed NVM inactive pages in the order of the number of writes.
  • the NVM inactive memory page is used to reclaim the page with a relatively small number of writes.
  • the NVM inactive memory page is written after the page is relatively large. Recycling, which can make the NVM memory page wear and balance, improve the stability and reliability of the storage unit.
  • Embodiment 1 is a flowchart of Embodiment 1 of a memory recycling method according to the present invention
  • FIG. 2 is a schematic diagram of Embodiment 1 of an NVM inactive memory page linked list organization according to the present invention
  • FIG. 3 is a flowchart of Embodiment 2 of a memory recycling method according to the present invention
  • FIG. 4 is a schematic diagram of Embodiment 2 of an NVM inactive memory page linked list organization according to the present invention
  • FIG. 5 is a flowchart of Embodiment 3 of a memory recovery method according to the present invention
  • FIG. 6 is a flowchart of Embodiment 1 of the memory recovery device of the present invention.
  • the memory recovery device that is, the memory module of the memory recovery device is composed of a dynamic random access memory (English full name Dynamic Random Access Memory, DRAM for short) and a non-volatile memory (Non-Volatile Memory, NVM for short). Applicable to memory recovery devices with memory modules consisting of NVM.
  • the memory module is a hybrid memory recovery device, when performing memory recovery, the inactive memory page in the DRAM can be first recovered. When the number of inactive memory pages in the DRAM cannot meet the recycling requirement, the memory page in the NVM is reclaimed.
  • the method for recovering memory pages in the NVM can use the memory recovery method of the embodiment of the present invention. It can be implemented by means of hardware or software.
  • the memory recovery device can usually be a component having processing functions in a terminal such as a mobile phone or a computer, for example, a CPU, etc., and can be used to implement a memory recovery method in the terminal.
  • Embodiment 1 is a flowchart of Embodiment 1 of a memory recovery method according to the present invention. As shown in FIG. 1, the memory recovery method of this implementation includes:
  • S101 Receive a memory reclamation request message, where the memory reclamation request message includes a reclaim identifier, and the reclaim identifier is used to indicate the number of memory pages requested to be reclaimed.
  • the memory recovery device when it runs the program, it needs to allocate a memory space for a certain process. At this time, if the free memory is insufficient, the operating system sends a memory recovery request message to the memory management module, and the memory management module receives the memory recovery.
  • the request message, the memory recycle request message includes a recycle identifier, where the recycle identifier may be an identifier for indicating the number of memory pages requested by the operating system, that is, the operating system requests the memory management module to allocate the number of memory pages identified by the recycle identifier, and the memory Management
  • the module reclaims the corresponding number of memory pages in the NVM inactive memory page list to meet the needs of the operating system.
  • the non-active memory page with a small number of writes is continuously reclaimed, so that During the execution of the memory page reclaiming process, the inactive memory pages that are written a small number of times are always reclaimed first, which avoids the memory module of the memory reclamation device. Because some memory pages are damaged due to the number of times of writing, the stability of the entire memory module is affected. Sex and reliability, improve the wear level of NVM memory pages.
  • the memory recycling request message includes a recycling identifier, where the recycling identifier is used to indicate the number of memory pages requested to be recycled, and according to the recycling identifier, the non-volatile memory NVM is inactive.
  • the NVM inactive pages are reclaimed in the order of the number of times the memory pages are written from small to large.
  • the pages in which the NVM inactive memory pages are written relatively small are first recycled.
  • the NVM inactive memory pages are reclaimed after the pages with relatively large write times. Utilizing, the NVM memory page wear level is balanced, and the stability and reliability of the storage unit are improved.
  • the method further includes: determining the number of times the NVM inactive memory page is written; according to the NVM inactive memory page, the inactive memory page list includes more Segments, each segment is used to store NVM inactive memory pages that set the range of times to be written.
  • the memory management module may further determine the number of times the NVM inactive memory page is written before the NVM inactive page is reclaimed according to the recycling identifier according to the order in which the non-volatile memory NVM inactive memory page is written from small to large. For example: the memory management module can obtain the number of times the inactive memory page is written by the number of times the NVM inactive memory page is recorded in the memory controller cache, if there is no corresponding number of times of the inactive memory page in the memory controller cache. When recording, it is still The number of times the corresponding inactive memory page is written can be obtained from the NVM counter.
  • the number of times the inactive memory page is written in the memory controller cache can reduce the access to the NVM. frequency.
  • the memory management module can also periodically refresh the number of writes of the inactive memory page recorded in the memory controller cache to the counter of the NVM, and the counter of the NVM records the number of times of writing all the memory pages in the NVM.
  • the plurality of segments included in the inactive memory page linked list are arranged in the inactive memory page linked list in a descending order from the corresponding setting.
  • FIG. 2 is a schematic diagram of Embodiment 1 of an NVM inactive memory page linked list organization.
  • the NVM inactive memory page linked list includes a plurality of NVM inactive memory page linked list segments, and each NVM inactive memory.
  • the header of the page link table segment contains a range of values indicating the number of times the memory pages in the segment are written. For example, all memory pages in the NVM inactive memory page link segment A are written in the range of 0 to 100. Between the memory pages of the memory list segment A of the NVM inactive memory page in the range of 0 to 100, the memory pages are arranged in the linked list in the order of the number of times of writing.
  • the NVM inactive memory page M is inserted into the by-mean by determining that the number of writes of the NVM inactive memory page M to be inserted is 30.
  • the number of writes is in the NVM inactive memory page link table A between 0 and 100, and is specifically inserted between the inactive memory pages of the linked list segment A and the number of writes 20 and 50, so that the inserted linked list segment A is inserted.
  • the memory pages are still arranged in ascending order of the number of writes. This ensures that when pages are reclaimed, the pages in the NVM inactive memory page list can always be reclaimed from the smallest to the largest.
  • the NVM inactive pages are reclaimed according to the number of times the non-volatile memory NVM inactive memory pages are written from small to large, including: in the inactive memory page list Sets the order in which the number of writes is from small to large, and recycles NVM inactive memory pages in one or more segments that match the number of memory pages requested by the recycle ID request.
  • FIG. 3 is a flowchart of Embodiment 2 of the memory recovery method of the present invention.
  • the memory recovery method provided by this embodiment may be divided into multiple segments, and each segment is used.
  • the NVM inactive memory page that stores the range of times the number of writes is set, the plurality of segments included in the inactive memory page list are inactive memory pages in the order of the number of times the corresponding writes are written from small to large.
  • the memory management module recycles the inactive memory pages in the NVM, it can be recycled according to the following steps:
  • the memory management module selects the NVM inactive memory page in the NVM inactive memory page list.
  • the NVM inactive memory page link table segment with the smallest number of write times in the linked list.
  • the specified number can be set by the operating system.
  • the memory recovery operation is completed; if the number of selected memory pages does not meet the requirements of the operating system, it is recovered from other segments in the NVM inactive memory page list. Memory page.
  • the memory reclamation operation is completed; if not, from other segments in the NVM inactive memory page linked list. Recycle the memory page.
  • the NVM inactive memory page linked list is selected to have a smaller number of write times than the NVM inactive memory page linked list segment selected in the above 301, and the adjacent NVM inactive memory page link segment is executed 302.
  • the memory recycling method of the embodiment recovers the NVM inactive according to the recycling identifier according to the number of times the non-volatile memory NVM inactive memory page is written from small to large.
  • the method further includes: determining a written group of the NVM inactive memory page, wherein the page list includes a plurality of page groups, and each of the page groups includes a set number of NVMs that are arranged according to the number of times of writing from small to large. Active memory page.
  • the memory management module may first determine the number of times the NVM inactive memory page is written before the NVM inactive page is reclaimed according to the recycling identifier according to the order in which the non-volatile memory NVM inactive memory page is written from small to large.
  • the specific process of determining the number of times the NVM inactive memory page is written is the same as that in the foregoing embodiment, and details are not described herein again.
  • the page list includes a plurality of page groups, each page group includes, according to the above embodiment, further, a plurality of page groups included in the inactive memory page linked list according to the setup time The order of the ones is arranged in the inactive memory page list.
  • FIG. 4 is a schematic diagram of Embodiment 2 of an NVM inactive memory page linked list organization manner.
  • the NVM inactive memory page linked list includes multiple page groups, and each page group is in the order of establishment time. Arranged in the list of pages, for example: The set number of NVM inactive memory pages contained in page group 0 is inserted into the linked list. The set number of NVM inactive memory pages contained in page group P is inserted into the linked list. The time is relatively early; the set number of NVM inactive memory pages contained in page group P is inserted into the linked list. The set number of NVM inactive memory pages contained in page group Q is inserted into the linked list. The time is relatively early.
  • the number of times the inactive memory pages are written is from small to large.
  • the NVM inactive memory page N to be inserted is determined by the judgment.
  • the number of writes is 30, and the NVM inactive memory page N is inserted into the page group Q at the end of the NVM inactive memory page list, and is specifically inserted between the inactive memory pages of the page group Q that are written 55 and 20 times. , so that the memory pages in the inserted linked list segment A are still arranged in the order of the number of times of writing, so as to ensure that the pages in the page group can always be recycled from the smallest to the largest in the order of being written. .
  • NVM inactive memory pages are reclaimed NVM inactive pages in ascending order of number of writes, including: Recycling one or more page groups in the inactive memory page list in accordance with the order of establishment time The number of memory pages matches the NVM inactive memory page.
  • FIG. 5 is a flowchart of a third embodiment of the memory recovery method of the present invention.
  • the memory recovery method provided in this embodiment may include multiple page groups in each page group.
  • the plurality of page groups included in the linked list are arranged in the page linked list according to the order of establishment time, and the memory tube
  • the memory management module starts from the head of the NVM inactive memory page link table segment, selects a specified number of memory pages according to the order in which the inactive memory pages are written from small to large, and recycles the selected memory page to make it a free page. For reuse, the specified number can be determined according to the needs of the operating system.
  • the memory recycling operation is completed; if the number of selected memory pages does not meet the requirements of the operating system, from other page groups in the NVM inactive memory page list. Recycle the memory page.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • FIG. 6 is a flowchart of Embodiment 1 of the memory recovery device of the present invention.
  • the memory recovery device 600 of the present embodiment includes: a receiving module 601 and a memory recycling module 602, where:
  • the receiving module 601 is configured to receive a memory reclamation request message, where the memory reclamation request message includes a recycle Identification, the recycling identifier is used to indicate the number of memory pages requested to be reclaimed;
  • the memory reclamation module 602 is configured to reclaim the NVM inactive pages according to the recycling identifier according to the order in which the non-volatile memory NVM inactive memory pages are written from small to large.
  • the memory recovery device of this embodiment can be used to perform the memory recovery method in the first embodiment of the memory recovery method.
  • the specific implementation process reference may be made to the first embodiment of the memory recovery method, and details are not described herein again.
  • the memory collection device of the embodiment receives the memory collection request message by the receiving module, where the memory recycling request message includes a recycling identifier, and the recycling identifier is used to indicate the number of memory pages requested to be recycled, and the memory recycling module according to the recycling identifier, according to the non-volatile
  • the memory NVM inactive memory page is reclaimed NVM inactive pages in the order of the number of writes.
  • the NVM inactive memory page is reclaimed with a relatively small number of writes.
  • the NVM inactive memory page is written a relatively large number of times. The page is recycled, which can make the NVM memory page wear and balance, improving the stability and reliability of the storage unit.
  • the memory recovery device 600 may further include: a determining module and a first plug-in module.
  • the number of times the NVM inactive memory page is written is determined before the NVM inactive memory page is reclaimed from the smallest to the largest NVM inactive pages.
  • the first insertion module may be configured to include a plurality of segments in the NVM table according to the number of times the NVM inactive memory page is written, and each segment is used to store an NVM inactive memory page that sets a range of times of writing.
  • the plurality of segments included in the inactive memory page linked list are arranged in the inactive memory page linked list in a descending order from the corresponding setting.
  • the memory recovery module may be specifically configured to: in the inactive memory page linked list, reclaim the recovery identifier request in one or more segments according to the order of setting the number of times of writing from small to large. The number of memory pages reclaimed matches the NVM inactive memory page.
  • the memory recovery device 600 may further include: a determination module and a second insertion module, where:
  • the determining module may be configured to determine the number of times the NVM inactive memory page is written before the memory recycling module reclaims the NVM inactive page according to the recycling identifier according to the order in which the non-volatile memory NVM inactive memory page is written from small to large. ;
  • the page list includes a plurality of page groups, each of which is included in the above embodiment, and further, the plurality of page groups included in the inactive memory page linked list are set according to the setup time. The order of the ones is arranged in the inactive memory page list.
  • the memory reclaiming module may be specifically configured to reclaim, in the inactive memory page linked list, the number of memory pages in the one or more page groups that are reclaimed by the reclaiming identifier request according to the order of establishment time. Matching NVM inactive memory pages.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本发明实施例提供一种内存回收方法及装置,内存回收方法包括:接收内存回收请求消息,内存回收请求消息中包含回收标识,回收标识用于表示请求回收的内存页面数量;根据回收标识,按照非易失性存储器NVM非活动内存页面被写次数从小到大的顺序回收NVM非活动页面,本发明实施例的内存回收方法及装置通过按照NVM非活动内存页面被写次数从小到大的顺序回收NVM非活动页面,实现了NVM非活动内存页面被写次数相对小的页面先被回收利用,NVM非活动内存页面被写次数相对大的页面后被回收利用,从而能够使NVM内存页面磨损均衡,提高了存储单元的稳定性和可靠性。

Description

内存回收方法及装置 本申请要求于 2013 年 02 月 22 日提交中国专利局、 申请号为 201310057351.1、 发明名称为"内存回收方法及装置 "的中国专利申请的优先 权, 其全部内容通过引用结合在本申请中。
技术领域 本发明实施例涉及计算机技术领域, 尤其涉及内存回收方法及装置。 背景技术
构成内存单元的内存器件通常包括动态随机访问存储器 (英文全称
Dynamic Random Access Memory, 简称 DRAM )和非易失性存储器(英文全 称 Non- Volatile Memory , 简称 NVM ) , DRAM可以承受的写次数高 , 但可集 成度低, 可集成的存储空间有限, NVM的集成度更高, 可以集成较大内存容 量的内存单元,但可以承受的写次数相对较低, 随着人们对存储设备的内存容 量的要求越来越高, 期望存储设备的内存容量越来越大, 越来越稳定可靠, 因 此,出现了由 DRAM和 NVM构成的混合结构的内存单元 ,由 DRAM和 NVM 混合可以提高存储设备的存储容量。
现有技术中 , DRAM和 NVM混合结构的存储设备的操作系统在执行页面 回收操作时,釆用最近最少使用算法(英文全称 Least Recently Used,简称 LRU ) 从非活动的 NVM页面链表的头部选择相应数量的页面进行回收,这种方法可 能会导致被写次数较多的 NVM页面先被回收利用, 致使被写次数多的 NVM 被磨损严重, 影响整个存储单元的稳定性和可靠性。 发明内容 本发明实施例的目的在于提供一种内存回收方法, 旨在解决 NVM的内存 页面磨损不均衡的问题。
第一方面, 本发明提供一种内存回收方法, 包括:
接收内存回收请求消息, 所述内存回收请求消息中包含回收标识, 所述回 收标识用于表示请求回收的内存页面数量; 根据所述回收标识, 按照非易失性存储器 NVM非活动内存页面被写次数 从小到大的顺序回收 NVM非活动页面。
结合第一方面,在第一方面的第一种可能的实现方式中, 所述根据所述回 收标识, 按照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序 回收 NVM非活动页面之前, 还包括:
确定所述 NVM非活动内存页面的被写次数;
根据所述 NVM非活动内存页面的被写次数, 将所述 NVM非活动内存页面 存储至非活动内存页面链表中的相应段中,所述非活动内存页面链表中包括多 个段, 每个段用于存储设定被写次数范围的 NVM非活动内存页面。
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现 方式中,所述非活动内存页面链表中包括的多个段按照对应的设定被写次数范 围从小到大的顺序在所述非活动内存页面链表中排列。
结合第一方面的第一种可能的实现方式或第一方面的第二种可能的实现 方式, 在第一方面的第三种可能的实现方式中, 所述根据所述回收标识, 按照 非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM非 活动页面, 包括:
在所述非活动内存页面链表中按照设定被写次数范围从小到大的顺序,回 收一个或多个段中的与所述回收标识请求回收的内存页面数量匹配的 NVM非 活动内存页面。
结合第一方面,在第一方面的第四种可能的实现方式中, 所述根据所述回 收标识, 按照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序 回收 NVM非活动页面之前, 还包括:
确定所述 NVM非活动内存页面的被写次数; 面组中, 所述页面列表中包括多个页面组,每个页面组中包括按照被写次数从 结合第一方面的第四种可能的实现方式,在第一方面的第五种可能的实现 方式中,所述非活动内存页面链表中包括的多个页面组按照建立时间的先后顺 序在所述非活动内存页面链表中排列。
结合第一方面的第四种可能的实现方式或第一方面的第五种可能的实现 方式中, 在第一方面的第六种可能的实现方式中, 所述根据所述回收标识, 按 照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM 非活动页面, 包括:
在所述非活动内存页面链表中按照建立时间的先后顺序,回收一个或多个 页面组中的与所述回收标识请求回收的内存页面数量匹配的 NVM非活动内存 页面。
第二方面, 本发明实施例提供一种内存回收装置, 包括:
接收模块, 用于接收内存回收请求消息, 所述内存回收请求消息中包含回 收标识, 所述回收标识用于表示请求回收的内存页面数量;
内存回收模块, 用于根据所述回收标识, 按照非易失性存储器 NVM非活 动内存页面被写次数从 'J、到大的顺序回收 NVM ^活动页面。
结合第二方面, 在第二方面的第一种可能的实现方式中, 还包括: 确定模块, 用于在所述内存回收模块根据所述回收标识,按照非易失性存 储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面之 前, 确定所述 NVM非活动内存页面的被写次数;
第一插入模块, 用于根据所述 NVM非活动内存页面的被写次数, 将所述 内存页面链表中包括多个段, 每个段用于存储设定被写次数范围的 NVM非活 动内存页面。
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现 方式中,所述非活动内存页面链表中包括的多个段按照对应的设定被写次数范 围从小到大的顺序在所述非活动内存页面链表中排列。
结合第二方面的第一种可能的实现方式或第二方面的第二种可能的实现 方式, 在第二方面的第三种可能的实现方式中,
内存回收模块,具体用于在所述非活动内存页面链表中按照设定被写次数 范围从小到大的顺序,回收一个或多个段中的与所述回收标识请求回收的内存 页面数量匹配的 N ^活动内存页面。
结合第二方面, 在第二方面的第四种可能的实现方式中, 还包括: 确定模块, 用于在所述内存回收模块根据所述回收标识,按照非易失性存 储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面之 前, 确定所述 NVM非活动内存页面的被写次数; 链表中的最后一个页面组中, 所述页面列表中包括多个页面组,每个页面组中 结合第二方面的第四种可能的实现方式,在第二方面的第五种可能的实现 方式中,所述非活动内存页面链表中包括的多个页面组按照建立时间的先后顺 序在所述非活动内存页面链表中排列。
结合第二方面的第四种可能的实现方式或第二方面的第五种可能的实现 方式中, 在第二方面的第六种可能的实现方式中,
内存回收模块,具体用于在所述非活动内存页面链表中按照建立时间的先 后顺序 ,回收一个或多个页面组中的与所述回收标识请求回收的内存页面数量 匹配的 NVM ^活动内存页面。
本实施例的内存回收方法及装置,通过接收内存回收请求消息, 内存回收 请求消息中包含回收标识, 回收标识用于表示请求回收的内存页面数量,根据 回收标识, 按照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺 序回收 NVM非活动页面, 实现了 NVM非活动内存页面被写次数相对小的页面 先被回收利用, NVM非活动内存页面被写次数相对大的页面后被回收利用, 从而能够使 NVM内存页面磨损均衡, 提高了存储单元的稳定性和可靠性。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描 述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出 创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明内存回收方法实施例一的流程图;
图 2为本发明 NVM非活动内存页面链表组织形式实施例一示意图; 图 3为本发明内存回收方法实施例二的流程图;
图 4为本发明 NVM非活动内存页面链表组织形式实施例二示意图; 图 5为本发明内存回收方法实施例三的流程图; 图 6为本发明内存回收装置实施例一的流程图。 具体实施方式 为使本发明的目的、技术方案和优点更加清楚, 下面将结合本发明中的附 图, 对本发明中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是 本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域 普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于 本发明保护的范围。 型的内存回收装置, 即内存回收装置的内存模块由动态随机访问存储器(英文 全称 Dynamic Random Access Memory, 简称 DRAM )和非易失性存储器(英文 全称 Non- Volatile Memory, 简称 NVM )构成, 还可以适用于内存模块由 NVM 构成的内存回收装置。对于内存模块为混合型的内存回收装置, 在执行内存回 收时, 可以先回收 DRAM中的非活动内存页面, 当 DRAM中的非活动内存页面 数量不能满足回收需要时, 再回收 NVM中内存页面, 回收 NVM中内存页面的 方法可以釆用本发明实施例的内存回收方法。 可以通过硬件或软件的方式实现, 该内存回收装置通常可以为手机、计算机等 终端中具有处理功能的部件, 例如: CPU等, 可以用于在终端中实现内存回收 方法。
图 1为本发明内存回收方法实施例一的流程图,如图 1所示, 本实施的内存 回收方法包括:
S 101、接收内存回收请求消息, 内存回收请求消息中包含回收标识, 回收 标识用于表示请求回收的内存页面数量。
具体地, 例如: 内存回收装置在运行程序时, 需要为某一进程分配内存空 间, 此时, 如果空闲内存不足, 则操作系统向内存管理模块发送内存回收请求 消息, 内存管理模块接收该内存回收请求消息, 该内存回收请求消息中包含回 收标识, 该回收标识可以为用于表示操作系统请求的内存页面数量的标识, 即 操作系统请求内存管理模块分配回收标识所标识的数量的内存页面,内存管理 模块根据该内存回收请求消息, 在 NVM非活动内存页面链表中回收相应数量 的内存页面满足操作系统的需要。
S102、 根据回收标识, 按照非易失性存储器 NVM非活动内存页面被写次 数从小到大的顺序回收 NVM非活动页面。 面的被写次数的大小,按照非活动内存页面的被写次数由小到大的顺序,依次 回收与回收标识相应的个数的非活动内存页面, 这样 NVM非活动内存页面链 表中的被写次数小的非活动内存页面先被回收利用,若被回收的非活动内存页 面的被写次数在下一次回收时仍然较小,则继续回收该被写次数较小的非活动 内存页面, 这样使得在执行内存页面回收过程中,被写次数较小的非活动内存 页面总是先被回收,避免了内存回收装置的内存模块因为一些内存页面因被写 次数多先被损坏, 影响整个内存模块的稳定性和可靠性, 提高了 NVM内存页 面的磨损均衡性。
本发明实施例的内存回收方法, 通过接收内存回收请求消息, 内存回收请 求消息中包含回收标识, 回收标识用于表示请求回收的内存页面数量,根据回 收标识, 按照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序 回收 NVM非活动页面, 实现了 NVM非活动内存页面被写次数相对小的页面先 被回收利用, NVM非活动内存页面被写次数相对大的页面后被回收利用, 从 而能够使 NVM内存页面磨损均衡, 提高了存储单元的稳定性和可靠性。
在上述实施例的基础上, 进一步地, 根据回收标识, 按照非易失性存储器
NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面之前, 还 包括: 确定 NVM非活动内存页面的被写次数; 根据 NVM非活动内存页面的被 非活动内存页面链表中包括多个段, 每个段用于存储设定被写次数范围的 NVM非活动内存页面。
具体地, 内存管理模块根据回收标识, 按照非易失性存储器 NVM非活动 内存页面被写次数从小到大的顺序回收 NVM非活动页面之前, 还可以先确定 NVM非活动内存页面的被写次数, 例如: 内存管理模块可以通过内存控制器 緩存中记录的 NVM非活动内存页面的被写次数获取非活动内存页面的被写次 数, 若内存控制器緩存中没有相应非活动内存页面的被写次数的记录时, 则还 可以从 NVM的计数器中获取相应非活动内存页面的被写次数, 通过在内存控 制器中设置内存控制器緩存,在内存控制器緩存中记录非活动内存页面的被写 次数可以减少对 NVM的访问次数。 内存管理模块还可以定期地将内存控制器 緩存中记录的非活动内存页面的被写次数刷新到 NVM的计数器中, 该 NVM的 计数器中记录了 NVM中所有内存页面的被写次数。
在上述实施例的基础上, 进一步地, 非活动内存页面链表中包括的多个段 按照对应的设定被写次数范围从小到大的顺序在非活动内存页面链表中排列。
具体地, 图 2为本发明 NVM非活动内存页面链表组织形式实施例一示意 图, 如图 2所示, NVM非活动内存页面链表包括多个 NVM非活动内存页面链 表段, 每个 NVM非活动内存页面链表段的表头包含一数值范围, 该数值范围 表示该段内所有内存页面的被写次数范围, 如 NVM非活动内存页面链表段 A 内的所有内存页面的被写次数范围在 0到 100之间, 在 NVM非活动内存页面链 表段 A内所有内存页面的被写次数范围在 0到 100之间的内存页面按照被写次 数从小到大的顺序在链表中排列。
当有新的 NVM非活动内存页面移动到 NVM非活动内存页面链表中时, 通 过判断获知待插入的 NVM非活动内存页面 M的被写次数为 30 , 将该 NVM非活 动内存页面 M插入到被写次数范围在 0到 100之间的 NVM非活动内存页面链表 段 A中, 并具体插入到链表段 A的被写次数为 20和 50的非活动内存页面之间, 使得插入后链表段 A内的内存页面依然按照被写次数从小到大的顺序排列, 这 样能够保证在页面回收时, 总是能从按照被写次数从小到大的顺序回收 NVM 非活动内存页面链表中的页面。
在上述实施例的基础上, 进一步地, 根据回收标识, 按照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面, 包括: 在非活动内存页面链表中按照设定被写次数范围从小到大的顺序,回收一个或 多个段中的与回收标识请求回收的内存页面数量匹配的 NVM非活动内存页 面。
具体地, 图 3为本发明内存回收方法实施例二的流程图, 如图 3所示, 本实 施例提供的内存回收方法, 非活动内存页面链表可以分为包括多个段,每个段 用于存储设定被写次数范围的 NVM非活动内存页面, 非活动内存页面链表中 包括的多个段按照对应的设定被写次数范围从小到大的顺序在非活动内存页 面链表中排列, 内存管理模块对 NVM中的非活动内存页面进行回收时可以依 照下述步骤回收:
301、 选择 NVM非活动内存页面链表中被写次数范围最小的段。
内存管理模块在 NVM非活动内存页面链表中选择 NVM非活动内存页面 链表中被写次数范围最小的 NVM非活动内存页面链表段。
302、 从选择的 NVM非活动内存页面链表段的头部回收非活动页面。
从选择的非活动内存页面链表段的头部开始,按照非活动内存页面被写次 数从小到大的顺序, 选择指定数目的内存页面, 回收选择的内存页面, 使其成 为空闲页面从而可以进行再次利用, 所述的指定数目可以由操作系统设定。
303、 判断是否回收了指定数目的内存页面, 若是, 则执行 304; 若否, 则 执行 305。
若选择的内存页面的数目能够满足操作系统的需求,则此次内存回收操作 完成; 若选择的内存页面的数目没有满足操作系统的需求, 则从 NVM非活动 内存页面链表中的其他段中回收内存页面。
304、 结束。
305、判断是否是最后一个 NVM非活动内存页面链表段,若是,则执行 304; 若否, 则执行 306。
若上述 301中选择的 NVM非活动内存页面链表段是 NVM非活动内存页面 链表的最后一个链表段, 则此次内存回收操作完成; 若不是, 则从 NVM非活 动内存页面链表中的其他段中回收内存页面。
306、 选择 NVM非活动内存页面链表中被写次数范围次小的段。
选择 NVM非活动内存页面链表中被写次数范围较上述 301中选择的 NVM 非活动内存页面链表段的写次数范围小且相邻的 NVM非活动内存页面链表 段, 再执行 302。
可选地,在内存回收方法实施例一的基础上, 本实施例的内存回收方法在 根据回收标识, 按照非易失性存储器 NVM非活动内存页面被写次数从小到大 的顺序回收 NVM非活动页面之前, 还包括: 确定 NVM非活动内存页面的被写 组中, 页面列表中包括多个页面组,每个页面组中包括按照被写次数从小到大 顺序排列的设定个数的 NVM非活动内存页面。 具体地, 内存管理模块在根据回收标识, 按照非易失性存储器 NVM非活 动内存页面被写次数从小到大的顺序回收 NVM非活动页面之前, 还可以先确 定 NVM非活动内存页面的被写次数, 确定 NVM非活动内存页面的被写次数的 具体过程与上述实施例相同, 此处不再赘述。 中的最后一个页面组中, 页面列表中包括多个页面组,每个页面组中包括按照 在上述实施例的基础上, 进一步地, 非活动内存页面链表中包括的多个页 面组按照建立时间的先后顺序在非活动内存页面链表中排列。
具体地, 图 4为本发明 NVM非活动内存页面链表组织形式实施例二示意 图, 如图 4所示, NVM非活动内存页面链表包括多个页面组, 每个页面组按照 建立时间的先后顺序在页面链表中排列, 例如: 页面组 0中包含的设定个数的 NVM非活动内存页面插入到链表中的时间比页面组 P中包含的设定个数的 NVM非活动内存页面插入到链表中的时间相对较早; 页面组 P中包含的设定个 数的 NVM非活动内存页面插入到链表中的时间比页面组 Q中包含的设定个数 的 NVM非活动内存页面插入到链表中的时间相对较早。 依次按照非活动内存页面的被写次数从小到大顺序排列, 当有新的 NVM非活 动内存页面 N移动到非活动内存页面链表中时,通过判断获知待插入的 NVM非 活动内存页面 N的被写次数为 30 ,将该 NVM非活动内存页面 N插入到 NVM非活 动内存页面链表尾部的页面组 Q中, 并具体插入到页面组 Q的被写次数为 55和 20的非活动内存页面之间, 使得插入后链表段 A内的内存页面依然按照被写次 数从小到大的顺序排列, 这样能够保证在页面回收时, 总是能从按照被写次数 从小到大的顺序回收页面组中的页面。
在上述实施例的基础上, 进一步地, 根据回收标识, 按照非易失性存储器
NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面, 包括: 在非活动内存页面链表中按照建立时间的先后顺序,回收一个或多个页面组中 的与回收标识请求回收的内存页面数量匹配的 NVM非活动内存页面。
具体地, 图 5为本发明内存回收方法实施例三的流程图, 如图 5所示, 本实 施例提供的内存回收方法, 页面列表中可以包括多个页面组,每个页面组中包 链表中包括的多个页面组按照建立时间的先后顺序在页面链表中排列,内存管
501、从 NVM非活动内存页面链表中建立时间最早的页面组开始回收非活 动页面。
内存管理模块从 NVM非活动内存页面链表段的头部开始, 按照非活动内 存页面被写次数从小到大的顺序,选择指定数目的内存页面, 回收选择的内存 页面,使其成为空闲页面从而可以进行再次利用, 所述的指定数目可以根据操 作系统的需求而定。
502、 判断是否回收了指定数目的内存页面。
若选择的内存页面的数目能够满足操作系统的需求,则此次内存回收操作 完成; 若选择的内存页面的数目没有满足操作系统的需求, 则从 NVM非活动 内存页面链表中的其他页面组中回收内存页面。
503、 结束。
504、 判断是否到达 NVM非活动内存页面链表的尾部。
若已经到达 NVM非活动内存页面链表的尾部, 则此次内存回收操作完成;
505、从 NVM非活动内存页面链表中建立时间的页面组开始回收非活动页 面。
选择 NVM非活动内存页面链表中建立时间较上述 501中选择的页面组的 建立时间晚且相邻的页面组,在选择的页面组中按照非活动内存页面被写次数 从小到大的顺序回收内存页面, 直至回收的内存页面数量满足操作系统的需 要。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可 以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存 储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储 介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的介质。
图 6为本发明内存回收装置实施例一的流程图,如图 6所示, 本实施的内存 回收装置 600包括: 接收模块 601和内存回收模块 602, 其中:
接收模块 601用于接收内存回收请求消息, 内存回收请求消息中包含回收 标识, 回收标识用于表示请求回收的内存页面数量;
内存回收模块 602用于根据回收标识,按照非易失性存储器 NVM非活动内 存页面被写次数从小到大的顺序回收 NVM非活动页面。
本实施例的内存回收装置可以用于执行内存回收方法实施例一的内存回 收方法, 具体执行过程可以参照内存回收方法实施例一, 此处不再赘述。
本实施例的内存回收装置,通过接收模块接收内存回收请求消息, 内存回 收请求消息中包含回收标识, 回收标识用于表示请求回收的内存页面数量, 内 存回收模块根据回收标识, 按照非易失性存储器 NVM非活动内存页面被写次 数从小到大的顺序回收 NVM非活动页面, 实现了 NVM非活动内存页面被写次 数相对小的页面先被回收利用, NVM非活动内存页面被写次数相对大的页面 后被回收利用, 从而能够使 NVM内存页面磨损均衡, 提高了存储单元的稳定 性和可靠性。
在上述实施例的基础上, 进一步地, 内存回收装置 600还可以包括: 确定 模块和第一插入模块。
确定模块, 可以用于在内存回收模块根据回收标识,按照非易失性存储器
NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面之前, 确 定 NVM非活动内存页面的被写次数;
第一插入模块, 可以用于根据 NVM非活动内存页面的被写次数, 将 NVM 表中包括多个段,每个段用于存储设定被写次数范围的 NVM非活动内存页面。
在上述实施例的基础上, 进一步地, 非活动内存页面链表中包括的多个段 按照对应的设定被写次数范围从小到大的顺序在非活动内存页面链表中排列。
在上述实施例的基础上, 进一步地, 内存回收模块具体可以用于在非活动 内存页面链表中按照设定被写次数范围从小到大的顺序,回收一个或多个段中 的与回收标识请求回收的内存页面数量匹配的 NVM非活动内存页面。
可选地, 在内存回收装置实施例一的基础上, 内存回收装置 600还可以包 括: 确定模块和第二插入模块, 其中:
确定模块, 可以用于在内存回收模块根据回收标识,按照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面之前, 确 定 NVM非活动内存页面的被写次数; 链表中的最后一个页面组中, 页面列表中包括多个页面组,每个页面组中包括 在上述实施例的基础上, 进一步地, 非活动内存页面链表中包括的多个页 面组按照建立时间的先后顺序在非活动内存页面链表中排列。
在上述实施例的基础上, 进一步地, 内存回收模块具体可以用于在非活动 内存页面链表中按照建立时间的先后顺序,回收一个或多个页面组中的与回收 标识请求回收的内存页面数量匹配的 NVM非活动内存页面。
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或者 对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并不使相 应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims

权 利 要 求
1、 一种内存回收方法, 其特征在于, 包括:
接收内存回收请求消息, 所述内存回收请求消息中包含回收标识, 所述回 收标识用于表示请求回收的内存页面数量;
根据所述回收标识, 按照非易失性存储器 NVM非活动内存页面被写次数 从小到大的顺序回收 NVM非活动页面。
2、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述回收标识, 按 照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM 非活动页面之前, 还包括:
确定所述 NVM非活动内存页面的被写次数;
根据所述 NVM非活动内存页面的被写次数, 将所述 NVM非活动内存页面 存储至非活动内存页面链表中的相应段中,所述非活动内存页面链表中包括多 个段, 每个段用于存储设定被写次数范围的 NVM非活动内存页面。
3、 根据权利要求 2所述的方法, 其特征在于, 所述非活动内存页面链表中 包括的多个段按照对应的设定被写次数范围从小到大的顺序在所述非活动内 存页面链表中排列。
4、 根据权利要求 2或 3所述的方法, 其特征在于, 所述根据所述回收标识, 按照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面, 包括:
在所述非活动内存页面链表中按照设定被写次数范围从小到大的顺序,回 收一个或多个段中的与所述回收标识请求回收的内存页面数量匹配的 NVM非 活动内存页面。
5、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述回收标识, 按 照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM 非活动页面之前, 还包括:
确定所述 NVM非活动内存页面的被写次数; 面组中, 所述页面列表中包括多个页面组,每个页面组中包括按照被写次数从
6、 根据权利要求 5所述的方法, 其特征在于, 所述非活动内存页面链表中 包括的多个页面组按照建立时间的先后顺序在所述非活动内存页面链表中排 列。
7、 根据权利要求 5或 6所述的方法, 其特征在于, 所述根据所述回收标识, 按照非易失性存储器 NVM非活动内存页面被写次数从小到大的顺序回收
NVM非活动页面, 包括:
在所述非活动内存页面链表中按照建立时间的先后顺序,回收一个或多个 页面组中的与所述回收标识请求回收的内存页面数量匹配的 NVM非活动内存 页面。
8、 一种内存回收装置, 其特征在于, 包括:
接收模块, 用于接收内存回收请求消息, 所述内存回收请求消息中包含回 收标识, 所述回收标识用于表示请求回收的内存页面数量;
内存回收模块, 用于根据所述回收标识, 按照非易失性存储器 NVM非活 动内存页面被写次数从 'J、到大的顺序回收 NVM ^活动页面。
9、 根据权利要求 8所述的装置, 其特征在于, 还包括:
确定模块, 用于在所述内存回收模块根据所述回收标识,按照非易失性存 储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面之 前, 确定所述 NVM非活动内存页面的被写次数;
第一插入模块, 用于根据所述 NVM非活动内存页面的被写次数, 将所述 内存页面链表中包括多个段, 每个段用于存储设定被写次数范围的 NVM非活 动内存页面。
10、 根据权利要求 9所述的装置, 其特征在于, 所述非活动内存页面链表 中包括的多个段按照对应的设定被写次数范围从小到大的顺序在所述非活动 内存页面链表中排列。
11、 根据权利要求 9或 10所述的装置, 其特征在于,
内存回收模块,具体用于在所述非活动内存页面链表中按照设定被写次数 范围从小到大的顺序,回收一个或多个段中的与所述回收标识请求回收的内存 页面数量匹配的 N ^活动内存页面。
12、 根据权利要求 8所述的装置, 其特征在于, 还包括: 确定模块, 用于在所述内存回收模块根据所述回收标识,按照非易失性存 储器 NVM非活动内存页面被写次数从小到大的顺序回收 NVM非活动页面之 前, 确定所述 NVM非活动内存页面的被写次数; 链表中的最后一个页面组中, 所述页面列表中包括多个页面组,每个页面组中
13、 根据权利要求 12所述的装置, 其特征在于, 所述非活动内存页面链表 中包括的多个页面组按照建立时间的先后顺序在所述非活动内存页面链表中 排列。
14、 根据权利要求 12或 13所述的装置, 其特征在于,
内存回收模块,具体用于在所述非活动内存页面链表中按照建立时间的先后顺 序,回收一个或多个页面组中的与所述回收标识请求回收的内存页面数量匹配 的 NVM非活动内存页面。
PCT/CN2014/070515 2013-02-22 2014-01-13 内存回收方法及装置 WO2014127684A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP14753914.2A EP2921963B1 (en) 2013-02-22 2014-01-13 Memory recycling method and device
JP2015552994A JP6014925B2 (ja) 2013-02-22 2014-01-13 メモリ回収方法および装置
KR1020157018254A KR20150095781A (ko) 2013-02-22 2014-01-13 메모리 리클레임 방법 및 장치
US14/798,094 US20150317246A1 (en) 2013-02-22 2015-07-13 Memory Reclamation Method and Apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310057351.1A CN104008061B (zh) 2013-02-22 2013-02-22 内存回收方法及装置
CN201310057351.1 2013-02-22

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/798,094 Continuation US20150317246A1 (en) 2013-02-22 2015-07-13 Memory Reclamation Method and Apparatus

Publications (1)

Publication Number Publication Date
WO2014127684A1 true WO2014127684A1 (zh) 2014-08-28

Family

ID=51368721

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/070515 WO2014127684A1 (zh) 2013-02-22 2014-01-13 内存回收方法及装置

Country Status (6)

Country Link
US (1) US20150317246A1 (zh)
EP (1) EP2921963B1 (zh)
JP (1) JP6014925B2 (zh)
KR (1) KR20150095781A (zh)
CN (1) CN104008061B (zh)
WO (1) WO2014127684A1 (zh)

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294189B (zh) * 2015-05-25 2020-09-25 中兴通讯股份有限公司 内存碎片整理方法及装置
CN105159777B (zh) * 2015-08-03 2018-07-27 中科创达软件股份有限公司 进程的内存回收方法及装置
CN105404589B (zh) * 2015-10-29 2019-04-30 天脉聚源(北京)教育科技有限公司 一种垃圾回收方法及装置
CN107885666B (zh) 2016-09-28 2021-07-20 华为技术有限公司 一种内存管理方法和装置
KR20180059208A (ko) * 2016-11-25 2018-06-04 삼성전자주식회사 리클레임 제어부를 갖는 메모리 콘트롤러 및 그에 따른 동작 제어 방법
KR20180076765A (ko) 2016-12-28 2018-07-06 에스케이하이닉스 주식회사 메모리 시스템 및 메모리 시스템의 동작 방법
CN106843756B (zh) * 2017-01-13 2019-12-31 中国科学院信息工程研究所 基于页面分类的内存页面回收方法及系统
KR20180123385A (ko) * 2017-05-08 2018-11-16 에스케이하이닉스 주식회사 메모리 시스템 및 이를 이용한 웨어-레벨링 방법
US20190012259A1 (en) * 2017-07-06 2019-01-10 Futurewei Technologies, Inc. Lba eviction in pcm media
CN109388520B (zh) * 2017-08-08 2022-02-15 深圳大心电子科技有限公司 数据备份方法、数据恢复方法以及存储控制器
CN108228343B (zh) * 2017-08-21 2020-11-17 珠海市魅族科技有限公司 内存回收方法及装置、计算机装置及计算机可读存储介质
CN108228344B (zh) * 2017-08-22 2021-08-10 珠海市魅族科技有限公司 多进程内存处理方法及装置、计算机装置及可读存储介质
KR102419036B1 (ko) * 2017-12-18 2022-07-11 에스케이하이닉스 주식회사 데이터 저장 장치 및 그것의 동작 방법
US11004495B2 (en) 2017-12-18 2021-05-11 SK Hynix Inc. Data storage device and operating method thereof
CN109992402B (zh) * 2017-12-29 2021-07-09 Oppo广东移动通信有限公司 内存处理方法和装置、电子设备、计算机可读存储介质
US11188250B2 (en) 2018-10-25 2021-11-30 Micron Technology, Inc. Two-stage hybrid memory buffer for multiple streams
CN111324288B (zh) * 2018-12-14 2024-02-23 兆易创新科技集团股份有限公司 一种存储器
CN111324284B (zh) * 2018-12-14 2024-02-23 兆易创新科技集团股份有限公司 一种存储器
CN110532198B (zh) * 2019-09-09 2023-08-08 成都西山居互动娱乐科技有限公司 一种存储空间分配的方法及装置
CN115757193B (zh) * 2019-11-15 2023-11-03 荣耀终端有限公司 一种内存的管理方法及电子设备
CN112988610A (zh) * 2019-12-16 2021-06-18 深圳市万普拉斯科技有限公司 内存回收处理方法、装置、计算机设备和存储介质
CN113392037B (zh) * 2020-03-12 2024-06-18 深圳市万普拉斯科技有限公司 内存回收方法、装置、计算机设备和存储介质
CN111782559A (zh) * 2020-07-06 2020-10-16 Oppo广东移动通信有限公司 一种页面管理方法、装置及计算机可读存储介质
CN112181863B (zh) * 2020-10-19 2024-06-14 Oppo广东移动通信有限公司 页面回收方法、装置、终端及存储介质
CN113778662B (zh) * 2021-07-28 2022-12-06 荣耀终端有限公司 内存回收方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231619A (zh) * 2008-02-22 2008-07-30 浙江大学 一种基于非连续页的动态内存管理方法
CN101833512A (zh) * 2010-04-22 2010-09-15 中兴通讯股份有限公司 一种内存回收方法及其装置
CN102508783A (zh) * 2011-10-18 2012-06-20 深圳市共进电子股份有限公司 一种避免数据混乱的内存回收方法
CN102880555A (zh) * 2012-07-28 2013-01-16 福州大学 面向实时系统的内存算法

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5577246A (en) * 1992-09-25 1996-11-19 Lucent Technologies Inc. Database memory compaction and reclamation method
JP3507132B2 (ja) * 1994-06-29 2004-03-15 株式会社日立製作所 フラッシュメモリを用いた記憶装置およびその記憶制御方法
JP3389186B2 (ja) * 1999-04-27 2003-03-24 松下電器産業株式会社 半導体メモリカード及び読み出し装置
US6654855B1 (en) * 2000-10-26 2003-11-25 Emc Corporation Method and apparatus for improving the efficiency of cache memories using chained metrics
KR100526190B1 (ko) * 2004-02-06 2005-11-03 삼성전자주식회사 플래시 메모리의 재사상 방법
KR100869675B1 (ko) * 2007-02-05 2008-11-21 지인정보기술 주식회사 디스크립터 배열을 이용한 플래시 메모리 제어 시스템 및방법
US7903486B2 (en) * 2007-11-19 2011-03-08 Sandforce, Inc. System, method, and computer program product for increasing a lifetime of a plurality of blocks of memory
US20100174845A1 (en) * 2009-01-05 2010-07-08 Sergey Anatolievich Gorobets Wear Leveling for Non-Volatile Memories: Maintenance of Experience Count and Passive Techniques
JP4666080B2 (ja) * 2009-02-09 2011-04-06 Tdk株式会社 メモリコントローラ及びメモリコントローラを備えるフラッシュメモリシステム、並びにフラッシュメモリの制御方法
WO2011010348A1 (ja) * 2009-07-23 2011-01-27 株式会社日立製作所 フラッシュメモリ装置
US8402242B2 (en) * 2009-07-29 2013-03-19 International Business Machines Corporation Write-erase endurance lifetime of memory storage devices
US8688894B2 (en) * 2009-09-03 2014-04-01 Pioneer Chip Technology Ltd. Page based management of flash storage
US9026716B2 (en) * 2010-05-12 2015-05-05 Western Digital Technologies, Inc. System and method for managing garbage collection in solid-state memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231619A (zh) * 2008-02-22 2008-07-30 浙江大学 一种基于非连续页的动态内存管理方法
CN101833512A (zh) * 2010-04-22 2010-09-15 中兴通讯股份有限公司 一种内存回收方法及其装置
CN102508783A (zh) * 2011-10-18 2012-06-20 深圳市共进电子股份有限公司 一种避免数据混乱的内存回收方法
CN102880555A (zh) * 2012-07-28 2013-01-16 福州大学 面向实时系统的内存算法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2921963A4 *

Also Published As

Publication number Publication date
US20150317246A1 (en) 2015-11-05
EP2921963B1 (en) 2020-12-02
CN104008061A (zh) 2014-08-27
KR20150095781A (ko) 2015-08-21
JP2016507830A (ja) 2016-03-10
EP2921963A4 (en) 2015-10-28
CN104008061B (zh) 2018-01-23
JP6014925B2 (ja) 2016-10-26
EP2921963A1 (en) 2015-09-23

Similar Documents

Publication Publication Date Title
WO2014127684A1 (zh) 内存回收方法及装置
WO2017050028A1 (zh) 一种固态硬盘的数据擦除方法及装置
US9910786B2 (en) Efficient redundant array of independent disks (RAID) write hole solutions
US10101930B2 (en) System and method for supporting atomic writes in a flash translation layer
US10114749B2 (en) Cache memory system and method for accessing cache line
KR101623119B1 (ko) 솔리드 스테이트 드라이브의 에러 제어 방법
US9298578B2 (en) Method and apparatus for power loss recovery in a flash memory-based SSD
US9489409B2 (en) Rollover strategies in a N-bit dictionary compressed column store
KR20160124794A (ko) Dram 결함들의 커널 마스킹
WO2016045483A1 (zh) 一种地址的处理方法、相关设备和系统
CN102768645B (zh) 混合缓存的固态硬盘预取方法和固态硬盘ssd
CN103995855B (zh) 存储数据的方法和装置
KR101420754B1 (ko) 비휘발성 메모리 시스템 및 이를 위한 맵핑 테이블 관리 방법
WO2017041570A1 (zh) 向缓存写入数据的方法及装置
CN106681934A (zh) 一种固态硬盘垃圾回收的方法、系统和固态硬盘控制器
EP3196767B1 (en) Method for writing data into flash memory device, flash memory device and storage system
WO2015053966A9 (en) Memory system with shared file system
CN107621927A (zh) 一种基于超融合系统的纵向扩展方法及其装置
CN110196818A (zh) 缓存数据的方法、缓存设备和存储系统
CN105204783A (zh) 一种基于数据生存期的固态盘垃圾回收方法
CN111078143B (zh) 基于段映射进行数据布局和调度的混合存储方法及系统
CN104216792B (zh) 数据备份的方法及内存数据库存储引擎
CN116701239A (zh) 基于伙伴算法的碎片回收管理方法、装置和计算机设备
WO2023124423A1 (zh) 一种存储空间分配方法、装置、终端设备及存储介质
CN103281358B (zh) 一种基于一致性hash算法存储资源的方法

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: 14753914

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2014753914

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 20157018254

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2015552994

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE