WO2023088546A1 - Controller and method to perform persistent memory management in a memory system - Google Patents

Controller and method to perform persistent memory management in a memory system Download PDF

Info

Publication number
WO2023088546A1
WO2023088546A1 PCT/EP2021/081914 EP2021081914W WO2023088546A1 WO 2023088546 A1 WO2023088546 A1 WO 2023088546A1 EP 2021081914 W EP2021081914 W EP 2021081914W WO 2023088546 A1 WO2023088546 A1 WO 2023088546A1
Authority
WO
WIPO (PCT)
Prior art keywords
controller
free
memory
elements
area
Prior art date
Application number
PCT/EP2021/081914
Other languages
French (fr)
Inventor
Sagi Manole
Amit Golander
Omer Caspi
Yigal Korman
Original Assignee
Huawei Technologies Co., Ltd.
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 Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Priority to PCT/EP2021/081914 priority Critical patent/WO2023088546A1/en
Publication of WO2023088546A1 publication Critical patent/WO2023088546A1/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
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • 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/7202Allocation control and policies
    • 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/7207Details relating to flash memory management management of metadata or control data

Definitions

  • the present disclosure relates generally to the field of memory-level storage technologies and more specifically, to a controller and a method to perform persistent memory management, for example, an efficient persistent memory allocation, in a memory system.
  • Memory management plays a vital role in every computing system to perform more efficiently, for example, to allocate and de-allocate memory before and after process execution, to keep track of used memory space by processes, to maintain data integrity while executing of process, and minimize fragmentation issues, and proper utilization of memory resources, etc.
  • the memory management is the task of allocating and freeing memory areas for different services and processes that are being performed on the computing system.
  • the majority of the memory allocators and memory-management systems are volatile in nature due to which the allocated areas are wiped out upon power failure or shutdown. Therefore, persistent memory and persistent memory allocators are being used nowadays for memory management because of its non-volatile and byte-addressable characteristics. Persistent memory relies on the persistency of the allocated memory areas and is more efficient to handle memory allocations during failures or shutdowns.
  • Persistent memory being a new and emerging technology still poses various challenges in practice. These challenges may include memory wear-out, poor memory allocations, challenges in knowing when and how to efficiently perform freeing of allocated areas etc. Although there are several wear levelling mechanisms that provide varying levels of longevity enhancement in certain memory systems, however, the wear-out problem still exists, and the persistent memory eventually becomes worn-out. To address these challenges, various existing methods, memory systems, and memory allocators are developed. In one example, certain traditional memory allocators are designed with in-place data writes but are not suitable for the non-volatile main memory (NVRAM) due to the limited endurance.
  • NVRAM non-volatile main memory
  • certain traditional wear- out aware memory allocators are based on redirecting of the data writes around to achieve wearlevelling to some extent and redesigning of a non-volatile memory (NVM) copy mechanism, bypassing the central processing unit (CPU) cache partially and prefetching data explicitly.
  • NVM non-volatile memory
  • Some existing methods and memory allocators use dynamic random-access memory (DRAM) to store traditional form of metadata for free space tracking so it is required to rebuild the volatile information from data memory area during each bring-up.
  • DRAM dynamic random-access memory
  • storing this metadata in the DRAM (which is a volatile memory) has the downside that it needs to be rebuilt whenever the machine reboots or the file system is brought online.
  • the existing memory allocators with DRAM faces another major challenge with regards to the flushing of data at the right time as it leaves CPU cache. Leaving CPU cache and redirecting writes leads to more wear-out, high memory footprint and heavy memory scrubbing forbring-up which are the major drawbacks of existing memory allocators using persistent memory.
  • the present disclosure provides persistent memory management and memory allocation controller.
  • the present disclosure provides a solution to the existing problem of how to improve the efficiency and effectiveness of persistent memory management and memory allocators while managing high wear-out, high memory footprint, and heavy memory scrubbing.
  • An aim of the present disclosure is to provide a solution that overcome at least partially the problem encountered in prior art and provide an improved controller and method to efficiently and effectively perform persistent memory management and memory allocation while reducing wear-out, memory footprint, and memory scrubbing during bring-up as compared to existing memory systems.
  • the present disclosure provides a controller configured to perform memory management in a memory system comprising one or more memory devices configured to store data.
  • the one or more memory devices are persistent memory devices the controller being configured to receive indications of a plurality of sub areas of a memory area.
  • the controller further configured to maintain meta data for each sub area.
  • the meta data comprises an indication of the size of elements of a sub area, an indication of number of free elements and reference to a list of free elements in the sub area.
  • the controller is further configured to allocate memory in the memory area based on the metadata.
  • the controller of the present disclosure ensures low wear-out, low memory footprint, and low memory scrubbing during bring-up in the one or more memory devices (or a persistent memory device) as compared to existing memory systems.
  • By virtue of maintaining metadata for each sub area and allocating memory based on such metadata that indicates the size of elements, the number of free elements, and reference to the list of free elements in the sub area improves the memory allocation effectively and efficiently without the rebuild any volatile information from data memory area during each bring-up.
  • the controller is further configured to receive an indication of the memory area, and to receive the indication of the sub areas by dividing the memory area into the plurality of sub areas.
  • the division of the memory area into the plurality of sub areas is accurate.
  • the list of free elements comprises references to free elements and for each free element a reference to a next free element in the sub area and a reference to a previous free element in the sub area.
  • the list of free elements and the reference to the previous free element in sub area makes the controller aware of an availability of the sub areas, thereby improving memory allocation.
  • the controller that is further configured to receive an allocation request indicating a processor.
  • the controller is further configured to select an element to be allocated based on a free table corresponding to the indicated processor.
  • the element to be allocated is the first element in the list of free elements for a sub area indexed by the free table.
  • the free table corresponding to the indicated processor is used to select the element to be allocated, where the element to be allocated is the first element in the list of free elements.
  • the controller is further configured to decrease the corresponding free counter for the sub area of the element and then update the list of free elements indicating that the allocated element is no longer free after allocating the element.
  • the list of free elements is updated, which is further used to provide reference to the free elements that are available for further allocation upon reception of a next request for allocation of the element.
  • the present disclosure provides the controller is configured to receive a free request for an element to be freed.
  • the controller is further configured to increase the corresponding free counter for the sub area of the element and insert a reference to the element to be freed in the list of free elements indicating that the freed element is free.
  • the insertion of the reference to the element to be freed indicates that the element is free and is available for further allocation, which further improves the efficiency of the memory system.
  • the present disclosure provides the controller configured to receive a request for reconstruction of a sub area and determine whether a first element in the list of free elements is a last allocated element and if so determine that a failure occurred during allocation.
  • the controller is further configured to determine whether a last element in the list of free elements is a last freed element and if not determine that a failure occurred during freeing.
  • the controller is useful to efficiently handle failures.
  • the controller is configured to count the number of entries in the list of free elements and compare it to the indication of number of free elements, and if there is a mismatch, determine that the failure occurred during allocation or freeing.
  • the controller can determine if the list of free elements is updated or not.
  • the comparison of the list of free elements with the indication of number of free elements is also useful to determine reason of failures, such as if occurred during allocation or freeing.
  • in response to determining that a failure occurred during freeing or allocating determine that the sub area is not available for use.
  • the controller is aware about the non-availability of the corresponding sub area, which does not cause any functional misbehaviour in the memory system.
  • the controller is further configured to receive the request for reconstruction of the sub area as part of a request for reconstruction of the memory area comprising the sub area, and in response to determining that a failure occurred during freeing or allocating, determine that the memory area is not available for use.
  • the determination of failure that occurred during freeing or allocation enables the controller to determine the availability of memory area and further reconstructing that memory area for further use.
  • the controller is configured to set a flag for a sub area when an allocation or freeing is to be performed for that subarea and clear the flag for when the allocation or freeing is concluded, and count the number of entries in the list of free elements for sub areas for which the flag is set.
  • the flag prevents the controller from allocating or freeing of the sub area for which allocation or freeing is to be performed and also provides reference to the sub areas from plurality of sub areas that are not available for allocation.
  • the present disclosure provides a method for use in a controller configured to perform memory management in a memory system comprising one or more memory devices configured to store files.
  • the one or more memory devices are persistent memory devices.
  • the method for use in controller is further configured for receiving indications of a plurality of sub areas of a memory area and maintaining meta data for each sub area.
  • the meta data comprises an indication of the size of elements of a sub area, an indication of number of free elements and reference to a list of free elements in the sub area.
  • the method further comprises allocating memory in the memory area based on the metadata.
  • the method achieves all the advantages and technical effects of the controller of the present disclosure.
  • FIG. 1 is a block diagram of a memory system, in accordance with an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a method for use in a controller that is configured to perform memory management in a memory system, in accordance with an embodiment of the present disclosure
  • FIG.3 is an illustration of a memory device, in accordance with an embodiment of the present disclosure.
  • an underlined number is employed to represent an item over which the underlined number is positioned or an item to which the underlined number is adjacent.
  • a non-underlined number relates to an item identified by a line linking the nonunderlined number to the item.
  • the non-underlined number is used to identify a general item at which the arrow is pointing.
  • FIG. l is a block diagram of a memory system, in accordance with an embodiment of the present disclosure.
  • the memory system 102 includes a controller 104, one or more memory devices 106, a network interface 108, and a meta data 112.
  • the one or more memory devices 106 further includes a memory area 110.
  • the memory area 110 is further divided into a plurality of sub areas 110A to 110N
  • the memory system 102 refers to a computer storage system that stores information (i.e., data such as data files or database files) in a storage medium, such as a storage disk.
  • the memory system 102 includes the controller 104 to perform memory management and also to optimize the overall performance of the memory system 102. Examples of memory system 102 include, but are not limited to, a block storage system, a file storage system, an object storage system, or a combination thereof.
  • the controller 104 includes suitable logic, circuitry, interfaces, and/or code that is configured to perform memory management (or a memory allocation process) in the memory system 102.
  • Examples of implementation of the controller 104 may include but are not limited to a central data processing device, a microprocessor, a microcontroller, a complex instruction set computing (CISC) processor, an application-specific integrated circuit (ASIC) processor, a reduced instruction set (RISC) processor, a very long instruction word (VLIW) processor, a state machine, and other processors or control circuitry.
  • CISC complex instruction set computing
  • ASIC application-specific integrated circuit
  • RISC reduced instruction set
  • VLIW very long instruction word
  • the one or more memory devices 106 includes suitable logic, circuitry, interfaces, and/or code that is configured to store data.
  • the one or more memory devices 106 are persistent memory devices (structure).
  • the persistent memory is non-volatile, solid-state high-performance byte- addressable memory device that resides on a memory bus.
  • the persistent memory is an emerging technology in which a common memory is persisted upon power failures or shutdowns.
  • the persistent memory and persistent-memory controllers rely on the persistency of the allocated memory areas and the reconstruction of the free areas on bring-up.
  • Other examples of the one or more memory devices 106 include, but are not limited to, a solid-state drive (SSD) storage server, a block storage system, a file storage system, an object storage system, or a combination thereof.
  • SSD solid-state drive
  • the network interface 108 includes a hardware or a software that is configured to establish communication among the one or more memory devices 106, and also with the controller 104.
  • Examples of network interface 108 may include but are not limited to, a computer port, a network socket, a network interface controller (NIC), and any other network interface device.
  • NIC network interface controller
  • the memory area 110 refers to a smallest data segments that contains an information requested by a user.
  • the memory area 110 includes the plurality of sub areas 110A to 110N.
  • the memory area 110 corresponds to au info table that includes an array of different entries, for example in this case 1024 entries that are equal to 1 gigabyte (GB)/1 megabyte (MB), and the like.
  • the au info table can include other possible numbers of entries without limiting the scope of the present disclosure.
  • each entry holds an information on a relevant sub area from the plurality of sub areas 110A to HON.
  • the memory area 110 includes an array of 1024 entries.
  • the plurality of sub areas 110A to HON refers to sub-allocation units (or divisions) of the memory area 110.
  • the size of each sub-area from the plurality of sub areas 110A to HON is 1 MB.
  • the meta data 112 includes different information related to the memory area 110, and also related to elements of the plurality of sub areas 110A to 110N, such as related to free elements, and the like.
  • the meta data 112 is stored in the one or more memory devices 106.
  • the meta data 112 can be at other place, such as in a local memory, and the like.
  • the meta data 112 may be stored in any form, such as a table, a file, a structure, in the form of arrays, and the like.
  • the meta data 112 may include a number of free elements, size of elements, a reference of a next or a previous element, and the like.
  • the controller 104 is configured to perform memory management (or memory allocation) in a memory system 102.
  • the controller 104 is used to improve efficiency of the memory system 102, such as through memory management (or persistent memory management).
  • the memory management is a task to provide services to allocate and free the memory area 110.
  • the controller 104 is configured to keep track of the memory area 110 (i.e., if allocated or free).
  • the controller 104 is further configured to receive indications of the plurality of sub areas 110A to HON of the memory area 110.
  • the indications correspond to references for the meta data 112 that is maintained by the controller 104 to determine whether the sub area from the plurality of sub areas 110A to HON is free or allocated.
  • the controller 104 is configured to receive internal indications from memory area 110.
  • the controller 104 is configured to receive the indications from a subsequent division of the plurality of sub areas 110A to HON.
  • Other options may also be possible to receive the indications by the controller 104 without limiting the scope of the present disclosure.
  • the external indications received from one or more devices such as from a central processing unit (CPU) of other memory devices.
  • the indications further provide references to the plurality of sub areas 110A to HON and the size of each element that is stored in the plurality of sub areas 110A to HON.
  • the indications are provided to the controller 104 to maintain, update and create the plurality of sub areas 110A to HON, and the references for the same.
  • the controller 104 is further configured to receive an indication of the memory area 110, and also to receive the indication of the plurality of sub areas by dividing the memory area 110 into the plurality of sub areas 110A to HON. Firstly, the indication of the memory area 110 is received, and then the controller 104 is configured to divide the memory area 110 into the plurality of sub areas 110A to HON. Further, division of the memory area 110 into the plurality of sub areas 110A to 110N is used to allow for implementations where the plurality of sub areas 110A to 110N are generated and are provided to the controller 104.
  • the indication received by the controller 104 includes an address of the memory area 110.
  • the indication of the memory area 110 is used by the controller 104 for memory management (or memory allocation) of the memory system 102.
  • the indication received by the controller 104 includes the size of each sub area of the plurality of sub areas 110A to 11 ON, and a number of elements that are stored in each sub area.
  • the indication may include reference of the memory area 110 for the plurality of sub areas 110A to 110N.
  • the controller 104 is further configured to maintain the meta data 112 for each sub area, and the meta data 112 includes an indication of the size of elements of a sub area.
  • the meta data 112 is generated, and then the meta data 112 is maintained by the controller 104, such as for later use and update (e.g., to allow to use of already generated tables/structures).
  • the meta data 112 includes the indication (e.g., an integer value) of the size of the elements of each sub area, such as for the sub area 110A.
  • the meta data 112 includes the indication of the size of the elements of the sub area 110A that are stored in a table form with different index values.
  • the indication of the size of the elements may be an actual size of the elements of the sub area from the plurality of sub areas 110A to 110N.
  • the indication can be an information/means which can be used by the controller 104 to calculate the actual size of the elements of the sub area.
  • the actual size of the element can be calculated from addresses of a start point to endpoints of the element of the sub area.
  • the size of the element refers to as an element size that is an integer value and is used to represent the element size, which is held by each sub area from the plurality of sub areas 110A to 110N
  • the size of the indication of the size of the elements of the sub area is 4, 8, 16, 32 bytes or in any of the ranges 2-8, 4-16, or 8-32 bytes.
  • the size of the indication of the size of the elements of the sub area varies as per division of the memory area 110 and the one or more memory devices 106 that is also maintained by the controller 104 in the form of meta data 112.
  • the size of the indication of the size of the elements of the sub area 110A is 4 bytes, 8 bytes, 16 bytes, or 32 bytes.
  • the size of the indication of the size of the elements of the sub area ranges from 2 bytes to 8 bytes, 4 bytes to 16 bytes, or 8 bytes to 32 bytes.
  • the size of the indication of the size of the elements of the sub area can have other possible values without limiting the scope of the disclosure.
  • the controller 104 can perform the memory management with less memory consumption in the memory system 102.
  • the meta data 112 further includes an indication of a number of free elements.
  • the meta data 112 includes the indication of the number of free elements in the plurality of sub areas 110A to 110N.
  • the free elements are useful for memory allocation purposes in the memory system 102.
  • a free count integer is used as a counter to provide the indication of the number of free elements within the plurality of sub areas 110A to 110N (e.g., by a number of counts).
  • the size of the indication of the number of free elements is 4, 8, 16, 32 bytes or in any of the ranges 2-8, 4 -16, or 8-32 bytes.
  • the size of the indication of the number of free elements varies as per division of the memory area 110 and the one or more memory devices 106 that are maintained by the controller 104 in the form of the meta data 112.
  • the size of the indication of the number of free elements is 4 bytes, 8 bytes, 16 bytes, or 32 bytes.
  • the size of the indication of the number of free elements ranges from 2 bytes to 8 bytes, 4 bytes to 16 bytes, or 8 bytes to 32 bytes.
  • the size of the indication of the number of free elements can have other values without limiting the scope of the disclosure.
  • the meta data 112 further includes reference to a list of free elements in the sub area.
  • the reference to the list of free elements in the sub area from the plurality of sub areas 110A to HON provides access to already generated tables to update, generate use tables/structures.
  • such a table includes free count, element size, and offset list-head to provide reference of the sub area from the plurality of sub areas 110A to HON.
  • the list of the free elements further includes references to the free elements and for each free element a reference to a next free element in the sub area, and includes a reference to a previous free element in the sub area.
  • the list of free elements that includes the references to the free elements is represented by an offset list head (e.g., of 16 bytes).
  • the list of free elements includes the reference that corresponds to the next free element in the sub area.
  • the list of free elements includes a next reference (e.g., of 8 bytes) that corresponds to the next free element in the sub area 110A.
  • the list of free elements further includes the reference that corresponds to the previous free element in the sub area.
  • the list of free elements includes a previous reference (e.g., of 8 bytes) that corresponds to the previous free element in the sub area 110A.
  • the references to the free elements are beneficial to provide updates to the controller 104 regarding allocation of the element so that the memory management and allocation can be efficiently controlled by the controller 104.
  • the size of the reference to the list of free elements in the sub area is 8, 16, 32, 64 bytes or in any of the ranges 4-16 or 8-32, or 16-64 bytes.
  • the size of the reference to the list of free elements varies as per division of the memory area 110 and the one or more memory devices 106 that are maintained by the controller 104 in the form of meta data 112.
  • the size of the reference to the list of free elements in the sub area 110A is 4 bytes, 8 bytes, 16 bytes, or 32 bytes.
  • the size of the reference to the list of free elements in the sub area 110A ranges from 4 bytes to 16 bytes or 8 bytes to 32 bytes or 16 bytes to 64 bytes.
  • the size of the reference to the list of free elements can have other values without limiting the scope of the disclosure. The variation in size makes memory management with less memory consumption in the memory system 102.
  • the controller 104 is further configured to receive an allocation request indicating a processor, and select an element to be allocated based on a free table corresponding to the indicated processor. Further, the element to be allocated is the first element in the list of free elements for the sub area indexed by the free table.
  • the allocation request received by the controller 104 indicates the processor, for example, a central processing unit (CPU), and the like.
  • the allocation request indicates an identification (ID) number (or a number) that corresponds to the processor, such as to a first processor, a second processor, a third processor, and the like.
  • the allocation request includes a reference of the element that is to be allocated from the plurality of sub areas 110A to 110N.
  • the controller 104 is configured to select the element to be allocated based on the free table that corresponds to the indicated processor.
  • the element to be allocated is always the first element in the list of free elements in the sub area.
  • the first element is further indexed by the free table of the meta data 112.
  • the allocation request running on the third processor will firstly try free table number three, and the like.
  • the first element can be pointed by the list of free elements (or offset list-head) from the plurality of sub areas 110A to 110N.
  • the controller 104 is further configured to allocate memory in the memory area 110 based on the meta data 112. In other words, allocation of the memory in the memory area 110 is performed based on the meta data 112 that is maintained by the controller 104.
  • the reference to the list of free elements in the sub area includes different entries, and each entry is of 32 bytes (e.g., 2 entries per cache line). However, each entry can have different possible values without limiting the scope of the present disclosure.
  • the allocation of the memory in the memory area 110 includes allocation of the free elements in the plurality of sub areas 110A to HON.
  • the entries in the list of free elements are also updated on every allocation and freeing of the element in plurality of sub areas 110A to HON. As a result, there exists an updated list of the free elements that are available for further allocation. Therefore, the controller 104 provides an efficient and low footprint process for memory management (and memory allocation), and also lower down wear out rate of the memory area 110 in the memory system 102.
  • the controller 104 may rely on an extended alternative dispute resolution (eADR) to avoid cache line flush (CLFLUSH) instructions and persistency points.
  • eADR refers to a mechanism of eliminating the need to wait for flushes to finish and to flush data with temporal locality.
  • CLFLUSH cache line flush
  • the eADR also provides a low foot-print and easy programming model.
  • the controller 104 is further configured to decrease the corresponding free counter for the sub area of the element, and update the list of free elements indicates that the allocated element is no longer free, after allocating the element.
  • the controller 104 is configured to decrease the corresponding free counter (e.g., the free count integer) for the sub area of the corresponding element.
  • the decrease in the free counter for the sub area of the element indicates that the element is allocated from the list of free elements and thus, the number of free elements is reduced in the sub area. Thereafter, the controller is configured to update the list of free elements, which indicates that the allocated element is no longer free.
  • the controller 104 will update a previous pointer of a next free element of the list of free elements. In another example, the controller 104 will also update a next pointer of the list of free elements. Therefore, the updated list of the free elements provides a reference to the free elements that are available for further allocation upon reception of the next request for allocation of the element.
  • the controller 104 is configured to select the indexing in the free table based on an element size indicated by the allocation request. For example, if there exists a table of 8 entries one for each element size (e.g., 256B, 512B, 1KB, up to 16KB). Then the controller 104 is configured to select the indexing in the free table based on the element size that is indicated by the allocation request. In an example, the indexing in the free table of the sub area for new allocations is done in 0(1) time.
  • the controller 104 is further configured to receive a free request for an element to be freed, increase the corresponding free counter for the sub area of the element, and then insert a reference to the element to be freed in the list of free elements indicating that the freed element is free.
  • the controller 104 is configured to use size of the element (i.e., element size) of its associated sub area (e.g., 1MB sub-allocation unit) to determine the element-size hold by the corresponding sub area from the plurality of sub areas 110A to 110N.
  • the controller 104 is configured to determine the element-size hold by the sub area 110A.
  • the controller 104 is configured to receive the free request for the element that is to be freed.
  • the controller 104 updates the free counter for the sub area of the element (or the free count integer) in the list of free elements.
  • the controller 104 increases the corresponding free counter for the sub area 110A of the element.
  • the controller 104 increases the free count integer for the sub area 110A of the element.
  • the increase in the free counter indicates that the element is now freed and the number of free elements is increased.
  • the corresponding free counter is increased as per the number of free requests received by the controller 104 for the elements to be freed.
  • the controller 104 inserts the reference of the element to be freed in the list of free elements to indicate which element is free.
  • the reference is inserted by setting (or updating) a previous pointer and a next pointer at the element that is freed in the list of free elements.
  • the reference is inserted by setting the previous pointer at a next element that is freed in the list of free elements.
  • the reference is inserted by setting the next pointer at a previous element that is freed in the list of free elements.
  • the free count integer reaches the element size (i.e., 1 MB) of the corresponding sub area, then the element in the corresponding sub area is freed.
  • the element in the corresponding sub area is also marked as not allocated, which can be a bit away from a high bit of the size of the element (or element size integer).
  • the controller 104 is further configured to receive the request for reconstruction of the sub area as part of a request for reconstruction of the memory area 110 comprising the sub area.
  • the controller 104 is further configured to determine whether a first element in the list of free elements is a last allocated element and if so determine that a failure occurred during allocation, or determine whether a last element in the list of free elements is a last freed element and if not determine that a failure occurred during freeing.
  • the controller 104 determines the entries of the memory area 110 (or au info table entries). Moreover, for each entry of the memory area 110, the allocated element is always the first element pointed by the list of free elements (or an offset list-head), and the last freed element is inserted in last.
  • the controller 104 is configured to determine if a next element and a previous element from the list of free elements point back to the free element and if not, then the failure occurred during allocation or freeing. In other words, the controller 104 is configured to determine whether the failure occurred during the allocation of the element or during the freeing of the element. For example, if the first element in the list of free elements is the last allocated element, then the failure occurred during the allocation of the element. However, if the last element in the list of free elements is not the last freed element, then the failure occurred during the freeing of the element. Moreover, the controller 104 receives the request for the reconstruction of the sub area as part of the request for the reconstruction of the memory area 110. Beneficially, as compared to the conventional approach, the controller 104 is useful to efficiently handle failures that occurred either during freeing or during allocation.
  • the controller 104 is further configured to count the number of entries in the list of free elements, and compare it to the indication of the number of free elements, and if there is a mismatch, then determine that the failure occurred during allocation or freeing. Firstly, the controller 104 is configured to check and confirm if the free counter for the sub area of the element is correct. Thereafter, the controller 104 is configured to traverse the list of free elements to count the number of entries in the list of free elements and also to compare the list of free elements with the indication of the number of free elements (e.g., with a free count integer). After that, the controller 104 determines whether the list of free elements is updated or not.
  • the comparison of the list of free elements with the indication of the number of free elements is also useful to determine the reason for failures, such as if occurred during allocation or freeing.
  • the controller 104 if the failure occurred during the allocation of the element, then the controller 104 is configured to update the free counter in the sub area and bring the controller 104 back to the pre-allocation status.
  • the controller 104 is configured to traverse the list of free elements and find the free element that points to the first free element. In an example, the first free element points to a second free element, and the second free element points back to the list of free elements.
  • the controller 104 is configured to update the free counter in the sub area.
  • the controller 104 is further configured to determine the failure, and, in response to determining that the failure occurred during freeing or allocating, determine that the subarea is not available for use. Firstly, the controller 104 is configured to determine whether the failure occurred during the freeing of the element or during the allocation of the element. Thereafter, the controller 104 is configured to determine that whether the subarea is not available for use. If the sub area is not available for use, then the sub area cannot be linked to the memory area 110, and also cannot be allocated, because the corresponding sub area is now out of the list of free elements. Beneficially as compared to the conventional approach, the corresponding sub area that is not available for use will not cause any functional misbehaviour in the memory system 102.
  • the controller 104 is further configured to receive a request for reconstruction of a sub area as part of a request for the reconstruction of the memory area 110 includes the sub area. Further, in response to determine that a failure occurred during freeing or allocating, and determine that the memory area 110 is not available for use. Firstly, the controller 104 is configured to determine whether the failure occurred during freeing of the element or during allocating the element. After that the controller 104 determines that the memory area is not available for use. The controller 104 further receives the request for the reconstruction of the sub area. In an example, the request for reconstruction of the sub area is an internal request, that is received after detection of the failure. Moreover, the request for the reconstruction of the memory area includes the sub area that needs to be reconstructed.
  • the determination of failure that occurred during freeing or allocation enables the controller 104 to determine the availability of memory area 110 and further reconstruction of the memory area 110 for further use.
  • the controller 104 is further configured to set a flag for a sub area when an allocation or freeing is to be performed for that sub area and clear the flag for when the allocation or freeing is concluded.
  • the controller 104 further counts the number of entries in the list of free elements for sub areas for which the flag is set.
  • the flag (e.g., a lock) represents that allocation or freeing of the element in the sub area from the plurality of sub areas 110A to 110N is under process.
  • the flag informs the controller 104 that no other task can be performed for the corresponding sub area for which the flag is set. Beneficially, it prevents the controller 104 from allocating or freeing the sub area for which allocation or freeing is to be performed. Moreover, if the element for the corresponding sub area is allocated (or freed), then the controller 104 is configured to clear the flag, which represents that the allocation or freeing of the element of the corresponding sub area is performed (or completed). After that, the controller 104 is configured to count the number of entries in the list of free elements for the sub area for which the flag is set, and also update the list of free elements. Beneficially, the flag not only provides information about allocation or freeing of the sub area but also provides a reference to the sub areas from the plurality of sub areas 110A to 110N that are not available for allocation or freeing.
  • the flag is set through a lock per entry in each of the free-tables.
  • the controller 104 will try to trylock the relevant lock of an entry of the list of free elements (or free table). In an example, if the trylock is successful, then the controller will go to the sub area that is indexed by the entry, and then allocate the element pointed by the entry in the sub area. Further, in case if the sub area is empty, then the controller 104 will go to the memory area 110 (or the au info table) to search for an already assigned and partially allocated sub area of a desired size that is not referenced by other entries in the list of free elements. Thereafter, the memory area 110 is also protected by the lock.
  • the controller 104 will try to trylock the same entry of the list of free elements (or a next free-table) and allocate the element from the list of free elements. In an example, if the controller 104 could't lock any free-table, then the controller 104 will start all over, but this time by locking the lock.
  • the controller 104 provides an advanced feature for memory management (and memory allocation) and also ensures low wear-out, low memory footprint, and low memory scrubbing during bring-up in the one or more memory devices 106 as compared to existing memory systems.
  • the controller 104 is configured to receive the indications, and maintain the meta data 112, which is further responsible for memory management.
  • the meta data 112 is further responsible for memory management.
  • FIG. 2 is a flowchart of a method for use in a controller that is configured to perform memory management in a memory system, in accordance with an embodiment of the present disclosure.
  • FIG. 2 is described in conjunction with elements from FIG. 1.
  • FIG. 2 there is shown a flowchart of a method 200 for use in the controller 104 that is configured to perform memory management in the memory system 102.
  • the method 200 includes steps 202 to 206.
  • the method 200 for use in the controller 104 that is configured to perform memory management (or memory allocation) in the memory system 102.
  • the method 200 is used to improve the efficiency of the memory system 102, such as through memory management (or persistent memory management.
  • the controller 104 is configured to keep track of which the memory area 110.
  • the method 200 includes, receiving indications of the plurality of sub areas 110A to 110N of the memory area 110.
  • the indications corresponding to references for the meta data 112 that is maintained by the controller 104 to determine whether the sub area from the plurality of sub areas 110A to 110N is free or allocated.
  • the indications are provided to the controller 104 to maintain, update and create the sub area and a reference for the same.
  • the indications further provide references to the plurality of sub areas 110A to 11 ON and the size of each element that is stored in the plurality of sub areas 110A to 110N.
  • the method 200 comprises, receiving an indication of the memory area 110, and also receiving the indication of the plurality of sub areas by dividing the memory area 110 into the plurality of sub areas 110A to 110N. Firstly, the indication of the memory area 110 is received, and then the controller 104 is configured to divide the memory area 110 into the plurality of sub areas 110A to 110N. Further, division of the memory area 110 into the plurality of sub areas 110A to 110N is used to allow for implementations where the plurality of sub areas 110A to 110N are generated and are provided to the controller 104.
  • the method 200 includes, maintaining the meta data 112 for each sub area. Firstly, the meta data 112 is generated, and then the meta data 112 is maintained by the controller 104, such as for later use and update (e.g., to allow to use of already generated tables/structures).
  • the step 204 further includes three other steps, such as the step 204A, 204B, and 204C.
  • the method 200 comprises, including an indication of the size of elements of a sub area.
  • the meta data 112 includes the indication (e.g., an integer value) of the size of the elements of the sub area, such as for the sub area 110A.
  • the indication of the size of the elements may be the actual size of the elements of the sub area from the plurality of sub areas 110A to 110N.
  • the method 200 comprises, including an indication of a number of free elements.
  • the free elements can be allocated for memory allocation purposes in the memory system 102.
  • a free count integer is used to provide the indication of the number of free elements within the plurality of sub areas 110A to 110N.
  • the method 200 comprises, including reference to a list of free elements in the sub area.
  • the reference of the list of free elements in the sub area 110A provides an access to already generated tables to update, generate and use tables/structures.
  • the method 200 comprises, receiving an allocation request indicating a processor, and selecting an element to be allocated based on a free table corresponding to the indicated processor. Further, the element to be allocated is the first element in the list of free elements for a sub area indexed by the free table.
  • the allocation request received by the controller 104 indicates the processor. Moreover, the allocation request includes a reference of the element that is to be allocated from the plurality of sub areas 110A to 110N. Thereafter, the controller 104 is configured to select the element to be allocated based on the free table that corresponds to the indicated processor.
  • the element to be allocated is always the first element in the list of free elements in the sub area. Moreover, the first element is indexed by the free table of the meta data 112.
  • the method 200 includes, allocating memory in the memory area 110 based on the meta data 112. Allocation of memory n the memory area 110 is performed based on the meta data 112 that is maintained by the controller 104.
  • the method 200 provides an efficient and low footprint process for memory management and memory allocation, and also lower down wear out rate of the memory area 110 in the memory system 102.
  • the method 200 further comprises, selecting the indexing in the free table based on an element size indicated by the allocation request. For example, if there exists a table of 8 entries one for each element size (e.g., 256B, 512B, 1KB, up to 16KB). Then the method 200 includes selecting the indexing in the free table based on the element size that is indicated by the allocation request.
  • the method 200 further comprises, receiving a free request for an element to be freed, increasing the corresponding free counter for the sub area of the element, and then inserting a reference to the element to be freed in the list of free elements indicating that the freed element is free.
  • the method 200 comprises using size of the element of its associated sub area for determining the element-size that is hold by the corresponding sub area from the plurality of sub areas 110A to 110N.
  • the method 200 comprises receiving the free request for the element that is to be freed.
  • the method 200 comprises updating the free counter for the sub area of the element in the list of free elements.
  • increasing the corresponding free counter for the sub area 110A of the element is increasing the corresponding free counter for the sub area 110A of the element.
  • the increase in the free counter indicates that the element is now freed and the number of free elements is increased.
  • the method 200 comprises inserting the reference of the element to be freed in the list of free elements to indicate that the freed element is free.
  • the element that is freed in the list of free elements will become the last element in the list of free elements which is pointed by the index of the corresponding sub area.
  • the insertion of the reference to the element to be freed is beneficial to indicate that the element is free and is available for further allocation (e.g., based on another allocation request).
  • the method 200 further comprises, receiving the request for the reconstruction of the sub area as part of a request for the reconstruction of the memory area 110 comprising the sub area.
  • the method 200 further comprises determining whether a first element in the list of free elements is a last allocated element and if so determine that a failure occurred during allocation, or determining whether a last element in the list of free elements is a last freed element and if not determine that a failure occurred during freeing.
  • the method 200 comprises, determining the entries of the memory area 110. Moreover, for each entry of the memory area 110, the allocated element is always the first element pointed by the list of fee elements (or an offset list-head), and the freed element is inserted in last.
  • the method 200 further includes determining whether the failure occurred during the allocation of the element or during the freeing of the element.
  • the method 200 comprises, receiving the request for the reconstruction of the sub area as part of the request for the reconstruction of the memory area 110
  • the method 200 further comprises, counting the number of entries in the list of free elements, and comparing it to the indication of the number of free elements, and if there is a mismatch, then determining that the failure occurred during allocation or freeing.
  • the method 200 comprises using the controller 104 to traverse the list of free elements to count the number of entries in the list of free elements and also to compare the list of free elements with the indication of the number of free elements After that, the controller 104 determines whether the list of free elements is updated or not, and also determines if the failure occurred during allocation or freeing.
  • the method 200 further comprises, determining the failure, and, in response to determining that the failure occurred during freeing or allocating, determining that the subarea is not available for use.
  • the method 200 comprises using the controller 104 for determining whether the failure occurred during freeing of the element or during the allocation of the element. Thereafter, the controller 104 is configured to determine that the subarea is not available for use. Beneficially, the corresponding sub area that is not available for use will not cause any functional misbehaviour in the memory system 102.
  • the method 200 further comprises, receiving a request for reconstruction of a sub area as part of a request for reconstruction of the memory area 110 includes the sub area. Further, in response to determining that a failure occurred during freeing or allocating, and determine that the memory area 110 is not available for use. Firstly, the method 200 comprises using the controller 104 determining whether the failure occurred during freeing of the element or during allocating the element. After that the controller 104 determines that the memory area is not available for use. The controller 104 further receives the request for the reconstruction of the sub area. Moreover, the request for the reconstruction of the memory area includes the sub area that needs to be reconstructed.
  • the method 200 further comprises, setting a flag for a sub area when an allocation or freeing is to be performed for that sub area and clearing the flag when the allocation or freeing is concluded.
  • the method 200 further comprises, counting the number of entries in the list of free elements for sub areas for which the flag is set.
  • the flag represents that allocation or freeing of the element is under process in the sub area from the plurality of sub areas 110A to 110N. As a result, the flag informs the controller 104 that no other task can be performed for the corresponding sub area for which the flag is set.
  • the method 200 prevents the controller 104 from allocating or freeing the sub area for which allocation or freeing is to be performed.
  • the controller 104 is configured to clear the flag, which represents that the allocation or freeing of the element of the corresponding sub area is performed. After that, the controller 104 is configured to count the number of entries in the list of free elements for the sub areas for which the flag is set, and also update the list of free elements.
  • the method 200 is used for memory management (and memory allocation) in the memory system 102, and also ensures low wear-out, low memory footprint, and low memory scrubbing during bring-up in the one or more memory devices 106 as compared to the existing methods.
  • the method 200 comprises, receiving the indications and maintaining the meta data 112, which is further responsible for memory management (and memory allocation).
  • the memory area 110 is divided into the plurality of sub areas 110A to 110N, which are maintained through the meta data 112.
  • steps 202 to 208 are only illustrative, and other alternatives can also be provided where one or more steps are added, one or more steps are removed, or one or more steps are provided in a different sequence without departing from the scope of the claims herein.
  • a computer-readable media comprising instructions that when loaded into and executed by the controller 104 enables the controller 104 to execute the method 200.
  • the instructions are implemented on the computer-readable media which include, but is not limited to, Electrically Erasable Programmable Read-Only Memory (EEPROM), Random Access Memory (RAM), Read Only Memory (ROM), Hard Disk Drive (HDD), Flash memory, a Secure Digital (SD) card, Solid-State Drive (SSD), a computer readable storage medium, and/or CPU cache memory.
  • the instructions are generated by a computer program, which is implemented in view of the method 200, and for use in implementing the method 200 on the controller 104. FIG.
  • FIG. 3 is an illustration of a memory device, in accordance with an embodiment of the present disclosure.
  • FIG. 2 is described in conjunction with elements from FIG. 1.
  • FIG. 3 there is shown a memory device 300 of the memory system 102.
  • the memory device 300 is similar to the one or memory devices 106 of FIG. 1.
  • the memory device 300 includes the memory area 110.
  • the memory area 110 includes an array of 1024 entries (e.g., 0 to 1023), as shown in the FIG. 3.
  • the list of free elements 302 is also referred to as an offset list-head that includes references to the free elements of the plurality of sub areas 110A to 110N, such as for the sub area 110A, and for the sub area HOB.
  • the list of free elements 302 further includes a reference to a next free element in the sub area.
  • the list of free elements 302 further includes the reference that corresponds to the previous free element in the sub area, such as in the sub area 110A.
  • the references to the free elements are beneficial to provide updates to the controller 104 regarding allocation of the elements so that the controller 104 can perform the memory management and allocation.
  • the list of free elements 302 provides the reference of the element to be allocated is the first element in the list of free elements for the sub area 110A, which is indexed by the free table. In an example, the element to be allocated is always the first element.
  • the size of the indication of the size of elements of a sub area is 4, 8, 16, 32 bytes or in any of the ranges 2-8, 4 -16 or 8-32 bytes. Further, the size of the indication of number of free elements is 4, 8, 16, 32 bytes or in any of the ranges 2-8, 4 -16 or 8-32 bytes.
  • the size of the reference to a list of free elements in the sub area is 8, 16, 32, 64 bytes or in any of the ranges 4-16, 8 -32 or 16-64 bytes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A controller (104) to perform persistent memory management in a memory system (102) that includes one or more memory devices (106). The controller is configured to receive an indication of a plurality of sub areas (110A...110N) of a memory area (110), and maintain a meta data (112) for each sub area. The metadata includes an indication of a size of elements of a sub area, an indication of number of free elements, and a reference to a list of free elements in the sub area. The meta data is further used by the controller to allocate memory in the memory area. The controller is used to improve efficiency of the memory system such as through memory management. The controller provides an optimal solution, because the persistent memory is managed based on metadata that is updated regularly. Thus, provides efficient memory management.

Description

CONTROLLER AND METHOD TO PERFORM PERSISTENT MEMORY
MANAGEMENT IN A MEMORY SYSTEM
TECHNICAL FIELD
The present disclosure relates generally to the field of memory-level storage technologies and more specifically, to a controller and a method to perform persistent memory management, for example, an efficient persistent memory allocation, in a memory system.
BACKGROUND
Memory management plays a vital role in every computing system to perform more efficiently, for example, to allocate and de-allocate memory before and after process execution, to keep track of used memory space by processes, to maintain data integrity while executing of process, and minimize fragmentation issues, and proper utilization of memory resources, etc. The memory management is the task of allocating and freeing memory areas for different services and processes that are being performed on the computing system. The majority of the memory allocators and memory-management systems are volatile in nature due to which the allocated areas are wiped out upon power failure or shutdown. Therefore, persistent memory and persistent memory allocators are being used nowadays for memory management because of its non-volatile and byte-addressable characteristics. Persistent memory relies on the persistency of the allocated memory areas and is more efficient to handle memory allocations during failures or shutdowns.
Persistent memory being a new and emerging technology still poses various challenges in practice. These challenges may include memory wear-out, poor memory allocations, challenges in knowing when and how to efficiently perform freeing of allocated areas etc. Although there are several wear levelling mechanisms that provide varying levels of longevity enhancement in certain memory systems, however, the wear-out problem still exists, and the persistent memory eventually becomes worn-out. To address these challenges, various existing methods, memory systems, and memory allocators are developed. In one example, certain traditional memory allocators are designed with in-place data writes but are not suitable for the non-volatile main memory (NVRAM) due to the limited endurance. In another example, certain traditional wear- out aware memory allocators are based on redirecting of the data writes around to achieve wearlevelling to some extent and redesigning of a non-volatile memory (NVM) copy mechanism, bypassing the central processing unit (CPU) cache partially and prefetching data explicitly. Some existing methods and memory allocators use dynamic random-access memory (DRAM) to store traditional form of metadata for free space tracking so it is required to rebuild the volatile information from data memory area during each bring-up. However, storing this metadata in the DRAM (which is a volatile memory) has the downside that it needs to be rebuilt whenever the machine reboots or the file system is brought online. The existing memory allocators with DRAM faces another major challenge with regards to the flushing of data at the right time as it leaves CPU cache. Leaving CPU cache and redirecting writes leads to more wear-out, high memory footprint and heavy memory scrubbing forbring-up which are the major drawbacks of existing memory allocators using persistent memory.
SUMMARY
The present disclosure provides persistent memory management and memory allocation controller. The present disclosure provides a solution to the existing problem of how to improve the efficiency and effectiveness of persistent memory management and memory allocators while managing high wear-out, high memory footprint, and heavy memory scrubbing. An aim of the present disclosure is to provide a solution that overcome at least partially the problem encountered in prior art and provide an improved controller and method to efficiently and effectively perform persistent memory management and memory allocation while reducing wear-out, memory footprint, and memory scrubbing during bring-up as compared to existing memory systems.
One or more objectives of the present disclosure is achieved by the solutions provided in the enclosed independent claims. Advantageous implementations of the present disclosure are further defined in the dependent claims.
In one aspect, the present disclosure provides a controller configured to perform memory management in a memory system comprising one or more memory devices configured to store data. The one or more memory devices are persistent memory devices the controller being configured to receive indications of a plurality of sub areas of a memory area. The controller further configured to maintain meta data for each sub area. The meta data comprises an indication of the size of elements of a sub area, an indication of number of free elements and reference to a list of free elements in the sub area. The controller is further configured to allocate memory in the memory area based on the metadata.
The controller of the present disclosure ensures low wear-out, low memory footprint, and low memory scrubbing during bring-up in the one or more memory devices (or a persistent memory device) as compared to existing memory systems. By virtue of maintaining metadata for each sub area and allocating memory based on such metadata that indicates the size of elements, the number of free elements, and reference to the list of free elements in the sub area improves the memory allocation effectively and efficiently without the rebuild any volatile information from data memory area during each bring-up.
In an implementation form, the controller is further configured to receive an indication of the memory area, and to receive the indication of the sub areas by dividing the memory area into the plurality of sub areas.
In this implementation, the division of the memory area into the plurality of sub areas is accurate.
In a further implementation form, the list of free elements comprises references to free elements and for each free element a reference to a next free element in the sub area and a reference to a previous free element in the sub area.
Beneficially, the list of free elements and the reference to the previous free element in sub area makes the controller aware of an availability of the sub areas, thereby improving memory allocation.
In a further implementation form, the controller that is further configured to receive an allocation request indicating a processor. The controller is further configured to select an element to be allocated based on a free table corresponding to the indicated processor. The element to be allocated is the first element in the list of free elements for a sub area indexed by the free table. In this implementation, the free table corresponding to the indicated processor is used to select the element to be allocated, where the element to be allocated is the first element in the list of free elements.
In a further implementation form, the controller is further configured to decrease the corresponding free counter for the sub area of the element and then update the list of free elements indicating that the allocated element is no longer free after allocating the element.
By virtue of decreasing the corresponding free counter, the list of free elements is updated, which is further used to provide reference to the free elements that are available for further allocation upon reception of a next request for allocation of the element.
In a further implementation form, the present disclosure provides the controller is configured to receive a free request for an element to be freed. The controller is further configured to increase the corresponding free counter for the sub area of the element and insert a reference to the element to be freed in the list of free elements indicating that the freed element is free.
Beneficially, the insertion of the reference to the element to be freed indicates that the element is free and is available for further allocation, which further improves the efficiency of the memory system.
In a further implementation form, the present disclosure provides the controller configured to receive a request for reconstruction of a sub area and determine whether a first element in the list of free elements is a last allocated element and if so determine that a failure occurred during allocation. The controller is further configured to determine whether a last element in the list of free elements is a last freed element and if not determine that a failure occurred during freeing.
In this implementation, the controller is useful to efficiently handle failures.
In a further implementation form, the controller is configured to count the number of entries in the list of free elements and compare it to the indication of number of free elements, and if there is a mismatch, determine that the failure occurred during allocation or freeing.
By virtue of comparing the list of free elements with the indication of number of free elements, the controller can determine if the list of free elements is updated or not. The comparison of the list of free elements with the indication of number of free elements is also useful to determine reason of failures, such as if occurred during allocation or freeing. In a further implementation form, in response to determining that a failure occurred during freeing or allocating, determine that the sub area is not available for use.
In this implementation, the controller is aware about the non-availability of the corresponding sub area, which does not cause any functional misbehaviour in the memory system.
In an implementation form, the controller is further configured to receive the request for reconstruction of the sub area as part of a request for reconstruction of the memory area comprising the sub area, and in response to determining that a failure occurred during freeing or allocating, determine that the memory area is not available for use.
Beneficially, the determination of failure that occurred during freeing or allocation enables the controller to determine the availability of memory area and further reconstructing that memory area for further use.
In further implementation form, the controller is configured to set a flag for a sub area when an allocation or freeing is to be performed for that subarea and clear the flag for when the allocation or freeing is concluded, and count the number of entries in the list of free elements for sub areas for which the flag is set.
Beneficially, the flag prevents the controller from allocating or freeing of the sub area for which allocation or freeing is to be performed and also provides reference to the sub areas from plurality of sub areas that are not available for allocation.
In another aspect, the present disclosure provides a method for use in a controller configured to perform memory management in a memory system comprising one or more memory devices configured to store files. The one or more memory devices are persistent memory devices. The method for use in controller is further configured for receiving indications of a plurality of sub areas of a memory area and maintaining meta data for each sub area. The meta data comprises an indication of the size of elements of a sub area, an indication of number of free elements and reference to a list of free elements in the sub area. The method further comprises allocating memory in the memory area based on the metadata.
The method achieves all the advantages and technical effects of the controller of the present disclosure.
It is to be appreciated that all the aforementioned implementation forms can be combined. It has to be noted that all devices, elements, circuitry, units and means described in the present application could be implemented in the software or hardware elements or any kind of combination thereof. All steps which are performed by the various entities described in the present application as well as the functionalities described to be performed by the various entities are intended to mean that the respective entity is adapted to or configured to perform the respective steps and functionalities. Even if, in the following description of specific embodiments, a specific functionality or step to be performed by external entities is not reflected in the description of a specific detailed element of that entity which performs that specific step or functionality, it should be clear for a skilled person that these methods and functionalities can be implemented in respective software or hardware elements, or any kind of combination thereof. It will be appreciated that features of the present disclosure are susceptible to being combined in various combinations without departing from the scope of the present disclosure as defined by the appended claims.
Additional aspects, advantages, features and objects of the present disclosure would be made apparent from the drawings and the detailed description of the illustrative implementations construed in conjunction with the appended claims that follow.
BRIEF DESCRIPTION OF THE DRAWINGS
The summary above, as well as the following detailed description of illustrative embodiments, is better understood when read in conjunction with the appended drawings. For the purpose of illustrating the present disclosure, exemplary constructions of the disclosure are shown in the drawings. However, the present disclosure is not limited to specific methods and instrumentalities disclosed herein. Moreover, those in the art will understand that the drawings are not to scale. Wherever possible, like elements have been indicated by identical numbers.
Embodiments of the present disclosure will now be described, by way of example only, with reference to the following diagrams wherein:
FIG. 1 is a block diagram of a memory system, in accordance with an embodiment of the present disclosure; FIG. 2 is a flowchart of a method for use in a controller that is configured to perform memory management in a memory system, in accordance with an embodiment of the present disclosure; and
FIG.3 is an illustration of a memory device, in accordance with an embodiment of the present disclosure.
In the accompanying drawings, an underlined number is employed to represent an item over which the underlined number is positioned or an item to which the underlined number is adjacent. A non-underlined number relates to an item identified by a line linking the nonunderlined number to the item. When a number is non-underlined and accompanied by an associated arrow, the non-underlined number is used to identify a general item at which the arrow is pointing.
DETAILED DESCRIPTION OF EMBODIMENTS
The following detailed description illustrates embodiments of the present disclosure and ways in which they can be implemented. Although some modes of carrying out the present disclosure have been disclosed, those skilled in the art would recognize that other embodiments for carrying out or practicing the present disclosure are also possible.
FIG. l is a block diagram of a memory system, in accordance with an embodiment of the present disclosure. With reference to FIG. 1, there is shown a block diagram 100 of a memory system 102. The memory system 102 includes a controller 104, one or more memory devices 106, a network interface 108, and a meta data 112. The one or more memory devices 106 further includes a memory area 110. The memory area 110 is further divided into a plurality of sub areas 110A to 110N
The memory system 102 refers to a computer storage system that stores information (i.e., data such as data files or database files) in a storage medium, such as a storage disk. The memory system 102 includes the controller 104 to perform memory management and also to optimize the overall performance of the memory system 102. Examples of memory system 102 include, but are not limited to, a block storage system, a file storage system, an object storage system, or a combination thereof. The controller 104 includes suitable logic, circuitry, interfaces, and/or code that is configured to perform memory management (or a memory allocation process) in the memory system 102. Examples of implementation of the controller 104 may include but are not limited to a central data processing device, a microprocessor, a microcontroller, a complex instruction set computing (CISC) processor, an application-specific integrated circuit (ASIC) processor, a reduced instruction set (RISC) processor, a very long instruction word (VLIW) processor, a state machine, and other processors or control circuitry.
The one or more memory devices 106 includes suitable logic, circuitry, interfaces, and/or code that is configured to store data. The one or more memory devices 106 are persistent memory devices (structure). The persistent memory is non-volatile, solid-state high-performance byte- addressable memory device that resides on a memory bus. The persistent memory is an emerging technology in which a common memory is persisted upon power failures or shutdowns. The persistent memory and persistent-memory controllers rely on the persistency of the allocated memory areas and the reconstruction of the free areas on bring-up. Other examples of the one or more memory devices 106 include, but are not limited to, a solid-state drive (SSD) storage server, a block storage system, a file storage system, an object storage system, or a combination thereof.
The network interface 108 includes a hardware or a software that is configured to establish communication among the one or more memory devices 106, and also with the controller 104. Examples of network interface 108 may include but are not limited to, a computer port, a network socket, a network interface controller (NIC), and any other network interface device.
The memory area 110 refers to a smallest data segments that contains an information requested by a user. The memory area 110 includes the plurality of sub areas 110A to 110N. In an implementation, the memory area 110 corresponds to au info table that includes an array of different entries, for example in this case 1024 entries that are equal to 1 gigabyte (GB)/1 megabyte (MB), and the like. However, the au info table can include other possible numbers of entries without limiting the scope of the present disclosure. Further, each entry holds an information on a relevant sub area from the plurality of sub areas 110A to HON. In an example, the memory area 110 includes an array of 1024 entries. Moreover, the plurality of sub areas 110A to HON refers to sub-allocation units (or divisions) of the memory area 110. In an example, the size of each sub-area from the plurality of sub areas 110A to HON is 1 MB. The meta data 112 includes different information related to the memory area 110, and also related to elements of the plurality of sub areas 110A to 110N, such as related to free elements, and the like. In an implementation, the meta data 112 is stored in the one or more memory devices 106. However, the meta data 112 can be at other place, such as in a local memory, and the like. In an example, the meta data 112 may be stored in any form, such as a table, a file, a structure, in the form of arrays, and the like. In an example, the meta data 112 may include a number of free elements, size of elements, a reference of a next or a previous element, and the like.
In operation, the controller 104 is configured to perform memory management (or memory allocation) in a memory system 102. The controller 104 is used to improve efficiency of the memory system 102, such as through memory management (or persistent memory management). In an example, the memory management is a task to provide services to allocate and free the memory area 110. In addition, the controller 104 is configured to keep track of the memory area 110 (i.e., if allocated or free).
The controller 104 is further configured to receive indications of the plurality of sub areas 110A to HON of the memory area 110. The indications correspond to references for the meta data 112 that is maintained by the controller 104 to determine whether the sub area from the plurality of sub areas 110A to HON is free or allocated. In an example, the controller 104 is configured to receive internal indications from memory area 110. In another example, the controller 104 is configured to receive the indications from a subsequent division of the plurality of sub areas 110A to HON. Other options may also be possible to receive the indications by the controller 104 without limiting the scope of the present disclosure. For example, the external indications received from one or more devices such as from a central processing unit (CPU) of other memory devices. The indications further provide references to the plurality of sub areas 110A to HON and the size of each element that is stored in the plurality of sub areas 110A to HON. The indications are provided to the controller 104 to maintain, update and create the plurality of sub areas 110A to HON, and the references for the same.
In accordance with an embodiment, the controller 104 is further configured to receive an indication of the memory area 110, and also to receive the indication of the plurality of sub areas by dividing the memory area 110 into the plurality of sub areas 110A to HON. Firstly, the indication of the memory area 110 is received, and then the controller 104 is configured to divide the memory area 110 into the plurality of sub areas 110A to HON. Further, division of the memory area 110 into the plurality of sub areas 110A to 110N is used to allow for implementations where the plurality of sub areas 110A to 110N are generated and are provided to the controller 104. In an example, the indication received by the controller 104 includes an address of the memory area 110. Moreover, the indication of the memory area 110 is used by the controller 104 for memory management (or memory allocation) of the memory system 102. In an example, the indication received by the controller 104 includes the size of each sub area of the plurality of sub areas 110A to 11 ON, and a number of elements that are stored in each sub area. In another example, the indication may include reference of the memory area 110 for the plurality of sub areas 110A to 110N.
The controller 104 is further configured to maintain the meta data 112 for each sub area, and the meta data 112 includes an indication of the size of elements of a sub area. Firstly, the meta data 112 is generated, and then the meta data 112 is maintained by the controller 104, such as for later use and update (e.g., to allow to use of already generated tables/structures). The meta data 112 includes the indication (e.g., an integer value) of the size of the elements of each sub area, such as for the sub area 110A. In an example, the meta data 112 includes the indication of the size of the elements of the sub area 110A that are stored in a table form with different index values. In an example, the indication of the size of the elements may be an actual size of the elements of the sub area from the plurality of sub areas 110A to 110N. In another example, the indication can be an information/means which can be used by the controller 104 to calculate the actual size of the elements of the sub area. Further, the actual size of the element can be calculated from addresses of a start point to endpoints of the element of the sub area. In an example, the size of the element refers to as an element size that is an integer value and is used to represent the element size, which is held by each sub area from the plurality of sub areas 110A to 110N
In accordance with an embodiment, the size of the indication of the size of the elements of the sub area is 4, 8, 16, 32 bytes or in any of the ranges 2-8, 4-16, or 8-32 bytes. In an implementation, the size of the indication of the size of the elements of the sub area varies as per division of the memory area 110 and the one or more memory devices 106 that is also maintained by the controller 104 in the form of meta data 112. In an example, the size of the indication of the size of the elements of the sub area 110A is 4 bytes, 8 bytes, 16 bytes, or 32 bytes. In another example, the size of the indication of the size of the elements of the sub area ranges from 2 bytes to 8 bytes, 4 bytes to 16 bytes, or 8 bytes to 32 bytes. Moreover, the size of the indication of the size of the elements of the sub area can have other possible values without limiting the scope of the disclosure. By virtue of using different values for the size of the indication, the controller 104 can perform the memory management with less memory consumption in the memory system 102.
The meta data 112 further includes an indication of a number of free elements. In other words, the meta data 112 includes the indication of the number of free elements in the plurality of sub areas 110A to 110N. The free elements are useful for memory allocation purposes in the memory system 102. In an example, a free count integer is used as a counter to provide the indication of the number of free elements within the plurality of sub areas 110A to 110N (e.g., by a number of counts).
In accordance with an embodiment, the size of the indication of the number of free elements is 4, 8, 16, 32 bytes or in any of the ranges 2-8, 4 -16, or 8-32 bytes. In an implementation, the size of the indication of the number of free elements varies as per division of the memory area 110 and the one or more memory devices 106 that are maintained by the controller 104 in the form of the meta data 112. In an example, the size of the indication of the number of free elements is 4 bytes, 8 bytes, 16 bytes, or 32 bytes. In another example, the size of the indication of the number of free elements ranges from 2 bytes to 8 bytes, 4 bytes to 16 bytes, or 8 bytes to 32 bytes. However, the size of the indication of the number of free elements can have other values without limiting the scope of the disclosure.
The meta data 112 further includes reference to a list of free elements in the sub area. The reference to the list of free elements in the sub area from the plurality of sub areas 110A to HON provides access to already generated tables to update, generate use tables/structures. In an example, such a table includes free count, element size, and offset list-head to provide reference of the sub area from the plurality of sub areas 110A to HON.
In accordance with an embodiment, the list of the free elements further includes references to the free elements and for each free element a reference to a next free element in the sub area, and includes a reference to a previous free element in the sub area. In an example, the list of free elements that includes the references to the free elements is represented by an offset list head (e.g., of 16 bytes). Moreover, for each free element, the list of free elements includes the reference that corresponds to the next free element in the sub area. For example, the list of free elements includes a next reference (e.g., of 8 bytes) that corresponds to the next free element in the sub area 110A. In addition, for each free element, the list of free elements further includes the reference that corresponds to the previous free element in the sub area. For example, the list of free elements includes a previous reference (e.g., of 8 bytes) that corresponds to the previous free element in the sub area 110A. The references to the free elements are beneficial to provide updates to the controller 104 regarding allocation of the element so that the memory management and allocation can be efficiently controlled by the controller 104.
In accordance with an embodiment, the size of the reference to the list of free elements in the sub area is 8, 16, 32, 64 bytes or in any of the ranges 4-16 or 8-32, or 16-64 bytes. In an implementation, the size of the reference to the list of free elements varies as per division of the memory area 110 and the one or more memory devices 106 that are maintained by the controller 104 in the form of meta data 112. For example, the size of the reference to the list of free elements in the sub area 110A is 4 bytes, 8 bytes, 16 bytes, or 32 bytes. In another example, the size of the reference to the list of free elements in the sub area 110A ranges from 4 bytes to 16 bytes or 8 bytes to 32 bytes or 16 bytes to 64 bytes. Moreover, the size of the reference to the list of free elements can have other values without limiting the scope of the disclosure. The variation in size makes memory management with less memory consumption in the memory system 102.
In accordance with an embodiment, the controller 104 is further configured to receive an allocation request indicating a processor, and select an element to be allocated based on a free table corresponding to the indicated processor. Further, the element to be allocated is the first element in the list of free elements for the sub area indexed by the free table. In an implementation, the allocation request received by the controller 104 indicates the processor, for example, a central processing unit (CPU), and the like. In an example, the allocation request indicates an identification (ID) number (or a number) that corresponds to the processor, such as to a first processor, a second processor, a third processor, and the like. Moreover, the allocation request includes a reference of the element that is to be allocated from the plurality of sub areas 110A to 110N. Thereafter, the controller 104 is configured to select the element to be allocated based on the free table that corresponds to the indicated processor. In an implementation, the element to be allocated is always the first element in the list of free elements in the sub area. Moreover, the first element is further indexed by the free table of the meta data 112. For example, the allocation request running on the third processor will firstly try free table number three, and the like. Further, the first element can be pointed by the list of free elements (or offset list-head) from the plurality of sub areas 110A to 110N. The controller 104 is further configured to allocate memory in the memory area 110 based on the meta data 112. In other words, allocation of the memory in the memory area 110 is performed based on the meta data 112 that is maintained by the controller 104. In an implementation, the reference to the list of free elements in the sub area includes different entries, and each entry is of 32 bytes (e.g., 2 entries per cache line). However, each entry can have different possible values without limiting the scope of the present disclosure. Moreover, the allocation of the memory in the memory area 110 includes allocation of the free elements in the plurality of sub areas 110A to HON. In an example, the entries in the list of free elements are also updated on every allocation and freeing of the element in plurality of sub areas 110A to HON. As a result, there exists an updated list of the free elements that are available for further allocation. Therefore, the controller 104 provides an efficient and low footprint process for memory management (and memory allocation), and also lower down wear out rate of the memory area 110 in the memory system 102. In addition, the controller 104 may rely on an extended alternative dispute resolution (eADR) to avoid cache line flush (CLFLUSH) instructions and persistency points. In an example, the eADR refers to a mechanism of eliminating the need to wait for flushes to finish and to flush data with temporal locality. The eADR also provides a low foot-print and easy programming model.
In accordance with an embodiment, the controller 104 is further configured to decrease the corresponding free counter for the sub area of the element, and update the list of free elements indicates that the allocated element is no longer free, after allocating the element. In other words, as the element in the list of free elements is allocated to the indicated processor, thus the number of free elements will be decreased. As a result, the controller 104 is configured to decrease the corresponding free counter (e.g., the free count integer) for the sub area of the corresponding element. Moreover, the decrease in the free counter for the sub area of the element indicates that the element is allocated from the list of free elements and thus, the number of free elements is reduced in the sub area. Thereafter, the controller is configured to update the list of free elements, which indicates that the allocated element is no longer free. In an example, the controller 104 will update a previous pointer of a next free element of the list of free elements. In another example, the controller 104 will also update a next pointer of the list of free elements. Therefore, the updated list of the free elements provides a reference to the free elements that are available for further allocation upon reception of the next request for allocation of the element. In an implementation, the controller 104 is configured to select the indexing in the free table based on an element size indicated by the allocation request. For example, if there exists a table of 8 entries one for each element size (e.g., 256B, 512B, 1KB, up to 16KB). Then the controller 104 is configured to select the indexing in the free table based on the element size that is indicated by the allocation request. In an example, the indexing in the free table of the sub area for new allocations is done in 0(1) time.
In accordance with an embodiment, the controller 104 is further configured to receive a free request for an element to be freed, increase the corresponding free counter for the sub area of the element, and then insert a reference to the element to be freed in the list of free elements indicating that the freed element is free. Firstly, the controller 104 is configured to use size of the element (i.e., element size) of its associated sub area (e.g., 1MB sub-allocation unit) to determine the element-size hold by the corresponding sub area from the plurality of sub areas 110A to 110N. For example, the controller 104 is configured to determine the element-size hold by the sub area 110A. Thereafter, the controller 104 is configured to receive the free request for the element that is to be freed. After that, the controller 104 updates the free counter for the sub area of the element (or the free count integer) in the list of free elements. In addition, the controller 104, increases the corresponding free counter for the sub area 110A of the element. For example, the controller 104 increases the free count integer for the sub area 110A of the element. The increase in the free counter indicates that the element is now freed and the number of free elements is increased. In an example, the corresponding free counter is increased as per the number of free requests received by the controller 104 for the elements to be freed. Thereafter, the controller 104 inserts the reference of the element to be freed in the list of free elements to indicate which element is free. In an example, the reference is inserted by setting (or updating) a previous pointer and a next pointer at the element that is freed in the list of free elements. In another example, the reference is inserted by setting the previous pointer at a next element that is freed in the list of free elements. In yet another example, the reference is inserted by setting the next pointer at a previous element that is freed in the list of free elements. As a result, the element that is freed in the list of free elements will become the last element in the list of free elements which is pointed by the index of the corresponding sub area. Therefore, the insertion of the reference to the element to be freed is beneficial to indicate that the element is free and is available for further allocation (e.g., based on another allocation request).
In an implementation, if the free count integer reaches the element size (i.e., 1 MB) of the corresponding sub area, then the element in the corresponding sub area is freed. In addition, the element in the corresponding sub area is also marked as not allocated, which can be a bit away from a high bit of the size of the element (or element size integer).
In an implementation, the controller 104 is further configured to receive the request for reconstruction of the sub area as part of a request for reconstruction of the memory area 110 comprising the sub area. The controller 104 is further configured to determine whether a first element in the list of free elements is a last allocated element and if so determine that a failure occurred during allocation, or determine whether a last element in the list of free elements is a last freed element and if not determine that a failure occurred during freeing. The controller 104 determines the entries of the memory area 110 (or au info table entries). Moreover, for each entry of the memory area 110, the allocated element is always the first element pointed by the list of free elements (or an offset list-head), and the last freed element is inserted in last. In an implementation, the controller 104 is configured to determine if a next element and a previous element from the list of free elements point back to the free element and if not, then the failure occurred during allocation or freeing. In other words, the controller 104 is configured to determine whether the failure occurred during the allocation of the element or during the freeing of the element. For example, if the first element in the list of free elements is the last allocated element, then the failure occurred during the allocation of the element. However, if the last element in the list of free elements is not the last freed element, then the failure occurred during the freeing of the element. Moreover, the controller 104 receives the request for the reconstruction of the sub area as part of the request for the reconstruction of the memory area 110. Beneficially, as compared to the conventional approach, the controller 104 is useful to efficiently handle failures that occurred either during freeing or during allocation.
In an implementation, the controller 104 is further configured to count the number of entries in the list of free elements, and compare it to the indication of the number of free elements, and if there is a mismatch, then determine that the failure occurred during allocation or freeing. Firstly, the controller 104 is configured to check and confirm if the free counter for the sub area of the element is correct. Thereafter, the controller 104 is configured to traverse the list of free elements to count the number of entries in the list of free elements and also to compare the list of free elements with the indication of the number of free elements (e.g., with a free count integer). After that, the controller 104 determines whether the list of free elements is updated or not. Moreover, the comparison of the list of free elements with the indication of the number of free elements is also useful to determine the reason for failures, such as if occurred during allocation or freeing. In an implementation, if the failure occurred during the allocation of the element, then the controller 104 is configured to update the free counter in the sub area and bring the controller 104 back to the pre-allocation status. In addition, the controller 104 is configured to traverse the list of free elements and find the free element that points to the first free element. In an example, the first free element points to a second free element, and the second free element points back to the list of free elements. However, if the failure occurred after freeing the allocation of the element, then the controller 104 is configured to update the free counter in the sub area.
In an implementation, the controller 104 is further configured to determine the failure, and, in response to determining that the failure occurred during freeing or allocating, determine that the subarea is not available for use. Firstly, the controller 104 is configured to determine whether the failure occurred during the freeing of the element or during the allocation of the element. Thereafter, the controller 104 is configured to determine that whether the subarea is not available for use. If the sub area is not available for use, then the sub area cannot be linked to the memory area 110, and also cannot be allocated, because the corresponding sub area is now out of the list of free elements. Beneficially as compared to the conventional approach, the corresponding sub area that is not available for use will not cause any functional misbehaviour in the memory system 102.
In an implementation, the controller 104 is further configured to receive a request for reconstruction of a sub area as part of a request for the reconstruction of the memory area 110 includes the sub area. Further, in response to determine that a failure occurred during freeing or allocating, and determine that the memory area 110 is not available for use. Firstly, the controller 104 is configured to determine whether the failure occurred during freeing of the element or during allocating the element. After that the controller 104 determines that the memory area is not available for use. The controller 104 further receives the request for the reconstruction of the sub area. In an example, the request for reconstruction of the sub area is an internal request, that is received after detection of the failure. Moreover, the request for the reconstruction of the memory area includes the sub area that needs to be reconstructed. Beneficially as compared to the conventional approach, the determination of failure that occurred during freeing or allocation enables the controller 104 to determine the availability of memory area 110 and further reconstruction of the memory area 110 for further use. In an implementation, the controller 104 is further configured to set a flag for a sub area when an allocation or freeing is to be performed for that sub area and clear the flag for when the allocation or freeing is concluded. The controller 104 further counts the number of entries in the list of free elements for sub areas for which the flag is set. In an implementation, the flag (e.g., a lock) represents that allocation or freeing of the element in the sub area from the plurality of sub areas 110A to 110N is under process. As a result, the flag informs the controller 104 that no other task can be performed for the corresponding sub area for which the flag is set. Beneficially, it prevents the controller 104 from allocating or freeing the sub area for which allocation or freeing is to be performed. Moreover, if the element for the corresponding sub area is allocated (or freed), then the controller 104 is configured to clear the flag, which represents that the allocation or freeing of the element of the corresponding sub area is performed (or completed). After that, the controller 104 is configured to count the number of entries in the list of free elements for the sub area for which the flag is set, and also update the list of free elements. Beneficially, the flag not only provides information about allocation or freeing of the sub area but also provides a reference to the sub areas from the plurality of sub areas 110A to 110N that are not available for allocation or freeing.
In an implementation, the flag is set through a lock per entry in each of the free-tables. Thus, on each allocation request, the controller 104 will try to trylock the relevant lock of an entry of the list of free elements (or free table). In an example, if the trylock is successful, then the controller will go to the sub area that is indexed by the entry, and then allocate the element pointed by the entry in the sub area. Further, in case if the sub area is empty, then the controller 104 will go to the memory area 110 (or the au info table) to search for an already assigned and partially allocated sub area of a desired size that is not referenced by other entries in the list of free elements. Thereafter, the memory area 110 is also protected by the lock. However, if the trylock is failed, then the controller 104 will try to trylock the same entry of the list of free elements (or a next free-table) and allocate the element from the list of free elements. In an example, if the controller 104 couldn't lock any free-table, then the controller 104 will start all over, but this time by locking the lock.
The controller 104 provides an advanced feature for memory management (and memory allocation) and also ensures low wear-out, low memory footprint, and low memory scrubbing during bring-up in the one or more memory devices 106 as compared to existing memory systems. The controller 104 is configured to receive the indications, and maintain the meta data 112, which is further responsible for memory management. By virtue of maintaining the meta data 112 for each sub area and allocating the memory area 110 based on the meta data 112 that indicates the size of elements, the number of free elements, and reference to the list of free elements in the sub area improves the memory allocation effectively and efficiently without rebuilding any volatile information from data memory area during each bring-up.
FIG. 2 is a flowchart of a method for use in a controller that is configured to perform memory management in a memory system, in accordance with an embodiment of the present disclosure. FIG. 2 is described in conjunction with elements from FIG. 1. With reference to FIG. 2, there is shown a flowchart of a method 200 for use in the controller 104 that is configured to perform memory management in the memory system 102. The method 200 includes steps 202 to 206.
There is provided the method 200 for use in the controller 104 that is configured to perform memory management (or memory allocation) in the memory system 102. The method 200 is used to improve the efficiency of the memory system 102, such as through memory management (or persistent memory management. The controller 104 is configured to keep track of which the memory area 110.
At step 202, the method 200 includes, receiving indications of the plurality of sub areas 110A to 110N of the memory area 110. The indications corresponding to references for the meta data 112 that is maintained by the controller 104 to determine whether the sub area from the plurality of sub areas 110A to 110N is free or allocated. The indications are provided to the controller 104 to maintain, update and create the sub area and a reference for the same. The indications further provide references to the plurality of sub areas 110A to 11 ON and the size of each element that is stored in the plurality of sub areas 110A to 110N.
In accordance with an embodiment, the method 200 comprises, receiving an indication of the memory area 110, and also receiving the indication of the plurality of sub areas by dividing the memory area 110 into the plurality of sub areas 110A to 110N. Firstly, the indication of the memory area 110 is received, and then the controller 104 is configured to divide the memory area 110 into the plurality of sub areas 110A to 110N. Further, division of the memory area 110 into the plurality of sub areas 110A to 110N is used to allow for implementations where the plurality of sub areas 110A to 110N are generated and are provided to the controller 104.
At step 204, the method 200 includes, maintaining the meta data 112 for each sub area. Firstly, the meta data 112 is generated, and then the meta data 112 is maintained by the controller 104, such as for later use and update (e.g., to allow to use of already generated tables/structures).
The step 204 further includes three other steps, such as the step 204A, 204B, and 204C.
At step 204A, the method 200 comprises, including an indication of the size of elements of a sub area. The meta data 112 includes the indication (e.g., an integer value) of the size of the elements of the sub area, such as for the sub area 110A. In an example, the indication of the size of the elements may be the actual size of the elements of the sub area from the plurality of sub areas 110A to 110N.
At step 204B, the method 200 comprises, including an indication of a number of free elements. The free elements can be allocated for memory allocation purposes in the memory system 102. In an example, a free count integer is used to provide the indication of the number of free elements within the plurality of sub areas 110A to 110N.
At step 204C, the method 200 comprises, including reference to a list of free elements in the sub area. The reference of the list of free elements in the sub area 110A provides an access to already generated tables to update, generate and use tables/structures.
In accordance with an embodiment, the method 200 comprises, receiving an allocation request indicating a processor, and selecting an element to be allocated based on a free table corresponding to the indicated processor. Further, the element to be allocated is the first element in the list of free elements for a sub area indexed by the free table. In an implementation, the allocation request received by the controller 104 indicates the processor. Moreover, the allocation request includes a reference of the element that is to be allocated from the plurality of sub areas 110A to 110N. Thereafter, the controller 104 is configured to select the element to be allocated based on the free table that corresponds to the indicated processor. In an implementation, the element to be allocated is always the first element in the list of free elements in the sub area. Moreover, the first element is indexed by the free table of the meta data 112.
At step 206, the method 200 includes, allocating memory in the memory area 110 based on the meta data 112. Allocation of memory n the memory area 110 is performed based on the meta data 112 that is maintained by the controller 104. The method 200 provides an efficient and low footprint process for memory management and memory allocation, and also lower down wear out rate of the memory area 110 in the memory system 102. In an implementation, the method 200 further comprises, selecting the indexing in the free table based on an element size indicated by the allocation request. For example, if there exists a table of 8 entries one for each element size (e.g., 256B, 512B, 1KB, up to 16KB). Then the method 200 includes selecting the indexing in the free table based on the element size that is indicated by the allocation request.
In accordance with an embodiment, the method 200 further comprises, receiving a free request for an element to be freed, increasing the corresponding free counter for the sub area of the element, and then inserting a reference to the element to be freed in the list of free elements indicating that the freed element is free. Firstly, the method 200 comprises using size of the element of its associated sub area for determining the element-size that is hold by the corresponding sub area from the plurality of sub areas 110A to 110N. Thereafter, the method 200 comprises receiving the free request for the element that is to be freed. After that, the method 200 comprises updating the free counter for the sub area of the element in the list of free elements. In addition, increasing the corresponding free counter for the sub area 110A of the element. The increase in the free counter indicates that the element is now freed and the number of free elements is increased. Thereafter, the method 200 comprises inserting the reference of the element to be freed in the list of free elements to indicate that the freed element is free. As a result, the element that is freed in the list of free elements will become the last element in the list of free elements which is pointed by the index of the corresponding sub area. The insertion of the reference to the element to be freed is beneficial to indicate that the element is free and is available for further allocation (e.g., based on another allocation request).
In an implementation, the method 200 further comprises, receiving the request for the reconstruction of the sub area as part of a request for the reconstruction of the memory area 110 comprising the sub area. The method 200 further comprises determining whether a first element in the list of free elements is a last allocated element and if so determine that a failure occurred during allocation, or determining whether a last element in the list of free elements is a last freed element and if not determine that a failure occurred during freeing. Firstly, the method 200 comprises, determining the entries of the memory area 110. Moreover, for each entry of the memory area 110, the allocated element is always the first element pointed by the list of fee elements (or an offset list-head), and the freed element is inserted in last. The method 200 further includes determining whether the failure occurred during the allocation of the element or during the freeing of the element. Moreover, the method 200 comprises, receiving the request for the reconstruction of the sub area as part of the request for the reconstruction of the memory area 110
In an implementation, the method 200 further comprises, counting the number of entries in the list of free elements, and comparing it to the indication of the number of free elements, and if there is a mismatch, then determining that the failure occurred during allocation or freeing. In an implementation, the method 200 comprises using the controller 104 to traverse the list of free elements to count the number of entries in the list of free elements and also to compare the list of free elements with the indication of the number of free elements After that, the controller 104 determines whether the list of free elements is updated or not, and also determines if the failure occurred during allocation or freeing.
In an implementation, the method 200 further comprises, determining the failure, and, in response to determining that the failure occurred during freeing or allocating, determining that the subarea is not available for use. Firstly, the method 200 comprises using the controller 104 for determining whether the failure occurred during freeing of the element or during the allocation of the element. Thereafter, the controller 104 is configured to determine that the subarea is not available for use. Beneficially, the corresponding sub area that is not available for use will not cause any functional misbehaviour in the memory system 102.
In an implementation, the method 200 further comprises, receiving a request for reconstruction of a sub area as part of a request for reconstruction of the memory area 110 includes the sub area. Further, in response to determining that a failure occurred during freeing or allocating, and determine that the memory area 110 is not available for use. Firstly, the method 200 comprises using the controller 104 determining whether the failure occurred during freeing of the element or during allocating the element. After that the controller 104 determines that the memory area is not available for use. The controller 104 further receives the request for the reconstruction of the sub area. Moreover, the request for the reconstruction of the memory area includes the sub area that needs to be reconstructed.
In an implementation, the method 200 further comprises, setting a flag for a sub area when an allocation or freeing is to be performed for that sub area and clearing the flag when the allocation or freeing is concluded. The method 200 further comprises, counting the number of entries in the list of free elements for sub areas for which the flag is set. In an implementation, the flag represents that allocation or freeing of the element is under process in the sub area from the plurality of sub areas 110A to 110N. As a result, the flag informs the controller 104 that no other task can be performed for the corresponding sub area for which the flag is set. Beneficially, the method 200 prevents the controller 104 from allocating or freeing the sub area for which allocation or freeing is to be performed. Moreover, if the element for the corresponding sub area is allocated (or freed), then the controller 104 is configured to clear the flag, which represents that the allocation or freeing of the element of the corresponding sub area is performed. After that, the controller 104 is configured to count the number of entries in the list of free elements for the sub areas for which the flag is set, and also update the list of free elements.
The method 200 is used for memory management (and memory allocation) in the memory system 102, and also ensures low wear-out, low memory footprint, and low memory scrubbing during bring-up in the one or more memory devices 106 as compared to the existing methods. The method 200 comprises, receiving the indications and maintaining the meta data 112, which is further responsible for memory management (and memory allocation). Moreover, the memory area 110 is divided into the plurality of sub areas 110A to 110N, which are maintained through the meta data 112. By virtue of maintaining the meta data 112 for each sub area and allocating the memory area 110 based on the meta data 112 that indicates the size of elements, the number of free elements, and reference to the list of free elements in the sub area improves the memory allocation effectively and efficiently without the rebuild any volatile information from data memory area during each bring-up.
The steps 202 to 208 are only illustrative, and other alternatives can also be provided where one or more steps are added, one or more steps are removed, or one or more steps are provided in a different sequence without departing from the scope of the claims herein.
There is further provided a computer-readable media comprising instructions that when loaded into and executed by the controller 104 enables the controller 104 to execute the method 200. In an example, the instructions are implemented on the computer-readable media which include, but is not limited to, Electrically Erasable Programmable Read-Only Memory (EEPROM), Random Access Memory (RAM), Read Only Memory (ROM), Hard Disk Drive (HDD), Flash memory, a Secure Digital (SD) card, Solid-State Drive (SSD), a computer readable storage medium, and/or CPU cache memory. In an example, the instructions are generated by a computer program, which is implemented in view of the method 200, and for use in implementing the method 200 on the controller 104. FIG. 3 is an illustration of a memory device, in accordance with an embodiment of the present disclosure. FIG. 2 is described in conjunction with elements from FIG. 1. With reference to FIG. 3, there is shown a memory device 300 of the memory system 102. The memory device 300 is similar to the one or memory devices 106 of FIG. 1. There is further shown a list of free elements 302, the memory area 110, the sub area 110A, and the sub area HOB.
The memory device 300 includes the memory area 110. In an example, the memory area 110 includes an array of 1024 entries (e.g., 0 to 1023), as shown in the FIG. 3. The list of free elements 302 is also referred to as an offset list-head that includes references to the free elements of the plurality of sub areas 110A to 110N, such as for the sub area 110A, and for the sub area HOB. Moreover, for each free element, the list of free elements 302 further includes a reference to a next free element in the sub area. In addition, for each free element, the list of free elements 302 further includes the reference that corresponds to the previous free element in the sub area, such as in the sub area 110A. The references to the free elements are beneficial to provide updates to the controller 104 regarding allocation of the elements so that the controller 104 can perform the memory management and allocation. In an implementation, the list of free elements 302 provides the reference of the element to be allocated is the first element in the list of free elements for the sub area 110A, which is indexed by the free table. In an example, the element to be allocated is always the first element. In an implementation, the size of the indication of the size of elements of a sub area is 4, 8, 16, 32 bytes or in any of the ranges 2-8, 4 -16 or 8-32 bytes. Further, the size of the indication of number of free elements is 4, 8, 16, 32 bytes or in any of the ranges 2-8, 4 -16 or 8-32 bytes. Moreover, the size of the reference to a list of free elements in the sub area is 8, 16, 32, 64 bytes or in any of the ranges 4-16, 8 -32 or 16-64 bytes.
Modifications to embodiments of the present disclosure described in the foregoing are possible without departing from the scope of the present disclosure as defined by the accompanying claims. Expressions such as "including", "comprising", "incorporating", "have", "is" used to describe and claim the present disclosure are intended to be construed in a non-exclusive manner, namely allowing for items, components or elements not explicitly described also to be present. Reference to the singular is also to be construed to relate to the plural. The word "exemplary" is used herein to mean "serving as an example, instance or illustration". Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments or to exclude the incorporation of features from other embodiments. The word "optionally" is used herein to mean "is provided in some embodiments and not provided in other embodiments". It is appreciated that certain features of the present disclosure, which are, for clarity, described in the context of separate embodiments, may also be provided in combination in a single embodiment. Conversely, various features of the present disclosure, which are, for brevity, described in the context of a single embodiment, may also be provided separately or in any suitable combination or as suitable in any other described embodiment of the disclosure.

Claims

1. A controller (104) configured to perform memory management in a memory system (102) comprising one or more memory devices (106) configured to store data, wherein the one or more memory devices (106) are persistent memory devices the controller (104) being configured to: receive indications of a plurality of sub areas (110A to 110N) of a memory area (110); maintain meta data (112) for each sub area, the meta data (112) comprising: an indication of the size of elements of a sub area; an indication of number of free elements; and reference to a list of free elements (302) in the sub area, wherein the controller (104) is configured to allocate memory in the memory area (110) based on the meta data (112).
2. The controller (104) according to claim 1, wherein the controller (104) is further configured to receive an indication of the memory area (110), and to receive the indication of the plurality of sub areas (110A to 110N) by dividing the memory area (110) into the plurality of sub areas (110A to 110N).
3. The controller (104) according to claim 1 or 2, wherein the list of free elements (302) comprises references to free elements and for each free element a reference to a next free element in the sub area and a reference to a previous free element in the sub area.
4. The controller (104) according to any of claims 1, 2 or 3, wherein the size of the indication of the size of elements of a sub area is 4, 8, 16, 32 Bytes or in any of the ranges 2-8, 4 -16 or 8-32 Bytes; the size of the indication of number of free elements is 4, 8, 16, 32 Bytes or in any of the ranges 2-8, 4 -16 or 8-32 Bytes; and the size of the reference to a list of free elements in the sub area is 8, 16, 32, 64 Bytes or in any of the ranges 4-16, 8 -32 or 16-64 Bytes.
25
5. The controller (104) according to any preceding claim, wherein the controller (104) is further configured to: receive an allocation request, the allocation request indicating a processor; select an element to be allocated based on a free table corresponding to the indicated processor, wherein the element to be allocated is the first element in the list of free elements (302) for a sub area indexed by the free table.
6. The controller (104) according to claim 5, wherein the controller (104) is further configured to decrease the corresponding free counter for the sub area of the element and then update the list of free elements (302) indicating that the allocated element is no longer free, after allocating the element.
7. The controller (104) according to claim 5 or 6, wherein the controller (104) is further configured to select the indexing in the free table based on an element size indicated by the allocation request.
8. The controller (104) according to any preceding claim, wherein the controller (104) is further configured to: receive a free request for an element to be freed; increase the corresponding free counter for the sub area of the element; and then insert a reference to the element to be freed in the list of free elements indicating that the freed element is free.
9. The controller (104) according to any preceding claim, wherein the controller (104) is further configured to: receive a request for reconstruction of a sub area and in response thereto determine whether a first element in the list of free elements is a last allocated element and if so determine that a failure occurred during allocation; or determine whether a last element in the list of free elements is a last freed element and if not determine that a failure occurred during freeing. 0. The controller (104) according to claim 9, wherein the controller (104) is further configured to count the number of entries in the list of free elements and compare it to the indication of number of free elements, and if there is a mismatch, determine that the failure occurred during allocation or freeing. 1. The controller (104) according to any of claims 9 or 10, wherein the controller (104) is further configured to, in response to determining that a failure occurred during freeing or allocating, determine that the subarea is not available for use. 2. The controller (104) according to any of claims 9 - 11, wherein the controller (104) is further configured to receive the request for reconstruction of the sub area as part of a request for reconstruction of the memory area (110) comprising the sub area, and in response to determining that a failure occurred during freeing or allocating, determine that the memory area (110) is not available for use. 3. The controller (104) according to claims 12 and 10, wherein the controller (104) is further configured to set a flag for a sub area when an allocation or freeing is to be performed for that subarea and clear the flag for when the allocation or freeing is concluded, and count the number of entries in the list of free elements (302) for the plurality of sub areas (110A to 110N) for which the flag is set. 4. A method (200) for use in a controller (104) configured to perform memory management in a memory system (102) comprising one or more memory devices (106) configured to store files, wherein the one or more memory devices (106) are persistent memory devices, the method (200) comprising: receiving indications of a plurality of sub areas (110A-110N) of a memory area (110); and maintaining meta data (112) for each sub area, the meta data (112) comprising: an indication of the size of elements of a sub area; an indication of number of free elements; and reference to a list of free elements in the sub area, wherein the method (200) further comprises allocating memory in the memory area (110) based on the meta data (112).
15. A computer-readable media comprising instructions that when loaded into and executed by a controller (104) enables the controller (104) to execute the method (200) according to claim 14.
28
PCT/EP2021/081914 2021-11-17 2021-11-17 Controller and method to perform persistent memory management in a memory system WO2023088546A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/EP2021/081914 WO2023088546A1 (en) 2021-11-17 2021-11-17 Controller and method to perform persistent memory management in a memory system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/EP2021/081914 WO2023088546A1 (en) 2021-11-17 2021-11-17 Controller and method to perform persistent memory management in a memory system

Publications (1)

Publication Number Publication Date
WO2023088546A1 true WO2023088546A1 (en) 2023-05-25

Family

ID=78790028

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/EP2021/081914 WO2023088546A1 (en) 2021-11-17 2021-11-17 Controller and method to perform persistent memory management in a memory system

Country Status (1)

Country Link
WO (1) WO2023088546A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017103751A1 (en) * 2015-12-18 2017-06-22 International Business Machines Corporation Recovery of multi-page failures in non-volatile memory system
US20180336140A1 (en) * 2017-05-17 2018-11-22 Samsung Electronics Co., Ltd. Method and system for flash-aware heap memory management
CN113050886A (en) * 2021-02-23 2021-06-29 山东师范大学 Nonvolatile memory storage method and system for embedded memory database

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017103751A1 (en) * 2015-12-18 2017-06-22 International Business Machines Corporation Recovery of multi-page failures in non-volatile memory system
US20180336140A1 (en) * 2017-05-17 2018-11-22 Samsung Electronics Co., Ltd. Method and system for flash-aware heap memory management
CN113050886A (en) * 2021-02-23 2021-06-29 山东师范大学 Nonvolatile memory storage method and system for embedded memory database

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WENTAO CAI ET AL: "Understanding and Optimizing Persistent Memory Allocation", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 14 March 2020 (2020-03-14), XP081621639 *

Similar Documents

Publication Publication Date Title
US10909030B2 (en) Enhanced trim command support for solid state drives
US9471500B2 (en) Bucketized multi-index low-memory data structures
EP2389631B1 (en) Solid state memory formatting
EP2530612B1 (en) Mount-time unmapping of unused logical addresses in non-volatile memory systems
KR101385789B1 (en) Non-volatile temporary data handling
US11237742B2 (en) Apparatus and method for controlling data stored in memory system
US20140372675A1 (en) Information processing apparatus, control circuit, and control method
JP2016506585A (en) Method and system for data storage
US11797435B2 (en) Zone based reconstruction of logical to physical address translation map
US11301331B2 (en) Storage device and operating method of storage device
US20240143219A1 (en) Software-hardware combination method for internal mapping address query of zoned namespace
US10198352B2 (en) Efficient pointer swizzling for persistent objects
US11797207B2 (en) Base and compressed difference data deduplication
WO2023088546A1 (en) Controller and method to perform persistent memory management in a memory system
US11055184B2 (en) In-place garbage collection of a sharded, replicated distributed state machine based on supersedable operations
CN107562654B (en) IO command processing method and device
CN107562639B (en) Erase block read request processing method and device
US11580018B2 (en) Method and apparatus for page validity management and related storage system
US11226738B2 (en) Electronic device and data compression method thereof
CN112947863B (en) Method for combining storage spaces under Feiteng server platform
CN118119931A (en) Controller and method for performing persistent memory management in a storage system
Liang et al. Mismatched memory management of android smartphones
CN108334276B (en) Dynamic data alignment method of flash memory
CN107544913B (en) FTL table rapid reconstruction method and device
US11144445B1 (en) Use of compression domains that are more granular than storage allocation units

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

Country of ref document: EP

Kind code of ref document: A1