CN101452379B - Internal memory space analyzing method and device and check point reserving method and device - Google Patents

Internal memory space analyzing method and device and check point reserving method and device Download PDF

Info

Publication number
CN101452379B
CN101452379B CN 200710094330 CN200710094330A CN101452379B CN 101452379 B CN101452379 B CN 101452379B CN 200710094330 CN200710094330 CN 200710094330 CN 200710094330 A CN200710094330 A CN 200710094330A CN 101452379 B CN101452379 B CN 101452379B
Authority
CN
China
Prior art keywords
memory headroom
keep
need
checkpoint
attribute
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.)
Expired - Fee Related
Application number
CN 200710094330
Other languages
Chinese (zh)
Other versions
CN101452379A (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.)
Wuxi Jiangnan Computing Technology Institute
Original Assignee
Wuxi Jiangnan Computing Technology Institute
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 Wuxi Jiangnan Computing Technology Institute filed Critical Wuxi Jiangnan Computing Technology Institute
Priority to CN 200710094330 priority Critical patent/CN101452379B/en
Publication of CN101452379A publication Critical patent/CN101452379A/en
Application granted granted Critical
Publication of CN101452379B publication Critical patent/CN101452379B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method and a device for analyzing memory space, and a method and a device for maintaining a check point. The method for analyzing the memory space comprises the following steps: setting a potential check point indicating the analysis of the memory space in a program; analyzing whether the memory space which does not need maintaining exists within the action range of the potential check point; and identifying the scope of the attribute which does not need maintaining in the memory space if the memory space which does not need maintaining exists. The method for analyzing the memory space and the method for maintaining the check point can reduce the maintaining amount of a transparent check point and shorten the maintaining recovery time.

Description

The reservation method of the analytical approach of memory headroom and device, checkpoint and device
Technical field
The present invention relates to computer system, particularly relate to a kind of analytical approach and device of memory headroom, the reservation method and the device of checkpoint.
Background technology
The research and the application of many science aspect usually need a large amount of and complex calculations, and the high-effect parallel computer of multiprocessor is one of best selection naturally.It is the basic demand to computing that program is carried out correctly and smoothly; But in this time-consuming calculating process, system broke down when the greateset risk that faces was carried out exactly, especially under the increasing situation of present system scale; The fault odds also increases thereupon; When fault takes place, no matter be the system failure or some irresistible reason, cause the computing achievement before must abandoning.Therefore in parallel environment, must have that some failure handling mechanisms is carried out fault-avoidance, fault removes or fault shifts, just can avoid causing unnecessary the repeating and the wasting of resources of program, improve the reliability of parallel computation.The checkpoint technology is exactly the effective fault-tolerant technique that a kind of quilt extensively adopts.
The checkpoint technology is in the operational process of program, retention point to be set; The process status in this moment is kept; When system breaks down, then utilize the last process status that keeps to recover, process status is returned to the state that keeps that time continue operation.
The checkpoint technology is from use angle; Can be divided into two types: a kind of is Embedded checkpoint technology, and this method needs the user to choose retention point at the program correct position, and this method need be revised user program; Retention point need set in advance, can't carry out instant reservation.A kind of in addition is transparent checkpoint technology, and this technology need not revised user program, can keep in real time in any moment that program is carried out.
The reservation of process status or recovery relate to mass data on disk storage or read; Especially in massively parallel computer system; Usually the operation of program is made up of thousands of process; So numerous processes is carried out the reservation or the recovery of state simultaneously, need take a large amount of retaining spaces and keep release time, and its expense is an acid test for computer system.Therefore, be necessary the checkpoint technology is optimized, to adapt to the application under extensive environment.
Existing a kind of be the reservation content that is conceived to the checkpoint, reduce the reservation amount of checkpoint through analyzing the internal storage location need not keep, thereby reduce its expense.For example; People such as Gerry Kingsley have proposed auxiliary checkpoint technology (the Compiler-Assisted Checkpoint OptimizationUsing SUIF of a kind of compiler; Gerry Kingsley, Micah Beck, James S.Plank; 1995/11/15); Use static data-flow analysis to optimize the performance of checkpoint, the mutual exclusion of use internal memory explains that which partial data space of processor can not be kept in the checkpoint, thereby can reduce the reservation amount size and the time that keeps recovery of checkpoint.This method utilizes compiler to come the data that need not keep in the routine analyzer; Can analyze the memory headroom that need not keep and recover, still, this method needs the effective routine analyzer of user; And in the suitable position insertion retention point of user program; Initiate the reservation of checkpoint through the retention point in the program, just a kind of optimisation technique of embedded checkpoint can't be carried out the optimization of diaphany point.In addition, this method is not considered the analysis to global pointer information and common mathematical function information.
Summary of the invention
The problem that the present invention solves is, a kind of analytical approach of memory headroom and the reservation method and the device of device, checkpoint are provided, with the reservation amount that reduces diaphany point and shortening reservation release time.
For addressing the above problem, the present invention provides a kind of spacial analytical method of internal memory, comprises the steps: in program, to be provided with potential checkpoint, and said potential checkpoint is for analyzing the indication of memory headroom; Whether in the reach of said potential checkpoint, analyzing has the memory headroom that need not keep; If the memory headroom that need not keep is arranged, then identify the action scope of the attribute that said memory headroom need not keep.
Optional, before said potential checkpoint is positioned at the loop body of loop statement.
Optional, said memory headroom comprises overall array and/or the space of dynamically applying for.
Optional, the said memory headroom that need not keep comprises the read-only memory headroom and/or the memory headroom of write-then-read.
Optional, whether said analysis has the memory headroom that need not keep further to comprise: structure definite value-quote chain and function calling relationship; Structure common mathematical function read-write behavioural information; In conjunction with definite value-quote chain, function calling relationship and common mathematical function read-write behavioural information, carry out the global pointer alias analysis, structure global pointer another name information; According to definite value-quote chain, function calling relationship, global pointer another name information and common mathematical function read-write behavioural information, whether the program block of analyzing said indication place has the memory headroom that need not keep.
Optional, said structure definite value-quote chain and function calling relationship comprise utilizes data-flow analysis technical construction definite value-quote chain, utilizes interprocedural analysis technical construction function calling relationship.
Optional, said structure common mathematical function read-write behavioural information comprises the latent structure common mathematical function read-write behavioural information table that utilizes java standard library, parallel storehouse and various common mathematical functions storehouse.
Optional; The action scope that identifies the attribute that said memory headroom need not keep comprises: the function call that the sign action scope begins is inserted in the starting position of the action scope of the attribute that need not keep at said memory headroom, and the end position of the action scope of the attribute that need not keep at said memory headroom inserts the function call that the sign action scope finishes.
For addressing the above problem, the present invention also provides a kind of analytical equipment of memory headroom, comprising: the unit is set, is used in program potential checkpoint being set, said potential checkpoint is for analyzing the indication of memory headroom; Analytic unit is used for saidly in the reach of potential checkpoint, analyzes whether the memory headroom that need not keep is arranged; Identify unit is used for when the memory headroom that said analytic unit analysis obtains need not keeping, and identifies the action scope of the attribute that said memory headroom need not keep.
For addressing the above problem; The present invention also provides a kind of reservation method of checkpoint; Comprise the steps: in the action scope of the attribute that memory headroom need not keep, to write down the information of said memory headroom according to the memory headroom action scope sign of the attribute that keeps of needs not; The memory headroom that need not keep whether record is arranged in the position of place, checkpoint inquiry present procedure operation; If there is the memory headroom that need not keep of record the position of present procedure operation, then do not keep the memory headroom that need not keep of said record, keep Unrecorded memory headroom.
Optional; Said in the action scope of the attribute that memory headroom need not keep; The information that writes down said memory headroom comprises: the start address and the length of said memory headroom are write down in the starting position of the action scope of the attribute that need not keep at said memory headroom, the start address and the length of the memory headroom of the end position cancellation record of the action scope of the attribute that need not keep at said memory headroom.
Optional, said checkpoint is the diaphany point.
Optional, said checkpoint is embedded checkpoint.
For addressing the above problem; The present invention also provides a kind of retaining device of checkpoint, comprising: record cell is used for according to the memory headroom action scope sign of the attribute that keeps of needs not; In the action scope of the attribute that memory headroom need not keep, write down the information of said memory headroom; Query unit, whether the position of inquiring about the present procedure operation at the place, checkpoint has the memory headroom that need not keep of record; Stick unit when being used in the position of present procedure operation the memory headroom that need not keep of record being arranged, does not keep the memory headroom that need not keep of said record, keeps Unrecorded memory headroom.
Compared with prior art; Technique scheme is through the compile-time analysis memory headroom; The action scope of the attribute that the sign memory headroom need not keep; Carry out the checkpoint in the program operation process when keeping, whether the position of inquiry present procedure operation is the action scope that is positioned at the attribute that memory headroom need not keep, and just can obtain locating in the checkpoint information of the memory headroom that need not keep.Therefore, technique scheme can reduce the reservation amount of checkpoint effectively, has also shortened retention time simultaneously; And because the reservation amount of checkpoint reduces, when needs carried out the recovery of checkpoint, also shortened corresponding release time.The minimizing of the reservation amount of checkpoint and keep the shortening of release time and improved the efficient of program run has also promoted the fault freedom of Large Scale Computer System simultaneously.
In addition; Compare and use static data-flow analysis in the prior art, the flow analysis of technique scheme binding data, interprocedural analysis, global pointer alias analysis and common mathematical function behavioural analysis can analyze the memory headroom that need not keep; Dynamically identify simultaneously the action scope of the attribute that memory headroom need not keep; Therefore whether, carry out the reservation of checkpoint in any moment of program run, can dynamically inquire about has the memory headroom that need not keep.
Description of drawings
Fig. 1 is the basic flow sheet of the analytical approach of embodiment of the invention memory headroom;
Fig. 2 is the detail flowchart of the analytical approach step S12 of memory headroom shown in Figure 1;
Fig. 3 is the process flow diagram of the reservation method of embodiment of the invention checkpoint;
Fig. 4 is the synoptic diagram of the analytical equipment of embodiment of the invention memory headroom;
Fig. 5 is the synoptic diagram of embodiment of the invention checkpoint retaining device.
Embodiment
The embodiment of the invention is the action scope through the attribute that need not keep at program compiler time sign memory headroom, so that program does not keep the memory headroom that need not keep when moving to the checkpoint.Promptly combine accompanying drawing and embodiment specific embodiments of the invention to do detailed explanation below.
Please refer to Fig. 1, it shows the basic procedure of analytical approach of the memory headroom of the embodiment of the invention, and the analytical approach of the memory headroom of present embodiment is accomplished by compiler.
Step S11 is provided with potential checkpoint in program, i.e. the indication of insertion needs analysis memory headroom in program.Compiler inserts in program analyzes the compiling indication #pragmaANALYSE_HERE whether memory headroom need keep; The position of its insertion is considered to a potential checkpoint; Said potential checkpoint is not necessarily real checkpoint; Can carry out real checkpoint reservation or recovery in this position, also can be as just the mark of an analyzed area.For the difficulty that reduces analysis, the accuracy that improves analysis, the insertion position of potential checkpoint should meet the following procedure pattern:
For (i=a; I<b; I=i+c) ∥ also can be circulations such as while_do, do_while
{
If ((i-a) %x==0) ∥ is used to indicate the iteration how many times to do a checkpoint
This conditional statement of ∥ is not essential according to circumstances
{
#pragma ANALYSE_HERE ∥ is used to indicate the compiling of potential checkpoint location
Indication
}
... the ∥ loop body
... ∥ also is checkpoint zone, promptly above the reach of potential checkpoint
}
In the said procedure, before potential checkpoint is inserted in the loop body of loop statement; (be loop body in) in the zone, checkpoint, comprise in the function of this intra-domain call and all can not occur the checkpoint once more that otherwise checkpoint that should the zone can not be as potential checkpoint; The statement that goto, continue, break etc. change the circulation execution sequence can not appear in the zone, checkpoint.The round-robin continue of internal layer, break statement use not restriction, and the goto statement can not occur, and occur goto, continue, break in the function of the recursive call at place, zone, checkpoint and all allow.
Step S12, whether in the reach of said potential checkpoint, analyzing has the memory headroom that need not keep.If then carry out step S13, then carry out step S14 if not.Compiling indication #pragmaANALYSE_HERE in the compiler recognizer, promptly the position of potential checkpoint analyzes whether the memory headroom that need not keep is arranged in its reach.In general; Can analyze to all memory headrooms, in the present embodiment, for operation is more easily analyzed in the optimization that makes the checkpoint; Only analyze bigger memory headroom, just can reduce the reservation amount of checkpoint effectively because reduce the reservation amount of big memory headroom; And little memory headroom can't take checkpoint a lot of reservation amount and retention time, also there is no need spended time analysis at this.Big memory headroom comprises: the overall array and the dynamic space of application, so in the present embodiment all analysis all with these two kinds of memory headrooms as analytic target.Certainly, in other embodiment, analytic target also can be overall array, or the space of just dynamically applying for.
The memory headroom that need not keep at the place, checkpoint has two kinds of situation; A kind of is read-only, and this memory headroom is owing to be read-only, and its data can not change; Therefore only need once to get final product, not be used in place, each checkpoint and all keep through other means reservations; Another kind is a write-then-read; Just in the code after the place, checkpoint, the visit to this memory headroom is to write for the first time, owing to resume operation from the checkpoint; Program brings into operation after the reservation of checkpoint; And this memory headroom was write before this, the data content that keeps this memory headroom like this is exactly nonsensical, so this type memory headroom also can keep.In the present embodiment, the memory headroom that need not keep comprises the read-only memory headroom and the memory headroom of write-then-read.Certainly, in other embodiment, the memory headroom that need not keep also can be read-only memory headroom, or the memory headroom of write-then-read.
Drawing certain or some memory headrooms through analysis need not keep in certain section interval that program is carried out; Claim that then the attribute of said memory headroom in this section interval need not keep, this section interval also just is called the action scope of the attribute that said memory headroom need not keep.
Step S13 if the memory headroom that need not keep is arranged, then identifies the action scope of the attribute that said memory headroom need not keep.Analysis result according to step S12; If the memory headroom that need not keep is arranged in the reach of potential checkpoint; The function call ckpt_nosave () that the sign action scope begins is inserted in the starting position of the action scope of the attribute that compiler need not keep at said memory headroom, and the end position of the action scope of the attribute that need not keep at said memory headroom inserts the function call ckpt_nosave_end () that the sign action scope finishes.
The function call ckpt_nosave_end () that function call ckpt_nosave () that the sign action scope begins and sign action scope finish is when program run, and dynamically which memory headroom the current run location of logging program has need not keep.Wherein, the start address and the length thereof of function call the ckpt_nosave () record that begins of the sign action scope memory headroom that need not keep; The record of the memory headroom that function call the ckpt_nosave_end () cancellation that the sign action scope finishes need not keep.
Step S14, if the memory headroom that in the reach of potential checkpoint, need not keep, then compiler does not deal with program.
Please continue with reference to figure 2, it shows the detailed process of above-mentioned steps S12.
Step S121, the structure definite value-(DU is Def-Use) with the constructed fuction call relation to quote chain.In the present embodiment, be to utilize data-flow analysis technical construction DU chain, utilize interprocedural analysis technical construction function calling relationship figure, data-flow analysis technology and interprocedural analysis technology are technology well known to those skilled in the art, promptly will not launch explanation at this.
Step S122, structure common mathematical function read-write behavioural information, the read-write situation of the memory headroom that built-in function just commonly used and other functions relate to its parameter.In the present embodiment, structure common mathematical function read-write behavioural information is to utilize the latent structure common mathematical function read-write behavioural information table in java standard library, parallel storehouse and various common mathematical functions storehouse.For instance, and function m emset (A, 0, SIZE) only can be to being that one section region of memory of SIZE is write from the initial length of A, then memset has the behavior of writing to first parameter, and latter two parameter then is read-only.
Step S123 in conjunction with DU chain, function calling relationship and common mathematical function read-write behavioural information, carries out the global pointer alias analysis.Specifically, be example with global pointer p, its method is to be starting point with main function node among the function calling relationship figure; Travel through the node on all and the aisled function calling relationship figure of main function; Scan the syntax tree of each node,, confirm the another name that global pointer p is possible in conjunction with DU chain information and common mathematical function read-write behavioural information; Just pointer p the memory headroom that might point to, thereby structure global pointer another name information.
Step S124, according to DU chain, function calling relationship, global pointer another name information and common mathematical function read-write behavior, whether the program block of analyzing the indication place of inserting has the memory headroom that need not keep.
Specifically; Each node among the traversal function calling relationship figure scans its syntax tree, searches zone to be analyzed; Just confirm the position of compiling indication #pragmaANALYSE_HERE; Each syntax tree node (also be appreciated that and be statement) analyzed one by one in the syntax tree of the program block at scanning compiling indication #pragma ANALYSE_HERE place then, handles respectively according to the syntax tree node types:
(1) if write statement; Then at first confirm the object that quilt is write; Method be the object confirming to write according to DU chain and global pointer another name information corresponding possibly be which section memory headroom, the program of corresponding to is exactly which the overall array or the dynamic space of application in the program, after the object of confirming to write; According to the length of write operation and write object and confirm that at the read-write state before this statement quilt write the final attribute of object, be write earlier or read earlier.If before current write operation, this object is not being carried out any read-write operation, then should to as if write-then-read, be the memory headroom that need not keep.
(2) if reading statement is the same with (1), at first confirm the object of being read; The read-write state of noting this object is for reading earlier, if after analysis in not to the writing of this object, then this object is read-only; If the write operation to it is arranged, then be to need to keep.
(3) if function call then has following three kinds of situation
This function is the function that defines in the user program, then finds the function body syntax tree of this function according to function calling relationship figure, scans this syntax tree, handles by (1) or (2) same mode;
This function is the built-in function of using always, and then according to common mathematical function read-write behavioural information table, the parameter information that associative function calls, DU chain and global pointer another name information are confirmed the memory headroom that this function read-write is influenced;
The function that defines in the user program, the function that neither use always think that then what all possibly take place in this function, promptly do not analyze.
(4) for branch statement, such as if () { ... }, its lower floor's statement block then; The statement in the branch statement just, the operation in the anolytic sentence piece all can't determine whether and can carry out, and also need carry out different processing for reading and writing operation wherein; For read operation wherein; Be regarded as being certain to take place, and, then think and to take place for wherein write operation; Think that when analyzing the read-only memory space this write operation is to take place, and think that in the analysis of write-then-read memory headroom this write operation is impossible.Adopt a kind of so conservative processing means, can guarantee the correctness of analysis result.
(5) in the The whole analytical process, the memory headroom of not write is read-only memory headroom.
For making above-mentioned explanation be easier to understand, lift 3 analysis example below again and describe.
Instance 1
Int A [1<<24]; ∥ 64MB data space
main()
{
int*p;
int?i,J;
P=A; ∥ pointer p points to array A
for(i=0;i<1000;i++)
{ the ∥ analyzed area begins
The potential checkpoint of #pragma ANALYSE_HERE ∥
for(j=0;j<(1<<24);j++)
{
p[j]=j;
}
The end of ∥ analyzed area
}
The program of instance 1 can analyze pointer p through the DU chain and point to array A's.Syntax tree through the scanning analysis zone; When scanning p [j]=j statement, discovery is a write operation, and its object is pointer p; Because pointer p points to A's; So write operation to as if A, can confirm the scope of write operation through the bound of analyzing this statement upper strata loop statement, thereby confirm that whole array A has been write.Added before this time write not to the read or write of A; Therefore be for the first time A to be write in analyzed area; That is to say that A is the data space of write-then-read; Because its content will be rewritten before using again, just this need not keep before writing the loop statement execution in analyzed area.
Instance 2
Int A [1<<24]; ∥ 64MB data space
main()
{
int*p;
int?i,j;
P=A; ∥ pointer p points to array A
for(i=0;i<1000;i++)
{ the ∥ analyzed area begins
The potential checkpoint of #pragma ANALYSE_HERE ∥
memset(p,0,sizeof(A));
The end of ∥ analyzed area
}
The program of instance 2 when the scanning analysis area code, finds that linear function calls memset (p; 0, sizeof (A)), can know through common mathematical function read-write behavioural information table; Memset can write the memory headroom that first parameter is pointed to, and the length of writing is the 3rd parameter, and its first parameter is pointer p; Can draw pointer p through the DU chain and point to array A, thereby can know that this function call writes A, length is sizeof (A); And, thereby can confirm that array A is a write-then-read before not to the reading or write operation of A, this write statement need not keep before carrying out in analyzed area.
Instance 3
Int A [1<<24]; ∥ 64MB data space
void?func(int*q,int?size)
{
intk,count=0;
for(k=0;k<size;k++)
{
count+=q[k]
}
}
main()
{
int*p;
int?i,j;
P=A; ∥ pointer p points to array A
For (j=0; J<(1<<24); J++) ∥ carries out assignment to array A
{
A[j]=j;
}
for(i=0;i<1000;i++)
{ the ∥ analyzed area begins
The potential checkpoint of #pragma ANALYSE_HERE ∥
func(p,1<<24);
The end of ∥ analyzed area
}
The program of instance 3 when the code in scanning analysis zone, runs into linear function and calls func (p; Sizeof (A)), through function calling relationship figure, can know that function f unc is user-defined function; Can find the syntax tree of its function body, and then the function body of scanning func, to confirm the read-write situation of this function to two parameters; Through scanning func function body, can know that func is read-only to the memory headroom of two parameters or parameter sensing, does not have the write operation to it; Through DU chain and real ginseng of function call and shape ginseng; Can confirm that the corresponding real ginseng of shape ginseng q among the func is pointer p, and pointer p points to array A, therefore can confirm among the func A to be read.After whole analyzed area has scanned, can know that not to the writing of array A, just A is read-only in analyzed area.Therefore the A array only need keep once, and the place, each checkpoint that just not be used in the analyzed area keeps.
The analytical approach of above-mentioned memory headroom has combined data-flow analysis and interprocedural analysis, can analyze the program behavior that strides across journey, therefore can dynamically analyze the memory headroom that need not keep.
Fig. 4 is the analytical equipment corresponding to the memory headroom of the analytical approach of above-mentioned memory headroom, and said device comprises: unit 41, analytic unit 42 and identify unit 43 are set.
Unit 41 is set, is used in program potential checkpoint being set, said potential checkpoint is for analyzing the indication of memory headroom;
Analytic unit 42 is used for saidly in the reach of potential checkpoint, analyzes whether the memory headroom that need not keep is arranged;
Identify unit 43 is used for when the memory headroom that analytic unit 42 analysis obtains need not keeping, and identifies the action scope of the attribute that said memory headroom need not keep.
Please refer to Fig. 3; It shows the process flow diagram of reservation method of the checkpoint of the embodiment of the invention; The reservation method of said checkpoint is after the analytical approach of using above-mentioned memory headroom compiles program, carries out automatically in the process of the program after the operation compiling.
Step S31 according to the memory headroom action scope sign of the attribute that keeps of needs not, in the action scope of the attribute that memory headroom need not keep, writes down the information of said memory headroom.
In the step S13 of the analytical approach of memory headroom shown in Figure 1; Analysis through compiler; The memory headroom that need not keep is arranged; The starting position and the end position of the action scope of the attribute that compiler need not keep at said memory headroom have all inserted function call, during program run, through carry out these function calls dynamically the current run location of logging program have which memory headroom need not keep.For example; Compiler has inserted function call ckpt_nosave (A in the starting position of action scope; Size), program run is write down start address and the length size of the memory headroom A that need not keep to this moment; The memory headroom that record need not keep can adopt the form of record sheet, has write down the start address and the length thereof of the memory headroom that need not keep in the table.Compiler has inserted function call ckpt_nosave_end at the end position of action scope, and (A, size), program run is to this moment, start address and the length size of the memory headroom A that cancellation has been write down.
Step S32; Initiate the reservation of diaphany point; In the position of diaphany point place inquiry present procedure operation whether in the action scope of the attribute that memory headroom need not keep; Whether inquiry just has the memory headroom that need not keep of record, if then carry out step S33, then carries out step S34 if not.In any moment of program run; The outside all might be initiated the reservation of diaphany point at any time; When needs carried out the reservation of diaphany point, program was interrupted, and got into the reservation flow process of diaphany point; Whether the position of at first inquiring about the present procedure operation has the attribute of some memory headroom need not keep; Just whether the current checkpointed retention position is positioned at the action scope of the attribute that some memory headroom need not keep, if can know that then these memory headrooms need not keep in the reservation of current checkpoint.For instance, if the initiation of diaphany point be function call ckpt_nosave (A, size) with function call ckpt_nosave_end (A, size) between, memory headroom A is exactly the memory headroom that need not keep so; If the initiation of diaphany point is that (A, size) (A, size) afterwards, memory headroom A is exactly the memory headroom that needs reservation so before or at function call ckpt_nosave_end at function call ckpt_nosave.
Step S33; If there is the memory headroom that need not keep (promptly being the action scope of the attribute that need not keep at memory headroom) position of present procedure operation; The memory headroom that need not keep that does not then keep said record, only reservation needs the memory headroom of reservation and other running state of programs.The place does not keep the memory headroom that these need not keep in the checkpoint, just can effectively reduce the reservation amount of diaphany point, has shortened retention time simultaneously yet; And because the reservation amount of checkpoint reduces, if need to recover this checkpoint, also shortened corresponding release time.
Step S34 is if the memory headroom that the position of present procedure operation need not keep then keeps all memory headrooms and running state of programs.
After the reservation flow process of accomplishing the checkpoint, get back to the interrupted position of program among the step S32, program continues operation.
Fig. 5 is the retaining device corresponding to the checkpoint of the reservation method of above-mentioned checkpoint, and said device comprises: record cell 51, query unit 52 and stick unit 53.
Record cell 51 is used in the action scope of the attribute that memory headroom need not keep, writing down the information of said memory headroom according to the memory headroom action scope sign of the attribute that keeps of needs not.
Query unit 52, whether the position that is used for the place inquiry present procedure operation in the checkpoint has the memory headroom that need not keep of record.
Stick unit 53 when being used in the position of present procedure operation the memory headroom that need not keep of record being arranged, does not keep the memory headroom that need not keep of said record, keeps Unrecorded memory headroom.
In addition; Also need to prove, though said method is to be that example describes with the diaphany point, in fact; It also is applicable to embedded checkpoint; That is to say that compiler adopts the analytical approach of above-mentioned memory headroom that program is analyzed in compile time, the action scope starting position of the attribute that need not keep at memory headroom and end position insert function call; Program is in when operation, writes down the memory headroom that needs not keep according to function call, and whether the run location of inquiry present procedure has the memory headroom that need not keep when moving to embedded checkpoint.
In sum; Technique scheme is through analyzing memory headroom; The action scope of the attribute that the sign memory headroom need not keep; To the checkpoint, whether the position of inquiry present procedure operation is the action scope that is positioned at the attribute that memory headroom need not keep in program run, just can obtain locating in the checkpoint memory headroom that need not keep.Do not keep the memory headroom that these need not keep in the checkpoint, just can reduce the reservation amount of checkpoint effectively, shortened retention time simultaneously yet; And because the reservation amount of checkpoint reduces, if need to recover this checkpoint, also shortened corresponding release time.The minimizing of the reservation amount of checkpoint and keep the shortening of release time and improved the efficient of program run has also promoted the fault freedom of Large Scale Computer System simultaneously.
In addition; Compare and use static data-flow analysis in the prior art, the flow analysis of technique scheme binding data, interprocedural analysis, global pointer alias analysis and common mathematical function behavioural analysis can analyze the memory headroom that need not keep; Dynamically identify simultaneously the action scope of the attribute that memory headroom need not keep; Therefore whether, carry out the reservation of checkpoint in any moment of program run, can dynamically inquire about has the memory headroom that need not keep.
Though the present invention with preferred embodiment openly as above; But it is not to be used for limiting the present invention; Any those skilled in the art are not breaking away from the spirit and scope of the present invention; Can make possible change and modification, so protection scope of the present invention should be as the criterion with the scope that claim of the present invention was defined.

Claims (17)

1. the analytical approach of a memory headroom is characterized in that, comprises the steps:
Potential checkpoint is set in program, and said potential checkpoint is for analyzing the indication of memory headroom;
Whether in the reach of said potential checkpoint, analyzing has the memory headroom that need not keep;
If the memory headroom that need not keep is arranged, then identify the action scope of the attribute that said memory headroom need not keep;
Whether said analysis has the memory headroom that need not keep further to comprise: structure definite value-quote chain and function calling relationship; Structure common mathematical function read-write behavioural information; In conjunction with definite value-quote chain, function calling relationship and common mathematical function read-write behavioural information, carry out the global pointer alias analysis, structure global pointer another name information; According to definite value-quote chain, function calling relationship, global pointer another name information and common mathematical function read-write behavioural information, whether the program block of analyzing said indication place has the memory headroom that need not keep;
The action scope of the attribute that the said memory headroom of said sign need not keep comprises: the function call that the sign action scope begins is inserted in the starting position of the action scope of the attribute that need not keep at said memory headroom, and the end position of the action scope of the attribute that need not keep at said memory headroom inserts the function call that the sign action scope finishes;
The action scope of the attribute that said memory headroom need not keep is meant certain section interval that program is carried out, and said memory headroom need not keep in this section interval.
2. the analytical approach of memory headroom according to claim 1 is characterized in that, before said potential checkpoint is positioned at the loop body of loop statement.
3. the analytical approach of memory headroom according to claim 1 is characterized in that, said memory headroom comprises overall array and/or the space of dynamically applying for.
4. the analytical approach of memory headroom according to claim 1 is characterized in that, the said memory headroom that need not keep comprises the read-only memory headroom and/or the memory headroom of write-then-read.
5. the analytical approach of memory headroom according to claim 1; It is characterized in that; Said structure definite value-quote chain and function calling relationship comprise utilizes data-flow analysis technical construction definite value-quote chain, utilizes interprocedural analysis technical construction function calling relationship figure.
6. the analytical approach of memory headroom according to claim 1 is characterized in that, said structure common mathematical function read-write behavioural information comprises the latent structure common mathematical function read-write behavioural information table that utilizes java standard library, parallel storehouse and common mathematical function storehouse.
7. the analytical equipment of a memory headroom is characterized in that, comprising:
The unit is set, is used in program potential checkpoint being set, said potential checkpoint is for analyzing the indication of memory headroom;
Analytic unit is used for saidly in the reach of potential checkpoint, and whether have the memory headroom that need not keep, comprising if analyzing: structure definite value-quote chain and function calling relationship; Structure common mathematical function read-write behavioural information; In conjunction with definite value-quote chain, function calling relationship and common mathematical function read-write behavioural information, carry out the global pointer alias analysis, structure global pointer another name information; According to definite value-quote chain, function calling relationship, global pointer another name information and common mathematical function read-write behavioural information, whether the program block of analyzing said indication place has the memory headroom that need not keep;
Identify unit; Be used for when the memory headroom that said analytic unit analysis obtains need not keeping; Identify the action scope of the attribute that said memory headroom need not keep; Comprise: the function call that the sign action scope begins is inserted in the starting position of the action scope of the attribute that need not keep at said memory headroom, and the end position of the action scope of the attribute that need not keep at said memory headroom inserts the function call that the sign action scope finishes;
The action scope of the attribute that said memory headroom need not keep is meant certain section interval that program is carried out, and said memory headroom need not keep in this section interval.
8. the analytical equipment of memory headroom according to claim 7 is characterized in that, the said unit that is provided with is provided with potential checkpoint before the loop body of loop statement.
9. the analytical equipment of memory headroom according to claim 7 is characterized in that, said memory headroom comprises overall array and/or the space of dynamically applying for.
10. the analytical equipment of memory headroom according to claim 7 is characterized in that, the said memory headroom that need not keep comprises the read-only memory headroom and/or the memory headroom of write-then-read.
11. the analytical equipment of memory headroom according to claim 7; It is characterized in that; The action scope of the attribute that the said memory headroom of the sign of said identify unit need not keep comprises: the function call that the sign action scope begins is inserted in the starting position of the action scope of the attribute that need not keep at said memory headroom, and the end position of the action scope of the attribute that need not keep at said memory headroom inserts the function call that the sign action scope finishes.
12. the reservation method of a checkpoint is characterized in that, comprises the steps:
According to the memory headroom action scope sign of the attribute that keeps of needs not, in the action scope of the attribute that memory headroom need not keep, write down the information of said memory headroom;
The memory headroom that need not keep whether record is arranged in the position of place, checkpoint inquiry present procedure operation;
If there is the memory headroom that need not keep of record the position of present procedure operation, then do not keep the memory headroom that need not keep of said record, keep Unrecorded memory headroom;
Said in the action scope of the attribute that memory headroom need not keep; The information that writes down said memory headroom comprises: the start address and the length of said memory headroom are write down in the starting position of the action scope of the attribute that need not keep at said memory headroom, the start address and the length of the memory headroom of the end position cancellation record of the action scope of the attribute that need not keep at said memory headroom;
The action scope of the attribute that said memory headroom need not keep is meant certain section interval that program is carried out, and said memory headroom need not keep in this section interval.
13. the reservation method of checkpoint according to claim 12 is characterized in that, said checkpoint is the diaphany point.
14. the reservation method of checkpoint according to claim 12 is characterized in that, said checkpoint is embedded checkpoint.
15. the retaining device of a checkpoint is characterized in that, comprising:
Record cell; Be used for according to the memory headroom action scope sign of the attribute that keeps of needs not; In the action scope of the attribute that memory headroom need not keep; Write down the information of said memory headroom, comprising: the start address and the length of said memory headroom are write down in the starting position of the action scope of the attribute that need not keep at said memory headroom, the start address and the length of the memory headroom of the end position cancellation record of the action scope of the attribute that need not keep at said memory headroom;
Query unit, whether the position that is used for the place inquiry present procedure operation in the checkpoint has the memory headroom that need not keep of record;
Stick unit when being used in the position of present procedure operation the memory headroom that need not keep of record being arranged, does not keep the memory headroom that need not keep of said record, keeps Unrecorded memory headroom;
The action scope of the attribute that said memory headroom need not keep is meant certain section interval that program is carried out, and said memory headroom need not keep in this section interval.
16. the retaining device of checkpoint according to claim 15 is characterized in that, said checkpoint is the diaphany point.
17. the retaining device of checkpoint according to claim 15 is characterized in that, said checkpoint is embedded checkpoint.
CN 200710094330 2007-11-28 2007-11-28 Internal memory space analyzing method and device and check point reserving method and device Expired - Fee Related CN101452379B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200710094330 CN101452379B (en) 2007-11-28 2007-11-28 Internal memory space analyzing method and device and check point reserving method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200710094330 CN101452379B (en) 2007-11-28 2007-11-28 Internal memory space analyzing method and device and check point reserving method and device

Publications (2)

Publication Number Publication Date
CN101452379A CN101452379A (en) 2009-06-10
CN101452379B true CN101452379B (en) 2012-05-23

Family

ID=40734629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200710094330 Expired - Fee Related CN101452379B (en) 2007-11-28 2007-11-28 Internal memory space analyzing method and device and check point reserving method and device

Country Status (1)

Country Link
CN (1) CN101452379B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753361A (en) * 2019-01-04 2019-05-14 合肥杰发科技有限公司 A kind of EMS memory management process, electronic equipment and storage device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136407B (en) * 2011-12-03 2015-06-03 南京南瑞继保电气有限公司 Method of achieving snapshot with electro-magnetic transient in DC system (EMTDC) simulation model based on data integrated access technique
CN106484618B (en) * 2016-10-10 2019-04-30 中国电力科学研究院 A kind of parallel playback method and device based on memory access dependence pair

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1164710A (en) * 1996-03-19 1997-11-12 株式会社东芝 Scatter storage type multiple processor system and failure recovery method
US6105148A (en) * 1995-06-16 2000-08-15 Lucent Technologies Inc. Persistent state checkpoint and restoration systems

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6105148A (en) * 1995-06-16 2000-08-15 Lucent Technologies Inc. Persistent state checkpoint and restoration systems
CN1164710A (en) * 1996-03-19 1997-11-12 株式会社东芝 Scatter storage type multiple processor system and failure recovery method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
James S.Plank等.Compiler-Assisted Memory Exclusion for Fast Checkpointing.《IEEE Technical Committee on Operating Systems and Application Environments Special Issue on Fault-Tolerance》.1995,全文. *
James S.Plank等.Memory Exclusion:Optimizing the Performance of Checkpointing Systems.《Technical Report UT-CS-335,University of Tennessee》.1996,全文. *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753361A (en) * 2019-01-04 2019-05-14 合肥杰发科技有限公司 A kind of EMS memory management process, electronic equipment and storage device
CN109753361B (en) * 2019-01-04 2020-10-23 合肥杰发科技有限公司 Memory management method, electronic equipment and storage device

Also Published As

Publication number Publication date
CN101452379A (en) 2009-06-10

Similar Documents

Publication Publication Date Title
Abdulla et al. Stateless model checking for TSO and PSO
US20220245057A1 (en) Systems, methods, and devices for vertically integrated instrumentation and trace reconstruction
US8024719B2 (en) Bounded hash table sorting in a dynamic program profiling system
Sui et al. Sparse flow-sensitive pointer analysis for multithreaded programs
KR101354796B1 (en) Optimization of software transactional memory operations
US20090248721A1 (en) System And Method for Stack Crawl Testing and Caching
US8352921B2 (en) Static analysis defect detection in the presence of virtual function calls
US7673295B1 (en) System and method for compile-time non-concurrency analysis
US20100115494A1 (en) System for dynamic program profiling
US20040216095A1 (en) Method and apparatus for recovering data values in dynamic runtime systems
WO2010014981A2 (en) Method and apparatus for detection and optimization of presumably parallel program regions
Roemer et al. Smarttrack: efficient predictive race detection
Sato et al. On-the-fly detection of precise loop nests across procedures on a dynamic binary translation system
US20060101437A1 (en) Data processing device and method
Yu et al. Fast loop-level data dependence profiling
Bai et al. {DSAC}: Effective Static Analysis of {Sleep-in-Atomic-Context} Bugs in Kernel Modules
CN101452379B (en) Internal memory space analyzing method and device and check point reserving method and device
KR20070087400A (en) Method and system for test coverage analysis of operating system software
Upadhyaya et al. Automatic atomic region identification in shared memory SPMD programs
Popov et al. Piecewise holistic autotuning of parallel programs with cere
Bai et al. Effective detection of sleep-in-atomic-context bugs in the Linux kernel
Bai et al. {DLOS}: Effective Static Detection of Deadlocks in {OS} Kernels
Raza A review of race detection mechanisms
Gruber et al. Building of a Polyhedral Representation from an Instrumented Execution: Making Dynamic Analyses of non-Affine Programs Scalable
KR102016226B1 (en) Method for adaptive dynamic analysing, adaptive dynamic analysing platform, device equipped with the same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120523

Termination date: 20131128