CN104050137A - Method and device for operating inner cores in heterogeneous operation system - Google Patents
Method and device for operating inner cores in heterogeneous operation system Download PDFInfo
- Publication number
- CN104050137A CN104050137A CN201310079899.6A CN201310079899A CN104050137A CN 104050137 A CN104050137 A CN 104050137A CN 201310079899 A CN201310079899 A CN 201310079899A CN 104050137 A CN104050137 A CN 104050137A
- Authority
- CN
- China
- Prior art keywords
- core
- kernel
- micro
- idle condition
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Power Sources (AREA)
- Stored Programmes (AREA)
- Multi Processors (AREA)
Abstract
The invention discloses a method and a device for operating inner cores in a heterogeneous operation system. The method and the device are applied to a many-core platform. The method comprises the following steps: setting cores in a core resource pool of a CPU (central processing unit) as an idle state; operating at least two cores in the idle state in the core resource pool of the CPU in two designated inner core types according to an operation requirement respectively, wherein the inner core types comprise a single inner core type and a micro inner core type. The invention further discloses the corresponding device for operating the inner cores in the heterogeneous operation system. By setting the idle state between the single inner core type and the micro inner core type, the cores can be operated in a mode of dynamically converting the micro inner core type and the single inner core type, so that single inner cores and micro inner cores can be operated simultaneously according to the operation requirement in the operation system, and the advantages of the two inner core types are integrated.
Description
Technical field
The present invention relates to many core operation system technologies field, relate in particular to method and the device of kernel operation in a kind of OS.
Background technology
At present, processor has entered the multi-core/many-core epoch, but, current operating system (Operating System, OS) only with symmetric multiprocessor (Symmetric Multi-Processing, SMP) mode is used multi-core/many-core processor, can not make full use of the parallel processing capability of multi-core/many-core processor.Experiment showed, that working as processor exceedes 16 cores, the performance of existing (SuSE) Linux OS no longer linear growth reduces on the contrary.Therefore, at present many core platforms have been produced the operating system of many researches, the feature of these many core OS is: microkernel architecture, and existing many core OS have adopted microkernel architecture; Many core design, can avoid the performance bottleneck of single kernel; Adopt message communicating, this technology can promote the extendability of many core OS.
An outstanding thought of Mach structure is more set up and function is put in higher level (and user model) and goes to move in operating system, and stays the next one little kernel of trying one's best, with it carry out the most basic kernel function of complete operation system.As shown in Figure 1, micro-kernel generally only provides basic hardware operation interface, and the function that OS must be provided operates in user's state with the form of system service, and the service of user's calling system is finished the work; Service is isolation each other, even if other modules appear extremely also can not interfering with in certain service; Between service and service, work by the mode of interprocess communication (Inter-Process Communication, IPC).Existing Mach is all based on CLIENT/SERVER MODEL, user need to call a kind of system service by the notice OS that sends a request message to OS, OS dispatches corresponding service processes after receiving message, and after completing, the mode by message communicating notifies result to user again.As shown in Figure 2, be the process of a calling system service.
Although the message communicating mode of micro-kernel has strengthened the extendability of OS, affect the performance of operating system service.Compared with single kernel operations system, complete same primary system service, the expense of micro-kernel than single kernel many several times even more.The service that all OS of single kernel operations system (taking (SuSE) Linux OS as example) provide is all programmed in code in kernel module, completing primary system, to serve needed process be that user program is absorbed in kernel, then served by kernel executive system, after completing, return to user's state from kernel state, expense is only that 2 contexts switch.And Mach completes and once calls normally 4 the contexts switchings of required expense.Each switching is all accompanied by and is absorbed in kernel and returns to user's state, and it is very large that communication and context switch the expense of bringing, and performance issue is very serious.
In sum, how to process better the operation of single kernel and micro-kernel, Hoisting System treatment effeciency has become industry problem in the urgent need to address.
Summary of the invention
In view of this, the embodiment of the present invention provides method and the device of the operation of kernel in a kind of OS, cannot the single kernel of fine processing and the problem of micro-kernel operation for what solve that prior art exists.
First aspect, provides a kind of method that in OS, kernel moves, and is applied to many core platforms, comprising:
Core in the nuclear resource pond of CPU is set to idle condition;
According to operation demand, the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively;
Wherein, described kernel type comprises: single kernel and micro-kernel.
In the possible implementation of the first, described according to operation demand, the core of at least two idle conditions in the nuclear resource pond of described CPU, respectively with the kernel type operation of two kinds of appointments, being comprised:
When the number of threads of the first application program that will move when operating system and parallel demand are many, the core of at least one idle condition in the nuclear resource pond of described CPU is moved with micro-kernel;
When the number of threads of the second application program that will move when described operating system and parallel demand are few, the core of at least one idle condition in the nuclear resource pond of described CPU is moved with single kernel.
The implementation possible according to the first of first aspect or first aspect, in the possible implementation of the second, after core in the nuclear resource pond of described CPU is set to idle condition, and described according to operation demand, before the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively, also comprise:
For described single kernel and described micro-kernel are distributed the first address space unitedly;
Described single kernel is that the core of the described single kernel of operation distributes the second address space;
User's state program that described micro-kernel is corresponding is that the core of the described micro-kernel of operation distributes the 3rd address space.
The implementation possible according to the second of first aspect, in the third possible implementation, described according to operation demand, the core of at least two idle conditions in the nuclear resource pond of described CPU, respectively with the kernel type operation of two kinds of appointments, being comprised:
When according to operation demand, when described core need to be moved with single kernel, in the nuclear resource pond of described CPU, search the core of an idle condition, load single kernel mirror image to described the second address space;
Send described interrupt message to described core, so that described core moves with single kernel;
When according to operation demand, when described core need to be moved with micro-kernel, in the nuclear resource pond of described CPU, search the core of an idle condition, load micro-kernel mirror image to described the 3rd address space;
Send described interrupt message to described core, so that described core moves with micro-kernel.
According to the third possible implementation of first aspect, in the 4th kind of possible implementation, described according to operation demand, the core of at least two idle conditions in the nuclear resource pond of described CPU, respectively with the kernel type operation of two kinds of appointments, is also comprised:
In the time finding the core of idle condition in the nuclear resource pond at described CPU, the core of the described idle condition finding is added in operating single kernel in symmetric multiprocessor SMP mode, so that the core of the described idle condition finding moves with single kernel.
According to the 4th kind of possible implementation of the third possible implementation of the possible implementation of the second of the possible implementation of the first of first aspect or first aspect or first aspect or first aspect or first aspect, in the 5th kind of possible implementation, described according to operation demand, after the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively, also comprise:
In the time that the load on the multiple described core with described micro-kernel or the operation of single kernel reduces, by the task immigration moving in core described in one of them to on core described in another of micro-kernel or single kernel operation, and described described in one of them core be set to idle condition, put into the nuclear resource pond of described CPU.
According to the 5th of first aspect the kind of possible implementation, in the 6th kind of possible implementation, described by the task immigration moving in core described in one of them to on core described in another of micro-kernel or single kernel operation, and described described in one of them core be set to idle condition, after putting into the nuclear resource pond of described CPU, also comprise:
Described micro-kernel mirror image is retained in to described the 3rd address space or described single kernel mirror image is retained in described the second address space;
Store the register information of described core;
The core that reselects described idle condition when the nuclear resource pond from described CPU is during with described micro-kernel or the operation of single kernel, the core of the idle condition reselecting described in described register information is loaded on, the core of the idle condition reselecting described in is with described micro-kernel or the operation of 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 the 7th kind of possible implementation, described by the task immigration moving in core described in one of them to on core described in another of micro-kernel or single kernel operation, and described described in one of them core be set to idle condition, after putting into the nuclear resource pond of described CPU, also comprise:
According to the distance of the physical location between the core moving in the nuclear resource pond of the core of described idle condition and described CPU, power level is set to the core of described idle condition;
According to described power level, wake successively the core of described idle condition up.
Second aspect, provides the device that in a kind of OS, kernel moves, and is applied to many core platforms, comprising:
The first setting unit, is set to idle condition for the core in the nuclear resource pond of CPU;
Running unit, for according to operation demand, moves the core of at least two idle conditions in the nuclear resource pond of described CPU respectively with the kernel type of two kinds of appointments;
Wherein, described kernel type comprises: single kernel and micro-kernel.
In the possible implementation of the first, described running unit comprises:
Micro-kernel running unit,, moves the core of at least one idle condition in the nuclear resource pond of described CPU when many for the number of threads of the first application program that will move when operating system and parallel demand with micro-kernel;
Single kernel running unit, while lacking, moves the core of at least one idle condition in the nuclear resource pond of described CPU for the number of threads of the second application program that will move when described operating system and parallel demand with single kernel.
The implementation possible according to the first of second aspect or second aspect, in the possible implementation of the second, described device also comprises:
The first allocation unit, is used to described single kernel and described micro-kernel to distribute the first address space unitedly;
The second allocation unit, for by described single kernel be operation described single kernel core distribute the second address space;
The 3rd allocation unit, for by user's state program corresponding to described micro-kernel being core distribution the 3rd address space of the described micro-kernel of operation.
The implementation possible according to the second of second aspect, in the third possible implementation, described running unit comprises:
Search unit, for when according to operation demand, when described core need to be moved with single kernel, in the nuclear resource pond of described CPU, search the core of an idle condition;
The first loading unit, for loading single kernel mirror image to described the second address space;
Interrupt location, for sending described interrupt message to described core, so that described core moves with single kernel;
The core of an idle condition, also for when according to operation demand, when described core need to be moved with micro-kernel, is searched in the described unit of searching in the nuclear resource pond of described CPU;
Described the first loading unit is also for loading micro-kernel mirror image to described the 3rd address space;
Described interrupt location is also for sending described interrupt message to described core, so that described core moves with micro-kernel.
According to the third possible implementation of second aspect, in the 4th kind of possible implementation, described running unit also comprises:
Add unit, for in the time finding the core of idle condition in the nuclear resource pond of described CPU, the core of the described idle condition finding is added in operating single kernel in symmetric multiprocessor SMP mode, so that the core of the described idle condition finding moves with single kernel.
According to the 4th kind of possible implementation of the third possible implementation of the possible implementation of the second of the possible implementation of the first of second aspect or second aspect or second aspect or second aspect or second aspect, in the 5th kind of possible implementation, described device also comprises:
Migration units, in the time that the load on the multiple described core with the operation of described micro-kernel or single kernel reduces, by the task immigration moving in core described in one of them to on core described in another of micro-kernel or the operation of single kernel;
Described the first setting unit also for described described in one of them core be set to idle condition, put into the nuclear resource pond of described CPU.
According to the 5th of second aspect the kind of possible implementation, in the 6th kind of possible implementation, described device also comprises:
Stick unit, for being retained in described micro-kernel mirror image described the 3rd address space or described single kernel mirror image being retained in to described the second address space;
Storage unit, for storing the register information of described core;
The second loading unit, while operation with described micro-kernel or single kernel for reselect the core of described idle condition when the nuclear resource pond from described CPU, the core of the idle condition reselecting described in described register information is loaded on, the core of the idle condition reselecting described in is with described micro-kernel or the operation of 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 the 7th kind of possible implementation, described device also comprises:
The second setting unit, for the distance of the physical location between the core moving according to the nuclear resource pond of the core of described idle condition and described CPU, arranges power level to the core of described idle condition;
Wakeup unit, for according to described power level, wakes the core of described idle condition up successively.
Adopt the method for kernel operation in a kind of OS provided by the invention and the technical scheme of device, by a kind of idle condition being set between single kernel and two kinds of kernel types of micro-kernel, can make core move to dynamic translation between micro-kernel and single kernel, thereby can move single kernel and micro-kernel according to operation demand in operating system simultaneously, have the advantage of two kinds of kernel types concurrently, promoted system treatment effeciency.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is Mach configuration diagram in prior art;
Fig. 2 is the method flow diagram of Mach call flow in prior art;
Fig. 3 is the method flow diagram of an embodiment of the method for kernel operation 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 diagram of another embodiment of the method for kernel operation in a kind of OS of the present invention;
Fig. 6 is memory address space distribution schematic diagram;
Fig. 7 is the method flow diagram that postpones to reclaim kernel;
Fig. 8 is the residing power level queue of the core of idle condition schematic diagram;
Fig. 9 is the structural representation of an embodiment of the device of kernel operation 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 of kernel operation in a kind of OS of the present invention;
Figure 12 is the structural representation of the embodiment of the equipment of kernel operation 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 clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 3 is the method flow diagram of an embodiment of the method for kernel operation in a kind of OS of the present invention.As shown in Figure 3, the method is applied to many core platforms, comprises the following steps:
Step S101, the core in the nuclear resource pond of CPU is set to idle condition.
Fig. 4 is the view of operating system center (core).As shown in Figure 4, all core is divided into three kinds of states by operating system: with micro-kernel operation, with single kernel operation and idle condition, kernel type when operation comprises: single kernel and micro-kernel, and set up the nuclear resource pond of a CPU, in the time of os starting, the core in the nuclear resource pond of CPU is set to idle condition; And out of service when core, in the time of idle condition, reclaim the nuclear resource pond of putting into this CPU.Idle condition endorse to call any one operation into in two kinds of kernel types.
Wherein, it is by ACPI managing electrical power that the core moving is set to idle condition, and power supply is turned off.Particularly, first, in the nuclear resource pond of CPU, core is labeled as to idle condition; Then,, by ACPI power management, control core and drop to S4 power level.ACPI is Advanced Program Zoom specification, and most of computing machine all meets this specification, and the ACPI interface that operating system can provide by hardware carries out power operation to core, belongs to prior art.
Step S102, according to operation demand, moves the core of at least two idle conditions in the nuclear resource pond of described CPU respectively with the kernel type of two kinds of appointments.
In this step, according to operation demand, the core of at least two idle conditions in the nuclear resource pond of CPU is moved with the kernel type of two kinds of appointments respectively; Wherein, this kernel type comprises: single kernel and micro-kernel.Particularly, the number of threads of each application program that operating system will be moved and parallel demand sometimes difference are very large, therefore, when the number of threads of the application program that will move when operating system and parallel demand are many, the core of at least one idle condition in the nuclear resource pond of described CPU is specified and moved with micro-kernel; When the number of threads of the application program that will move when described operating system and parallel demand are few, the core of at least one idle condition in the nuclear resource pond of described CPU is specified with single kernel operation.
In the time that core moves with micro-kernel, this micro-kernel generally only provides basic hardware operation interface, and the function that OS must be provided operates in user's state with the form of system service, and the service of user's calling system is finished the work; Service is isolation each other, even if other modules appear extremely also can not interfering with in certain service; The mode of communicating by letter by IPC between service and service is worked.Mach is based on CLIENT/SERVER MODEL, user need to call a kind of system service by the notice OS that sends a request message to OS, OS dispatches corresponding service processes after receiving message, and after completing, the mode by message communicating notifies result to user again.
When core is during with the operation of single kernel, the service that all OS provide is all programmed in code in kernel module, and completing primary system, to serve needed process be that user program is absorbed in kernel, then served by kernel executive system, after completing, returns to user's state from kernel state.
In the time that core exits the operation of micro-kernel or single kernel, all this core is re-set as to idle condition, put into the nuclear resource pond of CPU.Like this, originally, with the core of micro-kernel operation, be set to idle condition and put into behind the nuclear resource pond of CPU, this core of next operation system loads, can move it according to operation demand with single kernel; Similarly, originally, with the core of single kernel operation, be set to idle condition and put into behind the nuclear resource pond of CPU, this core of next operation system loads, can move it according to operation demand with micro-kernel.Like this, by between single kernel and two kinds of kernel types of micro-kernel, a kind of idle condition being set, can make core move to dynamic translation between micro-kernel and single kernel, make nuclear energy enough obtain flexible configuration according to operation demand.
According to an embodiment of the method for kernel operation in a kind of OS provided by the invention, by a kind of idle condition being set between single kernel and two kinds of kernel types of micro-kernel, can make core move to dynamic translation between micro-kernel and single kernel, thereby in operating system, can move single kernel and micro-kernel according to operation demand simultaneously, have the advantage of two kinds of kernel types concurrently.
Fig. 5 is the method flow diagram of another embodiment of the method for kernel operation in a kind of OS of the present invention.As shown in Figure 5, the method is applied to many core platforms, comprises the following steps:
Step S201, the core in the nuclear resource pond of CPU is set to idle condition.
When os starting, first start the startup core of an appointment, this startup is endorsed with single kernel or micro-kernel operation, in this startup core, stores start-up routine, making operating system can pass through Basic Input or Output System (BIOS) (Basic Input Output System, BIOS) starts.
This startup core starts a core supervisory routine after starting, and all core is formed to the nuclear resource pond of a CPU, and all cores in the nuclear resource pond of this CPU are set to idle condition.Out of service when core, in the time of idle condition, reclaim the nuclear resource pond of putting into this CPU.The endorsing of idle condition called as any one operation with in two kinds of kernel types, and wherein, kernel type comprises single kernel and micro-kernel.
Wherein, it is by ACPI managing electrical power that the core moving is set to idle condition, and power supply is turned off.Particularly, first, in the nuclear resource pond of CPU, core is labeled as to idle condition; Then,, by ACPI power management, control core and drop to S4 power level.ACPI is Advanced Program Zoom specification, and most of computing machine all meets this specification, and the ACPI interface that operating system can provide by hardware carries out power operation to core, belongs to prior art.
Step S202, for described single kernel and described micro-kernel are distributed the first address space unitedly.
Step S203, described single kernel is that the core of the described single kernel of operation distributes the second address space.
Step S204, user's state program that described micro-kernel is corresponding is that the core of the described micro-kernel of operation distributes the 3rd address space.
Start after core startup, also carry out the distribution of the resource of operating system, implementation be by by operating system as the resource such as internal memory, peripheral hardware is managed concentratedly, after os starting, on startup core, move a resource manager, give corresponding core by resource manager by system resource allocation, each core can only use the part resource being assigned on core.
Start core and start collection system information later, wherein, resource manager can be collected memory information, obtains the size of internal memory and takies situation.Fig. 6 is memory address space distribution schematic diagram, and as shown in Figure 6, obtaining memory address space is 4G, and wherein, 0~2G is allocated to user and uses, and operating system is single kernel and micro-kernel unified distribution address space, uses as 2G~4G being allocated to kernel.
For single kernel, resource manager can distribute some idle physical memories to use to single kernel, and it is all the part of distributing from resource manager, to go to distribute that single kernel distributes physical memory at every turn, and single kernel is that the core of the single kernel of operation distributes address space; After application program releasing memory, reclaimed by single kernel; Single kernel is using internal memory to occur when not enough to the new free memory of resource manager application starting on core; The internal memory that single kernel does not use for a long time can discharge to resource manager.
For micro-kernel, all micro-kernel is shared a storage management, and this storage management unification is to resource manager application internal memory, and the use-pattern of internal memory is with single kernel, and just supvr is not kernel but a storage management.
Step S205 when according to operation demand, when described core need to be moved with single kernel, searches the core of an idle condition in the nuclear resource pond of described CPU, loads single kernel mirror image to described the second address space.
In this step, when the number of threads of the application program that will move when operating system and parallel demand are few, core need to be moved with single kernel, operating system is searched the core of an idle condition in the nuclear resource pond of CPU, the single kernel mirror image that loads this core from the storage space of mirror image is checked the address space of answering to this, and this address space is that single kernel is the address space distributing with the core of single kernel operation.This list kernel mirror image is that single kernel moves necessary working procedure.
This step is the situation while creating a single kernel, and operating system need to load single kernel mirror image to core.
Also has another kind of situation, when the core of idle condition is added to operating single kernel in SMP mode, now, operating system does not need to load single kernel mirror image to core again, directly the core of the idle condition finding from the nuclear resource pond of CPU is added in operating single kernel in SMP mode.
Step S206, sends described interrupt message to described core, so that described core moves with single kernel.
First, operating system generates the interrupt message of this core, and this interrupt message comprises: memory location, start address, size and the title etc. of single kernel mirror image.Then, operating system sends this interrupt message to this core, and the core of this idle condition receives this interrupt message, just the single kernel mirror image in address space is moved on this core, thereby this core is moved with single kernel.
Step S207 when according to operation demand, when described core need to be moved with micro-kernel, searches the core of an idle condition in the nuclear resource pond of described CPU, loads micro-kernel mirror image to described the 3rd address space.
In this step, when the number of threads of the application program that will move when operating system and parallel demand are many, core need to be moved with micro-kernel, operating system is searched the core of an idle condition in the nuclear resource pond of CPU, the micro-kernel mirror image that loads this core from the storage space of mirror image is checked the address space of answering to this, and this address space is that user's state program that micro-kernel is corresponding is the address space of the core distribution of operation micro-kernel.This micro-kernel mirror image is that micro-kernel moves necessary working procedure.
Step S208, sends described interrupt message to described core, so that described core moves with micro-kernel.
Be similar to step S206, first, operating system generates the interrupt message of this core, and this interrupt message comprises: memory location, start address, size and the title etc. of micro-kernel mirror image.Then, operating system sends this interrupt message to this core, and the core of this idle condition receives this interrupt message, just the micro-kernel mirror image in address space is moved on this core, thereby this core is moved with micro-kernel.
Step S209, in the time that the load on the multiple described core with described micro-kernel or the operation of single kernel reduces, by the task immigration moving in core described in one of them to on core described in another of micro-kernel or single kernel operation, and described described in one of them core be set to idle condition, put into the nuclear resource pond of described CPU.
In the time that core moves with micro-kernel or single kernel, there is the process of certain operations system, as user's state task dispatching.In the time that the load on the multiple cores with micro-kernel or the operation of single kernel reduces, the operating system process migration occupying while needing one of them core operation is to the operating system process queue occupying with another core of micro-kernel or the operation of single kernel, uncompleted user's state task is proceeded, the service of not interrupt operation system according to queue.
Finally, the core of the complete task of this migration is re-set as to idle condition, puts into the nuclear resource pond of CPU.
When micro-kernel or single kernel are finished the work after migration, the storage management of single kernel or micro-kernel can be destroyed the micro-kernel mirror image that is kept at respectively single kernel mirror image of the second address space or is kept at the 3rd address space, to reclaim this address space; For some kernels, what when wake up next time, may load is identical mirror image, at this moment also mirror image can be retained, postpone to reclaim kernel, make, in the time reselecting corresponding core operation, can load the mirror image of this reservation, as shown in Figure 7, the step of concrete delay recovery kernel is as follows:
Step S2091, is retained in described micro-kernel mirror image described the 3rd address space or described single kernel mirror image is retained in described the second address space.
When micro-kernel or single kernel are finished the work after migration, operating system is not destroyed the micro-kernel mirror image that is kept at respectively single kernel mirror image of the second address space or is kept at the 3rd address space immediately, but is retained in corresponding address space.
Step S2092, stores the register information of described core.
Some data that are stored in register during by micro-kernel or the operation of single kernel are stored.
Step S2093, the core that reselects described idle condition when the nuclear resource pond from described CPU is during with described micro-kernel or the operation of single kernel, the core of the idle condition reselecting described in described register information is loaded on, the core of the idle condition reselecting described in is with described micro-kernel or the operation of single kernel.
The core that reselects idle condition when the nuclear resource pond from CPU is during with micro-kernel or the operation of single kernel, the register information of storage is loaded on to the core of this idle condition reselecting, in these register informations, comprise the interrupt message that starts operation, and owing to having retained micro-kernel mirror image or single kernel mirror image in address space, do not need to reload, endorsing with micro-kernel or the operation of single kernel of this idle condition reselecting.
Step S210, according to the distance of the physical location between the core moving in the nuclear resource pond of the core of described idle condition and described CPU, arranges power level to the core of described idle condition.
Step S211, according to described power level, wakes the core of described idle condition up successively.
The power-saving technology of the operating system of the present embodiment takes into full account the characteristic such as mesh network and internuclear compatibility of many core platforms, first, according to the distance of the physical location between the core moving in the nuclear resource pond of the core of idle condition and CPU, power level is set to the core of idle condition, the ability of power level for representing that the core of idle condition is waken up, power level is generally divided into the ranks such as S1, S2, S3 and S4, as an example, arrange from S1 to S4, the ability that the core of CPU is waken up diminishes.Some cores in idle condition, their physical location closes on behaviour area, and these cores at any time may be because the demand of operating system be loaded, therefore, these locational cores can not arrange it in deep sleep at once, but it is made as to S1, S2 power level.Then,, according to power level, wake successively the core of idle condition up.
Fig. 8 is the residing power level queue of the core of idle condition schematic diagram.As shown in Figure 8, core0, core1 form a workspace, core10~core15 forms another workspace, if workspace needs expansion, that be first waken up should be core2, core9, therefore, core2, core9 are under S1 state, because the possibility that core8 is waken up is also larger, therefore under S2 state, other core respectively in S3 or S4 state, so not only can energy-conservation but also not have too large performance loss according to the arrangement of OS.
According to another embodiment of the method for kernel operation in a kind of OS provided by the invention, by a kind of idle condition being set between single kernel and two kinds of kernel types of micro-kernel, can make core move to dynamic translation between micro-kernel and single kernel, thereby in operating system, can move single kernel and micro-kernel according to operation demand simultaneously, have the advantage of two kinds of kernel types concurrently; Meanwhile, the power-saving technology of operating system takes into full account the characteristic such as mesh network and internuclear compatibility of many core platforms, can ensure that system performance again can be effectively energy-conservation.
Fig. 9 is the structural representation of an embodiment of the device of kernel operation in a kind of OS of the present invention.As shown in Figure 9, this device 1000 is applied to many core platforms, comprising:
The first setting unit 101, is set to idle condition for the core in the nuclear resource pond of CPU.
Fig. 4 is the view of operating system center (core).As shown in Figure 4, all core is divided into three kinds of states by operating system: with micro-kernel operation, with single kernel operation and idle condition, kernel type when operation comprises: single kernel and micro-kernel, and set up the nuclear resource pond of a CPU, in the time of os starting, the core in the nuclear resource pond of the first setting unit 101 CPU is set to idle condition; And out of service when core, in the time of idle condition, reclaim the nuclear resource pond of putting into this CPU.Idle condition endorse to call any one operation into in two kinds of kernel types.
Wherein, the core that the first setting unit 101 is being moved is set to idle condition, is by ACPI managing electrical power, and power supply is turned off.Particularly, first, in the nuclear resource pond of CPU, core is labeled as to idle condition; Then,, by ACPI power management, control core and drop to S4 power level.ACPI is Advanced Program Zoom specification, and most of computing machine all meets this specification, and the ACPI interface that operating system can provide by hardware carries out power operation to core, belongs to prior art.
Running unit 102, for according to operation demand, moves the core of at least two idle conditions in the nuclear resource pond of described CPU respectively with the kernel type of two kinds of appointments.
In the present embodiment, running unit 102, according to operation demand, is moved the core of at least two idle conditions in the nuclear resource pond of CPU respectively with the kernel type of two kinds of appointments; Wherein, this kernel type comprises: single kernel and micro-kernel.
Particularly, the number of threads of each application program that operating system will be moved and parallel demand sometimes difference are very large, and therefore, as shown in figure 10, this running unit 102 can comprise: micro-kernel running unit 1021 and single kernel running unit 1022.When the number of threads of the application program that will move when operating system and parallel demand are many, micro-kernel running unit 1021 is specified the core of at least one idle condition in the nuclear resource pond of described CPU to move with micro-kernel; When the number of threads of the application program that will move when described operating system and parallel demand are few, single kernel running unit 1022 specifies the core of at least one idle condition in the nuclear resource pond of described CPU with single kernel operation.
In the time that core moves with micro-kernel, this micro-kernel generally only provides basic hardware operation interface, and the function that OS must be provided operates in user's state with the form of system service, and the service of user's calling system is finished the work; Service is isolation each other, even if other modules appear extremely also can not interfering with in certain service; The mode of communicating by letter by IPC between service and service is worked.Mach is based on CLIENT/SERVER MODEL, user need to call a kind of system service by the notice OS that sends a request message to OS, OS dispatches corresponding service processes after receiving message, and after completing, the mode by message communicating notifies result to user again.
When core is during with the operation of single kernel, the service that all OS provide is all programmed in code in kernel module, and completing primary system, to serve needed process be that user program is absorbed in kernel, then served by kernel executive system, after completing, returns to user's state from kernel state.
In the time that core exits the operation of micro-kernel or single kernel, this core is re-set as idle condition by the first setting unit 101, puts into the nuclear resource pond of CPU.Like this, originally, with the core of micro-kernel operation, be set to idle condition and put into behind the nuclear resource pond of CPU, this core of next operation system loads, can move it according to operation demand with single kernel; Similarly, originally, with the core of single kernel operation, be set to idle condition and put into behind the nuclear resource pond of CPU, this core of next operation system loads, can move it according to operation demand with micro-kernel.Like this, by between single kernel and two kinds of kernel types of micro-kernel, a kind of idle condition being set, can make core move to dynamic translation between micro-kernel and single kernel, make nuclear energy enough obtain flexible configuration according to operation demand.
According to an embodiment of the device of kernel operation in a kind of OS provided by the invention, by a kind of idle condition being set between single kernel and two kinds of kernel types of micro-kernel, can make core move to dynamic translation between micro-kernel and single kernel, thereby in operating system, can move single kernel and micro-kernel according to operation demand simultaneously, have the advantage of two kinds of kernel types concurrently.
Figure 11 is the structural representation of another embodiment of the device of kernel operation in a kind of OS of the present invention.As shown in figure 11, this device 2000 is applied to many core platforms, comprising:
The first setting unit 201, is set to idle condition for the core in the nuclear resource pond of CPU.
When os starting, first start the startup core of an appointment, this startup endorse with single kernel or micro-in
Core operation, stores start-up routine in this startup core, makes operating system can pass through Basic Input or Output System (BIOS) (Basic Input Output System, BIOS) and starts.
This startup core starts a core supervisory routine after starting, and by the nuclear resource pond of a CPU of all core compositions, all cores in the nuclear resource pond of first setting unit 201 these CPU are set to idle condition.Out of service when core, in the time of idle condition, reclaim the nuclear resource pond of putting into this CPU.The endorsing of idle condition called as any one operation with in two kinds of kernel types, and wherein, kernel type comprises single kernel and micro-kernel.
Wherein, it is by ACPI managing electrical power that the core moving is set to idle condition, and power supply is turned off.Particularly, first, in the nuclear resource pond of CPU, core is labeled as to idle condition; Then,, by ACPI power management, control core and drop to S4 power level.ACPI is Advanced Program Zoom specification, and most of computing machine all meets this specification, and the ACPI interface that operating system can provide by hardware carries out power operation to core, belongs to prior art.
The first allocation unit 202, is used to described single kernel and described micro-kernel to distribute the first address space unitedly.
The second allocation unit 203, for by described single kernel be operation described single kernel core distribute the second address space.
The 3rd allocation unit 204, for by user's state program corresponding to described micro-kernel being core distribution the 3rd address space of the described micro-kernel of operation.
Start after core startup, also carry out the distribution of the resource of operating system, implementation be by by operating system as the resource such as internal memory, peripheral hardware is managed concentratedly, after os starting, on startup core, move a resource manager, give corresponding core by resource manager by system resource allocation, each core can only use the part resource being assigned on core.
Start core and start collection system information later, wherein, resource manager can be collected memory information, obtains the size of internal memory and takies situation.Fig. 6 is memory address space distribution schematic diagram, and as shown in Figure 6, obtaining memory address space is 4G, wherein, 0~2G is allocated to user and uses, and the first allocation unit 202 is single kernel and micro-kernel unified distribution address space, uses as 2G~4G being allocated to kernel.
For single kernel, resource manager can distribute some idle physical memories to use to single kernel, and it is all the part of distributing from resource manager, to go to distribute that single kernel distributes physical memory at every turn, and single kernel is that the core of the single kernel of operation distributes address space; After application program releasing memory, reclaimed by single kernel; Single kernel is using internal memory to occur when not enough to the new free memory of resource manager application starting on core; The internal memory that single kernel does not use for a long time can discharge to resource manager.
For micro-kernel, all micro-kernel is shared a storage management, and this storage management unification is to resource manager application internal memory, and the use-pattern of internal memory is with single kernel, and just supvr is not kernel but a storage management.
Running unit 205, for according to operation demand, moves the core of at least two idle conditions in the nuclear resource pond of described CPU respectively with the kernel type of two kinds of appointments; Wherein, described kernel type comprises: single kernel and micro-kernel.
Wherein, running unit 205 can comprise and searches unit 2051, the first loading unit 2052, adds unit 2053 and interrupt location 2054.
Search unit 2051, for when according to operation demand, when described core need to be moved with single kernel, in the nuclear resource pond of described CPU, search the core of an idle condition.
The first loading unit 2052, for loading single kernel mirror image to described the second address space.
When the number of threads of the application program that will move when operating system and parallel demand are few, core need to be moved with single kernel, search unit 2051 and in the nuclear resource pond of CPU, search the core of an idle condition, the first loading unit 2052 loads single kernel mirror image of this core and checks the address space of answering to this from the storage space of mirror image, this address space is that single kernel is the address space distributing with the core of single kernel operation.This list kernel mirror image is that single kernel moves necessary working procedure.
This step is the situation while creating a single kernel, and the first loading unit 2052 need to load single kernel mirror image to core.
Also has another kind of situation, as the replacement of the first loading unit 2052, running unit 205 can also comprise and adds unit 2053, for in the time finding the core of idle condition in the nuclear resource pond of described CPU, the core of the described idle condition finding is added in operating single kernel in symmetric multiprocessor SMP mode, so that the core of the described idle condition finding moves with single kernel.When the core of idle condition is added to operating single kernel in SMP mode, now, add unit 2053 not need to load single kernel mirror image to core again, directly the core of the idle condition finding from the nuclear resource pond of CPU is added in operating single kernel in SMP mode.
Interrupt location 2054, for sending described interrupt message to described core, so that described core moves with single kernel.
First, interrupt location 2054 generates the interrupt message of this core, and this interrupt message comprises: memory location, start address, size and the title etc. of single kernel mirror image.Then, interrupt location 2054 sends this interrupt message to this core, and the core of this idle condition receives this interrupt message, just the single kernel mirror image in address space is moved on this core, thereby this core is moved with single kernel.
Search unit 2051 also for when according to operation demand, when described core need to be moved with micro-kernel, in the nuclear resource pond of described CPU, search the core of an idle condition.
The first loading unit 2052 is also for loading micro-kernel mirror image to described the 3rd address space.
When the number of threads of the application program that will move when operating system and parallel demand are many, core need to be moved with micro-kernel, search unit 2051 and in the nuclear resource pond of CPU, search the core of an idle condition, the first loading unit 2052 loads the micro-kernel mirror image of this core and checks the address space of answering to this from the storage space of mirror image, this address space is that user's state program that micro-kernel is corresponding is the address space of the core distribution of operation micro-kernel.This micro-kernel mirror image is that micro-kernel moves necessary working procedure.
Interrupt location 2054 is also for sending described interrupt message to described core, so that described core moves with micro-kernel.
First, interrupt location 2054 generates the interrupt message of this core, and this interrupt message comprises: memory location, start address, size and the title etc. of micro-kernel mirror image.Then, interrupt location 2054 sends this interrupt message to this core, and the core of this idle condition receives this interrupt message, just the micro-kernel mirror image in address space is moved on this core, thereby this core is moved with micro-kernel.
Migration units 206, in the time that the load on the multiple described core with the operation of described micro-kernel or single kernel reduces, by the task immigration moving in core described in one of them to on core described in another of micro-kernel or the operation of single kernel.
The first setting unit 201 also for described described in one of them core be set to idle condition, put into the nuclear resource pond of described CPU.
In the time that core moves with micro-kernel or single kernel, there is the process of certain operations system, as user's state task dispatching.In the time that the load on the multiple cores with micro-kernel or the operation of single kernel reduces, the operating system process migration occupying when migration units 206 needs one of them core operation is to the operating system process queue occupying with another core of micro-kernel or the operation of single kernel, uncompleted user's state task is proceeded, the service of not interrupt operation system according to queue.
Finally, the core of the complete task of this migration is re-set as idle condition by the first setting unit 201, puts into the nuclear resource pond of CPU.
When micro-kernel or single kernel are finished the work after migration, the storage management of single kernel or micro-kernel can be destroyed the micro-kernel mirror image that is kept at respectively single kernel mirror image of the second address space or is kept at the 3rd address space, to reclaim this address space; For some kernels, what when wake up next time, may load is identical mirror image, at this moment also mirror image can be retained, and postpones to reclaim kernel, makes, in the time reselecting corresponding core operation, can load the mirror image of this reservation, and this device 2000 can also comprise:
Stick unit 207, for being retained in described micro-kernel mirror image described the 3rd address space or described single kernel mirror image being retained in to described the second address space.
When micro-kernel or single kernel are finished the work after migration, operating system is not destroyed the micro-kernel mirror image that is kept at respectively single kernel mirror image of the second address space or is kept at the 3rd address space immediately, but by stick unit 207, mirror image is retained in corresponding address space.
Storage unit 208, for storing the register information of described core.
Some data that storage unit 208 is stored in register during by the operation of micro-kernel or single kernel are stored.
The second loading unit 209, the core that reselects described idle condition when the nuclear resource pond from described CPU is during with described micro-kernel or the operation of single kernel, the core of the idle condition reselecting described in described register information is loaded on, the core of the idle condition reselecting described in is with described micro-kernel or the operation of single kernel.
The core that reselects idle condition when the nuclear resource pond from CPU second loading unit 209 during with micro-kernel or the operation of single kernel, the register information of storage is loaded on to the core of this idle condition reselecting, in these register informations, comprise the interrupt message that starts operation, and owing to having retained micro-kernel mirror image or single kernel mirror image in address space, do not need to reload, endorsing with micro-kernel or the operation of single kernel of this idle condition reselecting.
The second setting unit 210, for the distance of the physical location between the core moving according to the nuclear resource pond of the core of described idle condition and described CPU, arranges power level to the core of described idle condition.
Wakeup unit 211, for according to described power level, wakes the core of described idle condition up successively.
The power-saving technology of the operating system of the present embodiment takes into full account the characteristic such as mesh network and internuclear compatibility of many core platforms, first, the second setting unit 210 is according to the distance of the physical location between the core moving in the nuclear resource pond of the core of idle condition and CPU, power level is set to the core of idle condition, the ability of power level for representing that the core of idle condition is waken up, power level is generally divided into the ranks such as S1, S2, S3 and S4, as an example, arrange from S1 to S4, the ability that the core of CPU is waken up diminishes.Some cores in idle condition, their physical location closes on behaviour area, and these cores at any time may be because the demand of operating system be loaded, therefore, these locational cores can not arrange it in deep sleep at once, but it is made as to S1, S2 power level.Then, wakeup unit 211, according to power level, is waken the core of idle condition up successively.
Fig. 8 is the residing power level queue of the core of idle condition schematic diagram.As shown in Figure 8, core0, core1 form a workspace, core10~core15 forms another workspace, if workspace needs expansion, that be first waken up should be core2, core9, therefore, core2, core9 are under S1 state, because the possibility that core8 is waken up is also larger, therefore under S2 state, other core respectively in S3 or S4 state, so not only can energy-conservation but also not have too large performance loss according to the arrangement of OS.
According to another embodiment of the device of kernel operation in a kind of OS provided by the invention, by a kind of idle condition being set between single kernel and two kinds of kernel types of micro-kernel, can make core move to dynamic translation between micro-kernel and single kernel, thereby in operating system, can move single kernel and micro-kernel according to operation demand simultaneously, have the advantage of two kinds of kernel types concurrently; Meanwhile, the power-saving technology of operating system takes into full account the characteristic such as mesh network and internuclear compatibility of many core platforms, can ensure that system performance again can be effectively energy-conservation.
Figure 12 is the structural representation of the embodiment of the equipment of kernel operation in a kind of OS of the present invention.As shown in figure 12, this equipment 3000 is applied to many core platforms, can comprise:
Input media 301, output unit 302, storer 303 and processor 304 (quantity of the processor 304 in the network equipment can be one or more, in Figure 12 taking a processor as example).In some embodiments of the invention, input media 301, output unit 302, storer 303 and processor 304 can be connected by bus or alternate manner, wherein, in Figure 12 to be connected to example by bus.
Wherein, processor 304 is for carrying out following steps:
Core in the nuclear resource pond of CPU is set to idle condition;
According to operation demand, the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively;
Wherein, described kernel type comprises: single kernel and micro-kernel.
Processor 304 is carried out described according to operation demand, and the step that the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively, comprising:
When the number of threads of the first application program that will move when operating system and parallel demand are many, the core of at least one idle condition in the nuclear resource pond of described CPU is moved with micro-kernel;
When the number of threads of the second application program that will move when described operating system and parallel demand are few, the core of at least one idle condition in the nuclear resource pond of described CPU is moved with single kernel.
After the core of processor 304 in the nuclear resource pond of carrying out described CPU is set to the step of idle condition, and described according to operation demand in execution, before the step that the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively, also comprise execution following steps:
For described single kernel and described micro-kernel are distributed the first address space unitedly;
Described single kernel is that the core of the described single kernel of operation distributes the second address space;
User's state program that described micro-kernel is corresponding is that the core of the described micro-kernel of operation distributes the 3rd address space.
Processor 304 is carried out described according to operation demand, and the step that the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively, comprising:
When according to operation demand, when described core need to be moved with single kernel, in the nuclear resource pond of described CPU, search the core of an idle condition, load single kernel mirror image to described the second address space;
Send described interrupt message to described core, so that described core moves with single kernel;
When according to operation demand, when described core need to be moved with micro-kernel, in the nuclear resource pond of described CPU, search the core of an idle condition, load micro-kernel mirror image to described the 3rd address space;
Send described interrupt message to described core, so that described core moves with micro-kernel.
Processor 304 is carried out described according to operation demand, and the step that the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively, also comprises:
In the time finding the core of idle condition in the nuclear resource pond at described CPU, the core of the described idle condition finding is added in operating single kernel in symmetric multiprocessor SMP mode, so that the core of the described idle condition finding moves with single kernel.
Processor 304 is described according to operation demand in execution, after the step that the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively, also comprises execution following steps:
In the time that the load on the multiple described core with described micro-kernel or the operation of single kernel reduces, by the task immigration moving in core described in one of them to on core described in another of micro-kernel or single kernel operation, and described described in one of them core be set to idle condition, put into the nuclear resource pond of described CPU.
Processor 304 is on core described in carrying out described another that the task immigration moving in core described in one of them is extremely moved with micro-kernel or single kernel, and described described in one of them core be set to idle condition, after putting into the step in nuclear resource pond of described CPU, also comprise execution following steps:
Described micro-kernel mirror image is retained in to described the 3rd address space or described single kernel mirror image is retained in described the second address space;
Store the register information of described core;
The core that reselects described idle condition when the nuclear resource pond from described CPU is during with described micro-kernel or the operation of single kernel, the core of the idle condition reselecting described in described register information is loaded on, the core of the idle condition reselecting described in is with described micro-kernel or the operation of single kernel.
Processor 304 is on core described in carrying out described another that the task immigration moving in core described in one of them is extremely moved with micro-kernel or single kernel, and described described in one of them core be set to idle condition, after putting into the step in nuclear resource pond of described CPU, also comprise execution following steps:
According to the distance of the physical location between the core moving in the nuclear resource pond of the core of described idle condition and described CPU, power level is set to the core of described idle condition;
According to described power level, wake successively the core of described idle condition up.
Be understandable that, the function of each functional module of the equipment 3000 of the present embodiment can be according to the method specific implementation in said method embodiment, and its specific implementation process can, with reference to the associated description of said method embodiment, repeat no more herein.
The equipment of kernel operation in a kind of OS providing according to the embodiment of the present invention, by a kind of idle condition being set between single kernel and two kinds of kernel types of micro-kernel, can make core move to dynamic translation between micro-kernel and single kernel, thereby in operating system, can move single kernel and micro-kernel according to operation demand simultaneously, have the advantage of two kinds of kernel types concurrently.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the specific works process of the equipment of foregoing description and module, can describe with reference to the corresponding process in preceding method embodiment, does not repeat them here.
In the several embodiment that provide in the application, should be understood that disclosed equipment and method can realize by another way.For example, device embodiment described above is only schematic, for example, the division of described module, be only that a kind of logic function is divided, when actual realization, can have other dividing mode, for example multiple modules or assembly can in conjunction with or can be integrated in another equipment, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some communication interfaces, indirect coupling or the communication connection of device or module can be electrically, machinery or other form.
The described module as separating component explanation can or can not be also physically to separate, and the parts that show as module can be or can not be also physical locations, can be positioned at a place, or also can be distributed in multiple network element.Can select according to the actual needs wherein some or all of, module realizes the object of the present embodiment scheme.
In addition, the each functional module in each embodiment of the present invention can be integrated in a processing module, can be also that the independent physics of modules exists, also can two or more module integrations in a module.
Finally it should be noted that: above each embodiment, only in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to aforementioned each embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or some or all of technical characterictic is wherein equal to replacement; And these amendments or replacement do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.
Claims (16)
1. a method for kernel operation in OS, is characterized in that, is applied to many core platforms, comprising:
Core in the nuclear resource pond of CPU is set to idle condition;
According to operation demand, the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively;
Wherein, described kernel type comprises: single kernel and micro-kernel.
2. the method for claim 1, is characterized in that, described according to operation demand, and the core of at least two idle conditions in the nuclear resource pond of described CPU, respectively with the kernel type operation of two kinds of appointments, being comprised:
When the number of threads of the first application program that will move when operating system and parallel demand are many, the core of at least one idle condition in the nuclear resource pond of described CPU is moved with micro-kernel;
When the number of threads of the second application program that will move when described operating system and parallel demand are few, the core of at least one idle condition in the nuclear resource pond of described CPU is moved with single kernel.
3. method as claimed in claim 1 or 2, it is characterized in that, after core in the nuclear resource pond of described CPU is set to idle condition, and described according to operation demand, before the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively, also comprise:
For described single kernel and described micro-kernel are distributed the first address space unitedly;
Described single kernel is that the core of the described single kernel of operation distributes the second address space;
User's state program that described micro-kernel is corresponding is that the core of the described micro-kernel of operation distributes the 3rd address space.
4. method as claimed in claim 3, is characterized in that, described according to operation demand, and the core of at least two idle conditions in the nuclear resource pond of described CPU, respectively with the kernel type operation of two kinds of appointments, being comprised:
When according to operation demand, when described core need to be moved with single kernel, in the nuclear resource pond of described CPU, search the core of an idle condition, load single kernel mirror image to described the second address space;
Send described interrupt message to described core, so that described core moves with single kernel;
When according to operation demand, when described core need to be moved with micro-kernel, in the nuclear resource pond of described CPU, search the core of an idle condition, load micro-kernel mirror image to described the 3rd address space;
Send described interrupt message to described core, so that described core moves with micro-kernel.
5. method as claimed in claim 4, is characterized in that, described according to operation demand, and the core of at least two idle conditions in the nuclear resource pond of described CPU, respectively with the kernel type operation of two kinds of appointments, is also comprised:
In the time finding the core of idle condition in the nuclear resource pond at described CPU, the core of the described idle condition finding is added in operating single kernel in symmetric multiprocessor SMP mode, so that the core of the described idle condition finding moves with single kernel.
6. the method as described in claim 1-5 any one, is characterized in that, described according to operation demand, after the core of at least two idle conditions in the nuclear resource pond of described CPU is moved with the kernel type of two kinds of appointments respectively, also comprises:
In the time that the load on the multiple described core with described micro-kernel or the operation of single kernel reduces, by the task immigration moving in core described in one of them to on core described in another of micro-kernel or single kernel operation, and described described in one of them core be set to idle condition, put into the nuclear resource pond of described CPU.
7. method as claimed in claim 6, it is characterized in that, described by the task immigration moving in core described in one of them to on core described in another of micro-kernel or single kernel operation, and described described in one of them core be set to idle condition, after putting into the nuclear resource pond of described CPU, also comprise:
Described micro-kernel mirror image is retained in to described the 3rd address space or described single kernel mirror image is retained in described the second address space;
Store the register information of described core;
The core that reselects described idle condition when the nuclear resource pond from described CPU is during with described micro-kernel or the operation of single kernel, the core of the idle condition reselecting described in described register information is loaded on, the core of the idle condition reselecting described in is with described micro-kernel or the operation of single kernel.
8. the method as described in claim 6 or 7, it is characterized in that, described by the task immigration moving in core described in one of them to on core described in another of micro-kernel or single kernel operation, and described described in one of them core be set to idle condition, after putting into the nuclear resource pond of described CPU, also comprise:
According to the distance of the physical location between the core moving in the nuclear resource pond of the core of described idle condition and described CPU, power level is set to the core of described idle condition;
According to described power level, wake successively the core of described idle condition up.
9. a device for kernel operation in OS, is characterized in that, is applied to many core platforms, comprising:
The first setting unit, is set to idle condition for the core in the nuclear resource pond of CPU;
Running unit, for according to operation demand, moves the core of at least two idle conditions in the nuclear resource pond of described CPU respectively with the kernel type of two kinds of appointments;
Wherein, described kernel type comprises: single kernel and micro-kernel.
10. device as claimed in claim 9, is characterized in that, described running unit comprises:
Micro-kernel running unit,, moves the core of at least one idle condition in the nuclear resource pond of described CPU when many for the number of threads of the first application program that will move when operating system and parallel demand with micro-kernel;
Single kernel running unit, while lacking, moves the core of at least one idle condition in the nuclear resource pond of described CPU for the number of threads of the second application program that will move when described operating system and parallel demand with single kernel.
11. devices as described in claim 9 or 10, is characterized in that, also comprise:
The first allocation unit, is used to described single kernel and described micro-kernel to distribute the first address space unitedly;
The second allocation unit, for by described single kernel be operation described single kernel core distribute the second address space;
The 3rd allocation unit, for by user's state program corresponding to described micro-kernel being core distribution the 3rd address space of the described micro-kernel of operation.
12. devices as claimed in claim 11, is characterized in that, described running unit comprises:
Search unit, for when according to operation demand, when described core need to be moved with single kernel, in the nuclear resource pond of described CPU, search the core of an idle condition;
The first loading unit, for loading single kernel mirror image to described the second address space;
Interrupt location, for sending described interrupt message to described core, so that described core moves with single kernel;
The core of an idle condition, also for when according to operation demand, when described core need to be moved with micro-kernel, is searched in the described unit of searching in the nuclear resource pond of described CPU;
Described the first loading unit is also for loading micro-kernel mirror image to described the 3rd address space;
Described interrupt location is also for sending described interrupt message to described core, so that described core moves with micro-kernel.
13. devices as claimed in claim 12, is characterized in that, described running unit also comprises:
Add unit, for in the time finding the core of idle condition in the nuclear resource pond of described CPU, the core of the described idle condition finding is added in operating single kernel in symmetric multiprocessor SMP mode, so that the core of the described idle condition finding moves with single kernel.
14. devices as described in claim 9-13 any one, is characterized in that, also comprise:
Migration units, in the time that the load on the multiple described core with the operation of described micro-kernel or single kernel reduces, by the task immigration moving in core described in one of them to on core described in another of micro-kernel or the operation of single kernel;
Described the first setting unit also for described described in one of them core be set to idle condition, put into the nuclear resource pond of described CPU.
15. devices as claimed in claim 14, is characterized in that, also comprise:
Stick unit, for being retained in described micro-kernel mirror image described the 3rd address space or described single kernel mirror image being retained in to described the second address space;
Storage unit, for storing the register information of described core;
The second loading unit, while operation with described micro-kernel or single kernel for reselect the core of described idle condition when the nuclear resource pond from described CPU, the core of the idle condition reselecting described in described register information is loaded on, the core of the idle condition reselecting described in is with described micro-kernel or the operation of single kernel.
16. devices as described in claims 14 or 15, is characterized in that, also comprise:
The second setting unit, for the distance of the physical location between the core moving according to the nuclear resource pond of the core of described idle condition and described CPU, arranges power level to the core of described idle condition; Wakeup unit, for according to described power level, wakes the core of described idle condition up successively.
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 true CN104050137A (en) | 2014-09-17 |
CN104050137B 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) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105528330A (en) * | 2014-09-30 | 2016-04-27 | 杭州华为数字技术有限公司 | Load balancing method and device, cluster and many-core processor |
CN108595270A (en) * | 2018-04-27 | 2018-09-28 | 新华三信息安全技术有限公司 | A kind of recovery method and device of memory source |
CN110083469A (en) * | 2019-05-11 | 2019-08-02 | 肖银皓 | A kind of isomerization hardware tissue runs unified core method and system |
CN111124522A (en) * | 2020-04-01 | 2020-05-08 | 广东戴维利科技有限公司 | Method and system for mixing microkernel and macrokernel |
CN112395079A (en) * | 2019-08-19 | 2021-02-23 | 无锡江南计算技术研究所 | Operation core operation migration method under heterogeneous many-core architecture |
CN113127069A (en) * | 2019-12-31 | 2021-07-16 | 成都鼎桥通信技术有限公司 | Position service management method and device based on dual systems and terminal equipment |
CN113626190A (en) * | 2021-08-04 | 2021-11-09 | 电子科技大学 | Load balancing method in microkernel operating system facing multi-kernel environment |
CN114090086A (en) * | 2021-11-23 | 2022-02-25 | 西安微电子技术研究所 | Embedded operating system quick starting method based on ZynqMP platform |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111488219B (en) * | 2020-04-07 | 2022-08-02 | 中国科学院自动化研究所 | Ethernet data flow recording method for high-speed data acquisition system |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101727351B (en) * | 2009-12-14 | 2012-09-05 | 北京航空航天大学 | 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 |
CN102831011B (en) * | 2012-08-10 | 2015-11-18 | 上海交通大学 | A kind of method for scheduling task based on many core systems and device |
-
2013
- 2013-03-13 CN CN201310079899.6A patent/CN104050137B/en not_active Expired - Fee Related
-
2014
- 2014-03-07 WO PCT/CN2014/073086 patent/WO2014139379A1/en active Application Filing
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105528330A (en) * | 2014-09-30 | 2016-04-27 | 杭州华为数字技术有限公司 | Load balancing method and device, cluster and many-core processor |
CN105528330B (en) * | 2014-09-30 | 2019-05-28 | 杭州华为数字技术有限公司 | The method, apparatus of load balancing is gathered together and many-core processor |
CN108595270A (en) * | 2018-04-27 | 2018-09-28 | 新华三信息安全技术有限公司 | A kind of recovery method and device of memory source |
CN110083469A (en) * | 2019-05-11 | 2019-08-02 | 肖银皓 | A kind of isomerization hardware tissue runs unified core method and system |
CN110083469B (en) * | 2019-05-11 | 2021-06-04 | 广东财经大学 | Method and system for organizing and running unified kernel by heterogeneous hardware |
CN112395079A (en) * | 2019-08-19 | 2021-02-23 | 无锡江南计算技术研究所 | Operation core operation migration method under heterogeneous many-core architecture |
CN113127069A (en) * | 2019-12-31 | 2021-07-16 | 成都鼎桥通信技术有限公司 | Position service management method and device based on dual systems and terminal equipment |
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 |
CN111124522A (en) * | 2020-04-01 | 2020-05-08 | 广东戴维利科技有限公司 | Method and system for mixing microkernel and macrokernel |
CN113626190A (en) * | 2021-08-04 | 2021-11-09 | 电子科技大学 | Load balancing method in microkernel operating system facing multi-kernel environment |
CN114090086A (en) * | 2021-11-23 | 2022-02-25 | 西安微电子技术研究所 | Embedded operating system quick starting method based on ZynqMP platform |
CN114090086B (en) * | 2021-11-23 | 2023-05-30 | 西安微电子技术研究所 | ZynqMP platform-based embedded operating system quick starting method |
Also Published As
Publication number | Publication date |
---|---|
WO2014139379A1 (en) | 2014-09-18 |
CN104050137B (en) | 2018-02-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104050137A (en) | Method and device for operating inner cores in heterogeneous operation system | |
CN102779072B (en) | Embedded system and dormancy and wake-up method of application process thereof | |
CN101946235B (en) | Method and apparatus for moving threads in a shared processor partitioning environment | |
CN102695998B (en) | System and method for controlling central processing unit power in a virtualized system | |
CN101405677B (en) | Adaptive power management | |
CN101706743B (en) | Dispatching method of virtual machine under multi-core environment | |
US8776066B2 (en) | Managing task execution on accelerators | |
US8423811B2 (en) | Transparently increasing power savings in a power management environment | |
CN102841674B (en) | Embedded system based on novel memory and hibernation and awakening method for process of embedded system | |
TWI569202B (en) | Apparatus and method for adjusting processor power usage based on network load | |
CN104598426A (en) | task scheduling method applied to a heterogeneous multi-core processor system | |
US20150067356A1 (en) | Power manager for multi-threaded data processor | |
CN101604264B (en) | Task scheduling method and system for supercomputer | |
CN101901159B (en) | Method and system for loading Linux operating system on multi-core CPU | |
CN102158513A (en) | Service cluster and energy-saving method and device thereof | |
CN103067425A (en) | Creation method of virtual machine, management system of virtual machine and related equipment thereof | |
CN107003713B (en) | Event driven method and system for logical partitioning for power management | |
CN110633152A (en) | Method and device for realizing horizontal scaling of service cluster | |
CN104346211A (en) | Method and system for realizing virtual machine migration under cloud computing | |
CN103076868B (en) | The electronic system of method for managing power supply and application the method | |
CN111857977B (en) | Elastic expansion method, device, server and storage medium | |
CN101894049A (en) | System and method for recycling garbage object in self-adaptive way | |
CN111459622A (en) | Method and device for scheduling virtual CPU, computer equipment and storage medium | |
CN103092703A (en) | Synchronized method and device for Java resource access | |
CN105100180A (en) | Cluster node dynamic loading method, device and system |
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 |