CN101833514B - Method for realizing virtual internal memory in nand type flash memory medium based on micromemory system - Google Patents

Method for realizing virtual internal memory in nand type flash memory medium based on micromemory system Download PDF

Info

Publication number
CN101833514B
CN101833514B CN2009100378423A CN200910037842A CN101833514B CN 101833514 B CN101833514 B CN 101833514B CN 2009100378423 A CN2009100378423 A CN 2009100378423A CN 200910037842 A CN200910037842 A CN 200910037842A CN 101833514 B CN101833514 B CN 101833514B
Authority
CN
China
Prior art keywords
memory
page
internal memory
virtual
virtual memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2009100378423A
Other languages
Chinese (zh)
Other versions
CN101833514A (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.)
ZHEJIANG JINHUA KAIYU ELECTRONIC TECHNOLOGY Co.,Ltd.
Original Assignee
Anyka Guangzhou Microelectronics Technology 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 Anyka Guangzhou Microelectronics Technology Co Ltd filed Critical Anyka Guangzhou Microelectronics Technology Co Ltd
Priority to CN2009100378423A priority Critical patent/CN101833514B/en
Publication of CN101833514A publication Critical patent/CN101833514A/en
Application granted granted Critical
Publication of CN101833514B publication Critical patent/CN101833514B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses a method for realizing virtual internal memory in a nand type flash memory medium based on a micromemory system, which comprises the following steps of: virtualizing a memory space as a virtual internal memory in a nand type flash memory; when the physical internal memory has no space to memorize a new internal memory page, writing the internal memory page in the physical internal memory into the virtual internal memory; invalidating the original internal memory page of the physical internal memory; and writing the internal memory which needs to be counted in the virtual internal memory into the physical internal memory to exchange the internal memory page of the physical internal memory with the internal memory page of the virtual internal memory. Compared with the prior art, the method has the advantages of improving the writing and erasing ratio according to a method for circulating the page mapping and the data block, reducing the times for reading and writing the internal memory, prolonging the service life of an electron device, improving the reliability thereof with an enough standby block method, guaranteeing the enough space when writing and erasing, reducing the phenomenon of data loss, reducing the write back of the date with a method of a dirtied identification and internal memory-abandoning mechanism, improving the efficiency of internal memory buffering, and prolonging the service life of a magnetic disc.

Description

Based on little memory system with the method for NOT-AND flash media implementation virtual memory
Technical field
The present invention relates to a kind of implementation method of virtual memory, relate in particular to a kind of based on little memory system with the NOT-AND flash medium on realize the method for virtual memory.
Background technology
In recent years, along with the development of computer operating system, the function that operating system has is more and more abundanter, and most of operating systems have the virtual memory technology.The virtual memory technology is an important techniques on the computing machine development history, and it helps application program to break away from the restriction of " volume ".The management method of virtual memory makes system both can move the volume ratio physical memory and also wants big application program, also can realize " paging as required " strategy, has both satisfied the travelling speed of program, has practiced thrift the physical memory space again.
The basic thought of virtual memory is: the size of program, data, storehouse can surpass the size of internal memory; Operating system is retained in internal memory to the part of the current use of program; And other part for storage on disk, and dynamic exchange between internal memory and disk when needed.When process was moved, earlier with a part of program graftabl, another part was temporarily stayed external memory, when the data of the instruction that will carry out or use during not at internal memory, is accomplished automatically by system they are called in the work of internal memory from external memory.Before process brings into operation, not whole pages of packing into, but pack into one or the zero page, the needs that move according to process afterwards, other page of dynamically packing into; When memory headroom is full, and during the page that need pack into new, then eliminate certain page, so that pack the new page into according to certain algorithm.When memory headroom was nervous, system temporarily moved on to external memory with some process in the internal memory, some process swap-in internal memory in the external memory, occupies the former shared zone, and this technology is the dynamic dispatching of process between internal memory and external memory.
Existing in the prior art have two with the most akin implementation of the present invention:
PC operating system aspect: Windows last with LINUX/UNIX on the virtual memory technology realize with hard disk, but be based on file system, need the certain physical internal memory to come the data that reside permanently of store files system.
The virtual memory technology of embedded OS aspect: LINUX and WINDOWS CE to be realizing with NOT-AND flash, but also is based on file system, and this will have sizable file system data to want memory-resident.
No matter be PC operating system or embedded OS, existing virtual memory technology all realizes on file system, because the data volume that resides in the internal memory is bigger, for little memory system, is worthless.Traditional virtual memory realizes that on file system so this mode resides in the data in EMS memory amount will be very big, and for the very little system of physical memory, it is worthless that yes.
Concerning electron trade, the competition more and more fierce, in order in the competition of industry, to be in the invincible position, quality and price are two aspects of particular importance.For in price, cost control is the basis.The little memory system virtual memory technology under the embedded environment that is based on of native system design.
Summary of the invention
To the objective of the invention is the data volume that resides in the internal memory in order reducing, to improve the speed and the efficient of system, on file system, do not realize virtual memory, directly with NOT-AND flash on realize virtual memory.
The object of the invention can be realized through following scheme: based on little memory system with the method for NOT-AND flash media implementation virtual memory, it is characterized in that, earlier with NOT-AND flash in a virtual storage space as virtual memory; When physical memory does not have the new page of space storage, the page in the physical memory is write on the virtual memory; Then the original page of physical memory was lost efficacy; At last the page that needs computing in the virtual memory is write in the physical memory, realize the page exchange of physical memory and virtual memory.
It is not screen to visit expiration policy at most that described page lost efficacy.
The process by the page or leaf mapping is adopted in the page exchange of described virtual memory and physical memory, promptly wipes a data block and can write a plurality of pages or leaves.
The page of described physical memory writes in the virtual memory process, and three method for optimizing are arranged:
1) if the attribute of physical memory page is read-only, then in virtual memory, deposited this page, the content in this physical memory page need not be written back in the virtual memory, and directly this section physical memory content is removed; Otherwise this physical memory page is write virtual memory.
2) dirty sign minimizing data write-back is write in utilization: if the content of depositing in the physical memory page is a data segment, whether the content that distinguish data segment was modified; Content was not modified, and write dirty sign and was changed to vacation, need not be written back in the virtual memory, directly the content in this section physical memory was removed; If the content of data segment was modified, write dirty being designated very, just the content with this data segment is written back in the virtual memory, then the content in this section physical memory is removed.
3) for idle internal memory, because this internal memory is unavailable, directly from physical memory, remove, also do one section corresponding in virtual memory internal memory abandoning mark simultaneously.
Described physical memory is written back in the process of virtual memory, comprises following content:
The content that a definition mapping table between physical memory and virtual memory, described mapping table write down said physical memory with NOT-AND flash on deposit position.
Page is written back to virtual memory and adopts by data block round-robin process: when the page content of physical memory changes; In order to improve system effectiveness; Not to wipe the corresponding page of this content on the virtual memory, but the page content of physical memory is write on the next empty page of current data block in the virtual memory.
The page of described physical memory writes in the virtual memory process; In order to solve bad piece problem; Improve system reliability; Stand-by block with NOT-AND flash medium reservation some: it is constant to guarantee that the intact back of write-back remains the data block of M (M>=2) individual free time in virtual memory, otherwise the not enough situation of freed data blocks can occur.
The advantage of the relative prior art of the present invention is: adopted by the page or leaf mapping with by the raising of data block round-robin method and write the wiping ratio, reduced the number of times of read/write memory, prolonged the life-span of electron device; The method of utilizing enough stand-by blocks is to improve system reliability, and guaranteeing to write has enough spaces when wiping, reduce the loss of data phenomenon; Utilize the method for dirty sign and internal memory drop mechanism to reduce the data write-back, improved the efficient and the life-span that has prolonged disk of memory buffer.
Description of drawings
Fig. 1 is an internal storage structure synoptic diagram of the present invention;
Fig. 2 is that page of the present invention writes the virtual memory schematic flow sheet from physical memory;
Fig. 3 is that page of the present invention writes the physical memory schematic flow sheet from virtual memory.
Embodiment
As shown in Figure 1; In order to practice thrift cost; Enhance competitiveness; The physical memory that system adopts has only 192K, utilizes memory management unit MMU (Memory Management Unit) to be the virtual memory of 2M the 192K physical memory is virtual, and virtual memory is the 2M space from branching away with the NOT-AND flash medium.Physical memory and virtual memory are a page with 4K all; The physical memory of 192K is divided into 192K/4K=48 page; The method by the page or leaf mapping is adopted in mapping between virtual memory and the physical memory, wipes data block exactly one time, can write a lot of pages or leaves; Native system is to wipe a data block, can write 64 pages or leaves.The purpose that adopts the page or leaf mapping is to improve to write to wipe ratio.In system's operational process physical memory and and NOT-AND flash between carry out exchanges data.
Wherein, physical memory has comprised the bottom of three part: 16k, the middle part of 160k and the top of 16k.Wherein the bottom of 16k is fixedly to be mapped to virtual memory, and structure has comprised data slice, status architecture, driving code and interruption code.The middle part of 160k is not fixedly to be mapped to virtual memory, whether shines upon to depend on whether page is modified, and can be mapped to virtual memory when page is modified; Structure has comprised user stack, the piece with sign-on, code segment and the read-only data section of 8k.The top of 16k is fixedly to be mapped to virtual memory, and structure has comprised the unusual storehouse of 1k, the interrupt stack of 1k, the dynamic data area of 3k, the high frequency code of 8k, the secondary MMU mapping table of 2k and the one-level MMU mapping table of 1k.
Physical memory and and NOT-AND flash between carry out exchanges data two kinds of operations arranged: the page changes to the page and swaps out.Change to exactly and will be loaded into physical memory with corresponding page on the NOT-AND flash.Swap out exactly with page in the physical memory be written back to NOT-AND flash on.
The page writes the virtual memory process from physical memory:
When physical memory does not have the new page of space storage, just need some page be shifted out from physical memory, with page in the physical memory be written back to NOT-AND flash on, make the content inefficacy of this page then.The method that adopts is to utilize not visit expiration policy at most and carry out page fault.For serviceable life of improving system effectiveness and speed and raising and NOT-AND flash (reduce with NOT-AND flash erasable) as far as possible, with page in the physical memory be written back to NOT-AND flash on three kinds of optimization methods are arranged:
1) divides according to the attribute of the content of depositing in the physical memory page; If the attribute of content is read-only, then with in the NOT-AND flash existing deposit the content in this physical memory page; Need not be written back to NOT-AND flash in, directly the content in this section physical memory is removed.
2) utilize and to write dirty sign and reduce the data write-back, write dirty sign and be really just need be written back to NOT-AND flash on.If the content of depositing in the physical memory page is a data segment, whether the content that distinguish data segment was modified.Content was not modified, and write dirty sign and was changed to vacation, need not be written back to NOT-AND flash in, directly the content in this section physical memory is removed; If the content of data segment section was modified, write dirty be designated true, just with the content of this data segment be written back to NOT-AND flash in, then the content in this section physical memory is removed.
3) adopt the internal memory drop mechanism: for the internal memory that has discharged,, directly from physical memory, remove because this internal memory is unavailable, simultaneously also will with NOT-AND flash on one section corresponding internal memory do to abandon mark.
Carry out page fault will the content of physical memory data segment be written back to NOT-AND flash on, be written back to the method for NOT-AND flash following:
1) physical memory and and NOT-AND flash between mapping table of definition, when being written back to, can be while writing revise mapping table with NOT-AND flash, the content that mapping table can be noted down physical memory with NOT-AND flash on deposit position;
2) write-back to and NOT-AND flash, employing be to follow bad method by data block.If physical memory page content changes, in order to improve system effectiveness, be not wipe with NOT-AND flash on the corresponding page of this content, but with the page content of physical memory write with NOT-AND flash on the next empty page of current data block;
3) in order to solve bad piece problem, improve system reliability, keep the stand-by block of some.Guarantee the intact back of write-back with the NOT-AND flash medium in to remain the data block of M (M>=2) individual free time constant, otherwise the not enough situation of freed data blocks can appear;
block?n-1 block?n block?n+M-1 block?n+M
write?over stuffed?with?data empty?block to?be?written empty?block ?least?access?block
Present state is:
Piece n-1: write full data;
Piece n is to piece n+M-1: be M idle data block;
Piece n+M is not empty, might have effective data page, needs to reclaim.
It is as shown in Figure 2 that the page writes the virtual memory flow process:
A) whether inspection piece n-1 writes full;
B) whether be empty if the result that step a returns, then gets next legal piece n for being and detects piece n+M; If the result that step a returns then jumps to step g for not;
C) if the result that step b returns for not, then moves on to piece n with legal page or leaf from piece n+M; And whether inspection moves successfully;
D) if the result that step c returns is for being then to jump to step f; If the result that step c returns then gets next legal piece n for not, and make M from subtracting 1;
E) replace this piece and be labeled as badly, return step c;
F) if the result that step b returns, then wipes piece n+M for being and whether inspection is successfully wiped;
G) if the result that step f returns is that then this piece of mark is not bad piece and returns step c; If the result that step f returns is for being, then page data is write current piece and whether inspection writes success;
H) if the result that step g is returned is for being then to upgrade mapping table; If the result that steps d is returned then gets next legal piece n for not, and make M from subtracting 1;
I) replace this piece and be labeled as badly, return step g.
" M is from subtracting 1 " that occur because occur writing failure in the above-mentioned steps can cause the number M of free block to reduce; Just the piece of subsequent use free time is not enough; Run into this situation, the recovery that after flow process is write in completion, need carry out the piece of a subsequent use free time again could guarantee that idle number of blocks remains unchanged.
The page writes the physical memory process from virtual memory:
Will be as shown in Figure 3 with the flow process that corresponding page on the NOT-AND flash is loaded into physical memory, at first the mapping table on the memory body of inquiry and NOT-AND flash takes out the id corresponding with the NOT-AND flash page or leaf; Read page from memory body then with NOT-AND flash; The mapping table of final updating MMU.
The invention solves on little memory system, directly with NOT-AND flash on realize the method for virtual memory and raising system performance and efficient be provided, improve and the NOT-AND flash method and the method that processing and the bad piece problem of NOT-AND flash are provided in serviceable life.

Claims (9)

  1. Based on little memory system with the method for NOT-AND flash media implementation virtual memory, it is characterized in that, earlier with NOT-AND flash in a virtual storage space as virtual memory; When physical memory does not have the new page of space storage, the page in the physical memory is write on the virtual memory; Then original this page of physical memory was lost efficacy; At last the page that needs computing in the virtual memory is write in the physical memory, realize the page exchange of physical memory and virtual memory.
  2. 2. according to claim 1 based on little memory system with the method for NOT-AND flash media implementation virtual memory, it is characterized in that the said original page of physical memory was lost efficacy is not screen to visit expiration policy at most.
  3. 3. according to claim 1 based on little memory system with the method for NOT-AND flash media implementation virtual memory; It is characterized in that; The process by the page or leaf mapping is adopted in the page exchange of described virtual memory and physical memory, promptly refreshes a data block and can write a plurality of pages or leaves.
  4. 4. according to claim 1 based on little memory system with the method for NOT-AND flash media implementation virtual memory; It is characterized in that; The page of described physical memory writes in the virtual memory process, when the attribute of physical memory page is read-only, then is illustrated in and has deposited this page in the virtual memory; Content in the corresponding physical page need not be written in the virtual memory, and directly this section physical memory content is removed; Otherwise this physical memory page is write virtual memory.
  5. 5. according to claim 1 based on little memory system with the method for NOT-AND flash media implementation virtual memory; It is characterized in that; The page of described physical memory writes in the virtual memory process; Utilizing dirty sign to reduce data writes: the content of in physical memory page, depositing is a data segment, and whether the content that distinguish data segment was modified; Content was not modified, and dirty sign is changed to vacation, need not be written in the virtual memory, directly the content in this section physical memory was removed; When the content of data segment was modified, dirtyly be designated very, just the content with this data segment is written in the virtual memory, then the content in this section physical memory is removed.
  6. 6. according to claim 1 based on little memory system with the method for NOT-AND flash media implementation virtual memory; It is characterized in that; The page of described physical memory writes in the virtual memory process, for discharging and idle internal memory, because this internal memory is unavailable; Directly this internal memory is removed from physical memory, also done one section corresponding in virtual memory internal memory abandoning mark simultaneously.
  7. 7. according to claim 1 based on little memory system with the method for NOT-AND flash media implementation virtual memory; It is characterized in that; Between described physical memory and virtual memory, make up a mapping table, the content that described mapping table writes down said physical memory with NOT-AND flash on deposit position.
  8. 8. according to claim 1 based on little memory system with the method for NOT-AND flash media implementation virtual memory; It is characterized in that; The process that page in the described physical memory writes virtual memory adopts by data block round-robin process: when the page content of physical memory changes, the page content of physical memory is write on the next empty page of current data block in the virtual memory; Current block is write full, then is written to an adjacent idle active block and gets on.
  9. 9. according to claim 1 based on little memory system with the method for NOT-AND flash media implementation virtual memory; It is characterized in that; The page of described physical memory writes in the virtual memory process, keeps 2 subsequent use freed data blocks at least with the NOT-AND flash medium.
CN2009100378423A 2009-03-12 2009-03-12 Method for realizing virtual internal memory in nand type flash memory medium based on micromemory system Active CN101833514B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100378423A CN101833514B (en) 2009-03-12 2009-03-12 Method for realizing virtual internal memory in nand type flash memory medium based on micromemory system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100378423A CN101833514B (en) 2009-03-12 2009-03-12 Method for realizing virtual internal memory in nand type flash memory medium based on micromemory system

Publications (2)

Publication Number Publication Date
CN101833514A CN101833514A (en) 2010-09-15
CN101833514B true CN101833514B (en) 2012-02-15

Family

ID=42717590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100378423A Active CN101833514B (en) 2009-03-12 2009-03-12 Method for realizing virtual internal memory in nand type flash memory medium based on micromemory system

Country Status (1)

Country Link
CN (1) CN101833514B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102253893A (en) * 2011-04-02 2011-11-23 赵悦 Method for extending internal memory
CN102184145B (en) * 2011-05-13 2013-04-17 杭州华三通信技术有限公司 Zero restart-data loss method and device
CN102662799B (en) * 2012-04-13 2015-01-21 华为技术有限公司 Data backup method, server and hot backup system
CN102662867A (en) * 2012-04-16 2012-09-12 上海大亚科技有限公司 Method for achieving virtual memory dump control in application device flash memory of embedded system
CN106528454B (en) * 2016-11-04 2019-03-29 中国人民解放军国防科学技术大学 A kind of memory system caching method based on flash memory
CN109408405B (en) * 2018-10-15 2021-03-09 Oppo广东移动通信有限公司 Memory page exchange method, device, terminal and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6332172B1 (en) * 1998-05-29 2001-12-18 Cisco Technology, Inc. Method and system for virtual memory compression in an embedded system
CN101158924A (en) * 2007-11-27 2008-04-09 北京大学 Dynamic EMS memory mappings method of virtual machine manager

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6332172B1 (en) * 1998-05-29 2001-12-18 Cisco Technology, Inc. Method and system for virtual memory compression in an embedded system
CN101158924A (en) * 2007-11-27 2008-04-09 北京大学 Dynamic EMS memory mappings method of virtual machine manager

Also Published As

Publication number Publication date
CN101833514A (en) 2010-09-15

Similar Documents

Publication Publication Date Title
CN106547703B (en) A kind of FTL optimization method based on block group structure
CN102135942B (en) Method for realizing wear-leveling in storage equipment as well as the storage equipment
CN102576293B (en) Data management in solid storage device and Bedding storage system
RU2666241C2 (en) Memory segment remapping to address fragmentation
CN101833514B (en) Method for realizing virtual internal memory in nand type flash memory medium based on micromemory system
CN102981963B (en) A kind of implementation method of flash translation layer (FTL) of solid-state disk
CN101634967B (en) Block management method for flash memory, storage system and controller
CN103559138B (en) Solid state hard disc and space management thereof
US8214578B2 (en) Method of storing data into flash memory according to usage patterns of addresses and data storage system using the same
CN102779096B (en) Page, block and face-based three-dimensional flash memory address mapping method
CN102508787B (en) System and method for memory allocation of composite memory
CN101645043B (en) Methods for reading and writing data and memory device
CN103092766A (en) Balanced loss achievement method for NAND FLASH
CN102163175A (en) Hybrid address mapping method based on locality analysis
CN105095116A (en) Cache replacing method, cache controller and processor
CN105718206B (en) The flash translation layer (FTL) and its implementation of RAID can be perceived
CN103049397A (en) Method and system for internal cache management of solid state disk based on novel memory
CN101625897B (en) Data write-in method, storage system and controller used for quick flash memory
CN102521160A (en) Write buffer detector, addressing method of written data and parallel channel write method
CN101556555B (en) Block managing method for flash memory as well as controller and storage system thereof
CN101533670A (en) Method and memory device realizing loss balance of memory device
CN105718530A (en) File storage system and file storage control method thereof
CN102768645A (en) Solid state disk (SSD) prefetching method for mixed caching and SSD
CN102999441B (en) Fine granularity memory access method
CN105630701B (en) Data storage device and the reading/writing method for using unavailable page table or unavailable piece of table

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200603

Address after: 321200 building a, Kaiyu Microelectronics Industrial Park, Wuyi science and Technology City, No.316, Wujiang Avenue, Wuyi County, Jinhua City, Zhejiang Province

Patentee after: ZHEJIANG JINHUA KAIYU ELECTRONIC TECHNOLOGY Co.,Ltd.

Address before: 301-303 401-402, zone C1, No. 182, science Avenue, Science City, Guangzhou high tech Industrial Development Zone

Patentee before: ANYKA (GUANGZHOU) MICROELECTRONICS TECHNOLOGY Co.,Ltd.

CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 321200 building a, inspection workshop building, Kaiyu Microelectronics Industrial Park, science and Technology City, Wuyi County, Jinhua City, Zhejiang Province (self declaration)

Patentee after: ZHEJIANG JINHUA KAIYU ELECTRONIC TECHNOLOGY Co.,Ltd.

Address before: 321200 building a, Kaiyu Microelectronics Industrial Park, Wuyi science and Technology City, 316 Wujiang Avenue, Wuyi County, Jinhua City, Zhejiang Province

Patentee before: ZHEJIANG JINHUA KAIYU ELECTRONIC TECHNOLOGY Co.,Ltd.