CN105045724A - Space allocation based wear leveling method for nonvolatile memory - Google Patents

Space allocation based wear leveling method for nonvolatile memory Download PDF

Info

Publication number
CN105045724A
CN105045724A CN201510381825.7A CN201510381825A CN105045724A CN 105045724 A CN105045724 A CN 105045724A CN 201510381825 A CN201510381825 A CN 201510381825A CN 105045724 A CN105045724 A CN 105045724A
Authority
CN
China
Prior art keywords
variable
threshold values
write operation
space
max
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510381825.7A
Other languages
Chinese (zh)
Other versions
CN105045724B (en
Inventor
沙行勉
龙林波
诸葛晴凤
刘铎
陈咸彰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University
Original Assignee
Chongqing University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing University filed Critical Chongqing University
Priority to CN201510381825.7A priority Critical patent/CN105045724B/en
Publication of CN105045724A publication Critical patent/CN105045724A/en
Application granted granted Critical
Publication of CN105045724B publication Critical patent/CN105045724B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention discloses a space allocation based wear leveling method for a nonvolatile memory. The method comprises the following steps of: 1. making statistics on the number of write operations of each variable and the dimension of the variable; 2. allocating an appropriate space dimension for each variable according to the unoccupied space dimension to enable the maximum number of the write operations in a nonvolatile memory to be reduced as far as possible; and 3. executing a recompiled program in an embedded system to realize wear leveling of the nonvolatile memory. The space allocation based wear leveling method for the nonvolatile memory has the following advantages: 1. the method has very short execution time and very low storage overhead; 2. no hardware overhead is required; 3. for a variable level, the method has a better fine grain property and can realize better wear leveling; and 4. the method does not need to depend on any hardware and has very high practicality.

Description

A kind of nonvolatile memory abrasion equilibrium method based on allocation of space
Technical field
The invention belongs to computer memory technical field, be specifically related to a kind of abrasion equilibrium method of nonvolatile memory.
Background technology
Phase transition storage (Phasechangememory, PCM) a kind of novel nonvolatile memory is belonged to, it have non-volatile, low in energy consumption, read at a high speed, store many remarkable characteristics such as intensive, extensively thought that most probable substitutes the storer of FLASH and DRAM, and become the main flow internal memory in following embedded system.But PCM is limited to its limited write durability.A typical PCM cell only can tolerate 10 7to 10 9secondary write operation, otherwise it will lose the ability of change state.The write operation of typical embedded program, usually writes on internal memory in the extremely unbalanced mode of one, such as: most of write operation concentrates on a small amount of variable.Write operation is variable frequently, large, erasable to this position continually to the position wearing and tearing of depositing this variable, accelerates the wearing and tearing of PCM.If do not have suitable management, PCM chip may be damaged in tens seconds.
In order to extend the life-span of PCM, prior art adopts the method reducing and write number of times or obtain abrasion equilibrium.For the write operation number of times reduced on PCM, because write operation number of times total on PCM does not directly determine the life-span of PCM, the life-span of PCM is depended on PCM is write position the most frequently, on PCM any unit write number of times exceed it write durability restriction, the reliability of PCM becomes even worse, and may make a mistake, therefore when the write operation of program is inconsistent, this reduces write operation number of times is unable.About abrasion equilibrium method, namely write operation is distributed on PCM uniformly, the core concept of abrasion equilibrium method is the optimization of system architecture level, such as periodically the region frequently write and the mapping of field infrequently write, or randomness ground exchange address spaces, makes each position be write number of times consistent.But due to very high exchange frequency, huge writing expense and run expense may occur, and mostly all needs the support of hardware and operating system, thus limits the practical application of phase transition storage PCM in embedded system.
Summary of the invention
For the deficiencies in the prior art, technical matters to be solved by this invention is the aspect from software compiler, according to access module, a kind of nonvolatile memory abrasion equilibrium method based on allocation of space is provided, it effectively can improve phase transition storage serviceable life in embedded systems, and there is very low time and storage overhead, without any need for hardware supported.
Technical matters to be solved by this invention is realized by such technical scheme, and it comprises the following steps:
Step 1, count the write operation number of times of each variable and the size of variable;
Step 2, be that each variable distributes suitable space size according to unappropriated space size, the maximum write operation number of times on nonvolatile memory is reduced as far as possible;
Step 3, compiled program, embedded system to perform, to obtain the abrasion equilibrium on nonvolatile memory.
Tool of the present invention has the following advantages: above-mentioned treatment step completes in compilation time, has very low execution time and storage overhead; Because do not need the support of operating system or hardware, there is no hardware spending; Prior art the present invention is directed to variable level for page level, has better fine granularity, so can obtain better abrasion equilibrium; The present invention does not need to rely on any hardware, has very high practicality.
Accompanying drawing explanation
Accompanying drawing of the present invention is described as follows:
Fig. 1 is the schematic diagram in the present invention, variable being extended to array;
Fig. 2 is allocation of space process flow diagram of the present invention;
Fig. 3 decision function judge of the present invention decision flowchart.
Embodiment
Be that the invention will be further described for embodiment below in conjunction with accompanying drawing with phase transition storage:
The present invention proposes a kind of space allocation method, namely space allocation method is that each variable is expanded to the array manifold varied in size, make the write operation amount on a position can expand to multiple position equably, thus obtain a write operation distribution balanced on phase transition storage.
As shown in Figure 1, (a) is extended to the schematic diagram of an array for canonical variable, and the array that (b) is one dimension is expanded into the schematic diagram of two-dimensional array, and write operation amount larger position is like this diffused into many times of spaces.C () to have the schematic diagram of n*w write operation for variable in storage unit 1, (d) write operation is diffused into n unit uniformly for n*w time, and each unit is only write w time.So first this method invention is concentrated and is made each unit in each canonical variable or data structure have a sizeable space, the namely value of middle h and Fig. 1 (b) of Fig. 1 (a) middle i, j, k.Then, we recompile program, make the write operation of variable be distributed to these array manifold uniformly.
The present invention includes following steps:
Step 1, count the write operation number of times of each variable and the size of variable;
Amendment compiler, compiles program source code, calculates the size of variable, and record the write operation number of times of each variable.
Step 2, be that each variable distributes suitable space size according to unappropriated space size, the maximum write operation number of times on phase transition storage is reduced as far as possible;
The variable frequently write is extended to the array of different size, for each array set threshold values, whenever the number of times write a position exceedes this threshold values, Data Migration to next position, and next for the index point of array position, make the write operation amount on a position can expand to multiple position equably, thus obtain one balance write distribution;
Step 3, compiled program, embedded system to perform, to obtain the abrasion equilibrium on phase transition storage.
Fig. 2 is space size allocation algorithm process flow diagram of the present invention.This flow process starts from step 301, then:
In step 302, input will leave write operation number of times and the variable size of the variable on phase transition storage in, and the size of phase transition storage,
In step 303, determine the next T of threshold values minbe exactly the write operation number of times of next time all variablees of threshold values is distributed on phase transition storage uniformly, total the write operation number of times equaling variable divides exactly the size in phase transition storage;
In step 304, determine the previous T of threshold values max, the previous of threshold values is exactly the maximum write operation number of times by original mode variable left on phase transition storage, namely the write operation number of times of write operation variable the most frequently;
Next, we make use of the basic thought of binary chop algorithm.Binary chop algorithm, also known as binary search, takes full advantage of the order relation between element, adopts divide-and-conquer strategy.Thus, we improve binary chop algorithm, search a qualified minimum threshold values, make any storage unit of phase transition storage all be less than minimum threshold values, thus prolongation phase transition storage is in the serviceable life of embedded system.Basic thought is, in the valued space of threshold value, gets the next T of threshold value minas tested object, if T minsatisfy condition, then search successfully; If T mindo not satisfy condition, then the intermediate value of test threshold.If intermediate value satisfies condition, continue to search in the left half-court of intermediate value; If intermediate value does not satisfy condition, then continue to search in the right half-court of intermediate value.Continuous repetition said process, until find.
In step 305, by the next T of decision function judge decision threshold minwhether satisfy condition, this decision function judge introduces in figure 3; If satisfy condition, then perform step 306; Otherwise, perform step 307;
In step 306, the next T of threshold values minsatisfy condition, then T minfor best threshold values, threshold values T=T namely undetermined min;
In step 307, give the space size of each variable according to best threshold values dispensed, the principle of distributing array manifold has just held the write operation of variable, and a few space then can not hold, and vmi is the integral multiple of si, can try to achieve the array manifold size of each variable
In formula, T is threshold values undetermined, and Wi is the write operation number of times of variable, and si is variable size; Then, step 313 is performed
In step 308, at the next T of threshold values mindo not satisfy condition down, then by the previous T of decision function judge decision threshold maxwhether satisfy condition; If met, then perform step 310; Otherwise, perform step 309;
In step 309, report an error low memory, performs step 313;
In step 310, judge intermediate value ((T by decision function judge max+ T min)/2) whether satisfy condition, if satisfy condition, then perform step 311; Otherwise, perform step 312;
In step 311, reduce hunting zone, intermediate value is assigned to the previous T of threshold values max, T max=(T max+ T min)/2), increase the next T of threshold values min, T min=t min+ 1; Turn and perform step 305;
In step 312, the previous of threshold values gets T max; The next T of intermediate value threshold values min=(T max+ T min)/2)+1, turn and perform step 305;
In step 313, EOP (end of program).
As shown in Figure 3, this flow process starts from step 401 to above-mentioned decision function judge determination flow, then:
In step 402, input the write operation number of times W of threshold values T undetermined, variable i, variable size S iwith the space S of phase transition storage pCM;
In step 403, according to the information of threshold values T undetermined and variable, calculate array manifold size needed for each variable
In step 404, need array manifold size according to each variable, calculate whole program requisite space total amount
In formula, n is total number of variable, and i is the sequence number of variable, vm iit is the space size of i-th variable;
In step 405, judge that whether variable requisite space total amount RM is than actual transformation storage space S pCMgreatly; If so, then threshold values T undetermined is too small, performs step 406; If not, then continue judgement and write expense, perform step 407;
In step 406, export false; Perform step 411
In step 407, variable write operation sum equals variable and writes the summation that number of times is multiplied by variable size, W T = Σ i = 1 n S i × W i ;
In step 408, calculate write operation expense: because each movement can cause reposition that once extra write operation occurs, so the vacuum space size that write operation expense equals to distribute deducts variable space size, W O = Σ i = 1 n ( vm i - S i ) ;
In step 409, limit the ratio value of write operation expense and variable write operation sum, make to obtain abrasion equilibrium in restriction write operation expense: in this method invention, the ratio value of setting write operation expense is 1%; If exceed this ratio value 1%, then threshold values T is too small, performs step 306; If do not exceed this ratio 1%, then perform step 410
In step 410, export true;
In step 411, EOP (end of program).

Claims (3)

1., based on a nonvolatile memory abrasion equilibrium method for allocation of space, it is characterized in that, comprise the following steps:
Step 1, count the write operation number of times of each variable and the size of variable;
Step 2, be that each variable distributes suitable space size according to unappropriated space size, the maximum write operation number of times on nonvolatile memory is reduced as far as possible;
Step 3, compiled program, embedded system to perform, to obtain the abrasion equilibrium on nonvolatile memory.
2. the nonvolatile memory abrasion equilibrium method based on allocation of space according to claim 1, is characterized in that, described variable space size allocation algorithm comprises the following steps:
Step 1) determine the next T of threshold values minwith the previous T of threshold values max;
Step 2) by the next T of decision function judge decision threshold minwhether satisfy condition, in this way, then threshold values T=T undetermined min; The array manifold size of variable
In formula, T is threshold values undetermined, and Wi is the write operation number of times of variable, and si is variable size;
Step 3) by the previous T of decision function judge decision threshold maxwhether satisfy condition, as no, report an error low memory;
Step 4) the previous T of threshold values maxsatisfy condition, judge intermediate value ((T by decision function judge max+ T min)/2) whether satisfy condition, in this way, intermediate value is assigned to the previous T of threshold values max, T max=(T max+ T min)/2), increase the next T of threshold values min, T min=T min+ 1; Proceed to step 2); Step 5) intermediate value ((T max+ T min)/2) do not satisfy condition, then the previous of threshold values gets T max; The next T of intermediate value threshold values min=(T max+ T min)/2)+1, proceed to step 2).
3. the nonvolatile memory abrasion equilibrium method based on allocation of space according to claim 2, is characterized in that, described decision function judge judges to comprise the following steps:
Step (1) according to threshold values T to be determined, the write operation number of times W of variable i, variable size S iwith the size S of phase transition storage pCM; Calculate array manifold size needed for each variable calculate whole program requisite space total amount
In formula, n is total number of variable, and i is the sequence number of variable, vm iit is the space size of i-th variable;
Step (2) judges that whether variable requisite space total amount RM is than actual transformation storage space S pCMgreatly; If so, then threshold values T undetermined is too small, exports false;
Step (3) at variable requisite space total amount RM than actual transformation storage space S pCMwhen little, calculate variable write operation sum calculate extra write operation expense W O = Σ i = 1 n ( vm i - S i ) ;
Step (4) limits the ratio value of write operation expense and variable write operation sum, if exceed this ratio value, then threshold values T is too small, exports false; If do not exceed this ratio, then export true.
CN201510381825.7A 2015-07-02 2015-07-02 A kind of nonvolatile storage abrasion equilibrium method based on space distribution Active CN105045724B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510381825.7A CN105045724B (en) 2015-07-02 2015-07-02 A kind of nonvolatile storage abrasion equilibrium method based on space distribution

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510381825.7A CN105045724B (en) 2015-07-02 2015-07-02 A kind of nonvolatile storage abrasion equilibrium method based on space distribution

Publications (2)

Publication Number Publication Date
CN105045724A true CN105045724A (en) 2015-11-11
CN105045724B CN105045724B (en) 2018-05-29

Family

ID=54452287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510381825.7A Active CN105045724B (en) 2015-07-02 2015-07-02 A kind of nonvolatile storage abrasion equilibrium method based on space distribution

Country Status (1)

Country Link
CN (1) CN105045724B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102325023A (en) * 2011-07-04 2012-01-18 飞天诚信科技股份有限公司 A kind of chip data creation method and device in useful life of prolonging
CN103019615A (en) * 2012-07-19 2013-04-03 中国人民解放军国防科学技术大学 Method for increasing durability of flash memory solid state disk on basis of load control

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102325023A (en) * 2011-07-04 2012-01-18 飞天诚信科技股份有限公司 A kind of chip data creation method and device in useful life of prolonging
CN103019615A (en) * 2012-07-19 2013-04-03 中国人民解放军国防科学技术大学 Method for increasing durability of flash memory solid state disk on basis of load control

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LINBO LONG,DUO LIU ETC.: "A space allocation and reuse strategy for PCM-based embedded systems", 《JOURNAL OF SYSTEMS ARCHITECTURE》 *
LINBO LONG,DUO LIU ETC.: "A space-based wear leveling for PCM-based embedded systems", 《EMBEDDED AND REAL-TIME COMPUTING SYSTEMS AND APPLICATIONIS》 *

Also Published As

Publication number Publication date
CN105045724B (en) 2018-05-29

Similar Documents

Publication Publication Date Title
US10209902B1 (en) Method and apparatus for selecting a memory block for writing data, based on a predicted frequency of updating the data
US8140585B2 (en) Method and apparatus for partitioning and sorting a data set on a multi-processor system
CN108628552B (en) Method for improving Flash wear life, control device and storage system
US10852978B2 (en) Key-value store using journaling with selective data storage format
US11829290B2 (en) Garbage collection candidate selection using block overwrite rate
CN105095116A (en) Cache replacing method, cache controller and processor
EP3861449A1 (en) Performing hybrid wear leveling operations based on a sub-total write counter
US10496533B1 (en) Allocation of overprovisioned blocks for minimizing write amplification in solid state drives
US11048437B2 (en) Double threshold controlled scheduling of memory access commands
US11249679B2 (en) Selecting a write operation mode from multiple write operation modes
CN202472635U (en) Flash memory wear leveling device
CN103559148A (en) On-chip scratch-pad memory (SPM) management method facing multitasking embedded system
US20160334996A1 (en) In-flash immutable object processing
Lim et al. Lazy and eager approaches for the set cover problem
CN105045724A (en) Space allocation based wear leveling method for nonvolatile memory
Xiao et al. PASM: Parallelism Aware Space Management strategy for hybrid SSD towards in-storage DNN training acceleration
US11681909B2 (en) Memory component with a bus to transmit data for a machine learning operation and another bus to transmit host data
US11263156B2 (en) Memory component with a virtualized bus and internal logic to perform a machine learning operation
US11769076B2 (en) Memory sub-system with a virtualized bus and internal logic to perform a machine learning operation
US11694076B2 (en) Memory sub-system with internal logic to perform a machine learning operation
US20210110249A1 (en) Memory component with internal logic to perform a machine learning operation
KR102580634B1 (en) Data processing methods and associated data processors for memory
US20200194080A1 (en) Consolidation of copy-back and write in pram blocks
US11676010B2 (en) Memory sub-system with a bus to transmit data for a machine learning operation and another bus to transmit host data
US10782906B1 (en) Memory subsystem interface to relate data and to retrieve related data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant