CN104123241B - Internal memory anonymity page initial method, apparatus and system - Google Patents

Internal memory anonymity page initial method, apparatus and system Download PDF

Info

Publication number
CN104123241B
CN104123241B CN201310144933.3A CN201310144933A CN104123241B CN 104123241 B CN104123241 B CN 104123241B CN 201310144933 A CN201310144933 A CN 201310144933A CN 104123241 B CN104123241 B CN 104123241B
Authority
CN
China
Prior art keywords
internal memory
energy consumption
write
page
anonymous
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
CN201310144933.3A
Other languages
Chinese (zh)
Other versions
CN104123241A (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.)
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
Original Assignee
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
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, Institute of Computing Technology of CAS filed Critical Huawei Technologies Co Ltd
Priority to CN201310144933.3A priority Critical patent/CN104123241B/en
Publication of CN104123241A publication Critical patent/CN104123241A/en
Application granted granted Critical
Publication of CN104123241B publication Critical patent/CN104123241B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Storage Device Security (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The embodiment of the present invention discloses a kind of anonymous page initial method of internal memory, including:The physical address of the anonymous page of internal memory to be identified is obtained, the anonymous page of the internal memory is the internal memory of a unit;According to the physical address, default address name mapping table is searched, the internal memory title of the internal memory corresponding to the physical address is obtained, the address name mapping table is used for the corresponding relation of the internal memory title for the physical address and internal memory for reflecting the anonymous page of internal memory;According to the internal memory title, the default energy consumption different information mapping table of lookup, acquisition writes 0 to the internal memory and writes 1 energy consumption different information, and the energy consumption different information mapping table is used for reflection and 0 is write to different internal memories and 1 energy consumption different information is write;According to the internal memory is write 0 with write 1 energy consumption different information, corresponding initialization operation is carried out to the anonymous page of the internal memory.It is corresponding to initialize system the embodiment of the invention also discloses a kind of anonymous page apparatus for initializing of internal memory and the anonymous page of internal memory.

Description

Internal memory anonymity page initial method, apparatus and system
Technical field
The present invention relates to computer realm, more particularly to a kind of anonymous page initial method of internal memory, apparatus and system.
Background technology
In computer systems, internal memory typically by DRAM, (visit by Dynamic Random Access Memory, dynamic random Ask memory) constitute.Because DRAM integrated levels are low, finite capacity.In addition, DRAM belongs to volatile memory device, in order to ensure Data are not lost, it is necessary to which continuous refresh operation, causes DRAM high energy consumptions.Memory system energy consumption accounts for computer system total energy consumption Large percentage, energy consumption problem also increasingly becomes the bottleneck of restriction memory system development.Compared with DRAM, new NVM (Non- Volatile Memory) energy consumption is lower, and because integrated level is high, bigger capacity can be accomplished.As application is held to internal memory The requirement of amount is increasing, and non-volatile demand is increased, and has only been difficult to meet the need applied by the DRAM internal memories constituted Ask, NVM is constituted as internal memory or DRAM with NVM and mixes internal memory, by the developing direction as following memory system.
The principle of NVM data storages is, by memory cell add different size, the voltage of different directions or magnetic field etc. come Change the resistance of memory cell, the data that storage is judged according to the difference of resistive memory cell size are 0 or 1.Such as PCM (Phase Change Memory, phase transition storage), by adding different size of voltage to change memory cell to memory cell Resistance;Unipolarity RRAM (Resistive Random Access Memory, resistive formula memory), by memory cell Plus different size of voltage changes the resistance of memory cell;Bipolarity RRAM, by adding different directions, difference to memory cell The voltage of size changes the resistance of memory cell;MRAM (Magnetoresistive Random Access Memory, magnetic Resistive memory), change the resistance of memory cell by adding the magnetic field of different directions to memory cell.It is this single according to storage First resistance sizes judge 0 and 1 memory device, and it is different with the energy consumption for writing 1 (SET operation) to write 0 (RESET operation).
The memory management module of operating system uses dynamic memory distribution technology, when the page that process is accessed is not in internal memory, Page fault can be caused, page fault processing routine carries out actual Physical Page distribution.Wherein, page is the interior of unit Deposit, page includes anonymous page and non-anonymous page.
In the prior art, operating system memory management module is when handling page fault, if this page is quilt for the first time Process accesses and is anonymous page, then page fault processing routine calls do_anonymous_page () function to obtain one newly The anonymous page of physics, and call clear_page () function that anonymous all positions of page are initialized as into 0.
All positions of anonymous page are directly initialized as 0, do not account for new NVM and write 0 by operating system in the anonymous page of distribution Energy consumption difference in size with writing 1, so as to cause energy waste.
The content of the invention
The embodiment of the present invention proposes a kind of anonymous page apparatus for initializing of internal memory for saving energy consumption, method, system, passes through identification The title and physical address of different internal memories, judge that internal memory writes 0 and writes 1 energy consumption difference, carry out different initialization operations, reduce The wasting of resources.
On the one hand, the embodiment of the present invention provides a kind of internal memory anonymous page initial method, including:
The physical address of the anonymous page of internal memory to be identified is obtained, the anonymous page of the internal memory is the internal memory of a unit;
According to the physical address, default address name mapping table is searched, is obtained corresponding to the interior of the physical address The internal memory title deposited, the address name mapping table is used for the internal memory title for the physical address and internal memory for reflecting the anonymous page of internal memory Corresponding relation;
According to the internal memory title, default energy consumption different information mapping table is searched, acquisition writes 0 to the internal memory with writing 1 Energy consumption different information, the energy consumption different information mapping table be used for reflect different internal memories is write 0 with write 1 energy consumption difference believe Breath;
According to the internal memory is write 0 with write 1 energy consumption different information, the anonymous page of the internal memory is initialized accordingly Operation.
In a kind of possible implementation on the one hand, the physical address for obtaining the anonymous page of internal memory to be identified it Before, address name mapping table is created, the address name mapping table is used to reflect the internal memory title and the anonymous page of the internal memory Corresponding physical address.
It is described in alternatively possible implementation with reference to one side or a kind of possible implementation of one side Setting up address name mapping table includes modification basic input-output system BIOS, by the internal memory title and the physical address The Installed System Memory mapping table write in BIOS.
It is described in alternatively possible implementation with reference to one side or a kind of possible implementation of one side Setting up address name mapping table includes running amended basic input-output system BIOS, by the internal memory title and described Physical address is saved into the Installed System Memory mapping table in the amended BIOS.
With reference to one side or a kind of possible implementation of one side, in alternatively possible implementation, in institute State acquisition and 0 is write to the internal memory with before writing 1 energy consumption different information, creating energy consumption different information mapping table, the energy consumption is poor Different information MAP table is used for reflection and 0 is write to different internal memories and 1 energy consumption different information is write.
It is described in alternatively possible implementation with reference to one side or a kind of possible implementation of one side Energy consumption different information mapping table set up in operating system nucleus, kernel startup after dynamic load.
It is described in alternatively possible implementation with reference to one side or a kind of possible implementation of one side According to the energy consumption different information that 0 is write to the internal memory and 1 is write, corresponding initialization behaviour is carried out to the anonymous page of the internal memory Make, including if the internal memory is write 0 energy consumption be less than the internal memory is write 1 energy consumption, by the anonymous all positions of page of the internal memory It is initialized as 0;If the internal memory is write 1 energy consumption be less than the internal memory is write 0 energy consumption, the anonymous page of the internal memory is owned Position is initialized as 1.
With reference to one side or a kind of possible implementation of one side, in alternatively possible implementation, state If the internal memory is write 0 energy consumption be less than the internal memory is write 1 energy consumption, the anonymous all positions of page of the internal memory are initialized as 0;If the internal memory is write 1 energy consumption be less than the internal memory is write 0 energy consumption, by all initialization of the anonymous page of the internal memory It is included in for 1 in the memory management module of operating system and adds an anonymous page initialization function, for the internal memory is anonymous All positions of page are set to 1;If the internal memory is write 0 energy consumption be less than the internal memory is write 1 energy consumption, calling system is existing The anonymous all positions of page of the internal memory are set to 0 by function;If the internal memory is write 1 energy consumption be less than 0 is write to the internal memory Energy consumption, then call the anonymous page initialization function of described addition, and the anonymous all positions of page of the internal memory are set into 1.
It is described in alternatively possible implementation with reference to one side or a kind of possible implementation of one side Internal memory include PCM, NVM, DRAM, RRAM, MRAM individually and any of the above combination mixing internal memory.
The embodiment of the present invention also provides a kind of internal memory anonymous page apparatus for initializing, including:
Addressed module, the physical address for obtaining the anonymous page of internal memory to be identified;
Internal memory title identification module, for the physical address obtained according to the addressed module, is searched defaultly Location title mapping table, obtains the internal memory title of the internal memory corresponding to the physical address, and the address name mapping table is used for anti- Reflect the corresponding relation of the physical address of the anonymous page of internal memory and the internal memory title of internal memory;
Energy consumption difference identification module, for the internal memory title obtained according to the internal memory title identification module, is searched Default energy consumption different information mapping table, acquisition writes 0 to the internal memory and writes 1 energy consumption different information, the energy consumption difference letter Breath mapping table is used for reflection and 0 is write to different internal memories and 1 energy consumption different information is write;
Initialization module, for the energy consumption that 0 is write to the internal memory and 1 is write obtained according to the energy consumption difference identification module Different information, corresponding initialization operation is carried out to the anonymous page of the internal memory.
In a kind of possible implementation on the one hand, the anonymous page apparatus for initializing of described internal memory also adds including first Plus module, for setting up address name mapping table in an operating system, the address name mapping table is used to reflect the internal memory Title and the corresponding physical address of the anonymous page of the internal memory.
It is described in alternatively possible implementation with reference to one side or a kind of possible implementation of one side First add module includes modification unit, for changing basic input-output system BIOS, by the internal memory title and described In physical address write-in BIOS;Execution unit, for running the modification amended basic input-output system BIOS of unit, The internal memory title and the physical address are saved into the amended BIOS.
It is described in alternatively possible implementation with reference to one side or a kind of possible implementation of one side The anonymous page apparatus for initializing of internal memory also include the second add module, for setting up energy consumption different information in operating system nucleus Mapping table, the energy consumption different information mapping table is used for reflection and 0 is write to the different internal memory and 1 energy consumption different information is write.
It is described in alternatively possible implementation with reference to one side or a kind of possible implementation of one side Anonymous page initialization module include first module, be less than for 0 energy consumption will to be write and write the anonymous all positions of page of the internal memory of 1 energy consumption It is initialized as 0;Second unit, is less than for will write 1 energy consumption and writes the anonymous all positions of page of the internal memory of 0 energy consumption and be initialized as 1.
It is described in alternatively possible implementation with reference to one side or a kind of possible implementation of one side The second add module operating system nucleus startup after dynamic load.
The embodiment of the present invention provides a kind of internal memory anonymous page initialization system, including builds the anonymous page of device and internal memory of table Apparatus for initializing:
The device for building table, for creating address name mapping table and creating energy consumption different information mapping table;Describedly Location title mapping table is used for the corresponding relation of the internal memory title for the physical address and internal memory for reflecting the anonymous page of the internal memory;Institute State energy consumption different information mapping table be used for reflect the different internal memories is write 0 and write 1 energy consumption different information;
The anonymous page apparatus for initializing of the internal memory, for the physical address according to the anonymous page of the acquisition internal memory to be identified, The address name mapping table that the device of table is created is built described in searching, the internal memory name corresponding to the internal memory of the physical address is obtained Claim;According to the internal memory title, the energy consumption different information mapping table that the device of table is created is built described in lookup, is obtained to described Internal memory write 0 with write 1 energy consumption different information, according to the internal memory write 0 with write 1 energy consumption different information, it is anonymous to the internal memory Page carries out corresponding initialization operation.
The embodiment of the present invention inquires about default address name mapping by obtaining the physical address of the anonymous page of internal memory to be identified Table, obtains the internal memory title of the internal memory corresponding to the physical address, further according to the internal memory title of acquisition, inquires about default internal memory Energy consumption different information table, inquire different internal memories write 0 with write 1 energy consumption difference, according to different internal memories write 0 with write 1 energy consumption it is poor It is different, corresponding initialization operation is carried out to the anonymous page of internal memory, so as to significantly reduce the waste of resource.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, without having to pay creative labor, may be used also To obtain other accompanying drawings according to these accompanying drawings.
Fig. 1 is a kind of anonymous page apparatus for initializing schematic diagram of internal memory provided in an embodiment of the present invention;
Fig. 2 is a kind of anonymous page apparatus for initializing schematic diagram of internal memory provided in an embodiment of the present invention;
Fig. 3 is a kind of anonymous page initial method schematic diagram of internal memory provided in an embodiment of the present invention;
Fig. 4 is a kind of anonymous page initial method schematic diagram of internal memory provided in an embodiment of the present invention;
Fig. 5 is a kind of anonymous page initial method schematic diagram of internal memory being made up of PCM provided in an embodiment of the present invention;
Fig. 6 initializes for a kind of anonymous page of the mixing internal memory being made up of DRAM and PCM, RRAM provided in an embodiment of the present invention Method schematic diagram;
Fig. 7 is a kind of anonymous page initialization system schematic of internal memory provided in an embodiment of the present invention;
Fig. 8 is a kind of PCM internal memories schematic diagram provided in an embodiment of the present invention;
Fig. 9 is the mixing internal memory schematic diagram that a kind of DRAM provided in an embodiment of the present invention is constituted with PCM, RRAM.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
One embodiment of the invention provides a kind of internal memory anonymous page apparatus for initializing, as shown in figure 1, including:
Addressed module 101, the physical address for obtaining the anonymous page of internal memory to be identified;
Internal memory title identification module 102, for the physical address obtained according to addressed module 101, searches default address Title mapping table, obtains the internal memory title corresponding to physical address;
Energy consumption difference identification module 103, for the internal memory title obtained according to internal memory title identification module 102, is searched pre- If energy consumption different information mapping table, obtain internal memory is write 0 with write 1 energy consumption different information;
Initialization module 104, for according to energy consumption difference identification module 103 obtain internal memory is write 0 with write 1 energy consumption it is poor Different information, corresponding initialization operation is carried out to the anonymous page of internal memory.
The embodiment of the present invention inquires about default address name mapping by obtaining the physical address of the anonymous page of internal memory to be identified Table, obtains the internal memory title of the internal memory corresponding to the physical address, further according to the internal memory title of acquisition, inquires about default internal memory Energy consumption different information table, inquire different internal memories write 0 with write 1 energy consumption difference, according to different internal memories write 0 with write 1 energy consumption it is poor It is different, corresponding initialization operation is carried out to the anonymous page of internal memory, so as to significantly reduce the waste of resource.
One embodiment of the invention also provides a kind of internal memory anonymous page apparatus for initializing, as shown in Fig. 2 including:
Addressed module 202, the physical address for obtaining the anonymous page of internal memory to be identified;
Internal memory title identification module 203, for the physical address obtained according to addressed module 202, searches default address Title mapping table, obtains the internal memory title corresponding to physical address;
Energy consumption difference identification module 204, for the internal memory title obtained according to internal memory title identification module 203, is searched pre- If energy consumption different information mapping table, obtain internal memory is write 0 with write 1 energy consumption different information;
Initialization module 205, for according to energy consumption difference identification module 204 obtain internal memory is write 0 with write 1 energy consumption it is poor Different information, corresponding initialization operation is carried out to the anonymous page of internal memory.
In a kind of possible implementation, internal memory anonymity page apparatus for initializing also includes:
First add module 200, for setting up address name mapping table in an operating system, address name mapping table is used for Reflect internal memory title and the corresponding physical address of the anonymous page of internal memory.
In alternatively possible implementation, the first add module includes:
Unit 2001 is changed, for changing basic input-output system BIOS, by internal memory title and the physical address Write in BIOS;
Execution unit 2002, for running amended basic input-output system BIOS, by internal memory title and physics Address is stored in amended BIOS.
In alternatively possible implementation, internal memory anonymity page apparatus for initializing also includes:
Second add module 201, for setting up energy consumption different information mapping table, energy consumption difference letter in operating system nucleus Breath mapping table is used for reflection and 0 is write to different internal memories and 1 energy consumption different information is write.
In alternatively possible implementation, initialization module 205 includes:
First module 2051, is less than for will write 0 energy consumption and writes the anonymous all positions of page of internal memory of 1 energy consumption and be initialized as 0;
Second unit 2052, is less than for will write 1 energy consumption and writes the anonymous all positions of page of internal memory of 0 energy consumption and be initialized as 1.
In alternatively possible implementation, the second add module 201 dynamic load after operating system nucleus startup, Dynamic load is to save memory source.
The embodiment of the present invention inquires about default address name mapping by obtaining the physical address of the anonymous page of internal memory to be identified Table, obtains the internal memory title of the internal memory corresponding to the physical address, further according to the internal memory title of acquisition, inquires about default internal memory Energy consumption different information table, inquire different internal memories write 0 with write 1 energy consumption difference, according to different internal memories write 0 with write 1 energy consumption it is poor It is different, it is less than to writing 0 energy consumption and writes the internal memory of 1 energy consumption by the anonymous all positions of page of internal memory and be set to 0, and be less than to writing 1 energy consumption and write 0 energy consumption Internal memory, the anonymous all positions of page of internal memory are set to 1, so that the larger waste for reducing resource.
One embodiment of the invention also provides a kind of internal memory anonymous page initial method, as shown in figure 3, step is as follows:
S100, obtains the physical address of the anonymous page of internal memory to be identified;
In one embodiment, operating system memory management module is addressed operation, obtains the anonymous page of internal memory to be identified Range of physical addresses.
S101, according to the physical address of acquisition, searches address name mapping table, obtains the internal memory name corresponding to physical address Claim;
In one embodiment, operating system reads the memory information in Installed System Memory mapping table in internal memory initialization, The name information of every kind of internal memory is obtained, and preserves the information.
S102, according to internal memory title, identification internal memory writes 0 and writes 1 energy consumption different information;
In one embodiment, operating system accesses energy consumption of memory different information mapping table after kernel startup, obtains interior Deposit write 0 with write 1 energy consumption different information.
S103, according to internal memory write 0 with write 1 energy consumption different information, carry out different initialization operations;
In one embodiment, if internal memory write 0 energy consumption be less than write 1 energy consumption, by all settings of the anonymous page of internal memory For 0;If internal memory write 1 energy consumption be less than write 0 energy consumption, the anonymous all positions of page of internal memory are set to 1;
In another embodiment, a newly-built function in operating system memory management module, for internal memory is anonymous All positions of page are set to 1;If it is small that internal memory writes 1 energy consumption, memory management module calls the new function to be initialized.
In another embodiment, if to write 0 energy consumption small for internal memory, operating system calls existing system method, by anonymous page All positions are initialized as 0.
The embodiment of the present invention inquires about default address name mapping by obtaining the physical address of the anonymous page of internal memory to be identified Table, obtains the internal memory title of the internal memory corresponding to the physical address, further according to the internal memory title of acquisition, inquires about default internal memory Energy consumption different information table, inquire different internal memories write 0 with write 1 energy consumption difference, according to different internal memories write 0 with write 1 energy consumption it is poor It is different, it is less than to writing 0 energy consumption and writes the internal memory of 1 energy consumption by the anonymous all positions of page of internal memory and be set to 0, and be less than to writing 1 energy consumption and write 0 energy consumption Internal memory, the anonymous all positions of page of internal memory are set to 1, so that the larger waste for reducing resource.
One embodiment of the invention also provides a kind of internal memory anonymous page initial method, as shown in figure 4, step is as follows:
S1001, creates address name mapping table;
In one embodiment, basic input-output system BIOS is changed, internal memory name is added in Installed System Memory mapping table Claim and corresponding physical address.
In another embodiment, amended basic input-output system BIOS is performed, by internal memory title and accordingly Physical address information be saved into Installed System Memory mapping table.
S100, obtains the physical address of the anonymous page of internal memory to be identified;
In one embodiment, operating system memory management module is addressed operation, obtains the anonymous page of internal memory to be identified Range of physical addresses.
S101, according to the physical address of acquisition, searches address name mapping table, obtains the internal memory name corresponding to physical address Claim;
In one embodiment, operating system reads the memory information in Installed System Memory mapping table in internal memory initialization, The name information of every kind of internal memory is obtained, and preserves the information.
S1011, creates energy consumption of memory different information mapping table;
In one embodiment, energy consumption of memory different information mapping table is set up in operating system nucleus.
In another embodiment, energy consumption of memory different information mapping table comprises at least two row contents:Internal memory title and It is corresponding to write energy consumption smaller value.
In another embodiment, energy consumption of memory different information mapping table dynamic load after operating system nucleus startup.
S102, according to internal memory title, identification internal memory writes 0 and writes 1 energy consumption different information;
In one embodiment, operating system accesses energy consumption of memory different information mapping table after kernel startup, obtains interior Deposit write 0 with write 1 energy consumption different information.
S103, according to internal memory write 0 with write 1 energy consumption different information, carry out different initialization operations;If writing 0 energy Consumption is small, and all positions are set into 0;If the energy consumption for writing 1 is small, all positions are set to 1;
In one embodiment, a newly-built function in operating system memory management module, for by the anonymous page of internal memory All positions are set to 1;If it is small that internal memory writes 1 energy consumption, memory management module calls the new function to be initialized.
In another embodiment, if to write 0 energy consumption small for internal memory, operating system calls existing system method, by anonymous page All positions are initialized as 0.
The embodiment of the present invention inquires about default address name mapping by obtaining the physical address of the anonymous page of internal memory to be identified Table, obtains the internal memory title of the internal memory corresponding to the physical address, further according to the internal memory title of acquisition, inquires about default internal memory Energy consumption different information table, inquire different internal memories write 0 with write 1 energy consumption difference, according to different internal memories write 0 with write 1 energy consumption it is poor It is different, it is less than to writing 0 energy consumption and writes the internal memory of 1 energy consumption by the anonymous all positions of page of internal memory and be set to 0, and be less than to writing 1 energy consumption and write 0 energy consumption Internal memory, the anonymous all positions of page of internal memory are set to 1, so that the larger waste for reducing resource.
For the ease of it is more directly perceived, be easier to understand the anonymous page initial method of internal memory, as shown in Figure 5 and Figure 8, the present embodiment Additionally provide a kind of anonymous page initial method of internal memory of PCM compositions.
S2001, creates address name mapping table first, i.e., by changing basic input-output system BIOS, by internal memory name Referred to as PCM and corresponding 0~4GB of physical address information are added in Installed System Memory mapping table E820 tables, and run amended BIOS preserves information, as shown in table 1;
S200, operating system is in internal memory initialization, and memory management module is addressed operation automatically, obtains the thing of internal memory It is 0~4GB to manage address, as shown in Figure 5;
S201, operating system reads the memory information in Installed System Memory mapping table E820 tables, identification in internal memory initialization Go out the entitled PCM of the corresponding internal memory of physical address of 0~4GB scopes;
S2011, sets up energy consumption of memory different information mapping table, the mapping of energy consumption of memory different information in operating system nucleus Table comprises at least two row contents:Internal memory title and it is corresponding write energy consumption smaller value, as shown in table 2;
S202, operating system accesses energy consumption of memory different information mapping table after kernel startup, and inquiry PCM writes 0 with writing 1 Energy consumption different information map information, obtain PCM write 1 energy consumption it is smaller;
S2031, adds an anonymous page initialization function clear_page_ in the memory management module of operating system One (), for all positions of anonymous page to be both configured into 1;
S203, learn on inquiry that PCM write 1 energy consumption be less than write 0 energy consumption, in the anonymous page of initialization, call clear_ All positions of anonymous page are initialized as 1 by page_one () function.
Device name Range of physical addresses
PCM 0~4GB
The internal memory title of table 1 and corresponding physical address information
Device name Write the less numerical value of energy consumption
DRAM 0
PCM 1
RRAM 0
The internal memory of table 2 writes 0 and writes 1 energy consumption difference in size information MAP table
The embodiment of the present invention inquires about default address name mapping by obtaining the physical address of the anonymous page of internal memory to be identified Table, obtains the internal memory title of the internal memory corresponding to the physical address, further according to the internal memory title of acquisition, inquires about default internal memory Energy consumption different information table, inquire different internal memories write 0 with write 1 energy consumption difference, according to different internal memories write 0 with write 1 energy consumption it is poor It is different, it is less than to writing 0 energy consumption and writes the internal memory of 1 energy consumption by the anonymous all positions of page of internal memory and be set to 0, and be less than to writing 1 energy consumption and write 0 energy consumption Internal memory, the anonymous all positions of page of internal memory are set to 1, so that the larger waste for reducing resource.
The present embodiment additionally provides a kind of anonymous page initial method of mixing internal memory being made up of DRAM and PCM, RRAM, such as Shown in Fig. 6 and Fig. 9:
S3001, creates address name mapping table, i.e., by changing basic input-output system BIOS, internal memory is entitled DRAM corresponding 0~1GB of physical address, the entitled PCM of the internal memory corresponding physical address of internal memory are 1~2GB, internal memory title It is that 2~4GB information is added in Installed System Memory mapping table E820 tables for the RRAM corresponding physical address of internal memory, and runs modification BIOS afterwards preserves information, as shown in table 3;
S300, during internal memory initialization, reads the memory information in Installed System Memory mapping table E820 tables, identifies that internal memory is anonymous Physical address where page is 0~4GB;
S301, operating system is in internal memory initialization, and memory management module is addressed operation automatically, obtains different things Reason address realm internal memory title be respectively:0~1GB is DRAM, and 1~2GB is PCM, and 2~4GB is RRAM;
S3011, sets up energy consumption of memory different information mapping table, the mapping of energy consumption of memory different information in operating system nucleus Table comprises at least two row contents:Internal memory title and it is corresponding write energy consumption smaller value, as shown in table 2;
S302, operating system accesses energy consumption of memory different information mapping table after kernel startup, obtains DRAM and writes 0 energy consumption Small, PCM writes that 1 energy consumption is small, RRAM writes the small information of 0 energy consumption;
S3031, adds an anonymous page initialization function clear_page_ in the memory management module of operating system One (), for all positions of anonymous page to be both configured into 1;
S303, learns on inquiry that, 0~1GB of range of physical addresses be DRAM, and DRAM write 0 energy consumption be less than write 1 energy Consumption, then the memory management module of operating system calls existing system function clear_page () function by the beginning of all positions of anonymous page Beginning turns to 0;1~2GB of range of physical addresses be PCM, PCM write 1 energy consumption be less than write 0 energy consumption, then call clear_page_ All positions of anonymous page are initialized as 1 by one () function;2~4GB of range of physical addresses is RRAM, and the energy consumption that RRAM writes 0 is less than Write 1 energy consumption, then call clear_page () function that all positions of anonymous page are initialized as into 0.
Device name Range of physical addresses
DRAM 0~1GB
PCM 1~2GB
RRAM 2~4GB
The internal memory title of table 3 and corresponding physical address information
The embodiment of the present invention inquires about default address name mapping by obtaining the physical address of the anonymous page of internal memory to be identified Table, obtains the internal memory title of the internal memory corresponding to the physical address, further according to the internal memory title of acquisition, inquires about default internal memory Energy consumption different information table, inquire different internal memories write 0 with write 1 energy consumption difference, according to different internal memories write 0 with write 1 energy consumption it is poor It is different, it is less than to writing 0 energy consumption and writes the internal memory of 1 energy consumption by the anonymous all positions of page of internal memory and be set to 0, and be less than to writing 1 energy consumption and write 0 energy consumption Internal memory, the anonymous all positions of page of internal memory are set to 1, so that the larger waste for reducing resource.
One embodiment of the invention also provides a kind of internal memory anonymous page initialization system, as shown in fig. 7, comprises:
400, one build table device, for create address name mapping table and create energy consumption different information mapping table;Ground Location title mapping table is used for the corresponding relation of the internal memory title for the physical address and internal memory for reflecting the anonymous page of internal memory;Energy consumption difference is believed Breath mapping table is used for reflection and 0 is write to different internal memories and 1 energy consumption different information is write;
401, internal memory anonymity page apparatus for initializing, for according to the physical address for obtaining the anonymous page of internal memory to be identified, searching The address name mapping table that the device for building table is created, obtains the internal memory title of the internal memory corresponding to physical address;According to interior Title is deposited, the energy consumption different information mapping table for building meter apparatus establishment is searched, acquisition writes 0 to internal memory and writes 1 energy consumption different information, According to internal memory write 0 with write 1 energy consumption different information, corresponding initialization operation is carried out to the anonymous page of internal memory.
In a kind of possible implementation, the device 400 for building table changes Installed System Memory mapping in operating system BIOS Table table, creates address name mapping table, and address name mapping table is used for the physical address and the name of internal memory for reflecting the anonymous page of internal memory Claim corresponding relation, as shown in table 3.
In a kind of possible implementation, Installed System Memory mapping table is E820 tables in BIOS.
In another possible implementation, the device 400 for building table creates energy consumption different information in operating system nucleus Mapping table, energy consumption different information mapping table is used for reflection and 0 is write to different internal memories and 1 energy consumption different information is write, such as the institute of table 2 Show.
The embodiment of the present invention inquires about default address name mapping by obtaining the physical address of the anonymous page of internal memory to be identified Table, obtains the internal memory title of the internal memory corresponding to the physical address, further according to the internal memory title of acquisition, inquires about default internal memory Energy consumption different information table, inquire different internal memories write 0 with write 1 energy consumption difference, according to different internal memories write 0 with write 1 energy consumption it is poor It is different, it is less than to writing 0 energy consumption and writes the internal memory of 1 energy consumption by the anonymous all positions of page of internal memory and be set to 0, and be less than to writing 1 energy consumption and write 0 energy consumption Internal memory, the anonymous all positions of page of internal memory are set to 1, so that the larger waste for reducing resource.
One embodiment of the invention additionally provides a kind of anonymous page initializing computer of internal memory, including memory and processing Device, wherein, memory is used for store instruction;Processor, is coupled with the memory, and the processor is configured as execution and is stored in Instruction in reservoir, and the processor is configurable for performing internal memory shown in any embodiment as corresponding to Fig. 2 to Fig. 3 and hides Name page initial method, its realization principle is similar, and here is omitted.
In summary, the embodiment of the present invention is when operating system memory management module initializes anonymous page, it is contemplated that different Internal memory writes 0 and writes 1 energy consumption difference in size, and anonymous page is initialized as to write the less numerical value of energy consumption.Pass through above technical scheme Memory system energy consumption is saved, so as to reduce the operating cost of memory system and whole system.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with The hardware of correlation is instructed to complete by computer program, described program can be stored in a computer read/write memory medium In, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
It the foregoing is only several embodiments of the present invention, those skilled in the art is according to can be with disclosed in application documents Various changes or modification are carried out to the present invention without departing from the spirit and scope of the present invention.

Claims (15)

1. a kind of anonymous page initial method of internal memory, it is characterised in that including:
The physical address of the anonymous page of internal memory to be identified is obtained, the anonymous page of the internal memory is the internal memory of a unit;
According to the physical address, default address name mapping table is searched, acquisition is corresponding to the internal memory of the physical address Internal memory title, the address name mapping table is used for the correspondence of the internal memory title for the physical address and internal memory for reflecting the anonymous page of internal memory Relation;
According to the internal memory title, default energy consumption different information mapping table is searched, acquisition writes 0 to the internal memory and writes 1 energy Different information is consumed, the energy consumption different information mapping table is used for reflection and 0 is write to different internal memories and 1 energy consumption different information is write;
According to the internal memory is write 0 with write 1 energy consumption different information, corresponding initialization is carried out to the anonymous page of the internal memory and grasped Make.
2. the anonymous page initial method of internal memory according to claim 1, it is characterised in that obtain internal memory to be identified described Before the physical address of anonymous page, in addition to:
Address name mapping table is created, the address name mapping table is used to reflect the internal memory title and the anonymous page of the internal memory Corresponding physical address.
3. the anonymous page initial method of internal memory according to claim 2, it is characterised in that the establishment address name mapping Table includes:
Basic input-output system BIOS is changed, the internal memory title and the physical address are write in the system in BIOS Deposit mapping table;
Amended basic input-output system BIOS is run, the internal memory title and the physical address are saved into described Installed System Memory mapping table in amended BIOS.
4. the anonymous page initial method of internal memory according to claim 1, it is characterised in that in the acquisition to the internal memory Write 0 with before writing 1 energy consumption different information, in addition to:
Energy consumption different information mapping table is created, the energy consumption different information mapping table, which is used to reflect, writes 0 to different internal memories with writing 1 Energy consumption different information.
5. the anonymous page initial method of internal memory according to claim 4, it is characterised in that described energy consumption different information reflects Firing table is created in operating system nucleus, the dynamic load after kernel startup.
6. the anonymous page initial method of internal memory according to claim 1, it is characterised in that the basis is write to the internal memory 0 with write 1 energy consumption different information, corresponding initialization operation is carried out to the anonymous page of the internal memory, including:
If the internal memory is write 0 energy consumption be less than the internal memory is write 1 energy consumption, the anonymous all positions of page of the internal memory are initial Turn to 0;
If the internal memory is write 1 energy consumption be less than the internal memory is write 0 energy consumption, the anonymous all positions of page of the internal memory are initial Turn to 1.
7. the anonymous page initial method of internal memory according to claim 6, it is characterised in that if described to the internal memory Write 0 energy consumption be less than the internal memory is write 1 energy consumption, the anonymous all positions of page of the internal memory are initialized as 0;If to described interior The energy consumption for writing 1 is deposited less than the energy consumption that 0 is write to the internal memory, the anonymous all positions of page of the internal memory are initialized as into 1 includes:
An anonymous page initialization function is added in the memory management module of operating system, for by the anonymous page institute of the internal memory There is position to be set to 1;
If the internal memory is write 0 energy consumption be less than the internal memory is write 1 energy consumption, the existing function of calling system will be described All positions of internal memory anonymity page are set to 0;
If the internal memory is write 1 energy consumption be less than the internal memory is write 0 energy consumption, at the beginning of calling the anonymous page of described addition The anonymous all positions of page of the internal memory are set to 1 by beginningization function.
8. the anonymous page initial method of internal memory according to claim 1 or 2 or 3 or 4 or 5 or 6 or 7, it is characterised in that institute State internal memory including PCM, NVM, DRAM, RRAM, MRAM individually and any of the above combination mixing internal memory.
9. a kind of anonymous page apparatus for initializing of internal memory, it is characterised in that including:
Addressed module, the physical address for obtaining the anonymous page of internal memory to be identified;
Internal memory title identification module, for the physical address obtained according to the addressed module, searches default address name Claim mapping table, obtain the internal memory title of the internal memory corresponding to the physical address, the address name mapping table is used to reflect interior Deposit the corresponding relation of the physical address of anonymous page and the internal memory title of internal memory;
Energy consumption difference identification module, for the internal memory title got according to the internal memory title identification module, is searched pre- If energy consumption different information mapping table, obtain the internal memory is write 0 with write 1 energy consumption different information, the energy consumption different information Mapping table is used for reflection and 0 is write to different internal memories and 1 energy consumption different information is write;
Initialization module, for the energy that 0 is write to the internal memory and 1 is write got according to the energy consumption difference identification module Different information is consumed, corresponding initialization operation is carried out to the anonymous page of the internal memory.
10. the anonymous page apparatus for initializing of internal memory according to claim 9, it is characterised in that also include:
First add module, for creating address name mapping table in an operating system, the address name mapping table is used for anti- Reflect the internal memory title and the corresponding physical address of the anonymous page of the internal memory.
11. the anonymous page apparatus for initializing of internal memory according to claim 10, it is characterised in that the first add module bag Include:
Unit is changed, for changing basic input-output system BIOS, the internal memory title and the physical address are write In BIOS;
Execution unit, for running the modification amended basic input-output system BIOS of unit, by the internal memory title And the physical address is saved into the amended BIOS.
12. the anonymous page apparatus for initializing of internal memory according to claim 9, it is characterised in that also include:
Second add module, for creating energy consumption different information mapping table, the energy consumption different information in operating system nucleus Mapping table is used for reflection and 0 is write to the different internal memory and 1 energy consumption different information is write.
13. the anonymous page apparatus for initializing of internal memory according to claim 9, it is characterised in that the initialization module includes:
First module, is less than for will write 0 energy consumption and writes the anonymous all positions of page of the internal memory of 1 energy consumption and be initialized as 0;
Second unit, is less than for will write 1 energy consumption and writes the anonymous all positions of page of the internal memory of 0 energy consumption and be initialized as 1.
14. the anonymous page apparatus for initializing of internal memory according to claim 12, it is characterised in that the second described add module The dynamic load after operating system nucleus startup.
15. a kind of anonymous page initialization system of internal memory, including build the anonymous page apparatus for initializing of device and internal memory of table, its feature It is, including:
The device for building table, for creating address name mapping table and creating energy consumption different information mapping table;The address name Mapping table is claimed to be used for the corresponding relation of internal memory title for the physical address and internal memory for reflecting the anonymous page of internal memory;The energy consumption difference letter Breath mapping table is used for reflection and 0 is write to different internal memories and 1 energy consumption different information is write;
The anonymous page apparatus for initializing of the internal memory, for according to the physical address for obtaining the anonymous page of the internal memory to be identified, searching The address name mapping table that the device for building table is created, obtains the internal memory title of the internal memory corresponding to the physical address;Root According to the internal memory title, the energy consumption different information mapping table that the device of table is created is built described in lookup, is obtained to the internal memory Write 0 with write 1 energy consumption different information, according to the internal memory write 0 with write 1 energy consumption different information, the anonymous page of the internal memory is entered The corresponding initialization operation of row.
CN201310144933.3A 2013-04-24 2013-04-24 Internal memory anonymity page initial method, apparatus and system Active CN104123241B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310144933.3A CN104123241B (en) 2013-04-24 2013-04-24 Internal memory anonymity page initial method, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310144933.3A CN104123241B (en) 2013-04-24 2013-04-24 Internal memory anonymity page initial method, apparatus and system

Publications (2)

Publication Number Publication Date
CN104123241A CN104123241A (en) 2014-10-29
CN104123241B true CN104123241B (en) 2017-08-29

Family

ID=51768659

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310144933.3A Active CN104123241B (en) 2013-04-24 2013-04-24 Internal memory anonymity page initial method, apparatus and system

Country Status (1)

Country Link
CN (1) CN104123241B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105786721A (en) * 2014-12-25 2016-07-20 研祥智能科技股份有限公司 Memory address mapping management method and processor
CN110008016B (en) * 2019-04-15 2021-06-22 深圳市万普拉斯科技有限公司 Anonymous page management method and device, terminal device and readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101438242A (en) * 2006-03-30 2009-05-20 晶像股份有限公司 Shared nonvolatile memory architecture

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8825982B2 (en) * 2010-06-10 2014-09-02 Global Supercomputing Corporation Storage unsharing

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101438242A (en) * 2006-03-30 2009-05-20 晶像股份有限公司 Shared nonvolatile memory architecture

Also Published As

Publication number Publication date
CN104123241A (en) 2014-10-29

Similar Documents

Publication Publication Date Title
CN103946826B (en) For realizing the device and method of multi-level store level on common storage channel
US9852069B2 (en) RAM disk using non-volatile random access memory
DE112011106032B4 (en) Energy saving by memory channel shutdown
CN104115129B (en) System and method for the intelligent refresh data from processor to memory sub-system
US10452539B2 (en) Simulator for enterprise-scale simulations on hybrid main memory systems
EP2661692B1 (en) Memory address translation
CN104050112B (en) Beginning and the instruction of end for marking the non-transactional code area for needing to write back lasting storage
CN105095116B (en) Cache method, cache controller and the processor replaced
US8386698B2 (en) Data accessing method for flash memory and storage system and controller using the same
CN109144888A (en) Storage system
EP3712774A1 (en) Apparatus and method for implementing a multi-level memory hierarchy
CN105808156A (en) Method for writing data into solid state drive and solid state drive
WO2013048503A1 (en) Apparatus and method for implementing a multi-level memory hierarchy having different operating modes
CN103425600A (en) Address mapping method for flash translation layer of solid state drive
CN103999161A (en) Apparatus and method for phase change memory drift management
CN105183379A (en) Mixed memory data backup system and method
CN103927130B (en) Based on external memory framework in the unification of memory management unit MMU
CN105808455A (en) Memory access method, storage-class memory and computer system
CN109521944A (en) data storage device and data storage method
CN105607862A (en) Solid state disk capable of combining DRAM (Dynamic Random Access Memory) with MRAM (Magnetic Random Access Memory) and being provided with backup power
US20190042415A1 (en) Storage model for a computer system having persistent system memory
CN104123241B (en) Internal memory anonymity page initial method, apparatus and system
CN101944011B (en) The device of working procedure, chip and method
CN103377141B (en) The access method of scratchpad area (SPA) and access device
CN102681792A (en) Solid-state disk memory partition method

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