CN105335306A - Memory control method and memory control device - Google Patents

Memory control method and memory control device Download PDF

Info

Publication number
CN105335306A
CN105335306A CN201410307864.8A CN201410307864A CN105335306A CN 105335306 A CN105335306 A CN 105335306A CN 201410307864 A CN201410307864 A CN 201410307864A CN 105335306 A CN105335306 A CN 105335306A
Authority
CN
China
Prior art keywords
memory
physical memory
page
physical
trigger condition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410307864.8A
Other languages
Chinese (zh)
Other versions
CN105335306B (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 CN201410307864.8A priority Critical patent/CN105335306B/en
Priority to PCT/CN2015/075704 priority patent/WO2016000470A1/en
Publication of CN105335306A publication Critical patent/CN105335306A/en
Application granted granted Critical
Publication of CN105335306B publication Critical patent/CN105335306B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The embodiment of the invention discloses a memory control method and a memory control device. The method comprises the following steps that memory control equipment receives control strategies aiming at physical memories and corresponding triggering conditions, wherein the triggering conditions include state information change of the physical memory and/or an access process received by the memory control equipment; the memory control equipment monitors the state information of the physical memory and the access process; and when the triggering condition is met, the memory control equipment calls the corresponding control strategy for controlling the physical memory. Therefore the memory control equipment used as hardware obtains necessary control strategies from the system to complete physical memory control semantic information required by the control strategies and corresponding control measurement triggering conditions, so that when one triggering condition is met, the memory control equipment can call the control strategy corresponding to the triggering condition to control the physical memory; the interrupt processing of a system is not needed in the control process; and the control efficiency is improved.

Description

A kind of internal memory control method and device
Technical field
The present invention relates to computer realm, particularly relate to a kind of internal memory control method and device.
Background technology
In system cloud gray model, processor can be conducted interviews to physical memory by access process, mainly pass through software at present, as operating system (OperatingSystem, OS), virtual machine monitor (VirtualMachineMonitor, VMM) etc. are directly responsible for these access processes of process and are controlled physical memory accordingly.
System produces a large amount of Signalling exchanges when carrying out Process flowchart to physical memory between meeting and physical memory, wherein the Signalling exchange of a big chunk all needs system to be realized by interrupt processing (as pagefault) substantially, and the related context information of system when all needing when carrying out interrupt processing at every turn to preserve interrupt processing in physical memory, such control flow can the system resource of at substantial.Visible, the expense of directly carrying out Process flowchart to physical memory by software systems is very large, and in some system, interrupt processing even can cause the average retardation more than the 2600CPU clock period, greatly have impact on the whole work efficiency of system.
As can be seen here, the system efficiency of directly carrying out Process flowchart to the physical memory as hardware is very low.
Summary of the invention
In order to solve the problems of the technologies described above, the invention provides a kind of internal memory control method and device, make system control physical memory by hardware control device, improve efficiency.
The embodiment of the invention discloses following technical scheme:
First aspect, the invention provides a kind of internal memory control method, and described method comprises:
Memory control equipment receives control strategy for physical memory and corresponding trigger condition, described control strategy carries the upper strata semantic information for realizing described control strategy, and described trigger condition comprises the access process that the change of the status information of described physical memory and/or described Memory control equipment receive;
Described Memory control equipment monitors the status information of physical memory and described access process;
When meeting described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory.
In the first possible implementation of first aspect,
The address information of described physical memory comprises physical address and virtual address;
The translation look-aside buffer TLB that described Memory control equipment is comprised by self carries out actual situation address translation operation between the physical address of described physical memory and virtual address, makes:
Described access process uses the virtual address of described physical memory by physical memory described in described Memory control device access; Described Memory control equipment, by described actual situation address translation operation, uses the physical address of described physical memory to control described physical memory.
In conjunction with the first possible implementation of first aspect or first aspect, in the implementation that the second is possible, when described trigger condition comprise described access process be specially request page locking time, comprising:
When described Memory control Supervision hear described access process be specially locking specified page in described physical memory time, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
The physical memory addresses information of the specified page used in access process described in described Memory control device parses determines the physical page information of described specified page;
If described specified page is in described physical memory, described specified page is locked in described physical memory by described Memory control equipment;
If described specified page is not in described physical memory, described specified page changes to and is locked in described physical memory by described Memory control equipment.
In conjunction with the implementation that the second of first aspect is possible, in the implementation that the third is possible, when described access process specifically comprises request for direct memory access buffer zone DMABuffer distribution physical page, comprising:
When described Memory control Supervision hears that described access process is specially DMABuffer distribution physical page, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
Described Memory control equipment is that described DMABuffer distributes physical page from described physical memory;
The described physical page distributed is locked in described physical memory by described Memory control equipment, and is locked in described TLB by page table entry corresponding for described physical page.
In conjunction with the first possible implementation of first aspect or first aspect, in the 4th kind of possible implementation, when described trigger condition comprise described access process specifically cause page faults to occur time, comprising:
When described Memory control Supervision hears that described access process specifically causes page faults to occur, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
Described Memory control equipment is determined and is caused the replacement page of the page of page faults and feed back to the transmit leg sending described access process.
In conjunction with the first possible implementation of first aspect or first aspect, in the 5th kind of possible implementation, when the change that described trigger condition comprises the status information of described physical memory be specially memory size change time, comprising:
When described Memory control Supervision hear the change of the status information of described physical memory be specially memory size change time, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
When described physical memory capacity change be specially described physical memory capacity increase time, described Memory control equipment determines the capacity of physical memory that increases and type, and upgrades the status information after the change of described physical memory;
When described physical memory capacity change be specially described physical memory capacity reduce time, the content of pages stored in the physical memory of minimizing copies in the free space of free memory in described physical memory by described Memory control equipment, and upgrades the status information after the change of described physical memory.
In conjunction with the first or the second of first aspect or first aspect or the third or the 4th kind or the 5th kind of possible implementation, in the 6th kind of possible implementation, also comprise:
When the status information of described physical memory changes, described Memory control equipment is by the status information feedback after described physical memory change to the transmit leg sending the described control strategy for physical memory and corresponding trigger condition, and described change comprises memory size change, type of memory change or memory usage and meets predetermined threshold;
Described Memory control equipment receives the control strategy of the status information after the correspondence described physical memory change that described transmit leg sends and corresponding trigger condition.
Second aspect, the invention provides a kind of Memory control device, comprising:
Receiving element, for receiving control strategy for physical memory and corresponding trigger condition, described control strategy carries the upper strata semantic information for realizing described control strategy, and described trigger condition comprises the access process that the change of the status information of described physical memory and/or described Memory control equipment receive;
Monitoring unit, for monitoring the status information of physical memory and described access process;
Control module, for when the result of described monitoring unit meets described trigger condition, calls corresponding control strategy and controls described physical memory.
In the first possible implementation of second aspect, it is characterized in that, when the address information of described physical memory comprises physical address and virtual address, also comprise:
Converting unit, carry out actual situation address translation operation for the translation look-aside buffer TLB comprised by self between the physical address of described physical memory and virtual address, make:
Described access process uses the virtual address of described physical memory to access described physical memory by described converting unit; Described converting unit, by described actual situation address translation operation, uses the physical address of described physical memory to control described physical memory.
In conjunction with the first possible implementation of second aspect or second aspect, in the implementation that the second is possible, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise described access process be specially request page locking time, specifically for:
The physical memory addresses information of resolving the specified page used in described access process determines the physical page information of described specified page;
If described specified page is in described physical memory, described specified page is locked in described physical memory;
If described specified page is not in described physical memory, described specified page changed to and is locked in described physical memory.
In conjunction with the implementation that the second of second aspect is possible, in the implementation that the third is possible, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise described access process specifically comprise request distribute physical page for direct memory access buffer zone DMABuffer time, specifically for:
Be that described DMABuffer distributes physical page from described physical memory;
The described physical page distributed is locked in described physical memory, and page table entry corresponding for described physical page is locked in described TLB.
In conjunction with the first possible implementation of second aspect or second aspect, in the 4th kind of possible implementation, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise described access process specifically cause page faults to occur time, specifically for:
Determine and cause the replacement page of the page of page faults and feed back to the transmit leg sending described access process.
In conjunction with the first possible implementation of second aspect or second aspect, in the 5th kind of possible implementation, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise change that described trigger condition comprises the status information of described physical memory be specially memory size change time, specifically for:
When described physical memory capacity change be specially described physical memory capacity reduce time, the content of pages stored in the physical memory of minimizing is copied in the free space of free memory in described physical memory, and upgrade the status information after the change of described physical memory.
In conjunction with the first or the second of second aspect or second aspect or the third or the 4th kind or the 5th kind of possible implementation, in the 6th kind of possible implementation, also comprise:
Feedback unit, for when the status information of described physical memory changes, by the status information feedback after described physical memory change to the transmit leg sending the described control strategy for physical memory and corresponding trigger condition, described change comprises memory size change, type of memory change or memory usage and meets predetermined threshold;
Described receiving element, the control strategy of the status information after the described physical memory of correspondence also sent for receiving described transmit leg changes and corresponding trigger condition.
As can be seen from technique scheme, Memory control equipment as hardware obtains necessary control strategy from system, the physical memory completed needed for these control strategies controls semantic information, and the trigger condition of corresponding control survey, make when meeting a trigger condition, described Memory control equipment can call should the control strategy of trigger condition control described physical memory, no longer need system to carry out interrupt processing in the process controlled, improve control efficiency.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The method flow diagram of a kind of Memory control that Fig. 1 provides for the embodiment of the present invention;
Method schematic diagram physical memory being carried out to physical page locking that Fig. 2 provides for the embodiment of the present invention;
The structure drawing of device of a kind of Memory control that Fig. 3 provides for the embodiment of the present invention;
The structure drawing of device of a kind of Memory control that Fig. 4 provides for the embodiment of the present invention;
The structure drawing of device of a kind of Memory control that Fig. 5 provides for the embodiment of the present invention;
The hardware configuration schematic diagram of a kind of Memory control equipment that Fig. 6 provides for the embodiment of the present invention.
Embodiment
As can be seen from prior art, be used as the system of software (OS) to control to need software and hardware frequently mutual as the physical memory of hardware, cause it to the expense of system itself very greatly, and can cause a large amount of processing delay.But in fact, to the Volume control of physical memory be, major part is all fairly simple comparatively speaking to the control operation of physical memory, be not to use complicated software just can complete, other hardware (such as Memory Controller Hub can be used completely, MemoryController) these control operations are performed, such as to place and the page replacement etc. of the judgement of illegal address access, the first time access of the page.For this feature, embodiments provide a kind of internal memory control method and device, be used as the Memory control equipment of hardware to obtain necessary control strategy from system, complete physical memory needed for these control strategies and control semantic information, and the trigger condition of corresponding control survey, make when meeting a trigger condition, described Memory control equipment can call should the control strategy of trigger condition control described physical memory, no longer need system to carry out interrupt processing in the process controlled, substantially increase control efficiency.
The embodiment of the present invention also has the feature of physical address and virtual address for physical memory, hardware (such as the comparatively typical translation look-aside buffer (TranslationLookasideBuffer of the conversion of address between virtual address and physical address can be carried out, TLB) part as described Memory control equipment) is integrated, make described Memory control equipment also can process the access process using virtual address to access physical memory, further improve the scope of application of the embodiment of the present invention.
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, 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 clearly described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiment one
How the present embodiment will carry out control to physical memory to internal memory opertaing device is described, and refer to Fig. 1, the method flow diagram of its a kind of Memory control provided for the embodiment of the present invention, the method comprises:
S101: Memory control equipment receives control strategy for physical memory and corresponding trigger condition, described control strategy carries the upper strata semantic information for realizing described control strategy, and described trigger condition comprises the access process that the change of the status information of described physical memory and/or described Memory control equipment receive.
Here it should be noted that, control strategy described here is mainly used for instructing described Memory control equipment to control physical memory, such as limit the free physical memory quota of access process, formulate page priorities, page locking etc., but perform these control strategies and need to use corresponding upper strata semantic information as operational order etc., can comprise: the establishment of process or end, virtual address distribution or release etc., transmit operation order, such as how to lock (Pin) physical page in physical memory, page table entry corresponding to Pin mono-section of virtual address space is in TLB etc.Described upper strata semantic information also refers to not comprise in originally hardware, primarily of the semantic information that software performs.
Trigger condition described in this can have one or more, and each described trigger condition can corresponding one or more control strategy, and related content illustrates carrying out expansion for different concrete conditions in embodiment two, repeats no more here.
Described Memory control equipment can have various ways to obtain these control strategies and corresponding trigger condition, such as obtain from system (OS), or by pre-setting, the present invention how to obtain described system strategy to described Memory control equipment and corresponding trigger condition does not limit.
S102: described Memory control equipment monitors the status information of physical memory and described access process.
S103: when meeting described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory.
This two step it should be noted that, because the described control strategy that obtains in S101 and trigger condition have corresponding relation, therefore once meet a trigger condition, because described Memory control equipment 6 has possessed necessary upper strata semantic information, therefore namely control strategy corresponding to described Memory control equipment calls can use upper strata semantic information to process accordingly according to control strategy, such as a locking specified page is in physical memory, process page faults etc. needs the system just treatable situation relevant to physical memory originally.Judge that the classification of described access process can be completed by access process identification (PID) (pid).
Visible, Memory control equipment as hardware obtains necessary control strategy from system, the physical memory completed needed for these control strategies controls semantic information, and the trigger condition of corresponding control survey, make when meeting a trigger condition, described Memory control equipment can call should the control strategy of trigger condition control described physical memory, no longer need system to carry out interrupt processing in the process controlled, substantially increase control efficiency.
Embodiment two
The present embodiment, by the basis of embodiment one, carries out expansion to described trigger condition and illustrates, and is that example describes described Memory control equipment and how processes described physical memory and control according to different trigger conditions.
Before launching to illustrate to described trigger condition, the feature that needs first comprise physical address and virtual address for physical memory is described, generally there are mapping relations between described physical address and described virtual address, in the prior art, as the Systematical control of software or when accessing physical memory, need the physical address paying close attention to physical memory, such as (DirectMemoryAccess is directly accessed to described physical memory execute store, DMA) during operational order, need multiple restriction, such as physical address must be continuously, must from low address etc., operating process is more loaded down with trivial details.In embodiments of the present invention, TLB is integrated an ingredient as self by described Memory control equipment, the translation function of actual situation address is applied in flexibly in the control to physical memory.Optionally, the embodiment of the present invention also comprises:
The address information of described physical memory comprises physical address and virtual address.
The TLB that described Memory control equipment is comprised by self carries out actual situation address translation operation between the physical address of described physical memory and virtual address, makes:
Described access process uses the virtual address of described physical memory by physical memory described in described Memory control device access; Described Memory control equipment, by described actual situation address translation operation, uses the physical address of described physical memory to control described physical memory.
That is, access process for described physical memory can directly use the virtual address of described physical memory to conduct interviews, thus in some cases, whether the physical address no longer needing to consider accessed physical memory is continuously and from low address, only need directly to use continuous print virtual address to carry out associative operation, by described Memory control equipment, how detailed content supports that the part of dma operation is described.
Next expansion explanation is carried out to described trigger condition, and be that example describes described Memory control equipment and how processes described physical memory and control according to different trigger conditions, embodiments provide at least five kinds of different trigger condition situations, these trigger conditions can be realize on the basis of embodiment one, also can be add in the present embodiment actual situation address conversion basis on realize, the present invention does not limit this.
The first situation:
Optionally, when described trigger condition comprise described access process be specially request page locking time, comprising:
When described Memory control Supervision hear described access process be specially request locking specified page in described physical memory time, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
The physical memory addresses information of the specified page used in access process described in described Memory control device parses determines the physical page information of described specified page.
If described specified page is in described physical memory, described specified page is locked in described physical memory by described Memory control equipment.
If described specified page is not in described physical memory, described specified page changes to and is locked in described physical memory by described Memory control equipment.
The page preserved in physical memory due to Memory control equipment itself cannot understanding is for the priority height of current application scene or significance level, when controlling described physical memory, probably can by important Page swap-out to outside physical memory, system treatment effeciency is caused to reduce, therefore system is after the priority considering the page or significance level, in order to prevent some important page by the physical memory that swaps out, system can send the access process of locking specified page to described Memory control equipment.When described Memory control equipment receives the access process requiring locking specified page, be equivalent to trigger corresponding trigger condition, described Memory control equipment, by calling corresponding control strategy, comprises query page, page locking etc.
Be described further by citing,
Such as on the basis that embodiment adds the conversion of actual situation address, method schematic diagram physical memory being carried out to physical page locking that the application scenarios of page locking can provide for the embodiment of the present invention see Fig. 2, Fig. 2, as shown in Figure 2:
S201: system sends Pin mono-sector address space (can refer to a specified page) the access process in internal memory to described Memory control equipment, and the form of described access process (or crying Pin order) can be: Pinstart_addrlen (or Pinpid).Described Pin order is added in the command queue of described Memory control equipment.Described Pin order calling mlock or mlock_all function to encapsulate and realizing by system standard, thus keeping system interface compatibility, do not need to carry out any amendment to application system, and do not need system break to be switched to kernel state, also system does not process.
S202: when scheduled for executing is to described Pin order from command queue for described Memory control equipment, obtains action type (Pin) and the operating parameter (a sector address space) of described Pin order.
S203: described Memory control equipment, according to the virtual address of resolving the described specified page obtained, inquires about the TLB in described Memory control equipment in units of the page, obtains the physical address of corresponding described specified page.
S204: if described specified page is not yet distributed, described Memory control equipment, by setting the attribute of described specified page as locking (PG_mlocked), realizes described specified page to be locked in described physical memory.Afterwards in the process operated described physical memory, locked described specified page can not be swapped out by from described physical memory.
If physical page is swapped out (present=0), then described Memory control device start changes to (Swap), described specified page is changed in described physical memory, further described specified page is performed to the operation of page locking.
S205: after described Pin order is complete, described Memory control equipment further can also notify system, such as can send response (Response) information.
The second situation:
Optionally, when described access process specifically comprise request for direct memory access buffer zone (DirectMemoryAccessBuffer, DMABuffer) distribute physical page time, comprising:
When described Memory control Supervision hears that described access process is specially DMABuffer distribution physical page, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
Described Memory control equipment is that described DMABuffer distributes physical page from described physical memory;
The described physical page distributed is locked in described physical memory by described Memory control equipment, and is locked in described TLB by page table entry corresponding for described physical page.
DMA be it should be noted that, the wide range that DMA applies at present, as present from the file read-write data disk to needing during internal memory to use DMA; From network interface card transceiver network bag to needing during internal memory to use DMA; Need to use DMA when the storage space PCIE device reads and writes data internal memory.
That is, described access process distributes one section in virtual address space continuous print DMABuffer (buffer zone) space by operating system, and sends request the order of one section of DMABuffer (buffer zone) physical space to described Memory Controller Hub;
Described Memory Controller Hub performs the order distributing DMABuffer physical space, and hardware distributes corresponding physical page, and by these page lockings in internal memory, and the page table entry of its correspondence is locked in the TLB in described Memory Controller Hub; The physical page at this time distributed for DMABuffer can distribute arbitrarily, and no longer needs to take one section of continuous print physical address space; Break DMA requires continuous physical page restriction to DMABuffer thus.
Operating system uses the virtual address space that DMABuffer is corresponding to send DMA request with the disk space information needing to access to dma controller.
Dma controller uses virtual address to send reading and writing data request to described Memory Controller Hub;
Described Memory Controller Hub directly uses the virtual address TLB inquired about on it to obtain corresponding physical address, thus realizes data being read into the physical page at DMABuffer place from peripheral hardware (as disk) or data being write back to peripheral hardware from DMABuffer.
The third situation:
Optionally, when described trigger condition comprise described access process specifically cause page faults to occur time, comprising:
When described Memory control Supervision hears that described access process specifically causes page faults to occur, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
Described Memory control equipment is determined and is caused the replacement page of the page of page faults and feed back to the transmit leg sending described access process.
Here it should be noted that, the situation of described page faults mainly refers to that target pages that described access process is accessed is not stored in the situation in described physical memory.When causing the situation of page faults to occur due to access process, described Memory control equipment needs for current page faults determines the replacement page.Relative to prior art, originally the determination needing system to carry out in the prior art replaces the flow process of the page, can be come by described Memory control equipment in embodiments of the present invention, that is, determine to replace to search in the flow process of the page the blank page, whether can as the replacement page and whether the page clean etc. all can be completed by described Memory control equipment.This greatly simplifies the operation burden of the system when there is page faults, improve system processing speed.
4th kind of situation:
Optionally, when the change that described trigger condition comprises the status information of described physical memory be specially memory size change time, comprising:
When described Memory control Supervision hear the change of the status information of described physical memory be specially memory size change time, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
When described physical memory capacity change be specially described physical memory capacity increase time, described Memory control equipment determines the capacity of physical memory that increases and type, and upgrades the status information after the change of described physical memory.
When described physical memory capacity change be specially described physical memory capacity reduce time, the content of pages stored in the physical memory of minimizing copies in the free space of free memory in described physical memory by described Memory control equipment, and upgrades the status information after the change of described physical memory.
Here it should be noted that, hot plug can be supported at present for physical memory, the type of physical memory is also various all the more, therefore the capacity of the described physical memory of described Memory control equipment control and type all may change at any time, in embodiments of the present invention, described Memory control equipment can monitor the change of the status information of described physical memory, and can carry out corresponding process and operation to the change of the capacity of described physical memory voluntarily.
Be illustrated further by practical application scene:
When carrying out hot plug action to described physical memory, Memory control equipment as described in the memory hot plug event (Hotplug) of correspondence is sent to by corresponding interface by bottom hardware (as BIOS), corresponding interface can be advanced configuration and power-management interface (AdvancedConfigurationandPowerManagementInterface, ACPI).
Described Memory control equipment is when receiving described memory hot plug event, storage organization in the described physical memory of corresponding adjustment, when the capacity of described physical memory adds, the situation of the physical memory such as newly plugged, the physical memory newly added is joined (if system is the free page chained list for buddy system (BuddySystem) in Linux) in the FreeList of memory management by described Memory control equipment; When the capacity of described physical memory decreases, a part for such as described physical memory is by situation about having pulled out, need first by by the valid data that comprise in the physical memory pulled out in the free page in residue physical memory, and reset the corresponding relation in corresponding data and physical memory between memory address.So described Memory control equipment no longer needs the participation of system to the process of internal memory hot plug events, what can realize system is completely transparent.
Further, described Memory control equipment can also identify the type of physical memory, the situation of the physical memory such as newly increased, and described Memory control equipment determines the storage class of the physical memory newly increased, such as PCM or DRAM etc.Such as reduce the situation of physical memory, described Memory control equipment determines the storage class of remaining physical memory.When described Memory control equipment needs to store data in described physical memory, dissimilar data can be stored in the physical memory of corresponding type according to the type of data, such as, the feature non-volatile according to PCM, system indicates described Memory control equipment that important data structure is placed on PCM space, improves the reliability and stability of system.Read to write slow feature soon according to PCM, system can indicate described Memory control equipment that the code segment of program and read-only data section are placed on PCM space.The data of other write access comparatively denses can be assigned in dram space.
5th kind of situation:
Optionally, also comprise:
When the status information of described physical memory changes, described Memory control equipment is by the status information feedback after described physical memory change to the transmit leg sending the described control strategy for physical memory and corresponding trigger condition, and described change comprises memory size change, type of memory change or memory usage and meets predetermined threshold;
Described Memory control equipment receives the control strategy of the status information after the correspondence described physical memory change that described transmit leg sends and corresponding trigger condition.
Here it should be noted that, this situation mainly refers to that described Memory control equipment also possesses the status information to physical memory described in system feedback, so that system determines corresponding control strategy according to the status information of current described physical memory, and the control strategy newly determined is sent to described Memory control equipment.By directly controlling the feedback of the described Memory control equipment of described physical memory, system effectively can grasp the change of the status information of described physical memory, send more practical control strategy with this to described Memory control equipment, allow described Memory control equipment can control described physical memory more targetedly.
Described 5th kind of situation except can add on the basis of embodiment one or in the present embodiment actual situation address conversion basis on realize, also can at least with other four kinds of situations (the first situation is to the 4th kind of situation) combine implement.Such as described 5th kind of situation can combine with the 4th kind of situation to be implemented, when there is described 4th kind of situation (namely occurring hot plug events), capacity or the type of described physical memory there will be change substantially, will trigger described 5th kind of situation thus, such system the status information of current described physical memory of more described Memory control equipment feedback will issue control strategy and corresponding trigger condition more targetedly to described Memory control equipment.Also have may combining of multiple triggering, exhaustive no longer one by one here.
As fully visible, Memory control equipment as hardware obtains necessary control strategy from system, the physical memory completed needed for these control strategies controls semantic information, and the trigger condition of corresponding control survey, make when meeting a trigger condition, described Memory control equipment can call should the control strategy of trigger condition control described physical memory, no longer need system to carry out interrupt processing in the process controlled, substantially increase control efficiency.
Embodiment three
Consult Fig. 3, the structure drawing of device of a kind of Memory control that Fig. 3 provides for the embodiment of the present invention, comprising:
Receiving element 301, for receiving control strategy for physical memory and corresponding trigger condition, described control strategy carries the upper strata semantic information for realizing described control strategy, and described trigger condition comprises the access process that the change of the status information of described physical memory and/or described Memory control equipment receive.
About the description of content please refer to the associated description in embodiment one S101 performed by described receiving element 301, repeat no more here.
Monitoring unit 302, for monitoring the status information of physical memory and described access process.
About the description of content please refer to the associated description in embodiment one S102 performed by described monitoring unit 302, repeat no more here.
Control module 303, for when the result of described monitoring unit meets described trigger condition, calls corresponding control strategy and controls described physical memory.
About the description of content please refer to the associated description in embodiment one S103 performed by described control module 303, repeat no more here.
Optionally, on basis embodiment illustrated in fig. 3, when the address information of described physical memory comprises physical address and virtual address, described Memory control device can further include converting unit 401, the structure drawing of device of a kind of Memory control that Fig. 4 provides for the embodiment of the present invention, as shown in Figure 4, also comprise:
Converting unit 401, carry out actual situation address translation operation for the translation look-aside buffer TLB comprised by self between the physical address of described physical memory and virtual address, make:
Described access process uses the virtual address of described physical memory to access described physical memory by described converting unit; Described converting unit, by described actual situation address translation operation, uses the physical address of described physical memory to control described physical memory.
About the description of content please refer to the associated description of carrying out actual situation address translation operation in embodiment two between Physics address and virtual address performed by described converting unit 401, repeat no more here.
Next expansion explanation is carried out to described trigger condition, and be that example describes described Memory control equipment and how processes described physical memory and control according to different trigger conditions, embodiments provide at least five kinds of different trigger condition situations, these trigger conditions can be realize on the basis of embodiment one, also can be add in the present embodiment actual situation address conversion basis on realize, the present invention does not limit this.
The first situation:
Optionally, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise described access process be specially page locking time, specifically for:
The physical memory addresses information of resolving the specified page used in described access process determines the physical page information of described specified page;
If described specified page is in described physical memory, described specified page is locked in described physical memory;
If described specified page is not in described physical memory, described specified page changed to and is locked in described physical memory.
The second situation:
Optionally, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise described access process specifically comprise request distribute physical page for direct memory access buffer zone DMABuffer time, specifically for:
Be that described DMABuffer distributes physical page from described physical memory;
The described physical page distributed is locked in described physical memory, and page table entry corresponding for described physical page is locked in described TLB.
The third situation:
Optionally, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise described access process specifically cause page faults to occur time, specifically for:
Determine and cause the replacement page of the page of page faults and feed back to the transmit leg sending described access process.
4th kind of situation:
Optionally, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise change that described trigger condition comprises the status information of described physical memory be specially memory size change time, specifically for:
When described physical memory capacity change be specially described physical memory capacity reduce time, the content of pages stored in the physical memory of minimizing is copied in the free space of free memory in described physical memory, and upgrade the status information after the change of described physical memory.
5th kind of situation:
Optionally, on basis embodiment illustrated in fig. 3, shown Memory control device can further include the structure drawing of device of a kind of Memory control that feedback unit 501, Fig. 5 provides for the embodiment of the present invention, as shown in Figure 5, also comprises:
Feedback unit 501, for when the status information of described physical memory changes, by the status information feedback after described physical memory change to the transmit leg sending the described control strategy for physical memory and corresponding trigger condition, described change comprises memory size change, type of memory change or memory usage and meets predetermined threshold;
Described receiving element 301, the control strategy of the status information after the described physical memory of correspondence also sent for receiving described transmit leg changes and corresponding trigger condition.
Visible, Memory control equipment as hardware obtains necessary control strategy from system, the physical memory completed needed for these control strategies controls semantic information, and the trigger condition of corresponding control survey, make when meeting a trigger condition, described Memory control equipment can call should the control strategy of trigger condition control described physical memory, no longer need system to carry out interrupt processing in the process controlled, substantially increase control efficiency.
Embodiment four
Refer to Fig. 6, the hardware configuration schematic diagram of a kind of Memory control equipment that Fig. 6 provides for the embodiment of the present invention, described Memory control equipment 600 comprises storer 601 and receiver 602, and the processor 603 be connected with described storer 601 and described receiver 602 respectively, described storer 601 is for storing batch processing instruction, and described processor 603 performs following operation for the programmed instruction calling the storage of described storer 601:
Trigger described receiver 602 and receive control strategy for physical memory and corresponding trigger condition, described control strategy carries the upper strata semantic information for realizing described control strategy, and described trigger condition comprises the access process that the change of the status information of described physical memory and/or described Memory control equipment receive;
Monitor the status information of physical memory and described access process;
When meeting described trigger condition, calling corresponding control strategy and described physical memory is controlled.
Alternatively, described processor 603 can be central processing unit (CentralProcessingUnit, CPU), described storer 601 can be random access memory (RandomAccessMemory, RAM) internal storage of type, described receiver 602 can comprise general physics interface, and described physical interface can be ether (Ethernet) interface or asynchronous transfer mode (AsynchronousTransferMode, ATM) interface.Described processor 603, receiver 602 and storer 601 can be integrated into one or more independently circuit or hardware, as: special IC (ApplicationSpecificIntegratedCircuit, ASIC).
It should be noted that, one of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-OnlyMemory, ROM) or random store-memory body (RandomAccessMemory, RAM) etc.
Above a kind of internal memory control method provided by the present invention and device are described in detail, apply specific embodiment herein to set forth principle of the present invention and embodiment, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (14)

1. an internal memory control method, is characterized in that, described method comprises:
Memory control equipment receives control strategy for physical memory and corresponding trigger condition, described control strategy carries the upper strata semantic information for realizing described control strategy, and described trigger condition comprises the access process that the change of the status information of described physical memory and/or described Memory control equipment receive;
Described Memory control equipment monitors the status information of physical memory and described access process;
When meeting described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory.
2. method according to claim 1, is characterized in that,
The address information of described physical memory comprises physical address and virtual address;
The translation look-aside buffer TLB that described Memory control equipment is comprised by self carries out actual situation address translation operation between the physical address of described physical memory and virtual address, makes:
Described access process uses the virtual address of described physical memory by physical memory described in described Memory control device access; Described Memory control equipment, by described actual situation address translation operation, uses the physical address of described physical memory to control described physical memory.
3. method according to claim 1 and 2, is characterized in that, when described trigger condition comprise described access process be specially request page locking time, comprising:
When described Memory control Supervision hear described access process be specially locking specified page in described physical memory time, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
The physical memory addresses information of the specified page used in access process described in described Memory control device parses determines the physical page information of described specified page;
If described specified page is in described physical memory, described specified page is locked in described physical memory by described Memory control equipment;
If described specified page is not in described physical memory, described specified page changes to and is locked in described physical memory by described Memory control equipment.
4. method according to claim 3, is characterized in that, when described access process specifically comprises request for direct memory access buffer zone DMABuffer distribution physical page, comprising:
When described Memory control Supervision hears that described access process is specially DMABuffer distribution physical page, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
Described Memory control equipment is that described DMABuffer distributes physical page from described physical memory;
The described physical page distributed is locked in described physical memory by described Memory control equipment, and is locked in described TLB by page table entry corresponding for described physical page.
5. method according to claim 1 and 2, is characterized in that, when described trigger condition comprise described access process specifically cause page faults to occur time, comprising:
When described Memory control Supervision hears that described access process specifically causes page faults to occur, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
Described Memory control equipment is determined and is caused the replacement page of the page of page faults and feed back to the transmit leg sending described access process.
6. method according to claim 1 and 2, is characterized in that, when the change that described trigger condition comprises the status information of described physical memory be specially memory size change time, comprising:
When described Memory control Supervision hear the change of the status information of described physical memory be specially memory size change time, meet described trigger condition, the corresponding control strategy of described Memory control equipment calls controls described physical memory, specifically comprises:
When described physical memory capacity change be specially described physical memory capacity increase time, described Memory control equipment determines the capacity of physical memory that increases and type, and upgrades the status information after the change of described physical memory;
When described physical memory capacity change be specially described physical memory capacity reduce time, the content of pages stored in the physical memory of minimizing copies in the free space of free memory in described physical memory by described Memory control equipment, and upgrades the status information after the change of described physical memory.
7. the method according to any one of claim 1 to 6, is characterized in that, also comprises:
When the status information of described physical memory changes, described Memory control equipment is by the status information feedback after described physical memory change to the transmit leg sending the described control strategy for physical memory and corresponding trigger condition, and described change comprises memory size change, type of memory change or memory usage and meets predetermined threshold;
Described Memory control equipment receives the control strategy of the status information after the correspondence described physical memory change that described transmit leg sends and corresponding trigger condition.
8. a Memory control device, is characterized in that, comprising:
Receiving element, for receiving control strategy for physical memory and corresponding trigger condition, described control strategy carries the upper strata semantic information for realizing described control strategy, and described trigger condition comprises the access process that the change of the status information of described physical memory and/or described Memory control equipment receive;
Monitoring unit, for monitoring the status information of physical memory and described access process;
Control module, for when the result of described monitoring unit meets described trigger condition, calls corresponding control strategy and controls described physical memory.
9. device according to claim 8, is characterized in that, when the address information of described physical memory comprises physical address and virtual address, also comprises:
Converting unit, carry out actual situation address translation operation for the translation look-aside buffer TLB comprised by self between the physical address of described physical memory and virtual address, make:
Described access process uses the virtual address of described physical memory to access described physical memory by described converting unit; Described converting unit, by described actual situation address translation operation, uses the physical address of described physical memory to control described physical memory.
10. device according to claim 8 or claim 9, is characterized in that, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise described access process be specially request page locking time, specifically for:
The physical memory addresses information of resolving the specified page used in described access process determines the physical page information of described specified page;
If described specified page is in described physical memory, described specified page is locked in described physical memory;
If described specified page is not in described physical memory, described specified page changed to and is locked in described physical memory.
11. devices according to claim 10, is characterized in that, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise described access process specifically comprise request distribute physical page for direct memory access buffer zone DMABuffer time, specifically for:
Be that described DMABuffer distributes physical page from described physical memory;
The described physical page distributed is locked in described physical memory, and page table entry corresponding for described physical page is locked in described TLB.
12. devices according to claim 8 or claim 9, is characterized in that, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise described access process specifically cause page faults to occur time, specifically for:
Determine and cause the replacement page of the page of page faults and feed back to the transmit leg sending described access process.
13. devices according to claim 8 or claim 9, is characterized in that, comprising:
Described control module when the result of described monitoring unit meet trigger condition comprise change that described trigger condition comprises the status information of described physical memory be specially memory size change time, specifically for:
When described physical memory capacity change be specially described physical memory capacity reduce time, the content of pages stored in the physical memory of minimizing is copied in the free space of free memory in described physical memory, and upgrade the status information after the change of described physical memory.
Device described in 14. any one of according to Claim 8 to 13, is characterized in that, also comprise:
Feedback unit, for when the status information of described physical memory changes, by the status information feedback after described physical memory change to the transmit leg sending the described control strategy for physical memory and corresponding trigger condition, described change comprises memory size change, type of memory change or memory usage and meets predetermined threshold;
Described receiving element, the control strategy of the status information after the described physical memory of correspondence also sent for receiving described transmit leg changes and corresponding trigger condition.
CN201410307864.8A 2014-06-30 2014-06-30 A kind of internal memory control method and device Active CN105335306B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410307864.8A CN105335306B (en) 2014-06-30 2014-06-30 A kind of internal memory control method and device
PCT/CN2015/075704 WO2016000470A1 (en) 2014-06-30 2015-04-01 Memory control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410307864.8A CN105335306B (en) 2014-06-30 2014-06-30 A kind of internal memory control method and device

Publications (2)

Publication Number Publication Date
CN105335306A true CN105335306A (en) 2016-02-17
CN105335306B CN105335306B (en) 2018-02-13

Family

ID=55018411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410307864.8A Active CN105335306B (en) 2014-06-30 2014-06-30 A kind of internal memory control method and device

Country Status (2)

Country Link
CN (1) CN105335306B (en)
WO (1) WO2016000470A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002706A (en) * 2018-06-08 2018-12-14 中国科学院计算技术研究所 Data isolation guard method and system in a kind of process based on user class page table
CN110008156A (en) * 2019-03-27 2019-07-12 无锡海斯凯尔医学技术有限公司 Device, method and the readable storage medium storing program for executing of data transmission
WO2020062311A1 (en) * 2018-09-30 2020-04-02 华为技术有限公司 Memory access method and apparatus
CN111666226A (en) * 2020-06-16 2020-09-15 北京紫光展锐通信技术有限公司 Page bump protection method for operating system memory recovery and user equipment
CN113125764A (en) * 2019-12-30 2021-07-16 深圳迈瑞生物医疗电子股份有限公司 Sample analyzer, automatic maintenance method thereof and readable storage medium
WO2021218370A1 (en) * 2020-04-30 2021-11-04 华为技术有限公司 Memory management method and terminal device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144714A (en) * 2017-06-19 2019-01-04 中兴通讯股份有限公司 EMS memory management process and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103515A (en) * 2009-12-22 2011-06-22 联想(北京)有限公司 Memory management method, virtual machine monitor and computer
CN102609466A (en) * 2012-01-13 2012-07-25 广州从兴电子开发有限公司 Method and system for controlling shared memory
CN103198028A (en) * 2013-03-18 2013-07-10 华为技术有限公司 Method, device and system for migrating stored data
CN103488588A (en) * 2013-10-09 2014-01-01 中国科学院计算技术研究所 Memory protection method and system and network interface controller

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103515A (en) * 2009-12-22 2011-06-22 联想(北京)有限公司 Memory management method, virtual machine monitor and computer
CN102609466A (en) * 2012-01-13 2012-07-25 广州从兴电子开发有限公司 Method and system for controlling shared memory
CN103198028A (en) * 2013-03-18 2013-07-10 华为技术有限公司 Method, device and system for migrating stored data
CN103488588A (en) * 2013-10-09 2014-01-01 中国科学院计算技术研究所 Memory protection method and system and network interface controller

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈明宇: "基于消息的内存系统关键技术研究", 《网络新媒体技术》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002706A (en) * 2018-06-08 2018-12-14 中国科学院计算技术研究所 Data isolation guard method and system in a kind of process based on user class page table
WO2020062311A1 (en) * 2018-09-30 2020-04-02 华为技术有限公司 Memory access method and apparatus
CN110008156A (en) * 2019-03-27 2019-07-12 无锡海斯凯尔医学技术有限公司 Device, method and the readable storage medium storing program for executing of data transmission
US11803490B2 (en) 2019-03-27 2023-10-31 Wuxi Hisky Medical Technologies Co., Ltd. Apparatus and method for data transmission and readable storage medium
CN113125764A (en) * 2019-12-30 2021-07-16 深圳迈瑞生物医疗电子股份有限公司 Sample analyzer, automatic maintenance method thereof and readable storage medium
CN113125764B (en) * 2019-12-30 2023-08-25 深圳迈瑞生物医疗电子股份有限公司 Sample analyzer, automatic maintenance method thereof and readable storage medium
WO2021218370A1 (en) * 2020-04-30 2021-11-04 华为技术有限公司 Memory management method and terminal device
US12086069B2 (en) 2020-04-30 2024-09-10 Huawei Technologies Co., Ltd. Memory management method to determine a frequently accessed page and associated terminal device
CN111666226A (en) * 2020-06-16 2020-09-15 北京紫光展锐通信技术有限公司 Page bump protection method for operating system memory recovery and user equipment
CN111666226B (en) * 2020-06-16 2022-09-13 北京紫光展锐通信技术有限公司 Page bump protection method for operating system memory recovery and user equipment

Also Published As

Publication number Publication date
CN105335306B (en) 2018-02-13
WO2016000470A1 (en) 2016-01-07

Similar Documents

Publication Publication Date Title
CN105335306A (en) Memory control method and memory control device
US11042297B2 (en) Techniques to configure a solid state drive to operate in a storage mode or a memory mode
CN102855193B (en) Go during the carry of untapped logical address in Nonvolatile memory system to map
US20090182962A1 (en) Memory Subsystem Hibernation
CN105205009A (en) Address mapping method and device based on large-capacity solid storage
US10268592B2 (en) System, method and computer-readable medium for dynamically mapping a non-volatile memory store
CN104346293A (en) Data access method, module, processor and terminal device for hybrid memory
US20220114086A1 (en) Techniques to expand system memory via use of available device memory
CN105808444A (en) Method for controlling memory device and non-volatile memory
US20170364449A1 (en) Process running method and apparatus
US10942807B2 (en) Storage system spanning multiple failure domains
CN110647359B (en) Semiconductor device, method of operating the same, and stacked memory device having the same
WO2019094260A1 (en) Computer memory content movement
CN108694101B (en) Persistent caching of memory-side cache contents
CN105138481A (en) Stored data processing method and apparatus and system
CN102725746B (en) Method and apparatus for managing memories in distributed computer system
KR20140073955A (en) Memory system and method for operating the same
EP3564814A1 (en) Method and device for starting and operating system, and computer storage medium
KR20150139017A (en) Apparatus and method for controlling memory
KR20140065196A (en) Memory system and method for operating the same
CN112445412A (en) Data storage method and device
CN112860595B (en) PCI (peripheral component interconnect express) equipment or PCIE (peripheral component interconnect express) equipment, data access method and related assembly
JP2022184735A (en) Program starting method and device, and storage medium
US20240193078A1 (en) Techniques to allocate memory for in-line or in-band error correction control
JP2005209178A (en) Memory protection unit, memory protection method, and memory protection program

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