CN104050137B - The method and device that kernel is run in a kind of OS - Google Patents

The method and device that kernel is run in a kind of OS Download PDF

Info

Publication number
CN104050137B
CN104050137B CN201310079899.6A CN201310079899A CN104050137B CN 104050137 B CN104050137 B CN 104050137B CN 201310079899 A CN201310079899 A CN 201310079899A CN 104050137 B CN104050137 B CN 104050137B
Authority
CN
China
Prior art keywords
core
kernel
run
micro
cpu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201310079899.6A
Other languages
Chinese (zh)
Other versions
CN104050137A (en
Inventor
詹卿
王伟
袁泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310079899.6A priority Critical patent/CN104050137B/en
Priority to PCT/CN2014/073086 priority patent/WO2014139379A1/en
Publication of CN104050137A publication Critical patent/CN104050137A/en
Application granted granted Critical
Publication of CN104050137B publication Critical patent/CN104050137B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Abstract

The invention discloses in a kind of OS kernel run method and device, applied to many-core platform, including:Core in CPU nuclear resource pond is arranged to idle condition;According to operation demand, the core of at least two idle conditions in the nuclear resource pond of the CPU is run with two kinds of core types specified respectively;Wherein, the core type includes:Single kernel and micro-kernel.The invention also discloses the device that kernel in corresponding OS is run.By setting a kind of idle condition between two kinds of core types of single kernel and micro-kernel, core can be made to be run to dynamic translation between micro-kernel and single kernel, so as to which in an operating system single kernel and micro-kernel can be run simultaneously according to operation demand, the advantages of having two kinds of core types concurrently.

Description

The method and device that kernel is run in a kind of OS
Technical field
The present invention relates to many-core operation system technology field, more particularly to the side that kernel is run in a kind of OS Method and device.
Background technology
At present, processor has been enter into the multi-core/many-core epoch, however, current operating system (Operating System, OS multi-core/many-core processor only) is used in symmetric multiprocessor (Symmetric Multi-Processing, SMP) mode, and The parallel processing capability of multi-core/many-core processor can not be made full use of.It is demonstrated experimentally that work as more than 16 cores of processor, it is existing The performance of (SuSE) Linux OS no longer linear increase reduces on the contrary.Therefore, many researches are generated to many-core platform at present Operating system, it is the characteristics of these many-cores OS:Microkernel architecture, existing many-core OS employ microkernel architecture;More kernels are set Meter, the performance bottleneck of single kernel can be avoided;Using message communicating, this technology can lift many-core OS autgmentability.
The prominent thought of one of Mach structure is that more set up in operating system is put into more with function High level(And user model)In go to run, and leave a small kernel as far as possible, it is most basic to complete operating system with it Kernel function.As shown in figure 1, micro-kernel typically only provides basic hardware operation interface, the function that OS must be provided is to be The form of system service operates in User space, and work is completed in the service of user's calling system;Service isolation between each other, even if some takes There is exception and does not also affect other modules in business;Pass through interprocess communication (Inter-Process between service and service Communication, IPC) mode work.Existing Mach is all based on CLIENT/SERVER MODEL, uses Family notifies that OS needs to call a kind of system service by sending request message to OS, OS receive dispatch after message it is corresponding service into Journey, after the completion of result is notified to user by way of message communicating again.As shown in Fig. 2 it is a calling system service Process.
Although the message communicating mode of micro-kernel enhances OS autgmentability, but have impact on the performance of operating system service. Compared with single kernel operating system, same primary system service is completed, several times even more than single kernel for the expense of micro-kernel More.Single kernel operating system(By taking (SuSE) Linux OS as an example)The service that all OS are provided is all by written in code in kernel In module, the process required for completing primary system service is that user program is absorbed in kernel, is then serviced by kernel execution system, After the completion of from kernel state return to User space, expense is only the switching of 2 contexts.And Mach, completion are once called Required expense is typically 4 context switchings.Switch every time all along with being absorbed in kernel and returning to User space, communicate and upper and lower The expense that text switching is brought is very big, and performance issue is very serious.
In summary, the operation of single kernel and micro-kernel how is preferably handled, lifting system treatment effeciency has turned into The problem of industry is in the urgent need to address.
The content of the invention
In view of this, the embodiments of the invention provide the method and device that kernel in a kind of OS is run, use In solve the problems, such as prior art there is can not handle the operation of single kernel and micro-kernel very well.
First aspect, there is provided a kind of method that kernel is run in OS, applied to many-core platform, including:
Core in CPU nuclear resource pond is arranged to idle condition;
According to operation demand, by the core of at least two idle conditions in the nuclear resource pond of the CPU respectively with two kinds of fingers Fixed core type operation;
Wherein, the core type includes:Single kernel and micro-kernel.
It is described according to operation demand in the first possible implementation, by the nuclear resource pond of the CPU at least The core of two idle conditions is run with two kinds of core types specified respectively, including:
When the number of threads and more parallel demand for the first application program that operating system to be run, by the CPU's The core of at least one idle condition in nuclear resource pond is run with micro-kernel;
When the number of threads for the second application program that the operating system to be run and few parallel demand, by described in The core of at least one idle condition in CPU nuclear resource pond is run with single kernel.
According to the possible implementation of the first of first aspect or first aspect, in second of possible implementation In, after the core in the nuclear resource pond by CPU is arranged to idle condition, and it is described according to operation demand, by the CPU Nuclear resource pond at least two idle conditions core run respectively with two kinds of core types specified before, in addition to:
The first address space is distributed unitedly for single kernel and the micro-kernel;
Single kernel distributes the second address space to run the core of single kernel;
User space program corresponding to the micro-kernel distributes the 3rd address space to run the core of the micro-kernel.
According to second of possible implementation of first aspect, in the third possible implementation, the basis Operation demand, by the core of at least two idle conditions in the nuclear resource pond of the CPU respectively with two kinds of core types specified Operation, including:
When, it is necessary to when the core is run with single kernel, one being searched in the nuclear resource pond of the CPU according to operation demand The core of individual idle condition, single kernel mirror image is loaded to second address space;
The interrupt message is sent to the core, so that the core is run with single kernel;
When, it is necessary to when the core is run with micro-kernel, one being searched in the nuclear resource pond of the CPU according to operation demand The core of individual idle condition, loading microkernel image to the 3rd address space;
The interrupt message is sent to the core, so that the core is run with micro-kernel.
According to the third possible implementation of first aspect, in the 4th kind of possible implementation, the basis Operation demand, by the core of at least two idle conditions in the nuclear resource pond of the CPU respectively with two kinds of core types specified Operation, in addition to:
When finding the core of idle condition in the nuclear resource pond in the CPU, by the idle condition found Core is added in a manner of symmetric multiprocessor SMP into operating single kernel so that the core of the idle condition found with Single kernel operation.
It is possible according to second of the possible implementation of the first of first aspect or first aspect or first aspect 4th kind of possible implementation of the possible implementation of the third of implementation or first aspect or first aspect, It is described according to operation demand in five kinds of possible implementations, by least two idle conditions in the nuclear resource pond of the CPU Core run respectively with two kinds of core types specified after, in addition to:
When the load on the multiple cores run with the micro-kernel or single kernel is reduced, by one of them core On the task immigration of middle operation to another described core run with micro-kernel or single kernel, and by one of them described described core Idle condition is arranged to, is put into the nuclear resource pond of the CPU.
It is described by it in the 6th kind of possible implementation according to the 5th of first aspect the kind of possible implementation In on task immigration to another described core run with micro-kernel or single kernel for running in the core, and will it is described its In the core be arranged to idle condition, be put into after the nuclear resource pond of the CPU, in addition to:
The microkernel image is retained in the 3rd address space or single kernel mirror image is retained in described In double-address space;
Store the register information of the core;
When the core that the idle condition is reselected from the nuclear resource pond of the CPU is run with the micro-kernel or single kernel When, the register information is loaded onto to the core of the idle condition reselected, then the idle condition reselected Core run with the micro-kernel or single kernel.
According to the 6th kind of possible implementation of the 5th of first aspect the kind of possible implementation or first aspect, In 7th kind of possible implementation, it is described by the task immigration run in one of them described core to micro-kernel or single kernel On another described core of operation, and one of them described described core is arranged to idle condition, is put into the nuclear resource of the CPU After pond, in addition to:
According to the physical location between the core being currently running in the core of the idle condition and the CPU nuclear resource pond Distance, the core to the idle condition set power level;
According to the power level, the core of the idle condition is waken up successively.
Second aspect, there is provided the device that kernel is run in a kind of OS, applied to many-core platform, including:
First setting unit, idle condition is arranged to for the core in the nuclear resource pond by CPU;
Running unit, for according to operation demand, by the core of at least two idle conditions in the nuclear resource pond of the CPU Run respectively with two kinds of core types specified;
Wherein, the core type includes:Single kernel and micro-kernel.
In the first possible implementation, the running unit includes:
Micro-kernel running unit, for the number of threads of the first application program to be run when operating system and parallel need to When asking more, the core of at least one idle condition in the nuclear resource pond of the CPU is run with micro-kernel;
Single kernel running unit, for the number of threads of the second application program to be run when the operating system and simultaneously When row demand is few, the core of at least one idle condition in the nuclear resource pond of the CPU is run with single kernel.
According to the possible implementation of the first of second aspect or second aspect, in second of possible implementation In, described device also includes:
First allocation unit, for distributing the first address space unitedly for single kernel and the micro-kernel;
Second allocation unit, for distributing the second address sky by single kernel to run the core of single kernel Between;
3rd allocation unit, it is the core of the operation micro-kernel for the User space program as corresponding to the micro-kernel Distribute the 3rd address space.
According to second of possible implementation of second aspect, in the third possible implementation, the operation Unit includes:
Searching unit, for when according to operation demand, it is necessary to when the core is run with single kernel, in the core of the CPU The core of an idle condition is searched in resource pool;
First loading unit, for loading single kernel mirror image to second address space;
Interrupt location, for sending the interrupt message to the core, so that the core is run with single kernel;
The searching unit be additionally operable to when according to operation demand, it is necessary to when the core is run with micro-kernel, in the CPU Nuclear resource pond in search an idle condition core;
First loading unit is additionally operable to load microkernel image to the 3rd address space;
The interrupt location is additionally operable to send the interrupt message to the core, so that the core is run with micro-kernel.
According to the third possible implementation of second aspect, in the 4th kind of possible implementation, the operation Unit also includes:
Unit is added, for the institute that when finding the core of idle condition in the nuclear resource pond in the CPU, will be found The core for stating idle condition is added in a manner of symmetric multiprocessor SMP into operating single kernel, so that the sky found The core of not busy state is run with single kernel.
It is possible according to second of the possible implementation of the first of second aspect or second aspect or second aspect 4th kind of possible implementation of the possible implementation of the third of implementation or second aspect or second aspect, In five kinds of possible implementations, described device also includes:
Migration units, for when the load on the multiple cores run with the micro-kernel or single kernel is reduced, inciting somebody to action On the task immigration run in one of them described core to another described core run with micro-kernel or single kernel;
First setting unit is additionally operable to one of them described described core being arranged to idle condition, is put into the CPU Nuclear resource pond.
According to the 5th of second aspect the kind of possible implementation, in the 6th kind of possible implementation, described device Also include:
Stick unit, for the microkernel image to be retained in into the 3rd address space or by single kernel mirror image It is retained in second address space;
Memory cell, for storing the register information of the core;
Second loading unit, the core of the idle condition is reselected with described for working as from the nuclear resource pond of the CPU When micro-kernel or single kernel are run, the register information is loaded onto to the core of the idle condition reselected, then it is described The core of the idle condition reselected is run with the micro-kernel or single kernel.
According to the 6th kind of possible implementation of the 5th of second aspect the kind of possible implementation or second aspect, In 7th kind of possible implementation, described device also includes:
Second setting unit, for what is be currently running in the core according to the idle condition and the CPU nuclear resource pond The distance of physical location between core, the core to the idle condition set power level;
Wakeup unit, for according to the power level, waking up the core of the idle condition successively.
The technical scheme for the method and device run using kernel in a kind of OS provided by the invention, is passed through A kind of idle condition is set between two kinds of core types of single kernel and micro-kernel, core can be made between micro-kernel and single kernel Run to dynamic translation, so as to which in an operating system single kernel and micro-kernel can be run simultaneously according to operation demand, have two concurrently The advantages of kind core type, improve system treatment effeciency.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is Mach configuration diagram in the prior art;
Fig. 2 is the method flow diagram of Mach call flow in the prior art;
Fig. 3 is the method flow diagram of one embodiment for the method that kernel is run in a kind of OS of the present invention;
Fig. 4 is the view of operating system center of the present invention;
Fig. 5 is the method flow of another embodiment of the method that kernel is run in a kind of OS of the present invention Figure;
Fig. 6 is memory address space distribution schematic diagram;
Fig. 7 is the method flow diagram of delay recovery kernel;
Fig. 8 is the power level queue schematic diagram residing for the core of idle condition;
Fig. 9 is the structural representation of one embodiment for the device that kernel is run in a kind of OS of the present invention;
Figure 10 is the structural representation of running unit;
Figure 11 is the structural representation of another embodiment of the device that kernel is run in a kind of OS of the present invention Figure;
Figure 12 is the structural representation of the embodiment for the equipment that kernel is run in a kind of OS of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made Embodiment, belong to the scope of protection of the invention.
Fig. 3 is the method flow diagram of one embodiment for the method that kernel is run in a kind of OS of the present invention. As shown in figure 3, this method is applied to many-core platform, comprise the following steps:
Step S101, the core in CPU nuclear resource pond is arranged to idle condition.
Fig. 4 is the view of operating system center (core).As shown in figure 4, all core is divided into by operating system Three kinds of states:Run with micro-kernel, with the operation of single kernel and idle condition, core type during operation includes:Single kernel and micro- Kernel, and CPU nuclear resource pond is established, in os starting, the core in CPU nuclear resource pond is arranged to idle State;And when core is out of service, during in idle condition, recovery is put into the nuclear resource pond of the CPU.The core of idle condition can be with Call as with any one operation in two kinds of core types.
Wherein, it is to manage power supply by ACPI the core being currently running to be arranged into idle condition, and power supply is turned off.Specifically Ground, first, core is labeled as idle condition in CPU nuclear resource pond;Then, dropped to by ACPI power managements, control core S4 power levels.ACPI is APM specification, and most of computer all meets this specification, and operating system can pass through The ACPI interfaces that hardware provides carry out power operation to core, belong to prior art.
Step S102, according to operation demand, the core of at least two idle conditions in the nuclear resource pond of the CPU is distinguished Run with two kinds of core types specified.
In this step, according to operation demand, by the core of at least two idle conditions in CPU nuclear resource pond respectively with Two kinds of core type operations specified;Wherein, the core type includes:Single kernel and micro-kernel.Specifically, operating system is wanted Difference is very big sometimes for the number of threads and parallel demand of each application program of operation, therefore, to be run when operating system When the number of threads of application program and more parallel demand, by the core of at least one idle condition in the nuclear resource pond of the CPU Specify and run with micro-kernel;, will when the number of threads for the application program that the operating system to be run and few parallel demand The core of at least one idle condition in the nuclear resource pond of the CPU is specified to be run with single kernel.
When core is run with micro-kernel, the micro-kernel typically only provides basic hardware operation interface, and OS must be provided Function operate in User space in the form of system service, work is completed in the service of user's calling system;Service isolation between each other, There is exception even if some service and also do not affect other modules;Worked between service and service by way of IPC communications. Mach is to notify OS to need to call by sending request message to OS based on CLIENT/SERVER MODEL, user A kind of system service, OS dispatch corresponding service processes after receiving message, after the completion of again by way of message communicating by result Notify to user.
When core is run with single kernel, the service that all OS are provided in kernel module, completes one all by written in code Process required for subsystem service is that user program is absorbed in kernel, is then serviced by kernel execution system, after the completion of from kernel State returns to User space.
When core exits the operation of micro-kernel or single kernel, the core is all re-set as idle condition, is put into CPU core Resource pool.So, the core originally run with micro-kernel, it is arranged to after idle condition is put into CPU nuclear resource pond, next operation The system loads core, it can be run with single kernel according to operation demand;Similarly, the core originally run with single kernel, if Be set to after idle condition is put into CPU nuclear resource pond, the next operation system loads core, can according to operation demand by its with Micro-kernel is run.So, by setting a kind of idle condition between two kinds of core types of single kernel and micro-kernel, core can be made Run to dynamic translation between micro-kernel and single kernel, reach nuclear energy and flexible configuration is obtained according to operation demand.
One embodiment for the method run according to kernel in a kind of OS provided by the invention, by list A kind of idle condition is set between two kinds of core types of kernel and micro-kernel, core dynamic between micro-kernel and single kernel can be made The operation of conversion ground, so as to which in an operating system single kernel and micro-kernel can be run simultaneously according to operation demand, have concurrently in two kinds The advantages of core type.
Fig. 5 is the method flow of another embodiment of the method that kernel is run in a kind of OS of the present invention Figure.As shown in figure 5, this method is applied to many-core platform, comprise the following steps:
Step S201, the core in CPU nuclear resource pond is arranged to idle condition.
During os starting, first start the startup core specified, the startup core can be transported with single kernel or micro-kernel OK, startup program is stored in the startup core so that operating system can pass through basic input output system (Basic Input Output System, BIOS) start.
After the startup core starts, start a core management program, all cores are formed to CPU nuclear resource pond, and will All cores in the nuclear resource pond of the CPU are arranged to idle condition.When core is out of service, during in idle condition, recovery is put into The nuclear resource pond of the CPU.The core of idle condition can be called to be run with any one in two kinds of core types, wherein, it is interior Core type includes single kernel and micro-kernel.
Wherein, it is to manage power supply by ACPI the core being currently running to be arranged into idle condition, and power supply is turned off.Specifically Ground, first, core is labeled as idle condition in CPU nuclear resource pond;Then, dropped to by ACPI power managements, control core S4 power levels.ACPI is APM specification, and most of computer all meets this specification, and operating system can pass through The ACPI interfaces that hardware provides carry out power operation to core, belong to prior art.
Step S202, it is that single kernel and the micro-kernel distribute the first address space unitedly.
Step S203, single kernel distribute the second address space to run the core of single kernel.
Step S204, User space program corresponding to the micro-kernel distribute the 3rd address sky to run the core of the micro-kernel Between.
Start after core starts, also carry out the distribution of the resource of operating system, one is achieved in that by by operating system In such as internal memory, peripheral hardware resource managed concentratedly, after os starting start core on run a resource manager, System resource allocation is given to corresponding core by resource manager, and each core can only use the part resource being assigned on core.
Start collection system information after core starts, wherein, resource manager can collect memory information, obtain internal memory Size and occupancy situation.Fig. 6 is memory address space distribution schematic diagram, as shown in fig. 6, it is 4G to obtain memory address space, its In, 0~2G is allocated to user's use, and operating system is that single kernel and micro-kernel distribute address space unitedly, such as by 2G~4G It is allocated to kernel use.
For single kernel, resource manager can distribute some free physical internal memories and be used to single kernel, and single kernel is each Distribution physical memory is all to go to distribute from the part of resource manager distribution, and single kernel is runs the core of single kernel distributively Location space;Reclaimed after application program releasing memory by single kernel;Single kernel when occurring insufficient using internal memory to start core on The new free memory of resource manager application;Single kernel for a long time without using internal memory can be released to resource manager.
For micro-kernel, all micro-kernels share a storage management, and this storage management is unified to money Source control program application internal memory, the occupation mode of internal memory with single kernel, simply manager be not kernel but a memory management Program.
Step S205, when according to operation demand, it is necessary to when the core is run with single kernel, in the nuclear resource of the CPU The core of an idle condition is searched in pond, loads single kernel mirror image to second address space.
In this step, when the number of threads of the application program to be run of operating system and parallel demand are few, it is necessary to Core is run with single kernel, operating system searches the core of an idle condition in CPU nuclear resource pond, and the storage from mirror image is empty Between load address space corresponding to single kernel mirror image to the core of the core, the address space be single kernel be with single kernel run The address space of core distribution.Single kernel mirror image is operation program necessary to the operation of single kernel.
To create situation during a single kernel, operating system needs to load single kernel mirror image to core the step.
Also another situation, when the core of idle condition is added in a manner of SMP to operating single kernel, now, operation System need not give core to load single kernel mirror image again, directly by the core of the idle condition found from CPU nuclear resource pond with SMP modes are added into operating single kernel.
Step S206, the interrupt message is sent to the core, so that the core is run with single kernel.
First, operating system generates the interrupt message of the core, and the interrupt message includes:The storage location of single kernel mirror image, Initial address, size and title etc..Then, operating system sends the interrupt message to the core, and the core of the idle condition receives The interrupt message, just single kernel mirror image in address space is run on the core, so that the core is run with single kernel.
Step S207, when according to operation demand, it is necessary to when the core is run with micro-kernel, in the nuclear resource of the CPU The core of an idle condition, loading microkernel image to the 3rd address space are searched in pond.
In this step, when the number of threads and more parallel demand of the application program to be run of operating system, it is necessary to Core is run with micro-kernel, operating system searches the core of an idle condition in CPU nuclear resource pond, and the storage from mirror image is empty Between load address space corresponding to the microkernel image to the core of the core, the address space is User space program corresponding to micro-kernel To run the address space of the core of micro-kernel distribution.The microkernel image is operation program necessary to micro-kernel operation.
Step S208, the interrupt message is sent to the core, so that the core is run with micro-kernel.
Similar to step S206, first, operating system generates the interrupt message of the core, and the interrupt message includes:Micro-kernel Storage location, initial address, size and title of mirror image etc..Then, operating system sends the interrupt message to the core, the free time The core of state receives the interrupt message, just runs the microkernel image in address space on the core, so that the core Run with micro-kernel.
Step S209, will wherein when the load on the multiple cores run with the micro-kernel or single kernel is reduced On the task immigration run in one core to another described core run with micro-kernel or single kernel, and by described in wherein One core is arranged to idle condition, is put into the nuclear resource pond of the CPU.
When core is run with micro-kernel or single kernel, there is the process of certain operations system, such as User space task dispatching.When with micro- , it is necessary to the operating system process that one of core occupies when running when load on kernel or multiple cores of single kernel operation is reduced Migrate in the operating system process queue occupied to another core run with micro-kernel or single kernel so that unfinished User space task continues according to queue, the service of not interrupt operation system.
Finally, the core of the complete task of the migration is re-set as idle condition, is put into CPU nuclear resource pond.
After micro-kernel or single kernel complete task immigration, the storage management of single kernel or micro-kernel can be by respectively The single kernel mirror image for being stored in the second address space or the microkernel image for being stored in the 3rd address space are destroyed, to reclaim the ground Location space;For some kernels, what next time may load when waking up is identical mirror image, at this moment can also be retained mirror image, i.e., Delay recovery kernel so that when reselecting corresponding core operation, the mirror image of the reservation can be loaded, as shown in fig. 7, specifically Delay recovery kernel the step of it is as follows:
Step S2091, the microkernel image is retained in the 3rd address space or protects single kernel mirror image Stay in second address space.
After micro-kernel or single kernel complete task immigration, operating system will not be stored in the list of the second address space respectively Kernel mirror image is stored in the microkernel image of the 3rd address space and destroyed immediately, and is kept in corresponding address space.
Step S2092, store the register information of the core.
Some data of storage in a register are stored when micro-kernel or single kernel are run.
Step S2093, when the core that the idle condition is reselected from the nuclear resource pond of the CPU with the micro-kernel or During single kernel operation, the register information is loaded onto to the core of the idle condition reselected, then it is described to reselect The core of idle condition run with the micro-kernel or single kernel.
When the core that idle condition is reselected from CPU nuclear resource pond is run with micro-kernel or single kernel, by storage Register information is loaded onto the core of the idle condition reselected, and the interruption of startup optimization is contained in these register informations Message, and due to remaining microkernel image or single kernel mirror image in address space, it is not necessary to reload, then this is selected again The core for the idle condition selected can be run with micro-kernel or single kernel.
Step S210, according between the core being currently running in the core of the idle condition and the CPU nuclear resource pond The distance of physical location, the core to the idle condition set power level.
Step S211, according to the power level, the core of the idle condition is waken up successively.
The power-saving technology of the operating system of the present embodiment takes into full account the mesh networks of many-core platform and internuclear compatibility etc. Characteristic, first, according to the distance of the physical location between the core being currently running in the core of idle condition and CPU nuclear resource pond, Core to idle condition sets power level, and power level is used to represent the ability that the core of idle condition is waken up, power level The ranks such as S1, S2, S3 and S4 are generally divided into, as an example, are set from S1 to S4, the ability that CPU core is waken up diminishes.Some Core in idle condition, their physical location close on behaviour area, and these cores may be because the demand quilt of operating system at any time Loading, therefore, the core on these positions will not set it to be in deep sleep at once, but it is set into S1, S2 power supply Rank.Then, according to the core of power level, successively wake-up idle condition.
Fig. 8 is the power level queue schematic diagram residing for the core of idle condition.As shown in figure 8, core0, core1 composition one Individual workspace, core10~core15 form another workspace, if workspace needs to extend, what is be waken up first should be Core2, core9, therefore, core2, core9 are under S1 states, because the possibility that core8 is waken up is also bigger, therefore Under S2 states, other core are respectively at S3 or S4 states according to OS arrangement, so not only can save but also not have too Big performance loss.
According in a kind of OS provided by the invention kernel run method another embodiment, by A kind of idle condition is set between single two kinds of core types of kernel and micro-kernel, core can be made to be moved between micro-kernel and single kernel State conversion ground operation, so as to run single kernel and micro-kernel simultaneously according to operation demand in an operating system, has two kinds concurrently The advantages of core type;Meanwhile the power-saving technology of operating system takes into full account the mesh networks of many-core platform and internuclear compatibility Etc. characteristic, it both can guarantee that systematic function and can effectively saved.
Fig. 9 is the structural representation of one embodiment for the device that kernel is run in a kind of OS of the present invention. As shown in figure 9, the device 1000 is applied to many-core platform, including:
First setting unit 101, idle condition is arranged to for the core in the nuclear resource pond by CPU.
Fig. 4 is the view of operating system center (core).As shown in figure 4, all core is divided into by operating system Three kinds of states:Run with micro-kernel, with the operation of single kernel and idle condition, core type during operation includes:Single kernel and micro- Kernel, and establish CPU nuclear resource pond, in os starting, the first setting unit 101 is by CPU nuclear resource pond In core be arranged to idle condition;And when core is out of service, during in idle condition, recovery is put into the nuclear resource pond of the CPU. The core of idle condition can be called as with any one operation in two kinds of core types.
Wherein, the core being currently running is arranged to idle condition by the first setting unit 101, is to manage power supply by ACPI, Power supply is turned off.Specifically, first, core is labeled as idle condition in CPU nuclear resource pond;Then, ACPI power supplys are passed through Management, control core drop to S4 power levels.ACPI is APM specification, and most of computer all meets this specification, Operating system can carry out power operation by the ACPI interfaces that hardware provides to core, belong to prior art.
Running unit 102, for according to operation demand, by least two idle conditions in the nuclear resource pond of the CPU Core run respectively with two kinds of core types specified.
In the present embodiment, running unit 102 is idle by least two in CPU nuclear resource pond according to operation demand The core of state is run with two kinds of core types specified respectively;Wherein, the core type includes:Single kernel and micro-kernel.
Specifically, difference is very sometimes for the number of threads of each application program to be run of operating system and parallel demand Greatly, therefore, as shown in Figure 10, the running unit 102 can include:Micro-kernel running unit 1021 and single kernel running unit 1022.When the number of threads and more parallel demand for the application program that operating system to be run, micro-kernel running unit 1021 The core of at least one idle condition in the nuclear resource pond of the CPU is specified and run with micro-kernel;When the operating system institute When the number of threads of the application program to be run and parallel demand are few, single kernel running unit 1022 is by the nuclear resource of the CPU The core of at least one idle condition in pond is specified to be run with single kernel.
When core is run with micro-kernel, the micro-kernel typically only provides basic hardware operation interface, and OS must be provided Function operate in User space in the form of system service, work is completed in the service of user's calling system;Service isolation between each other, There is exception even if some service and also do not affect other modules;Worked between service and service by way of IPC communications. Mach is to notify OS to need to call by sending request message to OS based on CLIENT/SERVER MODEL, user A kind of system service, OS dispatch corresponding service processes after receiving message, after the completion of again by way of message communicating by result Notify to user.
When core is run with single kernel, the service that all OS are provided in kernel module, completes one all by written in code Process required for subsystem service is that user program is absorbed in kernel, is then serviced by kernel execution system, after the completion of from kernel State returns to User space.
When core exits the operation of micro-kernel or single kernel, the core is re-set as idle shape by the first setting unit 101 State, it is put into CPU nuclear resource pond.So, the core originally run with micro-kernel, is arranged to the nuclear resource that idle condition is put into CPU Chi Hou, the next operation system loads core, it can be run with single kernel according to operation demand;Similarly, originally with list The core of kernel operation, it is arranged to after idle condition is put into CPU nuclear resource pond, the next operation system loads core, Ke Yigen It is run with micro-kernel according to operation demand.So, it is a kind of by being set between two kinds of core types of single kernel and micro-kernel Idle condition, core can be made to be run to dynamic translation between micro-kernel and single kernel, nuclear energy is reached and obtained according to operation demand Flexible configuration.
One embodiment of the device run according to kernel in a kind of OS provided by the invention, by list A kind of idle condition is set between two kinds of core types of kernel and micro-kernel, core dynamic between micro-kernel and single kernel can be made The operation of conversion ground, so as to which in an operating system single kernel and micro-kernel can be run simultaneously according to operation demand, have concurrently in two kinds The advantages of core type.
Figure 11 is the structural representation of another embodiment of the device that kernel is run in a kind of OS of the present invention Figure.As shown in figure 11, the device 2000 is applied to many-core platform, including:
First setting unit 201, idle condition is arranged to for the core in the nuclear resource pond by CPU.
During os starting, first start the startup core specified, the startup core can be with single kernel or micro- interior
Core is run, and stores startup program in the startup core so that operating system can pass through basic input output system (Basic Input Output System, BIOS) starts.
The startup core start after, start a core management program, by all cores form a CPU nuclear resource pond, first All cores in the nuclear resource pond of the CPU are arranged to idle condition by setting unit 201.When core is out of service, in idle shape During state, recovery is put into the nuclear resource pond of the CPU.The core of idle condition can be called as with any one in two kinds of core types Operation, wherein, core type includes single kernel and micro-kernel.
Wherein, it is to manage power supply by ACPI the core being currently running to be arranged into idle condition, and power supply is turned off.Specifically Ground, first, core is labeled as idle condition in CPU nuclear resource pond;Then, dropped to by ACPI power managements, control core S4 power levels.ACPI is APM specification, and most of computer all meets this specification, and operating system can pass through The ACPI interfaces that hardware provides carry out power operation to core, belong to prior art.
First allocation unit 202, for distributing the first address sky unitedly for single kernel and the micro-kernel Between.
Second allocation unit 203, for distributing the second address by single kernel to run the core of single kernel Space.
3rd allocation unit 204, it is the operation micro-kernel for the User space program as corresponding to the micro-kernel Core distribute the 3rd address space.
Start after core starts, also carry out the distribution of the resource of operating system, one is achieved in that by by operating system In such as internal memory, peripheral hardware resource managed concentratedly, after os starting start core on run a resource manager, System resource allocation is given to corresponding core by resource manager, and each core can only use the part resource being assigned on core.
Start collection system information after core starts, wherein, resource manager can collect memory information, obtain internal memory Size and occupancy situation.Fig. 6 is memory address space distribution schematic diagram, as shown in fig. 6, it is 4G to obtain memory address space, its In, 0~2G is allocated to user's use, and the first allocation unit 202 is that single kernel and micro-kernel distribute address space unitedly, 2G~4G such as is allocated into kernel to use.
For single kernel, resource manager can distribute some free physical internal memories and be used to single kernel, and single kernel is each Distribution physical memory is all to go to distribute from the part of resource manager distribution, and single kernel is runs the core of single kernel distributively Location space;Reclaimed after application program releasing memory by single kernel;Single kernel when occurring insufficient using internal memory to start core on The new free memory of resource manager application;Single kernel for a long time without using internal memory can be released to resource manager.
For micro-kernel, all micro-kernels share a storage management, and this storage management is unified to money Source control program application internal memory, the occupation mode of internal memory with single kernel, simply manager be not kernel but a memory management Program.
Running unit 205, for according to operation demand, by least two idle conditions in the nuclear resource pond of the CPU Core run respectively with two kinds of core types specified;Wherein, the core type includes:Single kernel and micro-kernel.
Wherein, running unit 205 can include searching unit 2051, the first loading unit 2052, add the and of unit 2053 Interrupt location 2054.
Searching unit 2051, for when according to operation demand, it is necessary to when the core is run with single kernel, in the CPU Nuclear resource pond in search an idle condition core.
First loading unit 2052, for loading single kernel mirror image to second address space.
When the number of threads for the application program that operating system to be run and few parallel demand, it is necessary to by core with single kernel Operation, searching unit 2051 search the core of an idle condition in CPU nuclear resource pond, and the first loading unit 2052 is from mirror image Memory space load address space corresponding to single kernel mirror image to the core of the core, the address space be single kernel be with list The address space of the core distribution of core operation.Single kernel mirror image is operation program necessary to the operation of single kernel.
To create situation during a single kernel, the first loading unit 2052 needs to load single kernel mirror to core the step Picture.
Also another situation, as the replacement of the first loading unit 2052, running unit 205 can also include adding list Member 2053, for the idle condition that when finding the core of idle condition in the nuclear resource pond in the CPU, will be found Core added in a manner of symmetric multiprocessor SMP into operating single kernel so that the core of the idle condition found Run with single kernel.When the core of idle condition is added in a manner of SMP to operating single kernel, now, unit 2053 is added not Need to load single kernel mirror image to core again, directly by the core of the idle condition found from CPU nuclear resource pond in a manner of SMP Add into operating single kernel.
Interrupt location 2054, for sending the interrupt message to the core, so that the core is run with single kernel.
First, interrupt location 2054 generates the interrupt message of the core, and the interrupt message includes:The storage position of single kernel mirror image Put, initial address, size and title etc..Then, interrupt location 2054 sends the interrupt message, the core of the idle condition to the core The interrupt message is received, just runs single kernel mirror image in address space on the core, so that the core is with single kernel Operation.
Searching unit 2051 be additionally operable to when according to operation demand, it is necessary to when the core is run with micro-kernel, in the CPU Nuclear resource pond in search an idle condition core.
First loading unit 2052 is additionally operable to load microkernel image to the 3rd address space.
When the number of threads and more parallel demand for the application program that operating system to be run, it is necessary to by core with micro-kernel Operation, searching unit 2051 search the core of an idle condition in CPU nuclear resource pond, and the first loading unit 2052 is from mirror image Memory space load address space corresponding to the microkernel image to the core of the core, the address space is used corresponding to micro-kernel The address space that family state program is distributed for the core of operation micro-kernel.The microkernel image is operation journey necessary to micro-kernel operation Sequence.
Interrupt location 2054 is additionally operable to send the interrupt message to the core, so that the core is run with micro-kernel.
First, interrupt location 2054 generates the interrupt message of the core, and the interrupt message includes:The storage position of microkernel image Put, initial address, size and title etc..Then, interrupt location 2054 sends the interrupt message, the core of the idle condition to the core The interrupt message is received, just runs the microkernel image in address space on the core, so that the core is with micro-kernel Operation.
Migration units 206, for when with the micro-kernel or single kernel operation multiple cores on load reduce when, By on the task immigration run in one of them described core to another the described core run with micro-kernel or single kernel.
First setting unit 201 is additionally operable to one of them described described core being arranged to idle condition, is put into the CPU's Nuclear resource pond.
When core is run with micro-kernel or single kernel, there is the process of certain operations system, such as User space task dispatching.When with micro- When load on kernel or multiple cores of single kernel operation is reduced, what migration units 206 were occupied when needing one of core to run In the operating system process queue that operating system process migration occupies to another core run with micro-kernel or single kernel, So that unfinished User space task continues according to queue, the service of not interrupt operation system.
Finally, the core of the complete task of the migration is re-set as idle condition by the first setting unit 201, is put into CPU core Resource pool.
After micro-kernel or single kernel complete task immigration, the storage management of single kernel or micro-kernel can be by respectively The single kernel mirror image for being stored in the second address space or the microkernel image for being stored in the 3rd address space are destroyed, to reclaim the ground Location space;For some kernels, what next time may load when waking up is identical mirror image, at this moment can also be retained mirror image, i.e., Delay recovery kernel so that when reselecting corresponding core operation, the mirror image of the reservation can be loaded, the device 2000 may be used also With including:
Stick unit 207, for the microkernel image to be retained in into the 3rd address space or by single kernel Mirror image is retained in second address space.
After micro-kernel or single kernel complete task immigration, operating system will not be stored in the list of the second address space respectively Kernel mirror image is stored in the microkernel image of the 3rd address space and destroyed immediately, but is retained mirror image by stick unit 207 In corresponding address space.
Memory cell 208, for storing the register information of the core.
Some data of storage in a register are stored when memory cell 208 runs micro-kernel or single kernel.
Second loading unit 209, when reselecting the core of the idle condition from the nuclear resource pond of the CPU with described micro- When kernel or single kernel are run, the register information is loaded onto to the core of the idle condition reselected, then it is described heavy The core of the idle condition newly selected is run with the micro-kernel or single kernel.
When the core that idle condition is reselected from CPU nuclear resource pond is run with micro-kernel or single kernel, second loads list Member 209, the register information of storage is loaded onto to the core of the idle condition reselected, contained in these register informations The interrupt message of startup optimization, and due to remaining microkernel image or single kernel mirror image in address space, it is not necessary to again Loading, then the core of the idle condition reselected can be with micro-kernel or the operation of single kernel.
Second setting unit 210, for the core according to the idle condition with being currently running in the nuclear resource pond of the CPU Core between physical location distance, to the idle condition core set power level.
Wakeup unit 211, for according to the power level, waking up the core of the idle condition successively.
The power-saving technology of the operating system of the present embodiment takes into full account the mesh networks of many-core platform and internuclear compatibility etc. Characteristic, first, the second setting unit 210 is according between the core being currently running in the core of idle condition and CPU nuclear resource pond The distance of physical location, the core to idle condition set power level, and power level is used to represent that the core of idle condition is waken up Ability, power level is generally divided into the ranks such as S1, S2, S3 and S4, as an example, sets from S1 to S4, and CPU core is waken up Ability diminish.Some are in the core of idle condition, and their physical location closes on behaviour area, and these cores may be because behaviour at any time The demand for making system is loaded, and therefore, the core on these positions will not set it to be in deep sleep at once, but by it It is set to S1, S2 power level.Then, wakeup unit 211 wakes up the core of idle condition according to power level successively.
Fig. 8 is the power level queue schematic diagram residing for the core of idle condition.As shown in figure 8, core0, core1 composition one Individual workspace, core10~core15 form another workspace, if workspace needs to extend, what is be waken up first should be Core2, core9, therefore, core2, core9 are under S1 states, because the possibility that core8 is waken up is also bigger, therefore Under S2 states, other core are respectively at S3 or S4 states according to OS arrangement, so not only can save but also not have too Big performance loss.
According in a kind of OS provided by the invention kernel run device another embodiment, by A kind of idle condition is set between single two kinds of core types of kernel and micro-kernel, core can be made to be moved between micro-kernel and single kernel State conversion ground operation, so as to run single kernel and micro-kernel simultaneously according to operation demand in an operating system, has two kinds concurrently The advantages of core type;Meanwhile the power-saving technology of operating system takes into full account the mesh networks of many-core platform and internuclear compatibility Etc. characteristic, it both can guarantee that systematic function and can effectively saved.
Figure 12 is the structural representation of the embodiment for the equipment that kernel is run in a kind of OS of the present invention.Such as figure Shown in 12, the equipment 3000 is applied to many-core platform, it may include:
Input unit 301, output device 302, memory 303 and processor 304 (processor 304 in the network equipment Quantity can be one or more, in Figure 12 by taking a processor as an example).In some embodiments of the invention, input unit 301st, output device 302, memory 303 and processor 304 can be connected by bus or other means, wherein, with logical in Figure 12 Cross exemplified by bus connection.
Wherein, processor 304 is used to perform following steps:
Core in CPU nuclear resource pond is arranged to idle condition;
According to operation demand, by the core of at least two idle conditions in the nuclear resource pond of the CPU respectively with two kinds of fingers Fixed core type operation;
Wherein, the core type includes:Single kernel and micro-kernel.
Processor 304 perform it is described according to operation demand, by least two idle conditions in the nuclear resource pond of the CPU Core the step of being run respectively with two kinds of core types specified, including:
When the number of threads and more parallel demand for the first application program that operating system to be run, by the CPU's The core of at least one idle condition in nuclear resource pond is run with micro-kernel;
When the number of threads for the second application program that the operating system to be run and few parallel demand, by described in The core of at least one idle condition in CPU nuclear resource pond is run with single kernel.
Processor 304 after the step of core in performing the nuclear resource pond by CPU is arranged to idle condition, and It is described according to operation demand performing, by the core of at least two idle conditions in the nuclear resource pond of the CPU respectively with two kinds Before the step of core type operation specified, in addition to perform following steps:
The first address space is distributed unitedly for single kernel and the micro-kernel;
Single kernel distributes the second address space to run the core of single kernel;
User space program corresponding to the micro-kernel distributes the 3rd address space to run the core of the micro-kernel.
Processor 304 perform it is described according to operation demand, by least two idle conditions in the nuclear resource pond of the CPU Core the step of being run respectively with two kinds of core types specified, including:
When, it is necessary to when the core is run with single kernel, one being searched in the nuclear resource pond of the CPU according to operation demand The core of individual idle condition, single kernel mirror image is loaded to second address space;
The interrupt message is sent to the core, so that the core is run with single kernel;
When, it is necessary to when the core is run with micro-kernel, one being searched in the nuclear resource pond of the CPU according to operation demand The core of individual idle condition, loading microkernel image to the 3rd address space;
The interrupt message is sent to the core, so that the core is run with micro-kernel.
Processor 304 perform it is described according to operation demand, by least two idle conditions in the nuclear resource pond of the CPU Core the step of being run respectively with two kinds of core types specified, in addition to:
When finding the core of idle condition in the nuclear resource pond in the CPU, by the idle condition found Core is added in a manner of symmetric multiprocessor SMP into operating single kernel so that the core of the idle condition found with Single kernel operation.
Processor 304 is described according to operation demand in execution, by least two idle shapes in the nuclear resource pond of the CPU After the step of core of state is run with two kinds of core types specified respectively, in addition to perform following steps:
When the load on the multiple cores run with the micro-kernel or single kernel is reduced, by one of them core On the task immigration of middle operation to another described core run with micro-kernel or single kernel, and by one of them described described core Idle condition is arranged to, is put into the nuclear resource pond of the CPU.
Processor 304 perform it is described by the task immigration run in one of them described core to micro-kernel or single kernel On another described core of operation, and one of them described described core is arranged to idle condition, is put into the nuclear resource of the CPU After the step of pond, in addition to perform following steps:
The microkernel image is retained in the 3rd address space or single kernel mirror image is retained in described In double-address space;
Store the register information of the core;
When the core that the idle condition is reselected from the nuclear resource pond of the CPU is run with the micro-kernel or single kernel When, the register information is loaded onto to the core of the idle condition reselected, then the idle condition reselected Core run with the micro-kernel or single kernel.
Processor 304 perform it is described by the task immigration run in one of them described core to micro-kernel or single kernel On another described core of operation, and one of them described described core is arranged to idle condition, is put into the nuclear resource of the CPU After the step of pond, in addition to perform following steps:
According to the physical location between the core being currently running in the core of the idle condition and the CPU nuclear resource pond Distance, the core to the idle condition set power level;
According to the power level, the core of the idle condition is waken up successively.
It is understood that the function of each functional module of the equipment 3000 of the present embodiment can be according to above method embodiment In method specific implementation, its specific implementation process is referred to the associated description of above method embodiment, and here is omitted.
The equipment that kernel is run in a kind of OS provided according to embodiments of the present invention, by single kernel and Between two kinds of core types of micro-kernel a kind of idle condition is set, core dynamic translation between micro-kernel and single kernel can be made Operation, so as to which in an operating system single kernel and micro-kernel can be run simultaneously according to operation demand, have two kinds of core types concurrently The advantages of.
It is apparent to those skilled in the art that for convenience and simplicity of description, the equipment of foregoing description With the specific work process of module, the corresponding process description in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed apparatus and method, it can be passed through Its mode is realized.For example, device embodiment described above is only schematical, for example, the division of the module, only Only a kind of division of logic function, there can be other dividing mode when actually realizing, such as multiple module or components can be tied Close or be desirably integrated into another equipment, or some features can be ignored, or do not perform.It is another, it is shown or discussed Mutual coupling or direct-coupling or communication connection can be indirect coupling by some communication interfaces, device or module Close or communicate to connect, can be electrical, mechanical or other forms.
The module illustrated as separating component can be or may not be physically separate, show as module The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.It can select according to the actual needs therein some or all of, module realizes this embodiment scheme Purpose.
In addition, each functional module in each embodiment of the present invention can be integrated in a processing module, can also That modules are individually physically present, can also two or more modules be integrated in a module.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to The technical scheme described in foregoing embodiments can so be modified, either which part or all technical characteristic are entered Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology The scope of scheme.

Claims (14)

1. a kind of method that kernel is run in OS, it is characterised in that applied to many-core platform, including:
Core in CPU nuclear resource pond is arranged to idle condition;
According to operation demand, the core of at least two idle conditions in the nuclear resource pond of the CPU is specified with two kinds respectively Core type is run, wherein, the core type includes:Single kernel and micro-kernel;
When the load on the multiple cores run with micro-kernel or single kernel is reduced, by what is run in one of them described core On task immigration to another described core run with micro-kernel or single kernel, and one of them described described core is arranged to empty Not busy state, it is put into the nuclear resource pond of the CPU;
The microkernel image of the core run with micro-kernel is retained in the 3rd address space or the list by the core run with single kernel Kernel mirror image is retained in the second address space;
The register information of the storage core run with micro-kernel or single kernel;
When the core that the idle condition is reselected from the nuclear resource pond of the CPU is run with micro-kernel or single kernel, by institute The core that register information is loaded onto the idle condition reselected is stated, then the core of the idle condition reselected is with micro- Kernel or the operation of single kernel.
2. the method as described in claim 1, it is characterised in that it is described according to operation demand, by the nuclear resource pond of the CPU The core of at least two idle conditions run respectively with two kinds of core types specified, including:
When the number of threads and more parallel demand for the first application program that operating system to be run, the core of the CPU is provided The core of at least one idle condition in the pond of source is run with micro-kernel;
When the number of threads for the second application program that the operating system to be run and few parallel demand, by the CPU's The core of at least one idle condition in nuclear resource pond is run with single kernel.
3. method as claimed in claim 2, it is characterised in that the core in the nuclear resource pond by CPU is arranged to idle shape After state, and described according to operation demand, by the core of at least two idle conditions in the nuclear resource pond of the CPU respectively with Before two kinds of core type operations specified, in addition to:
The first address space is distributed unitedly for single kernel and micro-kernel;
Single kernel distributes the second address space to run the core of single kernel;
User space program corresponding to the micro-kernel distributes the 3rd address space to run the core of the micro-kernel.
4. the method as described in claim 1, it is characterised in that the core in the nuclear resource pond by CPU is arranged to idle shape After state, and described according to operation demand, by the core of at least two idle conditions in the nuclear resource pond of the CPU respectively with Before two kinds of core type operations specified, in addition to:
The first address space is distributed unitedly for single kernel and micro-kernel;
Single kernel distributes the second address space to run the core of single kernel;
User space program corresponding to the micro-kernel distributes the 3rd address space to run the core of the micro-kernel.
5. method as claimed in claim 4, it is characterised in that it is described according to operation demand, by the nuclear resource pond of the CPU The core of at least two idle conditions run respectively with two kinds of core types specified, including:
When, it is necessary to when the core is run with single kernel, a sky is searched in the nuclear resource pond of the CPU according to operation demand The core of not busy state, single kernel mirror image is loaded to second address space;
Interrupt message is sent to the core, so that the core is run with single kernel;
When, it is necessary to when the core is run with micro-kernel, a sky is searched in the nuclear resource pond of the CPU according to operation demand The core of not busy state, loading microkernel image to the 3rd address space;
The interrupt message is sent to the core, so that the core is run with micro-kernel.
6. method as claimed in claim 5, it is characterised in that it is described according to operation demand, by the nuclear resource pond of the CPU The core of at least two idle conditions run respectively with two kinds of core types specified, in addition to:
When finding the core of idle condition in the nuclear resource pond in the CPU, by the core of the idle condition found with Symmetric multiprocessor SMP modes are added into operating single kernel, so that the core of the idle condition found is with list Core is run.
7. the method as described in claim 1, it is characterised in that it is described by the task immigration run in one of them described core extremely On another the described core run with micro-kernel or single kernel, and one of them described described core is arranged to idle condition, put After the nuclear resource pond for entering the CPU, in addition to:
According to the physical location between the core being currently running in the core of the idle condition and the CPU nuclear resource pond away from From the core to the idle condition sets power level;
According to the power level, the core of the idle condition is waken up successively.
A kind of 8. device that kernel is run in OS, it is characterised in that applied to many-core platform, including:
First setting unit, idle condition is arranged to for the core in the nuclear resource pond by CPU;
Running unit, for according to operation demand, the core of at least two idle conditions in the nuclear resource pond of the CPU to be distinguished Run with two kinds of core types specified, wherein, the core type includes:Single kernel and micro-kernel;
Migration units, for when with micro-kernel or single kernel operation multiple cores on load reduce when, by one of them On the task immigration run in the core to another described core run with micro-kernel or single kernel;
First setting unit is additionally operable to one of them described described core being arranged to idle condition, is put into the core of the CPU Resource pool;
Stick unit, for the microkernel image of the core run with micro-kernel being retained in into the 3rd address space or will be with single kernel Single kernel mirror image of the core of operation is retained in the second address space;
Memory cell, for storing the register information of the core run with micro-kernel or single kernel;
Second loading unit, for when from the nuclear resource pond of the CPU reselect the core of the idle condition with micro-kernel or During single kernel operation, the register information is loaded onto to the core of the idle condition reselected, then it is described to reselect The core of idle condition run with micro-kernel or single kernel.
9. device as claimed in claim 8, it is characterised in that the running unit includes:
Micro-kernel running unit is more for the number of threads of the first application program to be run and parallel demand when operating system When, the core of at least one idle condition in the nuclear resource pond of the CPU is run with micro-kernel;
Single kernel running unit, for the number of threads of the second application program to be run when the operating system and parallel need to When asking few, the core of at least one idle condition in the nuclear resource pond of the CPU is run with single kernel.
10. device as claimed in claim 9, it is characterised in that also include:
First allocation unit, for distributing the first address space unitedly for single kernel and the micro-kernel;
Second allocation unit, for distributing the second address space by single kernel to run the core of single kernel;
3rd allocation unit, distributed for the User space program as corresponding to the micro-kernel to run the core of the micro-kernel 3rd address space.
11. device as claimed in claim 8, it is characterised in that also include:
First allocation unit, for distributing the first address space unitedly for single kernel and the micro-kernel;
Second allocation unit, for distributing the second address space by single kernel to run the core of single kernel;
3rd allocation unit, distributed for the User space program as corresponding to the micro-kernel to run the core of the micro-kernel 3rd address space.
12. device as claimed in claim 11, it is characterised in that the running unit includes:
Searching unit, for when according to operation demand, it is necessary to when the core is run with single kernel, in the nuclear resource of the CPU The core of an idle condition is searched in pond;
First loading unit, for loading single kernel mirror image to second address space;
Interrupt location, for sending interrupt message to the core, so that the core is run with single kernel;
The searching unit be additionally operable to when according to operation demand, it is necessary to when the core is run with micro-kernel, in the core of the CPU The core of an idle condition is searched in resource pool;
First loading unit is additionally operable to load microkernel image to the 3rd address space;
The interrupt location is additionally operable to send the interrupt message to the core, so that the core is run with micro-kernel.
13. device as claimed in claim 12, it is characterised in that the running unit also includes:
Unit is added, for the sky that when finding the core of idle condition in the nuclear resource pond in the CPU, will be found The core of not busy state is added in a manner of symmetric multiprocessor SMP into operating single kernel, so that the idle shape found The core of state is run with single kernel.
14. device as claimed in claim 8, it is characterised in that also include:
Second setting unit, for the core that is currently running in the core according to the idle condition and the CPU nuclear resource pond it Between physical location distance, to the idle condition core set power level;
Wakeup unit, for according to the power level, waking up the core of the idle condition successively.
CN201310079899.6A 2013-03-13 2013-03-13 The method and device that kernel is run in a kind of OS Expired - Fee Related CN104050137B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201310079899.6A CN104050137B (en) 2013-03-13 2013-03-13 The method and device that kernel is run in a kind of OS
PCT/CN2014/073086 WO2014139379A1 (en) 2013-03-13 2014-03-07 Method and device for kernel running in heterogeneous operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310079899.6A CN104050137B (en) 2013-03-13 2013-03-13 The method and device that kernel is run in a kind of OS

Publications (2)

Publication Number Publication Date
CN104050137A CN104050137A (en) 2014-09-17
CN104050137B true CN104050137B (en) 2018-02-09

Family

ID=51502999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310079899.6A Expired - Fee Related CN104050137B (en) 2013-03-13 2013-03-13 The method and device that kernel is run in a kind of OS

Country Status (2)

Country Link
CN (1) CN104050137B (en)
WO (1) WO2014139379A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105528330B (en) * 2014-09-30 2019-05-28 杭州华为数字技术有限公司 The method, apparatus of load balancing is gathered together and many-core processor
CN108595270B (en) * 2018-04-27 2021-07-23 新华三信息安全技术有限公司 Memory resource recovery method and device
CN110083469B (en) * 2019-05-11 2021-06-04 广东财经大学 Method and system for organizing and running unified kernel by heterogeneous hardware
CN112395079B (en) * 2019-08-19 2022-10-04 无锡江南计算技术研究所 Operation core job migration method under heterogeneous many-core architecture
CN113127069B (en) * 2019-12-31 2023-08-22 成都鼎桥通信技术有限公司 Dual-system-based location service management method and device and terminal equipment
CN111124522B (en) * 2020-04-01 2020-08-04 广东戴维利科技有限公司 Method and system for mixing microkernel and macrokernel
CN111488219B (en) * 2020-04-07 2022-08-02 中国科学院自动化研究所 Ethernet data flow recording method for high-speed data acquisition system
CN113626190B (en) * 2021-08-04 2022-10-18 电子科技大学 Load balancing method in microkernel operating system facing multi-kernel environment
CN114090086B (en) * 2021-11-23 2023-05-30 西安微电子技术研究所 ZynqMP platform-based embedded operating system quick starting method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101727351A (en) * 2009-12-14 2010-06-09 北京航空航天大学 Multicore platform-orientated asymmetrical dispatcher for monitor of virtual machine and dispatching method thereof
CN101788920A (en) * 2010-02-05 2010-07-28 北京航空航天大学 CPU virtualization method based on processor partitioning technology
CN102831011A (en) * 2012-08-10 2012-12-19 上海交通大学 Task scheduling method and device based on multi-core system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101727351A (en) * 2009-12-14 2010-06-09 北京航空航天大学 Multicore platform-orientated asymmetrical dispatcher for monitor of virtual machine and dispatching method thereof
CN101788920A (en) * 2010-02-05 2010-07-28 北京航空航天大学 CPU virtualization method based on processor partitioning technology
CN102831011A (en) * 2012-08-10 2012-12-19 上海交通大学 Task scheduling method and device based on multi-core system

Also Published As

Publication number Publication date
WO2014139379A1 (en) 2014-09-18
CN104050137A (en) 2014-09-17

Similar Documents

Publication Publication Date Title
CN104050137B (en) The method and device that kernel is run in a kind of OS
CN101946235B (en) Method and apparatus for moving threads in a shared processor partitioning environment
TWI569202B (en) Apparatus and method for adjusting processor power usage based on network load
US8423811B2 (en) Transparently increasing power savings in a power management environment
US8448006B2 (en) Performing virtual and/or physical resource management for power management
CN101604264B (en) Task scheduling method and system for supercomputer
CN104598426B (en) Method for scheduling task for heterogeneous multi-nucleus processor system
CN102812439B (en) For the method and system of assigned tasks in multiprocessor computer system
US9201490B2 (en) Power management for a computer system
US20110131580A1 (en) Managing task execution on accelerators
CN102158513A (en) Service cluster and energy-saving method and device thereof
CN105808334A (en) MapReduce short job optimization system and method based on resource reuse
CN102495756A (en) Method and system for switching operating system between different central processing units
CN101901159B (en) Method and system for loading Linux operating system on multi-core CPU
CN110297661B (en) Parallel computing method, system and medium based on AMP framework DSP operating system
CN107003713B (en) Event driven method and system for logical partitioning for power management
CN101414270A (en) Method for implementing assist nuclear task dynamic PRI scheduling with hardware assistant
US20160314024A1 (en) Clearance mode in a multicore processor system
CN111475012A (en) Dynamic power routing to hardware accelerators
CN110399034A (en) A kind of power consumption optimization method and terminal of SoC system
CN101799772B (en) Kernel dispatching method, kernel backup method and multi-core processor
CN111459648B (en) Heterogeneous multi-core platform resource optimization method and device for application program
CN102141920A (en) Method for dynamically configuring C-State and communication equipment
CN104076892A (en) Power supply management method and power supply management system
US20180341482A1 (en) Method and arrangement for utilization of a processing arrangement

Legal Events

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

Granted publication date: 20180209

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