CN1794175A - Compiler and energy-saving method of operation system kernel coordination - Google Patents

Compiler and energy-saving method of operation system kernel coordination Download PDF

Info

Publication number
CN1794175A
CN1794175A CNA2006100489367A CN200610048936A CN1794175A CN 1794175 A CN1794175 A CN 1794175A CN A2006100489367 A CNA2006100489367 A CN A2006100489367A CN 200610048936 A CN200610048936 A CN 200610048936A CN 1794175 A CN1794175 A CN 1794175A
Authority
CN
China
Prior art keywords
program
compiler
operating system
section
system nucleus
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
CNA2006100489367A
Other languages
Chinese (zh)
Other versions
CN100346305C (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.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CNB2006100489367A priority Critical patent/CN100346305C/en
Publication of CN1794175A publication Critical patent/CN1794175A/en
Application granted granted Critical
Publication of CN100346305C publication Critical patent/CN100346305C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

A energy-saving method realized by coordinating of coder to operation system core includes dividing program to be different state period according to program static attribute at coding period of coder, then dividing program state to be sections by information when collection is carried out by said core in system operation, finally setting relevant operation frequency to save energy by applying dynamic frequency management technique on different state period.

Description

The power-economizing method of compiler and operation system kernel coordination
Technical field
The present invention relates to based on the built-in system software power-saving technology, particularly relate to a kind of operating system and compiler collaborative work method for saving energy.
Background technology
In portable embedded device field of power management, present difficulty is to satisfy the requirement of portable terminal to the power supply power supply, accomplishes to take up room little, in light weight again and power-on time is longer.The power solution emphasis of consumer electronics product of future generation should concentrate on hardware and software two aspect technology, comprise: (1) is under small and exquisite physical dimension, how to realize the technology and the technology of required power source performance, relate to technology such as heat management, noise reduction, battery management and function integration; (2) dynamic power management technology, it depends on that processor performance, software, middleware and user are to changing the requirements such as the time interval of battery; (3) the dynamic power management technology is to operating system nucleus and driver, and application programming interface (API) is to the influence of driver, middleware and application itself.
The function of embedded device becomes from strength to strength now, and function is also more and more abundanter.Along with the embedded device function is more and more, the user is also more and more higher to the energy requirement of embedded device battery, and existing lithium ion battery more and more has been difficult to satisfy the requirement of consumer to normal service time.To this, industry is mainly taked two kinds of methods, and the one, exploitation possesses the more novel battery technology of high-energy-density, and as fuel cell, in predictable 5 years, battery technology can not have very big breakthrough; The 2nd, the energy conversion efficiency of battery and energy-conservation aspect work hard.Under the at present new still jejune situation of high-energy battery technology (as fuel cell), the power management of handheld device of future generation can only be from improving the power utilization rate and reducing these two aspects of power consumption and set about.
How to prolong the serviceable life of battery, and the consumption that as far as possible reduces the energy content of battery has become a research focus of built-in field.Mainly concentrate on hardware design and software optimization two aspects now.Wherein software optimization aspect mainly comprises system software and application software two aspects now.System software mainly concentrates on two of compiler and operating system nucleuss.
In the operating system field, main method for managing power supply is to utilize operating system nucleus now, the frequency of dynamic Adjustment System processor and bus, the whole energy consumption of reduction system.And system can be that system is in low power consumpting state, to reach purpose of energy saving by dynamic frequency instruction change system state.Aspect compiler, now mainly by compiler in the compiling application program stage, code is optimized, compactness and the access means that code tries one's best concentrated as far as possible, to reach purpose of energy saving.
Above method in, all be operating system nucleus and compiler the energy-conservation of the system that finishes that work independently.Operating system can well be managed the energy consumption of total system, but specific application is not understood, and can not adopt proper method energy-conservation at specific application; Compiler can adopt the power-economizing method that meets application demand at specific application, but the easy like this instability that causes total system.
Summary of the invention
The object of the present invention is to provide the power-economizing method of a kind of compiler and operation system kernel coordination.
The technical scheme that the present invention solves its technical matters employing is as follows:
1) program static segmentation
Compiler is finished the static segment of program, compiler segmentation in the process that the source code to program P scans in the program compilation stage;
Compiler is divided into m static state section according to several principles with program P, article one principle: all function calls all are independently sections, the second principle: all circulations all are independently sections;
2) insertion program and kernel communication instruction
The segment information of program must be passed to operating system nucleus, compiler all inserts an instruction with the kernel communication in the front and back of each section in compilation process, this instruction significant feature is the notifying operation system kernel, program enters a new section now, and operating system nucleus will be set up this section of new data structure managing like this;
3) running state of programs segment management
By the communication instruction that compiler inserts, operating system nucleus just can be set up the Governance framework of this program; Each program is divided into a lot of sections, and operating system nucleus is kept at the operation information of each section of program in the data structure, and the segment information that this program is all with the chain watch chain together;
4) dynamic segmentation and dynamic frequency management
Operating system nucleus is complementary the ability of processor processes data and the ability of data transmission according to the running frequency of the dynamic Adjustment System processor of fast cache failure number;
Operating system nucleus will be according to the variation of certain section of program fast cache failure number when moving, and whether decision is with this section segmentation; When fast cache failure number in the unit interval not in same rank, operating system nucleus will to this section segment, be divided into two different sections, and new segment information preserved;
Program is in operational process, operating system nucleus utilizes the frequency of dynamic frequency modulation technology Adjustment System according to the fast cache failure number and the operating instruction number of different target phases of when operation in the unit interval, and the free time of processor is reduced, reduce the energy consumption of processor waste, reach purpose of energy saving.
The present invention compares with background technology, and the useful effect that has is:
The present invention combines the work of compiler and operating system, utilizes operating system to carry out energy-conservation to the control ability of total system and the uniqueness understanding of compiler application programs.Compiler is divided into different state section according to the static attribute of program with program in the compilation phase, the information that is combined in the operational process when collecting operation by kernel is with the program dynamic segmentation, pass through the dynamic frequency administrative skill then to the different conditions section, corresponding running frequency is set carries out energy-conservation.
(1) dynamic.When application program is moved in system, operating system dynamic collection program run information, and the information of collecting analyzed.Then according to the result of information analysis, the frequency of dynamic debugging system and to compiler original segmentation dynamically adjust.
(2) stability.Operating system is grasped the right of dynamic debugging system state in own hand, rather than transfers to application program, and system just can guarantee the stable of system at the state of taking into account dynamic debugging system under the overall situation like this.
(3) practicality.Original handheld device programmer must consider the tissue of code constantly in writing the process of application program, application program is moved on handheld device can be lacked consumed energy as far as possible.The power-economizing method that utilizes compiler and kernel to coordinate just can help the user to solve the problem of managing power consumption in compiling and operation phase.Through repeatedly authentication, this method can well reduce programmer's workload, and is very practical.
Description of drawings
Fig. 1 is the source code of the program P that will be compiled by compiler;
The code that has segmentation and kernel communication information after Fig. 2 is compiled by energy-conservation compiler;
Management data structures when Fig. 3 checks program run in being;
Fig. 4 is that the rank of fast cache failure number below the Xscale of Intel company architecture is divided;
Fig. 5 is a process flow diagram of the present invention.
Embodiment
When the software power-economizing method of implementing based on embedded system, operating system and compiler are widely used.
The power-economizing method specific implementation flow process of compiler and operation system kernel coordination is as follows.
The first step: program static segmentation.
Compiler is finished the static segment of program in the program compilation stage, and compiler is to the source code of the program P that compiled by compiler as shown in Figure 1, segmentation in the process that scans;
Compiler is in the compilation process to code, be divided into for 6 steps altogether, the optimization of front 3 step to last generating code not have to influence substantially, and the power-economizing method of compiler and operation system kernel coordination has been revised the 4th step of compiler, in to the optimizing process of code with code segmentation.
Compiler is divided into m static state section according to several principles with program P, article one principle: all function calls all are independently sections, the second principle: all circulations all are independently sections.Why using these two segmentation principles is to consider principle of locality, because the visit of adjacent data substantially all is to concentrate in the same circulation or in the same function.The process of static segment has following a few step:
1, compiler scans program source code;
2, judge whether it is the circulation beginning.If circulation beginning segmentation, otherwise continue;
3, judge whether it is function call, the words that are begin segmentation, otherwise continue;
4, judge whether that segmentation finishes, be to finish static segment, otherwise continue scanning sequence.
Second step: insertion program and kernel communication instruction.
The segment information of program must be passed to operating system nucleus, and ability and operating system are worked in coordination with; Through the first step, code has been divided into each section, and compiler all inserts an instruction with the kernel communication in the front and back of this section after finding a section.The instruction of these kernel communications all is the application programming interfaces that the certain operations system kernel provides.
This instruction significant feature of Entering Region is the notifying operation system kernel, and program enters a new section now, and the name of this section is Region, and wherein region is a character string, can play different names according to the needs of oneself.The meaning of this instruction of Exiting Region is just in time corresponding with that meaning of front, and he tells operating system nucleus, and program has been that this section of region withdraws from from name.After operating system was received this instruction of Entering Region, operating system nucleus will be set up this section of new data structure managing.
After segmentation and inserting the kernel communication instruction, above the code P of application program just be modified to the code that has segmentation and kernel communication information, as shown in Figure 2.
The 3rd step: running state of programs segment management.
By the communication instruction that compiler inserts, operating system nucleus just can be set up the Governance framework of this program; Each program is divided into a lot of sections, and operating system nucleus is kept at the operation information of each section of program in the data structure, and the segment information that this program is all is with the chain watch chain together, in when checking program run management data structures as shown in Figure 3.Operating system nucleus can be divided into so several steps to the running state of programs segment management:
1, creation facilities program (CFP) status data structure.When program is moved, operating system nucleus can be set up the process that a processCtrl data structure is used for managing this operation, the process number that comprises oneself, and what sections are this process be divided into, wherein also having important data at processCtrl is exactly a list structure list<RegionCtrl 〉, be used for together the message sense of all sections of this process.
2, set up the segment management data structure.Be that operating system nucleus is set up a regionCtrl data structure and is used for this section in the supervisory routine when program enters a section.When the communication instruction reporting system kernel program that adds in by second step when application program entered a new section, system can set up the data structure of a regionCtrl automatically, and above the corresponding processCtrl of its carry.Information when regionCtrl is mainly used to write down this section operation comprises the failure number of fast cache and the instruction number in the unit interval etc.Each regionCtrl comprises several regionHistory, and each regionHistory has write down the account of the history of this program run.
3, performance monitoring.Program is in operation, system is by the running state monitoring module on the processor, instruction number that the acquisition program was moved in the unit interval and fast cache failure number, the instruction number of unit interval operation has been represented the current state of processor, the fast cache failure number has been represented the ability and the load of routine access data, influence is very big to the energy consumption of system in the two co-ordination, and operating system nucleus is divided into different ranks according to the architecture of operation with the scope of fast cache failure number.The rank of fast cache failure number is divided as shown in Figure 4 below the Xscale of Intel company architecture.
4, performance information is preserved.Operating system nucleus is saved in the program run information that collects in the data structure of top 1,2 liang of step foundation, for the work of the 4th step provides data.
The 4th step: dynamic segmentation and dynamic frequency management.
Operating system nucleus is complementary the ability of processor processes data and the ability of data transmission according to the running frequency of the dynamic Adjustment System processor of fast cache failure number.
Operating system nucleus will be according to the variation of certain section of program fast cache failure number when moving, and whether decision is with this section segmentation; When fast cache failure number in the unit interval not in same rank, operating system nucleus will to this section segment, be divided into two different sections, and new segment information preserved, this process can be divided into following a few step:
1, determines whether segmentation;
2 if the words of segmentation are set up the data structure of a regionCtrl;
3, upgrade the information of new and old two sections.
Dynamic frequency modulation technology can be in the processor operational process processor frequencies of Adjustment System, when processor free time is longer, just can adjust processor speed to a lower value like this, reduce the energy of processor consumption.Program is in operational process, operating system nucleus utilizes the frequency of dynamic frequency modulation technology Adjustment System according to the fast cache failure number and the operating instruction number of different target phases of when operation in the unit interval, and the free time of processor is reduced, reduce the energy consumption of processor waste, reach purpose of energy saving.This process mainly is divided into several steps:
1, after past unit interval, system wake-up frequency modulation module;
2,, judge whether frequency modulation according to running state information;
If 3 require frequency modulation, according to result of calculation frequency modulation;
4, a newly-built regionHistory structure, and performance information is saved in regionHisorty.
The workflow diagram of whole invention as shown in Figure 5.

Claims (1)

1. the power-economizing method of compiler and operation system kernel coordination is characterized in that:
1) program static segmentation
Compiler is finished the static segment of program, compiler segmentation in the process that the source code to program P scans in the program compilation stage;
Compiler is divided into m static state section according to several principles with program P, article one principle: all function calls all are independently sections, the second principle: all circulations all are independently sections;
2) insertion program and kernel communication instruction
The segment information of program must be passed to operating system nucleus, compiler all inserts an instruction with the kernel communication in the front and back of each section in compilation process, this instruction significant feature is the notifying operation system kernel, program enters a new section now, and operating system nucleus will be set up this section of new data structure managing like this;
3) running state of programs segment management
By the communication instruction that compiler inserts, operating system nucleus just can be set up the Governance framework of this program; Each program is divided into a lot of sections, and operating system nucleus is kept at the operation information of each section of program in the data structure, and the segment information that this program is all with the chain watch chain together;
4) dynamic segmentation and dynamic frequency management
Operating system nucleus is complementary the ability of processor processes data and the ability of data transmission according to the running frequency of the dynamic Adjustment System processor of fast cache failure number;
Operating system nucleus will be according to the variation of certain section of program fast cache failure number when moving, and whether decision is with this section segmentation; When fast cache failure number in the unit interval not in same rank, operating system nucleus will to this section segment, be divided into two different sections, and new segment information preserved;
Program is in operational process, operating system nucleus utilizes the frequency of dynamic frequency modulation technology Adjustment System according to the fast cache failure number and the operating instruction number of different target phases of when operation in the unit interval, and the free time of processor is reduced, reduce the energy consumption of processor waste, reach purpose of energy saving.
CNB2006100489367A 2006-01-06 2006-01-06 Compiler and energy-saving method of operation system kernel coordination Expired - Fee Related CN100346305C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100489367A CN100346305C (en) 2006-01-06 2006-01-06 Compiler and energy-saving method of operation system kernel coordination

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100489367A CN100346305C (en) 2006-01-06 2006-01-06 Compiler and energy-saving method of operation system kernel coordination

Publications (2)

Publication Number Publication Date
CN1794175A true CN1794175A (en) 2006-06-28
CN100346305C CN100346305C (en) 2007-10-31

Family

ID=36805652

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100489367A Expired - Fee Related CN100346305C (en) 2006-01-06 2006-01-06 Compiler and energy-saving method of operation system kernel coordination

Country Status (1)

Country Link
CN (1) CN100346305C (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121285A (en) * 2017-12-20 2018-06-05 中国铁道科学研究院 Application software collaboration Compilation Method and device based on continuous function figure
CN108563442A (en) * 2018-02-28 2018-09-21 北京智行鸿远汽车有限公司 Code compiling method and device
CN109725904A (en) * 2017-10-31 2019-05-07 中国科学院微电子研究所 A kind of low-power consumption program instruction Compilation Method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6282663B1 (en) * 1997-01-22 2001-08-28 Intel Corporation Method and apparatus for performing power management by suppressing the speculative execution of instructions within a pipelined microprocessor
US6298448B1 (en) * 1998-12-21 2001-10-02 Siemens Information And Communication Networks, Inc. Apparatus and method for automatic CPU speed control based on application-specific criteria
JP2001043098A (en) * 1999-07-29 2001-02-16 Matsushita Electric Ind Co Ltd Operating system and virtual computer system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109725904A (en) * 2017-10-31 2019-05-07 中国科学院微电子研究所 A kind of low-power consumption program instruction Compilation Method and system
CN109725904B (en) * 2017-10-31 2021-10-22 中国科学院微电子研究所 Low-power-consumption program instruction compiling method and system
CN108121285A (en) * 2017-12-20 2018-06-05 中国铁道科学研究院 Application software collaboration Compilation Method and device based on continuous function figure
CN108121285B (en) * 2017-12-20 2020-08-25 中国铁道科学研究院 Application software collaborative compiling method and device based on continuous function diagram
CN108563442A (en) * 2018-02-28 2018-09-21 北京智行鸿远汽车有限公司 Code compiling method and device

Also Published As

Publication number Publication date
CN100346305C (en) 2007-10-31

Similar Documents

Publication Publication Date Title
CN1890636A (en) Apparatus and method for power performance monitors for low-power program tuning
CN1129831C (en) Method for setting computer having power saving function into power saving mode when using network
CN1945498A (en) Low power consumption real time task parameter model dispatching method facing embedded system
CN101313284B (en) Method and apparatus for providing for detecting processor state transitions
Attia et al. Dynamic power management techniques in multi-core architectures: A survey study
CN1142510C (en) Power supply control in data process system according to use of CPU
CN100465857C (en) Simplifying method facing to embedded system low-power consumption real time task scheduling
CN101510115B (en) Method for controlling processor frequency when program operation by using dynamic compiler
CN1881140A (en) Apparatus and method for automatically controlling processor mode of multi-core processor
CN1776568A (en) Task-based dynamic CPU working frequency regulating method and system
CN1173262C (en) Optimized bytecode interpreter of virtual machine instructions
CN101216727A (en) Embedded type low-power consumption operating system dynamic frequency regulation mapping method
CN100377042C (en) Method for saving energy by optimizing running frequency through combination of static compiler and dynamic frequency modulation techniques
CN100346305C (en) Compiler and energy-saving method of operation system kernel coordination
CN1435755A (en) Command converting device and method
CN1818829A (en) Frequency energy-saving method of kernel dynamic adjusting processor
Manzanares et al. A prefetching scheme for energy conservation in parallel disk systems
CN109101316B (en) Energy efficiency related cloud computing platform resource scheduling method
Fan et al. GreenSleep: a multi-sleep modes based scheduling of servers for cloud data center
CN200953143Y (en) Virtual hardware system
CN105589544A (en) Method, device and terminal reducing central processor energy consumption
CN100346306C (en) Energy-saving compiling method based on dynamic frequency modulation technology
Zhao et al. Dependency-based energy-efficient scheduling for homogeneous multi-core clusters
CN112764883A (en) Energy management method of cloud desktop system based on software definition
CN1258942C (en) Mobile communication terminal with time, data automatic calibration function

Legal Events

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

Granted publication date: 20071031

Termination date: 20120106