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 PDF

Info

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
cpu
idle state
microkernel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310079899.6A
Other languages
Chinese (zh)
Other versions
CN104050137B (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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multi Processors (AREA)
  • Power Sources (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种异构操作系统中内核运行的方法及装置,应用于众核平台,包括:将CPU的核资源池中的核设置为空闲状态;根据运行需求,将所述CPU的核资源池中的至少两个空闲状态的核分别以两种指定的内核类型运行;其中,所述内核类型包括:单内核和微内核。本发明还公开了相应的异构操作系统中内核运行的装置。通过在单内核和微内核两种内核类型之间设置一种空闲状态,可以使核在微内核和单内核之间动态转换地运行,从而在操作系统中能够根据运行需求同时运行单内核和微内核,兼有两种内核类型的优点。

The invention discloses a method and device for operating a kernel in a heterogeneous operating system, which is applied to a many-core platform, including: setting the cores in the core resource pool of the CPU to an idle state; The at least two cores in the idle state in the resource pool respectively run with two designated kernel types; wherein, the kernel types include: single kernel and microkernel. The invention also discloses a device for running the kernel in the corresponding heterogeneous operating system. By setting an idle state between the single kernel and the microkernel, the core can be dynamically switched between the microkernel and the single kernel, so that the operating system can run the single kernel and the microkernel at the same time according to the operating requirements. Kernel, which combines the advantages of both kernel types.

Description

Method and the device of kernel operation in a kind of OS
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.一种异构操作系统中内核运行的方法,其特征在于,应用于众核平台,包括:1. A method for kernel operation in a heterogeneous operating system, characterized in that it is applied to many-core platforms, including: 将CPU的核资源池中的核设置为空闲状态;Set the cores in the core resource pool of the CPU to an idle state; 根据运行需求,将所述CPU的核资源池中的至少两个空闲状态的核分别以两种指定的内核类型运行;Running at least two cores in the idle state in the core resource pool of the CPU with two specified core types respectively according to operation requirements; 其中,所述内核类型包括:单内核和微内核。Wherein, the kernel type includes: a single kernel and a microkernel. 2.如权利要求1所述的方法,其特征在于,所述根据运行需求,将所述CPU的核资源池中的至少两个空闲状态的核分别以两种指定的内核类型运行,包括:2. The method according to claim 1, wherein, according to the operating requirements, at least two cores in the idle state in the core resource pool of the CPU are respectively operated with two specified core types, comprising: 当操作系统所要运行的第一应用程序的线程数量和并行需求多时,将所述CPU的核资源池中的至少一个空闲状态的核以微内核运行;When the number of threads and parallel requirements of the first application program to be run by the operating system are large, at least one idle core in the core resource pool of the CPU is run as a microkernel; 当所述操作系统所要运行的第二应用程序的线程数量和并行需求少时,将所述CPU的核资源池中的至少一个空闲状态的核以单内核运行。When the number of threads and parallel requirements of the second application program to be run by the operating system are small, at least one idle core in the core resource pool of the CPU is run as a single core. 3.如权利要求1或2所述的方法,其特征在于,所述将CPU的核资源池中的核设置为空闲状态之后,以及所述根据运行需求,将所述CPU的核资源池中的至少两个空闲状态的核分别以两种指定的内核类型运行之前,还包括:3. The method according to claim 1 or 2, characterized in that, after the core in the core resource pool of the CPU is set to an idle state, and according to the operation requirement, the core in the core resource pool of the CPU Before at least two cores in the idle state of each run as the two specified core types, also include: 为所述单内核以及所述微内核统一分配第一地址空间;uniformly allocating a first address space for the single kernel and the microkernel; 所述单内核为运行所述单内核的核分配第二地址空间;The single kernel allocates a second address space for a core running the single kernel; 所述微内核对应的用户态程序为运行所述微内核的核分配第三地址空间。The user state program corresponding to the microkernel allocates a third address space for the core running the microkernel. 4.如权利要求3所述的方法,其特征在于,所述根据运行需求,将所述CPU的核资源池中的至少两个空闲状态的核分别以两种指定的内核类型运行,包括:4. The method according to claim 3, wherein, according to the operating requirements, at least two cores in the idle state in the core resource pool of the CPU are operated with two specified core types respectively, comprising: 当根据运行需求,需要将所述核以单内核运行时,在所述CPU的核资源池中查找一个空闲状态的核,加载单内核镜像至所述第二地址空间;When the core needs to be run with a single core according to the operation requirements, a core in an idle state is searched in the core resource pool of the CPU, and the single core image is loaded into the second address space; 向所述核发送所述中断消息,以使所述核以单内核运行;sending the interrupt message to the core to cause the core to operate as a single core; 当根据运行需求,需要将所述核以微内核运行时,在所述CPU的核资源池中查找一个空闲状态的核,加载微内核镜像至所述第三地址空间;When the core needs to be run with a microkernel according to operating requirements, a core in an idle state is searched in the core resource pool of the CPU, and the microkernel image is loaded into the third address space; 向所述核发送所述中断消息,以使所述核以微内核运行。The interrupt message is sent to the core to cause the core to operate as a microkernel. 5.如权利要求4所述的方法,其特征在于,所述根据运行需求,将所述CPU的核资源池中的至少两个空闲状态的核分别以两种指定的内核类型运行,还包括:5. The method according to claim 4, wherein, according to the operating requirements, at least two cores in the idle state in the core resource pool of the CPU are respectively operated with two specified core types, further comprising : 当在所述CPU的核资源池中查找到空闲状态的核时,将查找到的所述空闲状态的核以对称多处理器SMP方式加入至运行中的单内核中,以使查找到的所述空闲状态的核以单内核运行。When a core in the idle state is found in the core resource pool of the CPU, the found core in the idle state is added to the running single core in a symmetric multiprocessor SMP mode, so that all the found cores are The cores in the idle state described above run as a single core. 6.如权利要求1-5任意一项所述的方法,其特征在于,所述根据运行需求,将所述CPU的核资源池中的至少两个空闲状态的核分别以两种指定的内核类型运行之后,还包括:6. The method according to any one of claims 1-5, wherein, according to the operating requirements, at least two cores in the idle state in the core resource pool of the CPU are respectively divided into two designated cores After typing run, also include: 当以所述微内核或单内核运行的多个所述核上的负载减少时,将其中一个所述核中运行的任务迁移至以微内核或单内核运行的另一个所述核上,并将所述其中一个所述核设置为空闲状态,放入所述CPU的核资源池。When the load on a plurality of said cores running with said microkernel or single kernel decreases, migrating tasks running in one of said cores to another said core running with microkernel or single kernel, and Setting one of the cores to an idle state and putting it into the core resource pool of the CPU. 7.如权利要求6所述的方法,其特征在于,所述将其中一个所述核中运行的任务迁移至以微内核或单内核运行的另一个所述核上,并将所述其中一个所述核设置为空闲状态,放入所述CPU的核资源池之后,还包括:7. The method according to claim 6, wherein the tasks running in one of the cores are migrated to another core running with a microkernel or a single core, and the one of them is The core is set to an idle state, and after being put into the core resource pool of the CPU, it also includes: 将所述微内核镜像保留在所述第三地址空间或将所述单内核镜像保留在所述第二地址空间中;retaining the microkernel image in the third address space or retaining the single-kernel image in the second address space; 存储所述核的寄存器信息;storing register information of the core; 当从所述CPU的核资源池重新选择所述空闲状态的核以所述微内核或单内核运行时,将所述寄存器信息加载至所述重新选择的空闲状态的核,则所述重新选择的空闲状态的核以所述微内核或单内核运行。When reselecting the core in the idle state from the core resource pool of the CPU to run as the microkernel or single core, loading the register information into the reselected core in the idle state, then the reselecting The idle state core runs as the microkernel or single core. 8.如权利要求6或7所述的方法,其特征在于,所述将其中一个所述核中运行的任务迁移至以微内核或单内核运行的另一个所述核上,并将所述其中一个所述核设置为空闲状态,放入所述CPU的核资源池之后,还包括:8. The method according to claim 6 or 7, wherein the tasks running in one of the cores are migrated to another core running with a microkernel or a single core, and the One of the cores is set to an idle state, and after being put into the core resource pool of the CPU, it also includes: 根据所述空闲状态的核与所述CPU的核资源池中正在运行的核之间的物理位置的距离,给所述空闲状态的核设置电源级别;Setting a power level for the core in the idle state according to the physical distance between the core in the idle state and the running core in the core resource pool of the CPU; 根据所述电源级别,依次唤醒所述空闲状态的核。According to the power level, the cores in the idle state are sequentially woken up. 9.一种异构操作系统中内核运行的装置,其特征在于,应用于众核平台,包括:9. A device for running a kernel in a heterogeneous operating system, characterized in that it is applied to a many-core platform, including: 第一设置单元,用于将CPU的核资源池中的核设置为空闲状态;The first setting unit is used to set the cores in the core resource pool of the CPU to an idle state; 运行单元,用于根据运行需求,将所述CPU的核资源池中的至少两个空闲状态的核分别以两种指定的内核类型运行;An operation unit, configured to run at least two idle cores in the core resource pool of the CPU with two designated core types according to operation requirements; 其中,所述内核类型包括:单内核和微内核。Wherein, the kernel type includes: a single kernel and a microkernel. 10.如权利要求9所述的装置,其特征在于,所述运行单元包括:10. The device according to claim 9, wherein the operating unit comprises: 微内核运行单元,用于当操作系统所要运行的第一应用程序的线程数量和并行需求多时,将所述CPU的核资源池中的至少一个空闲状态的核以微内核运行;A microkernel running unit, configured to run at least one idle core in the core resource pool of the CPU as a microkernel when the number of threads and the parallel requirements of the first application program to be run by the operating system are large; 单内核运行单元,用于当所述操作系统所要运行的第二应用程序的线程数量和并行需求少时,将所述CPU的核资源池中的至少一个空闲状态的核以单内核运行。The single-core running unit is configured to run at least one idle core in the core resource pool of the CPU as a single core when the number of threads and parallel requirements of the second application program to be run by the operating system are small. 11.如权利要求9或10所述的装置,其特征在于,还包括:11. The device according to claim 9 or 10, further comprising: 第一地址分配单元,用于为所述单内核以及所述微内核统一分配第一地址空间;a first address allocation unit, configured to uniformly allocate a first address space for the single kernel and the microkernel; 第二地址分配单元,用于由所述单内核为运行所述单内核的核分配第二地址空间;a second address allocation unit, configured to allocate a second address space for a core running the single core by the single core; 第三地址分配单元,用于由所述微内核对应的用户态程序为运行所述微内核的核分配第三地址空间。The third address allocation unit is configured to allocate a third address space to the core running the microkernel by the user mode program corresponding to the microkernel. 12.如权利要求11所述的装置,其特征在于,所述运行单元包括:12. The device according to claim 11, wherein the operating unit comprises: 查找单元,用于当根据运行需求,需要将所述核以单内核运行时,在所述CPU的核资源池中查找一个空闲状态的核;A search unit, configured to search for a core in an idle state in the core resource pool of the CPU when the core needs to be run as a single core according to operating requirements; 第一加载单元,用于加载单内核镜像至所述第二地址空间;a first loading unit, configured to load a single kernel image into the second address space; 中断单元,用于向所述核发送所述中断消息,以使所述核以单内核运行;an interrupt unit, configured to send the interrupt message to the core, so that the core operates as a single core; 所述查找单元还用于当根据运行需求,需要将所述核以微内核运行时,在所述CPU的核资源池中查找一个空闲状态的核;The search unit is also used to search for an idle core in the core resource pool of the CPU when the core needs to be run as a microkernel according to the operation requirement; 所述第一加载单元还用于加载微内核镜像至所述第三地址空间;The first loading unit is also used to load the microkernel image to the third address space; 所述中断单元还用于向所述核发送所述中断消息,以使所述核以微内核运行。The interrupt unit is further configured to send the interrupt message to the core, so that the core runs as a microkernel. 13.如权利要求12所述的装置,其特征在于,所述运行单元还包括:13. The device according to claim 12, wherein the operating unit further comprises: 加入单元,用于当在所述CPU的核资源池中查找到空闲状态的核时,将查找到的所述空闲状态的核以对称多处理器SMP方式加入至运行中的单内核中,以使查找到的所述空闲状态的核以单内核运行。A joining unit is configured to add the found core in the idle state to the running single core in a symmetric multiprocessor SMP mode when finding the core in the idle state in the core resource pool of the CPU, so as to Make the found core in the idle state run as a single core. 14.如权利要求9-13任意一项所述的装置,其特征在于,还包括:14. The device according to any one of claims 9-13, further comprising: 迁移单元,用于当以所述微内核或单内核运行的多个所述核上的负载减少时,将其中一个所述核中运行的任务迁移至以微内核或单内核运行的另一个所述核上;A migration unit, configured to migrate a task running in one of the cores to another of the cores running in the microkernel or single kernel when the load on the multiple cores running in the microkernel or single kernel decreases. on the nucleus; 所述第一设置单元还用于将所述其中一个所述核设置为空闲状态,放入所述CPU的核资源池。The first setting unit is further configured to set the one of the cores to an idle state, and put it into the core resource pool of the CPU. 15.如权利要求14所述的装置,其特征在于,还包括:15. The apparatus of claim 14, further comprising: 保留单元,用于将所述微内核镜像保留在所述第三地址空间或将所述单内核镜像保留在所述第二地址空间中;a reserving unit for reserving the microkernel image in the third address space or reserving the single-kernel image in the second address space; 存储单元,用于存储所述核的寄存器信息;a storage unit, configured to store register information of the core; 第二加载单元,用于当从所述CPU的核资源池重新选择所述空闲状态的核以所述微内核或单内核运行时,将所述寄存器信息加载至所述重新选择的空闲状态的核,则所述重新选择的空闲状态的核以所述微内核或单内核运行。The second loading unit is configured to load the register information into the reselected idle state core when the core in the idle state is reselected from the core resource pool of the CPU to run as the microkernel or single core. core, then the re-selected core in the idle state runs with the microkernel or single core. 16.如权利要求14或15所述的装置,其特征在于,还包括:16. The device according to claim 14 or 15, further comprising: 第二设置单元,用于根据所述空闲状态的核与所述CPU的核资源池中正在运行的核之间的物理位置的距离,给所述空闲状态的核设置电源级别;唤醒单元,用于根据所述电源级别,依次唤醒所述空闲状态的核。The second setting unit is used to set the power level for the core in the idle state according to the physical distance between the core in the idle state and the running core in the core resource pool of the CPU; the wake-up unit uses Then wake up the cores in the idle state sequentially according to the power level.
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 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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Cited By (13)

* Cited by examiner, † Cited by third party
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
CN101946235B (en) Method and apparatus for moving threads in a shared processor partitioning environment
US8381002B2 (en) Transparently increasing power savings in a power management environment
CN1306404C (en) Dynamic switching of multiline range processor between single line range and complicated multiline range mode
CN101706743B (en) Dispatching method of virtual machine under multi-core environment
CN102027453B (en) System and method for optimizing interrupt processing in virtualized environments
US20150067356A1 (en) Power manager for multi-threaded data processor
CN112445615B (en) A thread scheduling system, computer device and storage medium
TWI569202B (en) Apparatus and method for adjusting processor power usage based on network load
CN102779072B (en) Embedded system and dormancy and wake-up method of application process thereof
US11782495B2 (en) Power consumption optimization on the cloud
CN101901159B (en) Method and system for loading Linux operating system on multi-core CPU
TW200413889A (en) Mechanism for processor power state aware distribution of lowest priority interrupts
CN107003713B (en) Event driven method and system for logical partitioning for power management
CN103608766A (en) Memory management model and interface for new applications
EP2672381A1 (en) Virtual resource management method, system and device
CN104346211A (en) Method and system for realizing virtual machine migration under cloud computing
CN110633152A (en) Method and device for realizing horizontal scaling of service cluster
CN101894049A (en) System and method for recycling garbage object in self-adaptive way
CN115509704A (en) Task scheduling method, device, equipment and storage medium
CN103019849A (en) Method for managing virtual machine in cloud computing environment
CN105340246A (en) Method, apparatus and device for managing system resource
CN116089049B (en) Asynchronous parallel I/O request-based process synchronous scheduling method, device and equipment
CN115102851B (en) Fusion platform for HPC and AI fusion calculation and resource management method thereof
CN115981795A (en) Method for realizing system isolation on android device through container

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

Granted publication date: 20180209