CN103176836A - Calculation apparatus, calculation method and recording medium of calculation program - Google Patents

Calculation apparatus, calculation method and recording medium of calculation program Download PDF

Info

Publication number
CN103176836A
CN103176836A CN2012105598898A CN201210559889A CN103176836A CN 103176836 A CN103176836 A CN 103176836A CN 2012105598898 A CN2012105598898 A CN 2012105598898A CN 201210559889 A CN201210559889 A CN 201210559889A CN 103176836 A CN103176836 A CN 103176836A
Authority
CN
China
Prior art keywords
value
processing
unit
thread
processor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012105598898A
Other languages
Chinese (zh)
Other versions
CN103176836B (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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Publication of CN103176836A publication Critical patent/CN103176836A/en
Application granted granted Critical
Publication of CN103176836B publication Critical patent/CN103176836B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3419Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/14Time supervision arrangements, e.g. real time clock
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/324Power saving characterised by the action undertaken by lowering clock frequency
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3058Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
    • G06F11/3062Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations where the monitored property is the power consumption
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/815Virtual
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/865Monitoring of software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/88Monitoring involving counting
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Power Sources (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a calculation apparatus, a calculation method and a recording medium of a calculation program. The calculation method includes calculating, by a processor, a difference between a first value and a second value, the first value being read from a clock counter that counts pulses of a clock signal having a plurality of types of frequencies, supplied to the processor in response to control command to start processing for an unit to be allocated to the processor, the second value being read from the clock counter in response to control command to stop processing.

Description

The recording medium of computing equipment, computing method and calculation procedure
The cross reference of related application
The application based on and require the right of priority of No. the 2011-280551st, the formerly Japanese patent application submitted on Dec 21st, 2011, the full content of this application is incorporated this paper by reference into.
Technical field
Embodiment discussed herein relates to computed measuring technique.
Background technology
The processing of a plurality of virtual machines can be carried out on a physical machine.Exist the utilization rate of a kind of CPU (central processing unit) based on virtual machine (CPU) to estimate that virtual machine carries out the technology of the power consumption when processing on physical machine.
The utilization rate of each CPU was calculated based on the time of the shared CPU of the processing of program.By comparison, exist the characteristics such as processing load of a kind of basis such as CPU to revise the technology of the frequency of operation (clock frequency) for synchronizing circuit.In order to reduce power that CPU consumes and the heat of radiation, control when revising the frequency of operation of CPU when carrying out, the practical operation quantity in the CPU time per unit is before the modification frequency and be different afterwards.Because consumed power when CPU works, if the operation amount that the frequency of operation of CPU changes and the CPU time per unit is interior changes, the power consumption of described CPU also changes.Come the method for the prior art of estimating power consumption not consider the variation of the power consumption that the variation due to frequency of operation brings according to the holding time of CPU.Therefore, for the program that will carry out, if the occupied time quantum of CPU is before frequency of operation is changed and be identical afterwards, although the practical operation quantity of CPU has changed, before changing and power consumption afterwards be estimated as mistakenly identical.
Summary of the invention
According to an aspect of the present invention, a kind of computing method comprise: by the difference between processor calculating the first value and the second value, described the first value reads from the clock counter that the pulse of clock signal is counted, the frequency of described clock signal changes and the control that starts in response to the processing to the processing unit that will be assigned to processor and be provided for processor, and described the second value reads from clock counter in response to the control that stops processing.
Objects and advantages of the present invention will realize and obtain by means of the assembly of specifically noting in claim or combination.
The cardinal principle description and the ensuing detailed description that are appreciated that the front are all exemplary and explanat, and invention required for protection are not formed restriction.
Description of drawings
Fig. 1 shows the example of the functional configuration of computing machine.
Fig. 2 shows the example of the software configuration of computing machine.
Fig. 3 shows the example of the hardware configuration of computing machine.
Fig. 4 shows according to Thread control and carries out the principle of work that data read.
Fig. 5 shows the example of the data structure of thread context.
Fig. 6 shows according to Thread control and carries out the principle of work that data read.
Fig. 7 shows by carrying out control module 111 and carries out the process flow diagram of controlling.
Fig. 8 shows the processing flow chart that stops and stopping for thread.
Fig. 9 shows the processing flow chart that activates and generate for thread.
Figure 10 A shows the relation between process and thread.
Figure 10 B shows the relation between process and thread.
Figure 10 C shows the relation between process and thread.
Figure 11 shows the relation between procedure ﹠ process.
Figure 12 shows the operation amount of each program.
Figure 13 shows the process flow diagram of the operation amount that calculates each program.
Figure 14 shows the process flow diagram of the operation amount that calculates each program.
Figure 15 shows the example of the screen message of display measurement result.
Figure 16 shows the example of the software configuration of computing machine 1.
Figure 17 shows the process flow diagram of the operation amount that calculates each virtual machine.
Figure 18 shows the relation between virtual machine and program.
Figure 19 shows the operation amount of each virtual machine.
Figure 20 shows the example of the screen message of display measurement result.
Figure 21 shows the example of the software configuration of computing machine.
Figure 22 shows the relation between virtual machine and program.
Figure 23 shows the example of the operation amount of each virtual machine.
Figure 24 shows the example of system configuration.
Figure 25 shows the example of the software configuration of computing machine.
Figure 26 shows the example of the sequential of switch unit.
Figure 27 A shows the relation between process and thread.
Figure 27 B shows the relation between process and thread.
Figure 27 C shows the relation between process and thread.
Figure 28 shows the relation between program and process.
Figure 29 shows the example of the operation amount of each program.
Embodiment
The power consumption of processor changes according to the frequency that offers the clock signal of processor.Because processor according to clock signal in one-period to the circuit in processor charging and discharge once, can cause the number of times of the charging and discharging carried out in time per unit to change so change the frequency of described clock signal.For example, when switching between the clock signal source is generating a plurality of oscillators of clock signal of different frequency, or the frequency of the clock signal that is generated by oscillator is when drifting about in time, and the frequency of clock signal all changes.
For example for interval t sometime, when processor worked in frequency f 1, the number of times of processor charging and discharging was f1t, and when described processor worked in frequency f 2, the number of times of processor charging and discharging was f2t.There is a kind of method that consumes based on the working time estimating power of processor.When time-based comes the operation amount of estimation processor, measure if carry out within exceeding the section sometime of the represented t of expression formula (1), will cause the error of one or many charging and discharging.In other words, when the operation amount of measurement processor in section t sometime, if clock frequency changes with (f1-f2) shown in expression formula (1) or larger value, can cause being equivalent to the error of one or more clock period.Therefore, when frequency changes with (f1-f2) shown in expression formula (1) or larger value, may need to consider the frequency jitter of clock signal on time period t to be measured.
t≤|1/(f1-f2)|……(1)
Embodiments of the invention are hereinafter described with reference to the accompanying drawings.At first, based on the configuration of Fig. 1 to 3 description according to the computing machine 1 of the first embodiment.
Fig. 1 shows an example of the functional configuration of computing machine 1.This computing machine 1 comprises processing unit 11 and storage unit 12.Processing unit 11 comprises performance element 110, carries out control module 111, clock counter 112, reading processing unit 113, computing unit 114 and storage control unit 115.
Fig. 2 shows an example of the software configuration of computing machine 1.In the example of software configuration shown in Figure 2, the polytype application program of operation, comprise application program 23a, application program 23b and application program 23c on computing machine 1.On computing machine 1, the application program of operation is not limited to application program 23a-23c.For example, the application program except application program 23a to 23c also can be moved on computing machine 1.In addition, on computing machine 1 also operation be useful on and carry out control and management so that the operating system (OS) of the processing of hardware (hardware, HW) 21 executive utility 23a-23c.Hardware 21 is hereinafter to utilize the described hardware 21 of Fig. 3.
Fig. 3 shows an example of the hardware configuration of computing machine 1.Computing machine 1 comprises processor 301, random-access memory (ram) 302, ROM (read-only memory) (ROM) 303, drive unit 304, recording medium 305, communication interface (I/F) 306, input interface (I/F) 307 and output interface (I/F) 308.Processor 301 operates by changing frequency of operation, and described frequency of operation is used to carry out synchronously to the circuit relevant with the operation of processor 301.Processor 301, RAM302, ROM303, drive unit 304, communication interface 306, input interface 307 and output interface 308 are coupled to bus 309.Described communication interface 306 is coupled to network 310.Described input interface 307 is coupled to input media 311.Described output interface 308 is coupled to output unit 312.
To the configuration of each element in the computing machine 1 shown in Fig. 1-3 be described.
The function of processing unit 11 realizes by processing based on execution such as OS22a, application program 23a to 23c such as processor 301.The function of storage unit 12 by such as under the control of processor 301 from reading informations such as RAM302 or recording mediums 305 or information is write RAM302 or recording medium 305 etc. realize.
Be described subsequently carrying out control module 111() control under, the processing of performance element 110 executive utility 23a to 23c.The function of performance element 110 loads from recording medium 305 by processor for example 301 and reads the application program 23a to 23c of RAM302 and order that pack processing is contained in the program that loads realizes.
The processing of the application program 23a-23c that described execution control module 111 scheduling execution units 110 are performed.When the processing of each application program is carried out in the mode of multitasking, carry out control module 111 and carry out control, think processor 301 distribution process, described process is the processing unit of application program.When distribution process is by deciding based on being included in the determined treatment state of algorithm of carrying out the process scheduler in control module 111.Similarly, when the processing of each application program was carried out in the mode of multithreading, described execution control module 111 was carried out and is controlled, and thought that processor 301 distributes thread, and described thread is the processing unit of application program.When distribute thread by deciding based on being included in the determined treatment state of algorithm of carrying out the thread scheduler in control module 111.The function of described execution processing unit 111 operates to realize based on the OS22a that comprises process scheduler or thread scheduler by for example processor 301 and RAM302.
Described clock counter 112 is the counters that increase progressively according to the cycle, wherein is used for operating with the described cycle with the clock of synchronizeing as the circuit of the part of the performed processing of processor 301.Described clock counter 112 is comprised in processor 301.When processor 301 was multi-core processor, for each kernel provides counter, and the operation amount of each kernel was measured based on the counter that each kernel comprises.In ensuing description, except as otherwise noted, will the situation of the processor 301 with single kernel be described by way of example.Described clock counter 112 indications are sometime, until should state the performed operation amount of processor 301 in the time place.For example, clock counter 112 begins counting when hardware 21 activates.Whenever through time (that is, each pulse) of one-period of the frequency of operation that is equivalent to processor 301 time, carry out and control with the register increase that arranges in clock counter 112 1 bit for example.The register of storing the value of described clock counter 112 has size and is the zone of for example 32 bits or 64 bits.In ensuing description, the clock value that reads in response to reading order is taken as variable clk0.
According to carry out control module 111 operation dispatchings with generate, activate (causing being in executing state), control in stopping (causing being in dormant state) or termination process or thread, reading processing unit 113 is carried out and is processed to read clock value in the clock counter 112 from be included in processor 301.The function of reading processing unit 113 is carried out to control according to OS22a by processor 301 for example and is realized, reading order is added to make in the command group that scheduling controlling is performed in described OS22a.
Described reading order is the order of reading the value of the clock counter 112 that is included in processor 301.Described reading order is a kind of Performance Detection mechanism (realizing in various types of CPU) for example.
Under the control of carrying out control module 111, computing unit 114 utilizes the clock value (clk1) that is read by reading processing unit 113 to carry out arithmetical operation (referring to expression formula (2)-(4)).For example, when described reading processing unit 113 according to the generation of the process of carrying out control module 111 or thread or activate when reading clock value (clk1), described computing unit 114 is carried out arithmetical operations (referring to expression formula (2)) so that with clock value (clk1) to variable clk0 assignment.When described reading processing unit 113 according to the process of carrying out control module 111 or thread stop or when stopping reading clock value (clk1), described computing unit 114 calculates clock values (clk1) and is worth difference d(between (clk0) referring to expression formula (3)).In addition, described computing unit 114 is carried out arithmetical operation (referring to expression formula (4)), so that the difference d between clock value (clk1) and value (clk0) is integrated with a merging value S.Described merging value S is by storage control unit 115 write storage units 12 of describing subsequently or the value that reads from storage unit 12.The initial value of value (clk0) and merging value S is such as 0 equivalence.In addition, "=" that comprises in expression formula (2) to (4) means the operational symbol of assignment, rather than equal sign.
clk0=clk1……(2)
d=clk1-clk0……(3)
S=S+d……(4)
Arithmetical operation in clock value (clk1) executable expressions (2) to (4) of the function of described computing unit 114 when making processor 301 based on the process of the process of OS22a or thread or Thread control the control of termination process or thread (generate, activate, stop or) realizes.Described clock value clk0 and clock value clk1 all are stored in the register or similar device of processor 301.
Described storage control unit 115 reads according to carrying out control module 111 data that are stored in storage unit 12, and writes data in storage unit 12.For example, according to stopping or the control of termination process or thread, described storage control unit 115 reads process or the thread context that will be stopped or stop from storage unit 12.Described context is the information about process or thread, and comprises the merging value S corresponding to process or thread.The function of described storage control unit 115 by processor 301 from realizing corresponding to reading merging value S the process context of the process that will be stopped or stop or thread or thread context.
In addition, for example described storage control unit 115 is stored following information in storage unit 12: the merging value S that this information calculates computing unit 114 with to be performed that control module 111 stops or the process or the thread that stopping are associated.The function of described storage control unit 115 is worth S by processor 301 with merging and writes corresponding to realizing in the process context of the process that will be stopped or stop or thread or thread context, and described merging value S calculates by the arithmetical operation in processor 301 executable expressions (3) and (4).In addition, for example as by carrying out performed process or the activation of thread or the part of generation of processing unit 111, the value clk0 that described storage control unit 115 will be calculated by the arithmetical operation in processor 301 executable expressions (2) stores in the process context or thread context of the process that is activated or generates or thread.
In another approach, when computing unit 114 calculated difference d, storage control unit 115 all can be stored in the difference d that calculates in corresponding process context or thread context.When same process or thread moved repeatedly, difference d was repeatedly stored in identical process context or thread context.
By being included in performance element 110, execution control module 111, clock counter 112, reading processing unit 113, computing unit 114 and the performed above-mentioned processing of storage control unit 115 in processing unit 11, each process or the thread computes performed for processor 301 go out the quantity of the clock period that comprises in the processing of process or thread.
Each element of hardware shown in Fig. 3 is further described below.
RAM302 is storer readable and that can write.For example, semiconductor memories such as static RAM (SRAM) (SRAM) or dynamic ram (DRAM) is used as RAM302.Alternatively, flash memory or similar device also can be replaced RAM and be used.ROM303 can comprise programming ROM (PROM) or similar device.Drive unit 304 is to carry out from recording medium 305 reading information and at least one device in writing information in the recording medium 305.The information that recording medium 305 storages are write by drive unit 304.Described recording medium 305 is recording mediums such as hard disk, CD (CD), digital versatile disc (DVD) or Blu-ray Disc.For example, computing machine 1 has the recording medium 305 of drive unit 304 and corresponding polytype recording medium.
Input media 311 is in response to physical operations and sends the device of input signal.For example, input media 311 is key devices such as the keyboard of the main body that attaches to computing machine 1 or button, or pointing devices such as mouse or touch panel.Output unit 312 is in response to the control of computing machine 1 and the device of output information.For example, output unit 312 is such as image output devices such as displays or such as audio output devices such as loudspeakers.For example, such as input and output devices such as touch-screens, can be used as input media 311 and output unit 312.
Referring now to Fig. 4-Fig. 6, the relation that how executing data reads when multithreading is activated is described.Although what describe in Fig. 4-Fig. 6 is the situation of carrying out multithreading, the relation between data read is same or analogous with the situation of carrying out multitask.
Fig. 4 shows to relate at performance element 110, clock counter 112 and between the thread context in being stored in storage unit 12 and carries out the relation that data read.
Carry out control module 111 and activate a thread (maybe when there is no thread, generating a thread) according to thread scheduler.In by the process of carrying out the performed thread activation processing of control module 111, reading processing unit 113 is carried out the processing (arrow (1) and (2)) of reading the quantity of clock period from clock counter 112.By computing unit 114 and the performed processing of storage control unit 115, the quantity (clk1) of clock period of reading is written in thread context T1 shown in Figure 5 as the quantity (clk0) of initial clock period (is written to clk0: arrow (3)).When the activation of thread was completed, performance element 110 was carried out the processing of the thread that activates based on the information in thread context T1 shown in Figure 5 of being included in.
Fig. 5 shows the example of the data structure of thread context T1.Described thread context T1 comprises for the process information by the performed thread process of processor 301, and thread management information.Described process information is the information that specific datas such as programmable counter or stack pointer reads the position.Performance element 110 is carried out based on the process information of appointment in the information of thread context T1 and is processed.The information of thread management packets of information vinculum journey identifier (ID), temporal information (merging value St and the similar information of the time t0 that thread is activated, thread process time) and clock period quantity (the merging value S of the quantity of the initial clock period quantity clk0 of thread and the clock period that comprises in thread process).
The process context that uses in multitask is controlled for example has and the same or analogous data structure of the thread context T1 shown in Fig. 5, and comprises process ID rather than Thread Id.Described process context for example also comprises the information about the thread that moves in process.
Execution thread stops processing described execution control module 111 in response to for example switching to another thread.In thread stopped processing, storage control unit 115 was preserved process informations such as programmable counter or stack pointer in thread context T1.In thread stopped processing, reading processing unit 113 was carried out the operation (arrow (4) and (5)) of reading the quantity of clock period from clock counter 112.Computing unit 114 and storage control unit 115 calculate merging value S(based on the quantity of the clock period in activating the quantity (clk1) of the clock period of reading in processing at thread and being written to thread context T1 and obtain clk0: arrow (6)), and described merging value S is write thread context T1(arrow (7)).
By above-mentioned processing, computing machine 1 can be recorded to the quantity that reads the clock period of a little counting of arrow (4) and (5) locating that reads a little from arrow (1) and (2) in thread context T1.
Fig. 6 shows how to carry out the relation that data read when having a plurality of thread.The period that is represented as " thread a " in Fig. 6 is illustrated in the period that comprises in the processing that thread activation, thread process and the thread of " thread a " stop.
The processing that writes that is used for activating and stopping " thread a " of being carried out by storage control unit 115 is based on the quantity of the clock period of locating to read in arrow (1) and (2), in the upper execution of thread context (a).Thread context (a) is the thread context of " thread a ".The processing that writes that is used for activating and stopping " thread b " of being carried out by storage control unit 115 is based on the quantity of the clock period of locating to read in arrow (3) and (4), in the upper execution of thread context (b).Thread context (b) is the thread context of " thread b ".In addition, when again carrying out the processing of " thread a " after the processing of " thread b ", the processing that writes that is used for activating and stopping " thread a " by storage control unit 115 execution, based on the quantity of the clock period of reading in arrow (5) and (6), in the upper execution of thread context (a).The quantity of the clock period that comprises in the processing of each thread is counted by above-mentioned storage control unit 115, thereby update package is contained in the merging value S in each thread context.
In the first embodiment, the frequency of operation of processor 301 can change.For example, if the frequency of operation of processor 301 changed in the indicated time of arrow X, the frequency of operation of processor 301 is being different between time of arrow (1) and (2) indication and the time of being indicated by arrow (5) and (6) so.That is to say, suppose that operation is the instruction of carrying out within a clock period, the operation amount in time per unit is different so.Therefore, by the method for shared time of measurement processor 301 in the use prior art, estimation based on the processor load of the time between the time between arrow (1) and (2) and arrow (5) and (6), to be inconsistent, reason be that the practical operation number in the unit interval is different.Yet in the first embodiment, even when frequency of operation changes, can measure before or after fluctuation between arrow (1) and (2) and the practical operation quantity of the processor 301 between arrow (5) and (6).
Fig. 7 shows to be carried out by processing unit 11 and controls the process flow diagram of counting with the quantity of clock period of being comprised in the processing to each thread.Described control is for example by processor 301 control performed according to OS22a.When the quantity of the clock period that comprises in to each process is counted, carry out with Fig. 7 in the same or similar flow process of flow process.Yet in this case, described being controlled in process rather than in thread carried out.
At first, carry out control module 111 and determine whether the Thread control event (S11) occurs.(be "Yes" in step S11) when determining that by execution control module 111 the Thread control event has occured, carry out control module 111 and begin to process to stop or terminate thread (S12).Processing in S12 is described further below.When the processing in S12 finishes, carry out control module 111 and begin to process to generate or activate a thread (S13).Processing in S13 is also described later.According to the state of a process of distributing to processor 301, such as when the finishing dealing with of the thread of carrying out or when the interruption of another thread occured, the multithread scheduling device that comprises in OS22a was carried out the judgement of whether having initiated the Thread control event.
Fig. 8 shows above-mentioned stopping or the example of the processing (S12) of terminate thread.At first, carry out control module 111 and judge whether institute's event is be used to stopping thread (S21).When institute's event is not (to be "No" at S21) when stopping thread, carry out control module 111 and judge whether institute's event is for terminate thread (S29).By the multithread scheduling device that is included in OS22a, according to such as interrupting whether having occured or whether thread process has finished etc. that situation is determined the generation of event and according to the performed processing of this event generation.
(be "Yes" in S21) when the event that stops thread occuring, carry out the reading order (S22) that control module 111 stops thread that being processed by controller 301.After the processing of S22, carry out control module 111 and obtain and read the process information of corresponding thread with ceasing and desisting order.For example, the programmable counter in execution control module 111 reading processors 301 and the value of stack pointer.In addition, carry out control module 111 control store control modules 115 and be stored in thread context corresponding to the thread that is being stopped with the process information that will be read, described thread context is stored in (S23) in storage unit 12.
When the processing in S23 is performed, in S27, by reading processing unit 113, computing unit 114 and the performed processing of storage control unit 115, carry out the processing of the quantity of the clock period in the thread that renewal is being stopped at S24.At first, reading processing unit 113 reads clock value (clk1) (S24) from clock counter 112, and storage control unit 115 reads initial clock value (clk0) and merging value S(S25 from the thread context of the thread that is being stopped).Processing in S25 can be carried out before S24.
The clock value (clk1) that computing unit 114 uses are read in S24 and S25, initial clock value (clk0) and merging value S come the arithmetical operation in executable expressions (3) and (4), and upgrade merging value S(S26).Merging value S after storage control unit 115 will upgrade is stored in the thread context of the thread that is being stopped in storage unit 12 (S27).When the processing in S27 was performed, the processing in S12 finished (S28).
Result of determination in S29 shows that (being "Yes" at S29) occurs the event for terminate thread, in S33, carry out the processing of the quantity of the clock period in the thread that renewal is being terminated at S30 by reading processing unit 113, computing unit 114 and the performed processing of storage control unit 115.Processing in S30 to S33 and S24 are same or similar to the processing in S27, therefore omit its description.
After the processing of S33, storage control unit 115 will be included in another storage area that Thread Id in the thread context of the thread that is being terminated and merging value S be stored in storage unit 12 (S34).Therefore, even when the storage area that is used for thread context is released, the data of the operation amount of the described terminate thread of expression still can keep.When the processing in S34 finished, the processing in S12 finished (S28).
Be not (to be "No" at S29) during for terminate thread when the result of determination in S29 shows event, the processing in S12 finishes (S28).For example, when thread begins immediately, because do not having thread processed before, judge in S29 that this event is not the event for terminate thread after computing machine 1 is activated.
Fig. 9 shows above-mentioned generation or activates the processing example of the processing (S13) of thread.At first, carry out control module 111 and judge whether event is in order to activate thread (S41).When institute's event is not when activating thread (being "No" at S41), carry out control module 111 and judge whether event is for generating thread (S47).By the multithread scheduling device that is included in OS22a, according to such as interrupting whether having occured or whether thread process has finished etc. that situation is determined the generation of event and according to the performed processing of this event generation.
When event is when activating thread (being "Yes" at S41), carry out control module 111 and read clock value (clk1) (S42) from clock counter 112.After reading clock value (clk1) by the processing in S42, as shown in expression formula (2), computing unit 114 uses clock value (clk1) to variable clk0 assignment.Storage control unit 115 will use the variable clk0 of clock value (clk1) institute assignment to be stored in thread context corresponding to the thread that will be activated (S43).
In addition, storage control unit 115 reads process information (S44) the thread context of the thread that will be activated from storage unit 12.Described process information is the information for the processing of the thread that will be activated, and this process information comprises, for example the value of programmable counter and stack pointer.Processing in S44 can be carried out before or after the processing of S42 or S43.When the processing in S44 is performed, carries out control module 111 and make performance element 110 begin to process (S45) based on the process information that reads in S44.After processing in S45 was performed, the processing in S13 finished (S46).
Be when generating thread (be "Yes" at S47) when the result of judging in S47 represents event, carry out control module 111 generation thread context (S48).In processing in S48, based on the instruction from execution control module 111, storage control unit 115 is determined to be used for storing the storage area of described thread context in storage unit 12, and the Thread Id of the thread that will be generated is stored in described storage area.
Reading processing unit 113 reads clock value (clk1) (S49) from clock counter 112.Processing in S49 can be carried out before the processing in S48.When reading clock value (clk1) by the processing of S49, as shown in expression formula (2), computing unit 114 uses clock value (clk1) to variable clk0 assignment.Storage control unit 115 will use the variable clk0 of clock value (clk1) institute assignment to be stored in the thread context of the thread that will be generated (S50).When the processing in S50 is performed, carries out control part 111 and make performance element 110 begin to process (S51).When the processing in S51 was performed, the processing in S13 finished (S46).When the processing in S13 finishes, carry out the processing that control module 111 is carried out in S11, and the generation of detection line process control event.
When processing more than computing machine 1 is carried out, for each thread and the process of operation on computing machine 1, the quantity of the clock period that counting comprises in the processing of being carried out by processor 301.Due to the operation consumed power of processor 301, be significant during cost (such as the power consumption of processor 301) that the measurement of the practical operation quantity of being carried out by processor 301 comprises in the operation of estimation processor 301.For example, according to the method for the power consumption of holding time estimation processor 301, before frequency of operation changes and afterwards, be inconsistent for the estimated result of power consumption in prior art.By comparison, in above-mentioned processing, because obtained the practical operation quantity of processor 301, even when therefore the frequency of operation of processor 301 changes, still can come according to the frequency of operation after changing the quantity of estimating power consumption.In the first embodiment, because the quantity of the clock period that will comprise in processing for each process or thread computes, therefore the significant operation amount of estimation tool for the power consumption in each process or thread is detectable.In addition, except power consumption, computing machine 1 can also for example estimate according to the operation amount of processor 301, the amount of the carbon dioxide that the power consumption that is produced by processor 301 generates or the heat of processor 301 radiation, the cost that comprises as the operation of processor 301.
The power that for example consumes by per clock period of computation processor 301 in advance, and the power that the quantity of clock period of counting in the first embodiment and precalculated per clock period consume is multiplied each other, the estimated value of coming rated output to consume.Similarly, for example, the quantity by clock period of will count in the amount of the precalculated carbon dioxide that discharges corresponding to a clock period of processor 301 and the first embodiment multiplies each other, and comes the estimated value of Calculation of Carbon Dioxide amount.In addition, for example when calculating the amount of carbon dioxide discharge, treat with the first embodiment in the size of the value that multiplies each other of the quantity of clock period of counting can change according to the generating type of the electric power that is provided for processor 301.For example, can use the value of two types: a kind of use mineral fuel generating, a kind of use renewable energy power generation.Similarly, the heat that is generated by processor 301 can obtain by following arithmetical operation, multiplies each other as the value of heat that per clock period of precalculated expression processor 301 is sent and the quantity of clock period.
Except the charging and discharging through the circuit in processor 301, processor 301 is the consumed power due to current leakage also.Therefore, for example, when rated output consumes, the power consumption addition that the power consumption that performance element 110 will cause due to current leakage and the quantity based on the clock period obtain, and output total value.The following calculating of power consumption that is caused by current leakage.For example, measure by the same or analogous processing of mode of calculating the quantity of clock period with processing unit 11 and process the time that each process or thread comprise.Performance element 110 with measured time and per unit internal cause current leakage and the power consumption that causes multiply each other.At this moment, when reading clock periodicity from clock counter 112, be included in reading processing unit 113 in processing unit 11 from timer acquisition time information.In addition, carry out the same or analogous processing of counting mode of control module 111 and storage control unit 115 execution and the quantity of clock period, and be stored in process context or thread context the cumulative time of using in processing.
The below will describe second embodiment.Used in a second embodiment the computing machine 1 in the first embodiment.In a second embodiment, the application program 23c execution that operates on computing machine 1 makes the operation amount visual processing of processor 301 when the processing of executive utility 23a and 23b.Performance element 110 is carried out visualization processing for example as described below based on application program 23c.
Figure 10 A to 10C shows below the table T2a to T2c(of the relation between expression process and thread also can be referred to as " table T2 ").Table T2a shown in Figure 10 A represents, process ID comprises that for the process of " A-1 " Thread Id is the thread of " a ".Table T2b shown in Figure 10 B represents, process ID is that the thread of " b " and Thread Id are the thread of " c " for the process of " B-1 " comprises Thread Id.Table T2c shown in Figure 10 C represents, process ID comprises that for the process of " A-2 " Thread Id is the thread of " d ".As shown in Figure 10 B, may generate two or more threads in a process.The table of the relation between expression process and thread is not limited to those shown in Figure 10 A to 10C.Can generate with computing machine 1 on the table corresponding to each process of operation.
Figure 11 shows the table T3 of the relation between representation program and process.Table T3 comprises and computing machine 1 being carried out or information that program that computing machine 1 is carried out in the past is associated with process, and wherein said process is the processing unit of each program.Table T2 and T3 are stored in storage unit 12.In Figure 11, program ID " A " is associated with process ID " A-1 " and " A-2 ", and program ID " B " is associated with process ID " B-1 " and " B-2 ", and program ID " C " is associated with process ID " C-1 ".As an example, the program ID of application program 23a is " A ", and the program ID of application program 23b is " B ", and the program ID of application program 23c is " C ".
The information that performance element 110 extractions are relevant with program, process and thread in operating in computing machine 1, and the table T2 of the relation between renewal expression process and thread, and the table T3 of the relation between representation program and process.Describedly be updated according to the time of the operation of carrying out on computing machine or periodically carry out in the given time.When arrived update time, performance element 110 came updating form T2 by obtaining the Thread Id in the process context that is stored in each process and the Thread Id that obtains being stored in a table corresponding to each process of showing T2.When arrive update time, performance element 110 comes updating form T3 by obtaining the process ID that is stored in management of process table (not shown) and the process ID that is relevant to each program that obtains being stored in table T3, carries out the control module 111 described management of process tables of use and comes executive process to control.
In addition, gather merging value S each thread that performance element 110 is carried out from computing machine 1 or the thread context of process or process context, and calculate the operation amount of each program of operation on computing machine 1 based on the merging value S that gathers and table T2 and T3.When being stored in each process context or thread context as difference d replacement merging value S, calculating the summation of the difference d that stores in each process context or thread context, and this summation is considered as the merging value S of preset sequence.Example table T4 as shown in figure 12 manages the operation amount of each program.In table T4, the program ID of each program is relevant to the procedure operation quantity T of program.
Figure 13 shows the process flow diagram of the procedure operation quantity T that calculates each program.Described processing is carried out by performance element 110 according to application program 23c.The same with the renewal of table T2 and T3, time of the calculating of the operation amount T of program performed operation on according to computing machine 1 or periodically carry out in the given time.In the processing of S61, judge whether the described time arrives.(be "Yes" in S61) when the time of determining calculation procedure operation amount T has arrived, performance element 110 is selected non-selected program ID(S62 from the represented program ID of table T3).Carry out the variables D (S63) that control module 111 empties the operation amount of selected representation program ID in S62.Processing in S63 can be performed before the processing in S62.
Next, performance element 110 to S62 in from table T3 selection unselected process ID (S64) in the relevant process ID of selected program ID.After processing in S64, performance element 110 is selected non-selected Thread Id (S65) in the Thread Id relevant to selected process ID in S64.
Performance element 110 reads merging value S(S66 from the thread context corresponding to selected Thread Id S65).After processing in S66, performance element 110 is updated to the merging value S that reads in S66 and the summation (S67) of variables D with the value of variables D.That is, performance element 110 is carried out arithmetical operation D=D+S, and wherein "=" means the operational character of assignment.At this moment, performance element 110 will be included in thread context merging value S zero clearing (S=0) (S68).
After processing in S68, performance element 110 judge with S64 in whether have non-selected Thread Id from the Thread Id that the selected process ID of table T2 is associated.(be "Yes" in S69) when the result of determination in S69 shows when having non-selected Thread Id, performance element 110 is carried out the processing in S65 again.(be not "No" in S69) when the result of determination in S69 shows when there is no non-selected Thread Id, performance element 110 judge with S62 in whether have non-selected process ID (S70) from the process ID that the selected program ID of table T3 is associated.(be "Yes" in S70) when the result of determination in S70 shows when having non-selected process ID, performance element 110 is carried out the processing in S64 again.
(be not "No" in S70) when the result of determination in S70 shows when having non-selected process ID, performance element 110 upgrade with show T4 in the procedure operation quantity T(S71 that is associated of selected program ID).That is, performance element 110 is carried out arithmetical operation T=T+D, and wherein "=" means the operational character of assignment.After the processing of S71, performance element 110 determines whether there is non-selected program ID(S72 in the represented program ID of table T3).(be "Yes" in S72) when the judged result in S72 shows when having non-selected program ID, performance element 110 is carried out the processing in S62 again.
(be not "No" in S72) when the result of determination in S72 shows when having non-selected program ID, performance element 110 judges whether to exist the request (S73) of carrying out Graphics Processing.For example, when the user inputs the demonstration request, maybe when receiving the demonstration request from another equipment, be judged to be the request that has the execution Graphics Processing.(be "No" in S73) when not having the request of carrying out Graphics Processing, performance element 110 terminations (S75).
(be "Yes" in S73) when the result of determination in S73 shows the request that has the execution Graphics Processing, for example, generate screen message 41(S74 as shown in figure 15).When the demonstration request that receives from the user, performance element 110 is presented at the screen message 41 that generates on output unit 312.When the demonstration request that receives from another equipment, performance element 110 sends to screen message 41 equipment that shows request that sends.Screen message 41 shown in Figure 15 comprises quantity, power consumption, the heat of release and the information of carbon dioxide-depleted amount of the clock period that represents each program.As described in the first embodiment, the amount of the power consumption of each program and the carbon dioxide of release can be passed through, and the amount of carbon dioxide and the procedure operation quantity T that for example respectively the power consumption of per clock period and per clock period are discharged multiply each other to calculate.
The 3rd embodiment is described below.In the 3rd embodiment, used the hardware of the computing machine 1 in the first embodiment.The 3rd embodiment is different from the first and second embodiment in the software configuration.
Figure 16 shows the example according to the software configuration of the computing machine 1 of the 3rd embodiment.Moving a plurality of virtual machine 26a-26c on computing machine 1.The hardware 21 that is used for the processing of each virtual machine of execution 26a-26c is controlled by supervisory routine 22b.
In addition, in the 3rd embodiment, computing machine 1 comprises performance element 110, carries out control module 111, clock counter 112, reading processing unit 113, computing unit 114 and storage control unit 115.By the processing based on the supervisory routine 122b in the 3rd embodiment, processor 301 is realized the function of execution control module 111, reading processing unit 113, computing unit 114 and storage control unit 115 in the first embodiment.In the 3rd embodiment, the operation amount for the processor 301 of each process or thread calculates under the management of supervisory routine 22b, and process wherein or thread are that each virtual machine 26a is to the processing unit of the processing of 26c.
In the 3rd embodiment, virtual machine 26c is the virtual machine for bookkeeping quantity.The processing of being carried out by performance element 110 based on virtual machine 26c is described with reference to Fig. 7 below.
At first, performance element 110 is carried out the processing of the operation amount of measuring each application program, as the processing (S81) of S61 to S72 in the second embodiment.Next, performance element 110 is selected non-selected virtual machine identification information (S82) from the virtual machine identification information (virtual machineidentification information, VMID) that comprises at Virtual Machine Manager table T5 shown in Figure 180.As example, the VMID of virtual machine 26a is " X " at this, and the VMID of virtual machine 26b is " Y ", and the VMID of virtual machine 26c is " Z ".When the processing in S82 is performed, represent that the variable U of the operation amount of each virtual machine is cleared (S83).In addition, performance element 110 with S82 in select non-selected program (S84) from the program that the selected VMID of Virtual Machine Manager table T5 is associated.Performance element 110 reads the procedure operation quantity T of selected program in S84 T5 from table, and based on the procedure operation quantity U that reads new variables U(S85 more).For example, performance element 110 is by coming more new variables U with the summation assignment of variable U and procedure operation quantity T to variable U.
When the processing in S85 is performed, performance element 110 judge with S82 in whether have non-selected program (S86) from the program that the selected VMID of Virtual Machine Manager table T5 shown in Figure 180 is associated.When the result of determination in S86 shows (being "Yes" at S86) when having non-selected program, performance element 110 is carried out the processing in S84 again.
(be not "No" in S86) when the result of determination in S86 shows when having non-selected program, performance element 110 is associated the VMID that selects in the value of variable U and S82, and U and the VMID that is associated is stored in table T6 shown in Figure 19 (S87).After the processing of S87, performance element 110 judges in the VMID that is included in table T5 whether have non-selected VMID(S88).(be "Yes" in S88) when the result of determination in S88 shows when having non-selected VMID, performance element 110 is carried out the processing in S82 again.
(be not "No" in S88) when the result of determination in S88 shows when having non-selected VMID, performance element 110 is carried out as S73 and the processing in S74 (S89) of the second embodiment.For example, performance element 110 generates screen message in response to request, and carries out the processing that sends the screen message that the screen message that generates or demonstration generate.
Figure 20 shows the example of the screen message in the 3rd embodiment.Screen message 42 is the information of the operation amount of virtual machine 26a of indicating for the user who uses virtual machine 26a.As shown in figure 20, in order for example to generate the screen message that the user who comprises each month uses state when finishing per month, performance element 110 will be shown T6 and copy another storage area to, and the information of the relevant virtual machine that comprises in removing table T6 (virtual machine, VM) operation amount.In addition, when generating screen message, performance element 110 is stored in the VM operation amount in table T6 for the VMID that will be shown reads, and the VM operation amount that is stored in the month in past of other storage areas.Be similar to the second embodiment, performance element 110 multiplies each other VM operation amount and the carbon dioxide releasing amount of the power consumption of per clock period and per clock period that reads respectively, thereby calculates respectively power consumption and the carbon dioxide releasing amount of each month.The same with power consumption, the expense of collecting is per month determined according to given contract (value that for example expense and the quantity of clock period of per clock period is multiplied each other and obtains).
The 4th embodiment is described below.In the 4th embodiment, as in the 3rd embodiment, each virtual machine all runs in computing machine 1.In addition, the virtual machine with driver functions of control hardware 21 also runs on computing machine 1, and described driver is carried out the processing of each virtual machine of operation on computing machine 1.By contrast, in the 3rd embodiment, for example supervisory routine 22b has driver functions.As in the 3rd embodiment, virtual machine 26c is the virtual machine of bookkeeping quantity for example.
Figure 21 shows the example of the software configuration of the computing machine 1 in the 4th embodiment.Except the software configuration of the 3rd embodiment shown in Figure 16, also operation has driver VM27a and driver VM27b.Carrying out the hardware of the processing of VM26a controls based on driver VM27a.In addition, carrying out the input of VM26b and the hardware of output controls based on driver VM27b.
Table T7 shown in Figure 22 has represented the Virtual Machine Manager table in the 4th embodiment.Virtual Machine Manager table T7 is the table of the following data of storage: for each virtual machine, the ID that these data will run on the virtual machine (comprising driver VM) on computing machine 1 is associated with the ID of program on running on virtual machine.In Virtual Machine Manager table T7, the ID of driver VM27 is " XX ", and the ID of driver VM27b is " YY ".In Virtual Machine Manager table T7, also shown the relation between VM.For example, Virtual Machine Manager table T7 comprises the VMID " X " that is associated with VMID " XX ", as the information of expression relation.Described information represents that VMID is that the virtual machine of " XX " is the virtual machine of the processing of the virtual machine of " X " for carrying out VMID.
In the 4th embodiment, performance element 110 is carried out the process flow diagram shown in Figure 17 based on virtual machine 26c.Be different from the 3rd embodiment, in S82, driver virtual machine 27a, 27b and 27c are also selected.Carry out the flow process of S82 to S88 by performance element 110, the operation amount that runs on each virtual machine on computing machine 1 is calculated.Figure 23 illustrates the operation amount of each virtual machine.In addition, in the flow process of S89 shown in Figure 17, performance element 110 is carried out above-mentioned Graphics Processing.In the 4th embodiment, for the virtual machine that is relative to each other in Virtual Machine Manager table T7, performance element 110 calculates the summation of the operation amount of associated virtual machine, and shows the described summation that calculates.
In the 4th embodiment, by carrying out above processing, except by processor 301 for wanting the measured performed arithmetic processing of program, the operation amount of the hardware controls of being carried out by processor 301 is also measurable.In addition, for when rated output consumes as the coefficient of multiplicand, the coefficient that for example will be multiply by by the operation amount of each virtual machine 26a to 26c be from will be by the different value of the coefficient that the operation amount of each driver VM27a and 27b multiply by.For example, for driver VM27a and 27b, the coefficient of the power consumption of considering the hardware of being controlled by each driver VM27a and 27b can also be set.
Hereinafter the 5th embodiment will be described.The 5th embodiment is the embodiment of the system that comprises the computing machine 1 in the first embodiment for example shown in Figure 24.
System as shown in figure 24 comprises computing machine 1, computing machine 2, trunking 3, trunking 4 and network 5.The configuration of the computing machine 1 in the hardware configuration of computing machine 1 and functional configuration and the first embodiment to the four embodiment is same or analogous.Computing machine 2 be for example with the same or analogous computing machine of the hardware configuration of computing machine 1.Trunking 3 is the communication between computing machine 1 and network 5 to be carried out the equipment of relaying.Trunking 4 is the communication between computing machine 2 and network 5 to be carried out the equipment of relaying.For example, computing machine 2 is to provide the computing machine of service by running on virtual machine on computing machine 1.The computing machine of the service that alternatively, is provided for is not limited to the computing machine 2 shown in Figure 24.For example, service can be provided for a plurality of computing machine (not shown).
In the 5th embodiment, be the operation amount of each purpose machine measurement processor 301 of the service of being provided for.Measurement for each purpose machine of the service of being provided for means the operation amount that measurement processor 301 is performed.The situation of various processing that request is provided for the access originator of service is carried out described measurement.For example, above-mentioned measurement mean to take the user of the checking of having served by reception as unit (take account number that can be by user ID or similar information sign as unit) or take Internet protocol (IP) address in services request source etc. as the performed processing of unit, the operation amount of metering computer 1.
Figure 25 shows the example of the software configuration of computing machine 1.As in the 3rd embodiment, supervisory routine 22b and virtual machine 26a to 26c run on computing machine 1.In the 5th embodiment, virtual machine 26a comprises OS28a, application program 29a and application program 29b.Virtual machine 26b comprises OS28b, application program 29c and application program 29d. Virtual machine 26a and 26b neither are limited to software configuration shown in Figure 25, and other application programs also can be moved on computing machine 1.
In the 5th embodiment, service is offered another computing machine based on application program 29a.Come supervisory packet to be contained in the operation amount of each application program in virtual machine 26a based on application program 29b.As the OS22a in the first embodiment, OS28a carries out the software of hardware controls according to operation each application program thereon.OS28a can be counted the operation amount of operation each application software thereon.Different from the first embodiment, in the 5th embodiment, OS28a is performed is controlled to be control performed on supervisory routine 22b, supervisory routine 22b simulation hardware 21.Hardware 21 is carried out according to the control of supervisory routine 22b and is processed.
Figure 26 is the sequential chart that be shown the switching time of the unit of wanting measured.That is, be the switching time shown in Figure 26, the switching of the switching of the switching of the unit that for example will be processed by application program 29a, the unit that will be processed by OS28a or the VM that will be processed by supervisory routine 22b.The unit that will be processed by application program 29 be can serviced (26a provides by application program) unit (wanting processed unit, as user (account) or address) of identification.In Figure 26, the unit is identified by the identification information that is called as " CLID ".Identification information " CLID " is, for example user ID or the address of processing request source.
Want processed VM to be switched by supervisory routine 22b.In the period that the processing of VM26a is performed, supervisory routine 22b carries out the processing for the treatment of the application program processed by OS28a.
Want processed application to be switched by OS28a.The switching of wanting processed application is carried out by the switching of process or thread as described in the first embodiment basically.Under the control of OS28a, read the value of clock counter according to the switching of process or thread (comprise stop, termination, activation and generation process or thread).The value of the clock counter that read this moment is the value by the clock counter of supervisory routine 22b emulation, and this value can obtain by the quantity of counting in the clock period that the processing that is used for VM26a comprises.
Want processed unit to be switched by application program 29a.In Figure 26, identification information CLID is that the unit of C1 is switched to the unit that identification information CLID is C2 (X1).By described switching (X1), application program 29a notifies described switching to OS28a.The notice of switching comprises the identification information CLID of the unit that switches purpose machine place.According to the switching notice from application program 29a, OS28a carries out the memory location that Counter Value was processed and changed to clock count.Clock count process according to carry out (referring to Fig. 7-9) according to the similar mode of counting of the switching of using.The memory location that changes Counter Value is to the thread context of the merging value S of the quantity in store clock cycle or the processing that process context switches.In the 5th embodiment, thread context and process context are provided for wants processed unit, and it will be described below.
Figure 27 A-27C and Figure 28 show the example that is used for the admin table of supervisory routine, process and thread in the 5th embodiment.In the 5th embodiment, be each processed Object Management group for example program, process and thread.That is to say, each is wanted the ID addition of the program, process and the thread that comprise in the identification information CLID of processed object and the table shown in Fig. 5,11 and 12, and manage described identification information CLID and described ID.
Figure 27 A to 27C shows the relation between process and thread.In the 5th embodiment, the identification information CLID that OS28a will provide in notice is increased to process ID and Thread Id in both.Figure 28 shows the relation between procedure ﹠ process.In the 5th embodiment, the identification information CLID that OS28a will provide in notice is increased in program ID and process ID.
When OS28a changes the memory location, if for being located in and not existing the unit of wanting processed switching purpose, generate management information based on the identification information CLID that comprises in the notice from application program 29a as Figure 27 A to 27C and information shown in Figure 28.For example, the information that be generated comprises the information of representation program and process Relations Among and the information (as Figure 27 A to 27C and shown in Figure 28) of the relation between expression process and thread, and the thread context and the process context that are used for each CLID.
As the application program 23c in the second embodiment, described application program 29b is the application program of the operation amount of the application of management operating on OS28a for example.Table T11 shown in Figure 29 is managed by application program 29b.Figure 29 shows table 11, and this table is the table of having stored according to the operation amount of each processing unit of each program of OS28a operation.
Application program 29b based on the relation shown in Figure 27 A-27C and Figure 28 and be stored in each thread context or each process context in the value of merging value S upgrade the table T11 shown in Figure 29.The processing of the renewal of described renewal by being similar to the his-and-hers watches T4 shown in Figure 13 and 14 is carried out.Therefore, application program 29b measures the operation amount of the processor 301 that the processing that can be identified comprises in each wants processed unit.The screen message that is generated by application program 29b is by sending to as instruments such as Emails, for example suitable processing target.Described screen message is the screen message that for example represents the measurement result of operation amount, for example shown in Figure 15 or Figure 10 like that.Therefore, the user who receives the service provide becomes the operation amount of the processor 301 that comprises when the service that provides can be provided.
For example in any one of above-mentioned the first to the 5th embodiment, processor 301 can comprise a plurality of kernels.According to process or Thread control, OS is read value from the set clock counter of each kernel of the processor 301 of distribution process or thread, thereby calculates the operation amount that comprises in the performed processing of each kernel.
All examples as herein described and conditional statement all are used for the purpose of teaching, concept with the development that helps promotion the art that reader understanding the present invention and inventor proposed, and being considered to be not limited to this concrete example and condition of setting forth, the composition of these examples in same instructions does not represent Pros and Cons of the present invention.Although embodiments of the invention by detailed description, should be appreciated that without departing from the spirit and scope of the present invention, can carry out various modifications, replacement and distortion to the present invention.

Claims (10)

1. computing method comprise:
Calculate difference between the first value and the second value by processor, described the first value reads from the clock counter that is used for the pulse of clock signal is counted, described clock signal has multi-frequency and the control command that starts in response to the processing to the unit that will be assigned to described processor and offer described processor, and described the second value reads from described clock counter in response to the control command that stops processing.
2. computing method as claimed in claim 1 also comprise: calculate the value at cost that the multiplication by the difference that will calculate and the value at cost of the clock period of certain class per unit quantity of expression obtains.
3. computing method as claimed in claim 1 or 2, also comprise: store explicitly the difference that calculates in memory storage with for the identification information of identifying described unit.
4. computing method as claimed in claim 3 also comprise:
Calculate the difference between the 3rd value and the 4th value, described the 3rd value reads from described clock counter in response to the control command that starts the processing of further carrying out when further carrying out the processing of described unit, and described the 4th value reads from described clock counter in response to the control command of the processing that stops having started under controlling; And
Store explicitly the merging value with described identification information in described memory storage, described merging value obtains with the difference addition that is associated with described identification information in being stored in described memory storage by the difference that will calculate based on described the 3rd value and described the 4th value.
5. computing method as claimed in claim 4 also comprise:
Calculate the difference between the 5th value and the 6th value, described the 5th value reads from described clock counter in response to the control command of the processing that starts another unit in the time will carrying out the processing of other unit, and described the 6th value reads from described clock counter in response to the control command of the processing that stops described other unit; And
When the unit that to be programs identical with the program of described unit, described other unit, store explicitly the summation of described merging value and the difference that calculates based on described the 5th value and described the 6th value with the program identification information of the described program of sign in described memory storage.
6. computing method as claimed in claim 5 also comprise:
When the processing of the unit of at least one driver that is performed in the input control that makes described program and input control is performed, calculate the difference between the 7th value and the 8th value, described the 7th value reads from described clock counter in response to the control command of the processing that starts described driver unit, and described the 8th value reads from described clock counter in response to the control command of the processing that stops described driver unit; And
Store explicitly the summation of the described summation of the difference that calculates based on the difference of described the 7th value and described the 8th value and described merging value with based on described the 5th value and described the 6th value with program identification information in described memory storage.
7. computing method as described in any one in claim 1 to 6, wherein,
Described unit is in the thread that is used as the Multi-thread control object, the process that is used as the multitask control object and the unit of the access originator of access computer being carried out processing.
8. computing equipment comprises:
Computing unit, described computing unit is used for calculating the difference between the first value and the second value, described the first value reads from the clock counter that the pulse of clock signal is counted, described clock signal has multi-frequency and the control command that starts in response to the processing to the unit that will be assigned to described processor and be provided for described processor, and described the second value reads from described clock counter in response to the control command that stops processing.
9. calculation element as claimed in claim 8 also comprises:
Described unit is in the thread that is used as the Multi-thread control object, the process that is used as the multitask control object and the unit of the access originator of access computer being carried out processing.
10. calculation element as claimed in claim 8 or 9 also comprises:
Storage unit, described storage unit stores with the identification information of the described unit of sign the difference that calculates explicitly.
CN201210559889.8A 2011-12-21 2012-12-20 The record medium of computing device, computational methods and calculation procedure Active CN103176836B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011-280551 2011-12-21
JP2011280551A JP5799797B2 (en) 2011-12-21 2011-12-21 Calculation method, calculation program, and computer

Publications (2)

Publication Number Publication Date
CN103176836A true CN103176836A (en) 2013-06-26
CN103176836B CN103176836B (en) 2016-10-05

Family

ID=47561078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210559889.8A Active CN103176836B (en) 2011-12-21 2012-12-20 The record medium of computing device, computational methods and calculation procedure

Country Status (4)

Country Link
US (1) US9323642B2 (en)
EP (1) EP2608042B1 (en)
JP (1) JP5799797B2 (en)
CN (1) CN103176836B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106462437A (en) * 2014-03-27 2017-02-22 国际商业机器公司 Control area for managing multiple threads in a computer

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6670525B2 (en) * 2013-11-01 2020-03-25 長井 信二 Automatic greenhouse gas emission calculator, warehouse management system and computer software for automatic greenhouse gas emission calculator
US9558035B2 (en) * 2013-12-18 2017-01-31 Oracle International Corporation System and method for supporting adaptive busy wait in a computing environment
CN110309036B (en) * 2018-03-27 2023-02-10 华为技术有限公司 CPU occupancy rate detection method and detection equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011018163A (en) * 2009-07-08 2011-01-27 Renesas Electronics Corp Semiconductor device
CN102057356A (en) * 2008-06-11 2011-05-11 高通股份有限公司 Method and system for measuring task load
CN102184125A (en) * 2011-06-02 2011-09-14 首都师范大学 Load balancing method based on program behaviour online analysis under heterogeneous multi-core environment

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63170744A (en) * 1987-01-08 1988-07-14 Mitsubishi Electric Corp Information processor
US5838976A (en) * 1995-11-28 1998-11-17 Hewlett-Packard Co. System and method for profiling code on symmetric multiprocessor architectures
US7242223B1 (en) * 2003-03-10 2007-07-10 National Semiconductor Corporation Clock frequency monitor
US7571338B2 (en) * 2004-05-24 2009-08-04 Telefonaktiebolaget Lm Ericsson (Publ) Determining a time difference between first and second clock domains
JP4661509B2 (en) * 2005-09-30 2011-03-30 富士通株式会社 Transmission equipment
KR100741470B1 (en) * 2006-09-26 2007-07-20 삼성전자주식회사 Clock generator for usb devices
US7788511B2 (en) * 2007-08-16 2010-08-31 Texas Instruments Incorporated Method for measuring utilization of a power managed CPU
US7881895B2 (en) * 2008-05-27 2011-02-01 Sony Ericsson Mobile Communications Ab Methods of calibrating a clock using multiple clock periods with a single counter and related devices and methods
JP5153503B2 (en) 2008-07-31 2013-02-27 インターナショナル・ビジネス・マシーンズ・コーポレーション System and method for estimating power consumption

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102057356A (en) * 2008-06-11 2011-05-11 高通股份有限公司 Method and system for measuring task load
JP2011018163A (en) * 2009-07-08 2011-01-27 Renesas Electronics Corp Semiconductor device
CN102184125A (en) * 2011-06-02 2011-09-14 首都师范大学 Load balancing method based on program behaviour online analysis under heterogeneous multi-core environment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106462437A (en) * 2014-03-27 2017-02-22 国际商业机器公司 Control area for managing multiple threads in a computer
CN106462437B (en) * 2014-03-27 2019-11-15 国际商业机器公司 For managing the control zone of multiple threads in computer

Also Published As

Publication number Publication date
CN103176836B (en) 2016-10-05
EP2608042A3 (en) 2017-02-15
EP2608042A2 (en) 2013-06-26
JP2013131076A (en) 2013-07-04
US20130166941A1 (en) 2013-06-27
JP5799797B2 (en) 2015-10-28
EP2608042B1 (en) 2020-09-16
US9323642B2 (en) 2016-04-26

Similar Documents

Publication Publication Date Title
Gelenbe et al. Analysis and synthesis of computer systems
CN102103516B (en) Virtual-CPU based frequency and voltage scaling
Díaz et al. Optimal allocation of virtual machines in multi-cloud environments with reserved and on-demand pricing
CN104838359B (en) The software interrupt and thread scheduling of latency-sensitive
Huang et al. Cap3: A cloud auto-provisioning framework for parallel processing using on-demand and spot instances
CN106662909A (en) Heuristic processsor power management in operating systems
US8683160B2 (en) Method and apparatus for supporting memory usage accounting
Denning Resource allocation in multiprocess computer systems.
CN103176836A (en) Calculation apparatus, calculation method and recording medium of calculation program
Sigovan et al. Visualizing Large‐scale Parallel Communication Traces Using a Particle Animation Technique
CN105378668A (en) Operating system-managed interrupt steering in multiprocessor systems
EP2551767A1 (en) Method and device for adjusting clock interrupt cycle
CN103677990A (en) Virtual machine real-time task scheduling method and device and virtual machine
Gómez-Martín et al. Fattened backfilling: An improved strategy for job scheduling in parallel systems
CN102591621A (en) Prediction by using calculating history
US9471128B2 (en) Systems and methods for displaying, in a user interface, an energy utilization metric, a wake count, and a total amount of time that a CPU is awake
US8650367B2 (en) Method and apparatus for supporting memory usage throttling
Anderson et al. Value-maximizing deadline scheduling and its application to animation rendering
Zhang et al. An energy-efficient task scheduling heuristic algorithm without virtual machine migration in real-time cloud environments
Akhmetov et al. Adaptive Decision Support System for Scaling University Cloud Applications
Wang et al. Optimal synthesis of communication procedures in real-time synchronous reactive models
Hernández et al. A Simulation-based Scheduling Strategy for Scientific Workflows.
Kostopoulos et al. Energy-aware pricing within cloud environments
CN110689922A (en) Method and system for GC content analysis of automatic parallelization knockout strategy
Ghiț et al. An approximate bribe queueing model for bid advising in cloud spot markets

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