CN101216725B - Dynamic power consumption control method for multithread predication by stack depth - Google Patents

Dynamic power consumption control method for multithread predication by stack depth Download PDF

Info

Publication number
CN101216725B
CN101216725B CN2008100193441A CN200810019344A CN101216725B CN 101216725 B CN101216725 B CN 101216725B CN 2008100193441 A CN2008100193441 A CN 2008100193441A CN 200810019344 A CN200810019344 A CN 200810019344A CN 101216725 B CN101216725 B CN 101216725B
Authority
CN
China
Prior art keywords
hash table
request
time
free time
thread
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
CN2008100193441A
Other languages
Chinese (zh)
Other versions
CN101216725A (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.)
Southeast University
Original Assignee
Southeast University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Southeast University filed Critical Southeast University
Priority to CN2008100193441A priority Critical patent/CN101216725B/en
Publication of CN101216725A publication Critical patent/CN101216725A/en
Application granted granted Critical
Publication of CN101216725B publication Critical patent/CN101216725B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

A dynamic power consumption controlling method using the depth of stacking for multithreading prediction is suitable for supplying power to the battery. The method includes various idle mode components of low power consumption and uses the devices of multi-task imbedded system. The method includes the following steps: step one: using the cluster mode of operating request to describe the characteristics of the sequence Phi of operating request by a single thread to the components; step 2: using two-stage hashtable to predict the probability distribution of the request interval under single thread mode; step 3, taking the thread as an independent request source and grouping the request source according to the task to which the thread belong and the entry address of the thread; step 4: calculating, according to the possibility distribution of the idle time of the components, the optimum overtime threshold kopt and the optimum power consumption mode sopt under multiple power consumption modes and single thread. The method improves the effective hit rate for prediction and further reduces the power consumption for the idle consumption-manageable components.

Description

Utilize stack depth to carry out the dynamic power consumption control method of multithreading prediction
Technical field
The present invention is applicable to powered battery, has multiple idle low-power consumption mode parts, and adopts the equipment of multitask embedded system.Belong to the embedded system low-power consumption technical field.
Background technology
Many parts of embedded system can provide the operational mode of multiple power consumption and performance class, and allow to pay certain performance cost and reduce power consumption.For example, processor provides multiple frequency of operation and operating voltage, and that hard disk provides is idle, multiple low-power consumption mode when idle such as standby and sleep etc.Because the switching between pattern generally all will be paid the cost on performance and the power consumption, so be not that to enter free time for any length the power consumption of idle pulley low more good more.The best low-power consumption mode that the free time of different length can enter is difference to some extent, and the length that can accurately dope free time will help reducing power consumption.
Traditional dynamic power management strategy simply is considered as the load of parts to have ignored the information of system and application from single request source.And real system multitask multithreading normally, it is a plurality of that the source of load often has, and have visibly different feature.Single request source model of conventional dynamic power managed strategy will cause the load analysis difficulty for non-stationary, and tactful prediction effect is undesirable.In the multitask environment of embedded system, because task can repeatedly be carried out, these processes that belong to same task have identical run time version, have similar behavioural characteristic.Equally, carry out identical its behavior of thread in entry address and also have similarity.Utilize these similaritys can improve the prediction effect of strategy.In most systems, operation of equipment is encapsulated in the specific api function, and application task is realized operation requests to equipment by calling api function.The invoked procedure of these api functions also has certain rules, can be used further to improve the prediction effect of strategy.
Summary of the invention
Technical matters: the purpose of this invention is to provide a kind of dynamic power consumption control method of utilizing stack depth to carry out the multithreading prediction, reduce the power consumption of embedded system parts.
Technical scheme: the present invention is dark by stack, function return address and request bunch integrated mode predictions request (Stack Based Prediction interval time, SBP), be request source independently with thread then, and request source divided into groups according to task under the thread and entry address.Obey under the assumed condition of same distribution in the request that request source on the same group produces, comprehensively each request source calculates the parts probability distribution of free time to the predicting the outcome of requesting interval time.Last according to the parts probability distribution of free time, calculate optimum overtime thresholding and optimum power consumption mode under many power consumption modes simple gate limit.Finish the back in Request Processing and start timer, when parts free time surpasses the optimum overtime thresholding that calculates, then control assembly enters corresponding optimum power consumption mode at once.
This method is specific as follows:
The first step: bunch integrated mode RCM by operation requests describes the feature of single thread to the operation requests sequence Φ of parts, and its computing method are as follows:
RCM Φ = mod 2 32 ( Σ r i ∈ Φ RA ( r i ) ) , Φ={r i|T RI(r i,r i-1)<T BE(s 2)}
In the formula:
r i---system is to the operation requests of parts;
RA (r i)---produce operation requests r iThe return address of function;
Mod x(y)---think that radix x carries out modular arithmetic to y;
T RI(r i, r I-1)---operation requests r iWith r I-1Between free time;
s 2---the 2nd grade of idle pulley;
T BE(s 2)---enter the break-even time of the 2nd grade of idle pulley, promptly enter the shortest free time that idle pulley can energy efficient;
Second step: adopt the two-stage Hash table to predict the probability distribution of single-threaded following requesting interval time, first order Hash table is according to mod 37[RA (r i)] the function return address Hash table that makes up, solving hash-collision with chained list, the index node of this Hash table comprises the statistics F that free time after the operation requests with same functions return address is distributed RA, and second level Hash table: according to mod 17[SD (r i)] and mod 17The dark Hash table of stack that [RCM] makes up respectively and request bunch integrated mode Hash table, wherein SD (r i) expression generation operation requests r iThe time stack depth, promptly storehouse top and storehouse the bottom poor; The index node of the dark Hash table of stack has comprised the free time distribution F after the operation requests with same functions return address and stack depth SDThe index node of request bunch integrated mode Hash table has then comprised the free time distribution F after the operation requests with same functions return address and request bunch integrated mode RCMSingle-threaded following requesting interval time, i.e. the probability distribution F of free time after the request PredictCan predict F when only function return address Hash table hits according to the hit situation of Hash table Predict=F RAF when only the dark Hash table of stack hits Predict=F SDF when only a request bunch integrated mode Hash table hits Predict=F RCMWhen a dark Hash table of stack and a request bunch integrated mode Hash table hit F simultaneously Predict=F SD* F RCM
The 3rd step: be request source independently with thread, and request source is divided into groups according to task under the thread and entry address, belong to the identical thread of same task and execution entry address and be included into same grouping, obey under the assumed condition of same distribution in the request of request source generation on the same group, comprehensive each request source predicts the outcome to the requesting interval time, calculates parts and enters i level idle pulley s iProbability P (s i); Computing method are as follows,
P ( s i ) = &Pi; j = 1 N T P j ( s i , &Delta; t j ) - &Pi; j = 1 N T P j ( s i + 1 , &Delta; t j ) , ( i < n ) &Pi; j = 1 N T P j ( s i , &Delta; t j ) , ( i = n )
P j ( s i , &Delta; t j ) = 1 - F predict ( T BE ( s i ) + &Delta; t j ) - F predict ( &Delta; t j ) 1 - F predict ( &Delta; t j )
In the formula
N T---the current total number of threads of using parts, i.e. request source sum;
The idle pulley sum of n---parts;
Δ t j---the time-delay that request source j is current;
P j(s i, Δ t j)---request source j is at idle Δ t jContinue the idle time after time above i level idle pulley s iThe probability of break-even time;
The 4th step:, calculate the optimum overtime thresholding k under many power consumption modes simple gate limit according to the parts probability distribution of free time OptWith optimum power consumption mode s Opt, computing method are as follows,
E total ( r&Delta;t , s i ) = &Sigma; j = 1 r ( a 1 T j + n j b 1 ) + &Sigma; j = r + 1 q ( a i T j + n j ( ( a 1 - a i ) r&Delta;t + b i ) )
E opt = min 1 &le; i &le; m 1 &le; r &le; q { E total ( r&Delta;t , s i ) } = E total ( r opt &Delta;t , s opt )
k opt=r optΔt
In the formula
Δ t---the interval time of the overtime thresholding of candidate;
E Total(r Δ t, s i)---parts enter i level idle pulley s behind process r Δ t time-out time iEnergy consumption expectation;
Q---the sum of the overtime thresholding of candidate;
a i---the average power consumption of i level idle pulley;
The equivalence conversion energy consumption of bi---i level idle pulley;
T j---in the free time distribution statistics, drop on the length summation of j the free time in interval;
n j---in the free time distribution statistics, free time is dropped on the sum of j the request in interval; Finish the back in Request Processing and start timer, in case parts free time surpasses the optimum overtime thresholding k that calculates Opt, then control assembly enters corresponding optimum power consumption mode s at once Opt
Beneficial effect: the dynamic power consumption control method of utilizing stack depth to carry out the multithreading prediction of the present invention has improved the effective hit rate and the discrimination of dynamic power management strategy prediction, has reduced the power consumption when parts are idle.Experimental result shows that effective hit rate of the present invention is higher 7~21 percentage points than conventional dynamic power managed strategy, but power consumption reduction amplitude is about 60%~90% of maximum energy efficient.
Description of drawings
Fig. 1. the energy consumption of idle pulley and free time concern synoptic diagram, four straight line e are arranged among the figure 1=a 1T+b 1, e 2=a 2T+b 2, e 3=a 3T+b 3, e 4=a 4T+b 4, represent the 1st grade of relation respectively to the energy consumption e and the free time t of the 4th grade of idle pulley.Horizontal ordinate is represented free time t, and ordinate is represented the energy consumption E under the idle pulley.Article four, the horizontal ordinate of three of straight line intersection points is respectively t 2, t 3And t 4,
Fig. 2. based on the data structure synoptic diagram of stack information prediction, the Hash table (RA Hash table) of a function return address is arranged among the figure, this Hash table has 37 index entries, and each index entry solves hash-collision by chained list.This chained list is by some chained list nodes, as formations such as RA1, RA2, by pointer link (representing with solid arrow among the figure).These nodes are key word with the function return address all, and comprise the probability distribution (representing with triangle among the figure, in upper right corner signal) of free time, a Hash table (SD Hash table) and the Hash table (RCM Hash table) of asking bunch integrated mode that stack is dark.The SD Hash table has 17 index entries, and each index entry solves hash-collision by chained list.This chained list, is linked by pointer as formations such as SD1, SD2 by some chained list nodes.These nodes are key word with stack deeply, and comprise the probability distribution of free time.The RCM Hash table has 17 index entries, and each index entry solves hash-collision by chained list.This chained list, is linked by pointer as formations such as RCM1, RCM2 by some chained list nodes.These nodes are key word with request bunch integrated mode, and comprise the probability distribution of free time,
Fig. 3. based on the prediction schematic flow sheet of stack information prediction,
Fig. 4. based on the renewal schematic flow sheet of stack information prediction,
Fig. 5. according to process and thread grouping data predicted structural representation.A Hash table (PG Hash table) and a two-dimentional Hash lookup table (P/T ID Hash table) that a process group is arranged among the figure.The PG Hash table has 256 index entries, and each index entry solves hash-collision by chained list.This chained list, is linked by pointer as formations such as PG1, PG2 by some chained list nodes.Each node is a key word with process group sign (PGID), and comprises the probability distribution that predicts the outcome and the Hash table (TG Hash table) of a sets of threads.The TG Hash table has 17 index entries, and each index entry solves hash-collision by chained list.This chained list, is linked by pointer as formations such as TG1, TG2 by some chained list nodes.Each node is with sets of threads sign (TGID), and promptly the thread entry address is a key word, and comprises the fallout predictor (representing with circle in the drawings, as SBP1 and SBP2 etc.) of a free time, the probability distribution that predicts the outcome and thread tabulation.The thread tabulation is by some chained list nodes, as formations such as TI1, TI2, by pointer link (representing with solid arrow in the drawings).Each node is a key word with thread identification (TID), and comprises the attribute information of thread.P/T ID Hash table is one 37 * 37 a matrix, according to process identification (PID) (PID) and thread identification (TID) index matrix element.Each element of matrix is one and searches chained list.Chained list points to thread tabulation node, and as TI1, TI2 etc., node is by pointer link (representing with empty arrow in the drawings).
Embodiment
Fig. 1. described the idle energy consumption of different idle pulley lower member and the relation of free time, every straight line represents that promptly idle energy consumption is with the variation of free time, the slope a of straight line among the figure iRepresent the average power consumption of i level idle pulley, intercept b iRepresent the equivalence conversion energy consumption of i level idle pulley.The straight line of other idle pulley correspondence of adjacent level intersects three intersection points that produce, the horizontal ordinate t of these intersection points in twos iBe the break-even time T between i level idle pulley and the 1st grade of idle pulley BE(s i).
Fig. 2. illustrated to carry out single-threaded data predicted structure based on stack information.Whole data structure is a tree based on Hash table.The root of tree is the Hash table (RA Hash Table) of a function return address, the function return address is hashed on the concordance list of [0,36] by hash function, and we claim that this concordance list is the RA Hash table.In order to solve hash-collision (Hash Collision), we adopt the single-track link table structure to write down each RA node.The data structure of RA node comprises five parts:
The function return address: the key word of RA node is used for the coupling of searching of Hash table;
Prediction distribution: at Fig. 2. in be expressed as leg-of-mutton mark.Adopt histogrammic form to write down of the distribution of all function return addresses for request free time thereafter of node RA value.According to idle pulley and the analysis that concerns between free time, we can come the reduced representation distribution of free time by the best idle pulley of statistics free time correspondence.This is distributed as later prediction foundation is provided;
The Hash table (SD Hash Table) that stack is dark: the mode of retrieving deeply according to stack is provided, and hash function is the same with the RA Hash table to adopt modular arithmetic, and only the radix of mould is 17, and importing variable into is the dark rather than function return address of stack.Also adopt list structure to write down each SD node and solved hash-collision.The data structure of SD node only comprises the dark key word of stack and based on the prediction distribution of SD;
The Hash table (RCM Hash Table) of request bunch integrated mode: the mode of retrieving according to request bunch integrated mode is provided, institutional framework is similar to the SD Hash table, and the data structure of different is RCM node comprises is RCM key word and based on the prediction distribution of RCM;
Node pointer: point to next stage RA node, constitute chained list.If current node is last record, then this pointer is empty.
Fig. 3. the prediction flow process of carrying out single-threaded prediction based on stack information has been described:
[prediction beginning] Request Processing finishes, and obtains RA, SD and the RCM of request, enters [step 1];
[step 1] searches the RA Hash table, judges whether RA hits.If hit and enter [step 3], otherwise enter [step 2];
[step 2] is provided with RA hit in tag flag RA=false.Predict that free time is shorter, should enter ready idle pulley, s Predict=s 1, [prediction finishes];
[step 3] is provided with RA hit in tag flag RA=true.Obtain the RA node, search the SD Hash table on this node, judge whether SD hits.If hit and enter [step 7], otherwise enter [step 4];
[step 4] is provided with SD hit in tag flag SD=false.Search the RCM Hash table on the RA node, judge whether RSM hits.If hit and enter [step 6], otherwise enter [step 5];
[step 5] is provided with RCM hit in tag flagR CM=false.Prediction distribution F according to the RA node RACarry out model prediction, s Predict=Predict (F RA), [prediction finishes];
[step 6] is provided with RCM hit in tag flag RCM=true.Obtain the RCM node, according to the prediction distribution F of this node RCMCarry out model prediction, s Predict=Predict (F RCM), [prediction finishes];
[step 7] is provided with SD hit in tag flag SD=true.Obtain the SD node.Search the RCM Hash table on the RA node, judge whether RSM hits.If hit and enter [step 9], otherwise enter [step 8];
[step 8] is provided with RCM hit in tag flag RCM=false.Prediction distribution F according to the SD node SDCarry out model prediction, s Predict=Predict (F SD), [prediction finishes];
[step 9] is provided with RCM hit in tag flag RCM=true.Obtain the RCM node, according to the prediction distribution F of this node RCMPrediction distribution F with the SD node SDCarry out model prediction, s Predict=CombinePredict (F RCM, F SD), [prediction finishes];
Fig. 4. the more new technological process that carries out single-threaded prediction based on stack information has been described:
[upgrading beginning] has new request to arrive, and obtains apart from the real space time interval t of last request Idle, and should free time the best idle pulley S of correspondence Opt(t Idle) (computing method of best idle pulley are referring to formula (1.2)).Enter [step 41];
[step 41] is according to RA hit in tag flag RAJudge last time, whether the RA of request hit.If hit and enter [step 44], otherwise enter [step 42];
The best idle pulley S of [step 42] judgement correspondence of actual free time Opt(t Idle) whether be ready mode.Be that ready mode enters [step 43], otherwise [upgrade and finish];
[step 43] sets up new RA node for request last time, adds the chained list stem of manipulative indexing in the RA Hash table to.In the SD of this RA node Hash table and RCM Hash table, add newly-built SD node and RCM node respectively.And the prediction distribution of initialization RA node, SD node and RCM node.[upgrade and finish];
[step 44] removes RA hit in tag flag RA=false.Upgrade prediction distribution (the i.e. best idle pulley S of increase correspondence of actual free time of the corresponding RA node of request last time Opt(t Idle) statistical value), enter [step 45];
[step 45] is according to SD hit in tag flag SDJudge last time, whether the SD of request hit.If hit and enter [step 46], otherwise enter [step 47];
[step 6] removes SD hit in tag flag SD=false.Upgrade the prediction distribution of the corresponding SD node of request last time, enter [step 49];
The best idle pulley S of [step 47] judgement correspondence of actual free time Opt(t Idle) whether be ready mode.Be that ready mode enters [step 49], otherwise enter [step 48];
[step 48] is according to the newly-built SD node of SD information of asking last time and add the SD Hash table to, and the initialization prediction distribution, enters [step 49];
[step 49] is according to RCM hit in tag flag RCMJudge last time, whether the RCM of request hit.If hit and enter [step 410], otherwise enter [step 411];
[step 410] removes RCM hit in tag flag RCM=false.Upgrade the prediction distribution of the corresponding RCM node of request last time, [upgrade and finish];
The best idle pulley S of [step 411] judgement correspondence of actual free time Opt(t Idle) whether be ready mode.Be that ready mode enters [upgrade and finish], otherwise enter [step 412];
[step 412] is according to the newly-built RCM node of RCM information of asking last time and add the RCM Hash table to, and the initialization prediction distribution, [upgrade and finish].
Fig. 5. illustrated under the multithreading grouping data predicted structure.The major part of data structure is a search tree based on Hash table.The top of tree is a process group Hash table (PG Hash Table), can search according to the executable file path of process.We are mapped as one 32 integer value with the executable file path by following character string hash function, be called the process group sign (Processes Group Identifier, PGID).This hash algorithm has utilized 7/15 biased ring shift characters that move to add up, and the length of character string also as a calculating factor.The least-significant byte of process group sign is used as the index of PG Hash table, so the length of PG Hash table is 2 8=256.Though for embedded system, so many PG have been enough to distinguish various application programs,, still adopt the single-track link table structure to write down each PG node for solving possible hash-collision.The PG node only comprises four contents: process group sign PGID, empty prediction distribution, attached sets of threads Hash table (TG Hash Table) and next stage PG node pointer.Wherein PGID is the key word of node, and the TG Hash table then is that the entry address with thread is a key word, is called sets of threads sign TGID.Its hash function employing radix is 17 modular arithmetic, and TGID is hashed on the concordance list of [0,16].The TG Hash table has equally also adopted single-track link table to solve hash-collision.The TG node is made up of five parts:
The thread entry address: i.e. TGID, 32 integer values, the key word of TG node is used for the coupling of searching of TG Hash table;
SBP fallout predictor: at Fig. 5. middlely represent, utilize the SBP forecasting techniques that the prediction service of idle pulley is provided for thread on the same group with circle.Generally speaking, have similar behavioural characteristic with the thread that enters the mouth, the thread execution flow processs of different inlets differ greatly.So the SBP fallout predictor of the shared TG node of thread on the same group, the SBP fallout predictor of each TG node is then separate;
The thread tabulation: (Thread Information, the TI) single-track link table of node formation have been preserved the thread information that the SBP forecasting institute needs by thread information.Each TI node is represented a thread that has moved, and also just means an independently request source for the model of MSR;
The prediction statistical information: with the histogram-fitting distribution of free time, and the method for employing moving window, for each idle pulley provides distribution statistics information.
Node pointer: point to next stage TG node, constitute chained list.If current node is last record, then this pointer is empty.
TI node in the thread tabulation provides following thread information:
Identification information: comprise the identification information of thread and identification information two parts of affiliated process.The identification information of thread is thread identification TID and sets of threads sign TGID, and the identification information of process is process identification (PID) PID and process group sign PGID;
Stack information: comprise initial stack pointer, current stack pointer, current function return address RA and current request bunch integrated mode RCM.It is dark that wherein initial stack pointer and current stack pointer are used to calculate stack;
Temporal information: write down the moment t that last time, Request Processing finished Previous
By TGID and PGID we can be to the processing of classifying of numerous threads, but more often need to find efficiently thread information, so we have set up a two-dimentional Hash lookup table (P/T ID HashTable), be used for searching fast the TI node.Its data structure is at Fig. 5. in be expressed as one 37 * 37 array, be that 37 modular arithmetic hashes to TID and PID [0,36] respectively and goes up and constitute line index and column index by radix.Each unit in the P/T ID Hash table all points to a single-track link table that is made of the TI node, and this chained list is different with the thread chained list of TG node, at Fig. 5. and the empty arrow of middle usefulness is represented.Generally, embedded OS concurrent process number can be not too many, and plain length with this chained list generally can not surpass 3.Factors such as the consideration embedded system memory is limited for the scale of further restricted T I node, and improve seek rate, only the thread that once and used PMC are carried out index.New process or thread have only when having used PMC, just can be added in the concordance list.Need to use PMC thread establishment and withdraw from, and the arrival of PMC request all may cause the variation of node: 1. during thread creation, search the PG Hash table and the TG Hash table confirms whether use PMC according to PGID and TGID, only when hitting, just add TI node (joining simultaneously in the TI chained list of P/T ID Hash table); When 2. thread withdraws from, search P/T ID Hash table, only deletion TI node (from the TI chained list of TG node, deleting simultaneously) when hitting according to PID and TID.Even but the TI node chained list of TG node is all deleted, the TG node still keeps, for new thread is got ready; When 3. the PMC request arrives, search P/T ID Hash table, only when miss, add TI node (generate PGID and TGID simultaneously, join in the TI chained list of corresponding TG node,, then also want newly-built PG or TG) if fail to hit PG or TG according to PID and TID.
But at first at power consumption management component (Power Manageable Component PMC) sets up the linear model of energy consumption when idle, as Fig. 1. shown in.The horizontal ordinate t of three intersection points among the figure 2, t 3, t 4To be divided into four time periods free time, each time period all has one makes the minimum idle pulley of energy consumption, and the idle pulley difference of different time sections correspondence, and the average power consumption of the idle pulley of time period correspondence more backward is low more.Therefore, be the iptimum relationship function E of energy consumption and free time with these three intersection points and the piecewise function of the broken line that line segment was constituted that is connected intersection point (overstriking demonstration) representative Opt(t):
E opt ( t ) = a 1 t + b 1 , ( 0 &le; t < t 2 ) a i t + b i , ( t i &le; t < t i + 1 , 1 < i &le; n - 1 ) a n t + b n , ( t n &le; t ) - - - ( 1.1 )
Can also obtain the idle pulley of corresponding optimum energy consumption and the relation function S of free time equally Opt(t):
S opt ( t ) = s 1 , ( 0 &le; t < t 2 ) s i , ( t i &le; t < t t + 1 , 1 < i &le; n - 1 ) s n , ( t n &le; t ) - - - ( 1.2 )
Like this for given free time length, according to S Opt(t) and E Opt(t) just can calculate best idle pulley and minimum energy consumption.
The difference between the single request has been reflected in the dark and function return address of stack, and also exists certain contact between the request, and the length of free time is relevant with the feature of asking bunch collection.We with break-even time of the 2nd grade of idle pulley as thresholding, the requesting interval time is defined as a request bunch Φ (Request Cluster) less than the continuous request of this thresholding.That is to say that at interval free time is all greater than break-even time of the 2nd grade of idle pulley between any two requests bunch.The feature of request bunch represents with the function return address sum of all requests that it comprised, be defined as ask bunch integrated mode (Requests-Clustering Mode, RCM):
Φ={r i|T RI(r i,r i-1)<T BE(s 2)}
RCM &Phi; = mod 2 32 ( &Sigma; r i &Element; &Phi; RA ( r i ) ) - - - ( 1.3 )
In the formula
r i---the PMC operation requests;
T RI(r i, r I-1)---request r iWith r I-1Between free time;
s 2---(ready idle pulley is s to the 2nd grade of idle pulley 1);
Mod x(y)---think that radix x carries out modular arithmetic to y;
RA (r i)---request r iThe function return address.
We just can predict, function return address dark according to stack and these stack information of request bunch integrated mode comparatively accurately to the free time of single thread, i.e. SBP.The data structure of SBP is as Fig. 2. shown in, based on this data structure, the prediction flow process of SBP is as Fig. 3. shown in.The Predict algorithm of predicting according to the prediction distribution of single thread is to seek the idle pulley s that satisfies following condition from the angle of probability Predict:
P ( s 1 ) &le; &Sigma; i > 1 P ( s i ) - - - ( 1.4 )
P ( s predict ) = max i > 1 { P ( s i ) }
In the formula
P (s i)---enter idle pulley s in the prediction distribution iProbability.
If do not find the idle pulley that satisfies above-mentioned condition, then be predicted as and enter ready idle pulley, i.e. s Predict=s 1And according to the prediction distribution F of SD and RCM SDAnd F RCMThe CombinePredict algorithm that carries out associated prediction be in earlier will prediction distribution with SD and RCM identical free time correspondence probable value multiply each other i.e. F in twos SD* F RCM, obtain a new distribution F Predict, and then go out the idle pulley s that should enter according to the Predict algorithm predicts Predict=Predict (F Predict).The original date structure only has the RA Hash table of a sky, can add more RA node gradually through renewal with after adjusting, and the prediction distribution of each node is also being brought in constant renewal in.In order to utilize historical data and off-line analysis, we import to whole data structure in the file, and making after SBP starts can be according to the whole data structure of this document initialization, thereby avoids setting up once more the time that data structure will spend.
In the multitask environment of embedded system, because task can repeatedly be carried out, these processes that belong to same task have identical run time version, have similar behavioural characteristic, we with its be included into same process group (Processes Group, PG).Equally, also have similarity because carry out identical its behavior of thread in entry address, we also it is included into same sets of threads (Threads Group, TG).We can obtain to be created all information of process and thread when establishment process and thread, and obtain notice when process and thread withdraw from, and these information are sent to the power managed device PM of PMC.That we pay close attention in the establishment information of process is sign (the Process Identifier of process, PID) and the path of executable file (being application name and place catalogue), and we pay close attention in the establishment information of thread be thread sign (ThreadIdentifier, TID), entry address (Thread Entry) and initial stack pointer.Process ID and Thread Id belong to multidate information, are the unique identifications of distinguishing different processes and different threads.The path of the executable file of process and the entry address of thread then belong to static information, process and thread can be divided into groups according to these two kinds of information.When carrying out solicit operation, PMC obtains the sign TID of thread of executable operations and the sign PID of affiliated process thereof like this.According to TID and PID, this solicit operation be mapped to a unique sorted group (PG, TG) on, and corresponding one single-threaded, thereby can enough SBP forecasting techniquess carry out single-threaded idle pulley prediction.
We are according to Fig. 5. mode made up a Hash tree.Each thread can be considered as an independently request source, a TI node in corresponding the Hash tree.Dope the distribution that requesting interval time of single thread may obey by statistics and analysis to solicit operation.At first,, and hit under the situation of the TI node in the P/T ID Hash table SBP fallout predictor that PGID that is preserved according to the TI node and TGID find the TG node at the TID and the PID that obtain to ask.Then, use the current stack information and the time information renovation TI node that obtain, and current stack information is passed to the prediction that the SBP fallout predictor carries out idle pulley.According to predicting the outcome and the prediction statistical information of TG node, the distribution of classified statistics free time.In the prediction statistical information of TG node, longest-idle is T Max, will [0, T Max] time period (T MaxGenerally be taken as 2/T BE(s n)) be divided into N equably BinIndividual minizone (N BinGenerally get 40), and with a N Bin+ 1 array is deposited the cumulative number that the free time in each section interval occurs, and free time surpasses T MaxAll charge to last unit of array.The approximate distribution that has characterized free time of frequency histogram that occurs by free time of this array like this, we be called free time frequency distribution table (Idle-Frequency Distribution Table, IFDT).For the variation that can distribute the idle time of self-adaptation, adopted the statistical method of moving window.Moving window is that a maximum length is L SWFifo queue (L SWGeneral value is 40), formation preserved free time at one's leisure between index in the frequency distribution table.The TG node has been set up independently free time frequency distribution table and moving window for each idle pulley.After choosing free time frequency distribution table and moving window according to the idle pulley of prediction, with free time at one's leisure between index in the frequency distribution table deposit formation in, if queue length has exceeded maximum length L SWRestriction, the dequeue of formation stem so simultaneously increases and reduces statistical value in the free time frequency distribution table respectively according to the index of going into formation and dequeue.So the reflection of free time frequency distribution table is the interior free time distribution statistics of moving window.Free time distributes last, (asks current time and last time time interval t-t constantly according to free time frequency distribution table and time delay Previous), (ConditionalProbability Function CPF) calculates the probability that surpasses the different idle pulley break-even times in the current following free time that predicts the outcome to the conditional probability computing module.Suppose that the statistics of free time frequency distribution table on i interval is n i(1≤i≤N Bin), what the distribution F (t) of free time can be similar to so is expressed as:
F ( t ) = &Sigma; i = 1 k n i / &Sigma; i = 1 N bin + 1 n i = &Sigma; i = 1 k n i / L , k = min ( [ t m ] + 1 , N bin + 1 ) - - - ( 1.5 )
In the formula
The interval time interval of m---free time frequency distribution, i.e. m=T Max/ N Bin
K---the sequence number between free time t location;
L---the length of current moving window formation.
Because after the moving window formation reaches maximum length, just can not reduce, so at L SWThe saturated L ≡ of the total amount L of statistics after the individual request SWIf current time apart from time interval (being called elapsed-time standards) of solicit operation last time be Δ t=t-t Previous, free time this moment be distributed as conditional probability, so the algorithm of CDF is as follows:
CDF ( t , &Delta;t ) = F ( t + &Delta;t ) - F ( &Delta;t ) 1 - F ( &Delta;t ) , ( &Delta;t < T max ) 1 , ( &Delta;t &GreaterEqual; T max , n N bin + 1 = 0 ) 0 , ( &Delta;t &GreaterEqual; T max , n N bin + 0 &NotEqual; 0 ) - - - ( 1.6 )
Can calculate free time above idle pulley s according to CDF iThe probability P (s of break-even time i, Δ t) be:
P(s i,Δt)=1-CDF(T BE(s i),Δt) (1.7)
If order
Figure GSB00000377341900131
Represent elapsed-time standards Δ t respectively and surpass the interval sequence number at break-even time place afterwards, then have according to formula (1.6) and (1.7):
P ( s i , &Delta;t ) = ( L - &Sigma; i = 1 k i &prime; n i ) / ( L - &Sigma; i = 1 k i n i ) , ( k i &le; N bin ) 0 , ( k i = N bin + 1 , n N bin + 1 = 0 ) 1 , ( k i = N bin + 1 , n N bin + 1 &NotEqual; 0 ) - - - ( 1.8 )
Just can draw the probability that free time surpasses the different idle pulley break-even times by statistics like this to free time frequency distribution table.
The establishment of process and thread and the message that withdraws from have been arranged, just can divide the time interval of load, thereby carried out the load estimation under the multithreading according to the influence of thread.The request source that only has PID and TID to hit when request arrives carries out SBP prediction (time-delay of this request source is updated to 0), and other request source only recalculates the probability P (s that each idle pulley break-even time is exceeded according to elapsed-time standards Δ t i, Δ t).Calculate PMC again and enter i level idle pulley s iProbability P (s i):
P ( s i ) = &Pi; j = 1 N T P j ( s i , &Delta; t j ) - &Pi; j = 1 N T P j ( s i + 1 , &Delta; t j ) , ( i < n ) &Pi; j = 1 N T P j ( s i , &Delta; t j ) , ( i = n ) - - - ( 1.9 )
In the formula
N T---the current total number of threads of using PMC, i.e. request source sum;
N---PMC idle pulley sum;
Δ t j---the time-delay that request source j is current;
P j(s i, Δ t j)---the free time of request source j surpasses idle pulley s iThe probability of break-even time, its computing method are suc as formula (1.8).
After acquisition PMC entered the probability of each idle pulley, the method for prediction idle pulley was identical with formula (1.4), selected the final idle pulley that enters of predicting of conduct of probability maximum, preferentially selected the idle pulley of more low-power consumption under the identical situation of probability.
After all used the thread of PMC all to withdraw from, formula (1.9) was just no longer suitable.Need predict according to the empty request source of reserve this moment.Empty request source is not represented any thread, does not participate in prediction when the thread operation of using PMC is arranged.Empty request source has been predicted the PMC free time under the thread situation of no any use PMC.Prediction algorithm adopts the method for easy exponential average (Exponential Average):
s predict(n)=I -1spredict(n-1)+(1-α)I(s opt(t n-1))) (1.10)
In the formula
s Predict(n)---the idle pulley of the n time prediction;
t n---the actual free time of the n time prediction;
I (s i)---with idle pulley s iBe mapped as the operator of subscript sequence number i;
I -1(i)---the inverse operation of I, i is mapped as idle pulley s with the subscript sequence number i, when sequence number is rounded up to the integer sequence number during for decimal;
α---the exponential damping factor between 0 to 1, generally gets 0.5.
The prognoses system that is made of empty request source and thread request source is by just providing the prediction service for system on the whole time period like this.
When prediction can make mistakes, in order to reduce the loss that misprediction brings, we adopted the overtime strategy of single overtime thresholding to carry out final decision-making according to the probability distribution that predicts the outcome.Because adopt histogram approximate representation probability distribution, and add up with moving window, thus this strategy be called the overtime strategy of simple gate limit self-adaptation based on probability (Probability-based Single-threshold Adaptive Timeout, PSAT).Overtime thresholding k is an element of limited arithmetic sequence set, k=r Δ t, and (0≤r<q), Δ t is the equal difference interval of thresholding, and r is a thresholding k corresponding sequence number.Minimum threshold is 0, and max threshold is q Δ t.J level idle pulley s then jUnder total energy consumption be:
E total _ idle = &Sigma; i = 1 r ( a 1 T i + n i b 1 ) + &Sigma; i = r + 1 q ( a j T i + n i ( ( a 1 - a j ) r&Delta;t + b j ) ) - - - ( 1.11 )
In the formula
T i---drop on the length summation of i the free time in the interval;
n i---free time is dropped on the sum of i the request in the interval;
If probability distribution is definite, i.e. T iAnd n iConstant, then total energy consumption can be expressed as the function E of overtime thresholding Total_idle=E (r), relatively the total energy consumption under the individual overtime thresholding of q can be determined idle pulley s iUnder lowest energy consumption E Opt(i)=minE Total_idleBest overtime thresholding k with correspondence Opt(i).By comparing the lowest energy consumption under each idle pulley, just can determine final best overtime thresholding k then OptWith the idle pulley s that should enter Opt:
E opt = E opt ( j ) = min 1 &le; i &le; m { E i ( k opt ( i ) ) }
k opt=k opt(j)
s opt=s j (1.12)
In the formula
k Opt(i)---enter idle pulley s iOptimum overtime thresholding;
E i(k)---under thresholding k, enter idle pulley s iEnergy consumption;
E Opt(i)---enter idle pulley s iLowest energy consumption.

Claims (1)

1. one kind is utilized stack depth to carry out the dynamic power consumption control method that multithreading is predicted, it is characterized in that: the first step: bunch integrated mode RCM by operation requests describes the feature of single thread to the operation requests sequence Φ of parts, and its computing method are as follows:
RCM &Phi; = mod 2 32 ( &Sigma; r i &Element; &Phi; RA ( r i ) ) , &Phi; = { r i | T RI ( r i , r i - 1 ) < T BE ( s 2 ) }
In the formula:
r i---system is to the operation requests of parts;
RA (r i)---produce operation requests r iThe return address of function;
Mod x(y)---think that radix x carries out modular arithmetic to y;
T RI(r i, r I-1)---operation requests r iWith r I-1Between free time;
s 2---the 2nd grade of idle pulley;
T BE(s 2)---enter the break-even time of the 2nd grade of idle pulley, promptly enter the shortest free time that idle pulley can energy efficient;
Second step: adopt the two-stage Hash table to predict the probability distribution of single-threaded following requesting interval time, first order Hash table is according to mod 37[RA (r i)] the function return address Hash table that makes up, solving hash-collision with chained list, the index node of this Hash table comprises the statistics F that free time after the operation requests with same functions return address is distributed RA, and second level Hash table: according to mod 17[SD (r i)] and mod 17The dark Hash table of stack that [RCM] makes up respectively and request bunch integrated mode Hash table, wherein SD (r i) expression generation operation requests r iThe time stack depth, promptly storehouse top and storehouse the bottom poor; The index node of the dark Hash table of stack has comprised the free time distribution F after the operation requests with same functions return address and stack depth SDThe index node of request bunch integrated mode Hash table has then comprised the free time distribution F after the operation requests with same functions return address and request bunch integrated mode RCMSingle-threaded following requesting interval time, i.e. the probability distribution F of free time after the request PredictCan predict F when only function return address Hash table hits according to the hit situation of Hash table Predict=F RAF when only the dark Hash table of stack hits Predict=F SDF when only a request bunch integrated mode Hash table hits Predict=F RCMWhen a dark Hash table of stack and a request bunch integrated mode Hash table hit F simultaneously Predict=F SD* F RCM
The 3rd step: be request source independently with thread, and request source is divided into groups according to task under the thread and entry address, belong to the identical thread of same task and execution entry address and be included into same grouping, obey under the assumed condition of same distribution in the request of request source generation on the same group, comprehensive each request source predicts the outcome to the requesting interval time, calculates parts and enters i level idle pulley s iProbability P (s i); Computing method are as follows,
P ( s i ) = &Pi; j = 1 N T P j ( s i , &Delta; t j ) - &Pi; j = 1 N T P j ( s i + 1 , &Delta; t j ) , ( i < n ) &Pi; j = 1 N T P j ( s i , &Delta; t j ) , ( i = n )
P j ( s i , &Delta; t j ) = 1 - F predict ( T BE ( s i ) + &Delta; t j ) - F predict ( &Delta; t j ) 1 - F predict ( &Delta; t j )
In the formula
N T---the current total number of threads of using parts, i.e. request source sum;
The idle pulley sum of n---parts;
Δ t j---the time-delay that request source j is current;
P j(s i, Δ t j)---request source j is at idle Δ t jContinue the idle time after time above i level idle pulley s iThe probability of break-even time;
The 4th step:, calculate the optimum overtime thresholding k under many power consumption modes simple gate limit according to the parts probability distribution of free time OptWith optimum power consumption mode s Opt, computing method are as follows,
E total ( r&Delta;t , s i ) = &Sigma; j = 1 r ( a 1 T j + n j b 1 ) + &Sigma; j = r + 1 q ( a i T j + n j ( ( a 1 - a i ) r&Delta;t + b i ) )
E opt = min 1 &le; i &le; m 1 &le; r &le; q { E total ( r&Delta;t , s i ) } = E total ( r opt &Delta;t , s opt )
k opt=r optΔt
In the formula
Δ t---the interval time of the overtime thresholding of candidate;
E Total(r Δ t, s i)---parts enter i level idle pulley s behind process r Δ t time-out time iEnergy consumption expectation;
Q---the sum of the overtime thresholding of candidate;
a i---the average power consumption of i level idle pulley;
The equivalence conversion energy consumption of bi---i level idle pulley;
T j---in the free time distribution statistics, drop on the length summation of j the free time in interval;
n j---in the free time distribution statistics, free time is dropped on the sum of j the request in interval; Finish the back in Request Processing and start timer, in case parts free time surpasses the optimum overtime thresholding k that calculates Opt, then control assembly enters corresponding optimum power consumption mode s at once Opt
CN2008100193441A 2008-01-04 2008-01-04 Dynamic power consumption control method for multithread predication by stack depth Expired - Fee Related CN101216725B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100193441A CN101216725B (en) 2008-01-04 2008-01-04 Dynamic power consumption control method for multithread predication by stack depth

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100193441A CN101216725B (en) 2008-01-04 2008-01-04 Dynamic power consumption control method for multithread predication by stack depth

Publications (2)

Publication Number Publication Date
CN101216725A CN101216725A (en) 2008-07-09
CN101216725B true CN101216725B (en) 2011-04-27

Family

ID=39623168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100193441A Expired - Fee Related CN101216725B (en) 2008-01-04 2008-01-04 Dynamic power consumption control method for multithread predication by stack depth

Country Status (1)

Country Link
CN (1) CN101216725B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9417876B2 (en) 2014-03-27 2016-08-16 International Business Machines Corporation Thread context restoration in a multithreading computer system
US9459875B2 (en) 2014-03-27 2016-10-04 International Business Machines Corporation Dynamic enablement of multithreading
US9594661B2 (en) 2014-03-27 2017-03-14 International Business Machines Corporation Method for executing a query instruction for idle time accumulation among cores in a multithreading computer system
US9804847B2 (en) 2014-03-27 2017-10-31 International Business Machines Corporation Thread context preservation in a multithreading computer system
US9921848B2 (en) 2014-03-27 2018-03-20 International Business Machines Corporation Address expansion and contraction in a multithreading computer system
US10095523B2 (en) 2014-03-27 2018-10-09 International Business Machines Corporation Hardware counters to track utilization in a multithreading computer system

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101860944B (en) * 2009-04-13 2013-08-28 华为技术有限公司 Method and device for controlling energy efficiency of communication system, service processing unit and service processing system
CN101916229B (en) * 2010-07-16 2013-03-06 中国科学院计算技术研究所 Efficient analogy method for replacing cache randomly
CN103678137B (en) * 2013-12-30 2015-07-08 北京控制工程研究所 Task maximum stack depth detection method based on list files
GB2516999B (en) * 2014-01-31 2015-07-22 Imagination Tech Ltd An improved return stack buffer
US9218185B2 (en) 2014-03-27 2015-12-22 International Business Machines Corporation Multithreading capability information retrieval
CN105930397B (en) * 2016-04-15 2019-05-17 北京思特奇信息技术股份有限公司 A kind of message treatment method and system
CN106227639A (en) * 2016-07-25 2016-12-14 张升泽 Multi core chip voltage calculates method and system
CN106155862A (en) * 2016-07-25 2016-11-23 张升泽 Current calculation method in electronic chip and system
CN106294063A (en) * 2016-07-26 2017-01-04 张升泽 Temperature-controlled process based on chip and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6587950B1 (en) * 1999-12-16 2003-07-01 Intel Corporation Cluster power management technique
CN1818862A (en) * 2006-03-02 2006-08-16 浙江大学 Local variable supporting method based on sram in built-in system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6587950B1 (en) * 1999-12-16 2003-07-01 Intel Corporation Cluster power management technique
CN1818862A (en) * 2006-03-02 2006-08-16 浙江大学 Local variable supporting method based on sram in built-in system

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9417876B2 (en) 2014-03-27 2016-08-16 International Business Machines Corporation Thread context restoration in a multithreading computer system
US9454372B2 (en) 2014-03-27 2016-09-27 International Business Machines Corporation Thread context restoration in a multithreading computer system
US9459875B2 (en) 2014-03-27 2016-10-04 International Business Machines Corporation Dynamic enablement of multithreading
US9594661B2 (en) 2014-03-27 2017-03-14 International Business Machines Corporation Method for executing a query instruction for idle time accumulation among cores in a multithreading computer system
US9594660B2 (en) 2014-03-27 2017-03-14 International Business Machines Corporation Multithreading computer system and program product for executing a query instruction for idle time accumulation among cores
US9804847B2 (en) 2014-03-27 2017-10-31 International Business Machines Corporation Thread context preservation in a multithreading computer system
US9804846B2 (en) 2014-03-27 2017-10-31 International Business Machines Corporation Thread context preservation in a multithreading computer system
US9921848B2 (en) 2014-03-27 2018-03-20 International Business Machines Corporation Address expansion and contraction in a multithreading computer system
US9921849B2 (en) 2014-03-27 2018-03-20 International Business Machines Corporation Address expansion and contraction in a multithreading computer system
US10095523B2 (en) 2014-03-27 2018-10-09 International Business Machines Corporation Hardware counters to track utilization in a multithreading computer system
US10102004B2 (en) 2014-03-27 2018-10-16 International Business Machines Corporation Hardware counters to track utilization in a multithreading computer system

Also Published As

Publication number Publication date
CN101216725A (en) 2008-07-09

Similar Documents

Publication Publication Date Title
CN101216725B (en) Dynamic power consumption control method for multithread predication by stack depth
Tang et al. Short‐term power load forecasting based on multi‐layer bidirectional recurrent neural network
Wilschut et al. Dataflow query execution in a parallel main-memory environment
CN110096349A (en) A kind of job scheduling method based on the prediction of clustered node load condition
CN103631657B (en) A kind of method for scheduling task based on MapReduce
CN102156665B (en) Differential serving method for virtual system competition resources
CN103930888B (en) Selected based on the many grain size subpopulation polymerizations updating, storing and response constrains
CN108874538B (en) Scheduling server, scheduling method and application method for scheduling quantum computer
Wang et al. Optimal parameters estimation and input subset for grey model based on chaotic particle swarm optimization algorithm
CN103823545B (en) A kind of server awakening method of cloud computing system
CN103197983B (en) Service component reliability online time sequence predicting method based on probability graph model
CN101231720A (en) Enterprise process model multi-target parameter optimizing method based on genetic algorithm
CN105843189B (en) A kind of efficient scheduling rule selection method for semiconductor production line based on simplified simulation model
CN102737126A (en) Classification rule mining method under cloud computing environment
Wei et al. A cloud manufacturing resource allocation model based on ant colony optimization algorithm
CN102445980A (en) Energy-saving control system based on back-propagation (BP) neural network
CN106779219A (en) A kind of electricity demand forecasting method and system
CN110490429A (en) Based on SSA algorithm intelligent building micro-capacitance sensor household loads fast dispatch method
CN111176784B (en) Virtual machine integration method based on extreme learning machine and ant colony system
Li et al. Task scheduling of computational grid based on particle swarm algorithm
CN112365097A (en) Method, device and equipment for processing electricity consumption data and computer readable storage medium
CN109980695B (en) Distributed energy and user behavior prediction method for power distribution and utilization system
Han et al. Multiple rules decision-based DE solution for the earliness-tardiness case of hybrid flow-shop scheduling problem
Tang et al. A network load perception based task scheduler for parallel distributed data processing systems
Utama A modified beluga whale optimization for optimizing energy-efficient no-idle permutation flow shop scheduling problem

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110427

Termination date: 20210104

CF01 Termination of patent right due to non-payment of annual fee