CN105550029A - Process scheduling method and device - Google Patents

Process scheduling method and device Download PDF

Info

Publication number
CN105550029A
CN105550029A CN201510991456.3A CN201510991456A CN105550029A CN 105550029 A CN105550029 A CN 105550029A CN 201510991456 A CN201510991456 A CN 201510991456A CN 105550029 A CN105550029 A CN 105550029A
Authority
CN
China
Prior art keywords
scheduling
core cpu
mark
thread
controlling
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
CN201510991456.3A
Other languages
Chinese (zh)
Other versions
CN105550029B (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.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology 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 Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201510991456.3A priority Critical patent/CN105550029B/en
Publication of CN105550029A publication Critical patent/CN105550029A/en
Application granted granted Critical
Publication of CN105550029B publication Critical patent/CN105550029B/en
Active 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration

Abstract

Embodiments of the invention provide a process scheduling method and device, relate to the technical field of computers, and aim at realizing the preemptive locking function of task scheduling in VxWorks in a Linux user state. The method comprises the following steps: when a CPU core is in a user state, setting a scheduling control identification corresponding to the CPU core; and when the CPU core is in a core state, obtaining the scheduling control identification corresponding to the CPU core, wherein the CPU core is used for process or thread scheduling, and when the scheduling control identification allows scheduling, process or thread scheduling is carried out at the CPU core. The process scheduling method and device provided by the embodiments of the invention are used for process or thread scheduling.

Description

A kind of process scheduling method and device
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of process scheduling method and device.
Background technology
Vxworks operating system and (SuSE) Linux OS are all embedded OSs, and along with the development of data communication technology, vxworks operating system cannot meet communications equipment vendor in hardware, cost and the demand that functionally increases gradually.In this context, communications equipment vendor progressively attempts communication facilities to move to (SuSE) Linux OS by vxworks operating system, in this course, for the consideration to cost, need originally to operate in software transplanting on vxworks operating system on (SuSE) Linux OS by many.
But because the design philosophy of vxworks operating system and (SuSE) Linux OS and system architecture differ greatly, if do not provide corresponding adaptation mechanism, in the software transplanting that will originally operate on vxworks operating system in the process on (SuSE) Linux OS, more difficulty will be run into, and need to carry out larger change to the software originally operated on vxworks operating system, make the software transplanting that originally operate on vxworks operating system required cost to (SuSE) Linux OS improve, and reduce the income that software transplanting brings.
Summary of the invention
A kind of process scheduling method that embodiments of the invention provide and device, what can realize task scheduling in VxWorks in Linux seizes lock function, reduce and transplant cost needed for software to Linux from VxWorks, improve the income brought to Linux from VxWorks transplanting software.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, embodiments provides a kind of process scheduling method, is applied to the Linux equipment comprising one or more core cpu, comprises when core cpu is in User space, arranges the scheduling controlling mark that core cpu is corresponding; When core cpu is in kernel state, obtain the scheduling controlling mark that core cpu is corresponding, wherein core cpu is used for process or thread scheduling; When scheduling controlling mark allows scheduling, carry out process or thread scheduling at core cpu.
In the first possible implementation of first aspect, described scheduling controlling corresponding to core cpu that arrange identifies, and be included in shared drive and arrange scheduling controlling mark corresponding to core cpu, shared drive is positioned at Linux equipment; Obtain the scheduling controlling mark that core cpu is corresponding, be included in shared drive and read scheduling controlling mark corresponding to core cpu.
In the implementation that the second of first aspect is possible, the scheduling controlling mark that the described core cpu of described acquisition is corresponding, specifically comprises the mark obtaining core cpu; The scheduling controlling mark of core cpu is obtained according to the mark of core cpu.
In the third possible implementation of first aspect, process scheduling method also comprises when scheduling controlling mark does not allow scheduling, does not carry out process or thread scheduling at core cpu.
In conjunction with the implementation that first aspect the second is possible, in the 4th kind of possible implementation, when scheduling controlling is designated permission scheduling, carry out process or thread scheduling at core cpu, specifically comprise when scheduling controlling is designated zero, carry out process or thread scheduling at core cpu; When scheduling controlling mark does not allow scheduling, do not carry out process or thread scheduling at core cpu, specifically comprise when scheduling controlling is designated non-zero, do not carry out process or thread scheduling at core cpu.
In conjunction with first aspect, or any one possible implementation of first aspect first to fourth kind, in the 5th kind of possible implementation, before obtaining scheduling controlling mark corresponding to core cpu, also comprise closedown kernel and seize; Process scheduling method also comprises removing process or reschedule mark corresponding to thread, and open kernel and seize, reschedule mark is used for identification process or thread the need of scheduling.
In conjunction with first aspect, or any one possible implementation of first aspect first to fourth kind, in the 6th kind of possible implementation, also comprise: when core cpu forbids process or thread scheduling, the scheduling controlling of core cpu mark is added 1; When core cpu allows process or thread scheduling, the scheduling controlling of core cpu mark is subtracted 1.
Second aspect, embodiments provides a kind of process scheduling device, is positioned at the Linux equipment comprising one or more core cpu, comprises setting unit, for being in User space when core cpu, arranges the scheduling controlling mark that core cpu is corresponding; Acquiring unit, for being in kernel state when core cpu, obtain the scheduling controlling mark that core cpu is corresponding, wherein core cpu is used for process or thread scheduling; Scheduling unit, for when scheduling controlling mark allows scheduling, carries out process or thread scheduling at core cpu.
In the first possible implementation of second aspect, setting unit is specifically for being in User space when core cpu, and arrange scheduling controlling mark corresponding to core cpu at shared drive, shared drive is positioned at Linux equipment; Acquiring unit specifically for: when core cpu is in kernel state, shared drive read core cpu corresponding scheduling controlling mark.
In the implementation that the second of second aspect is possible, acquiring unit is specifically for obtaining the mark of core cpu; The scheduling controlling mark of core cpu is obtained according to the mark of core cpu.
In the third possible implementation of second aspect, scheduling unit also for when scheduling controlling mark does not allow scheduling, does not carry out process or thread scheduling at core cpu.
In conjunction with the third possible implementation of second aspect, in the 4th kind of possible implementation, scheduling unit, specifically for when scheduling controlling is designated zero, carries out process or thread scheduling at core cpu; When scheduling controlling is designated non-zero, do not carry out process or thread scheduling at core cpu.
In conjunction with second aspect, or any one possible implementation of second aspect first to fourth kind, in the 5th kind of possible implementation, process scheduling device also comprises administrative unit, for obtain scheduling controlling mark corresponding to core cpu at acquiring unit before, close kernel and seize; Administrative unit is also for removing process or reschedule mark corresponding to thread, and open kernel and seize, reschedule mark is used for identification process or thread the need of scheduling.
In conjunction with second aspect, or any one possible implementation of second aspect first to fourth kind, in the 6th kind of possible implementation, process scheduling device also comprises identify unit, during for forbidding process or thread scheduling when core cpu, the scheduling controlling of core cpu mark is added 1, when core cpu allows process or thread scheduling, the scheduling controlling of core cpu mark is subtracted 1.
The process scheduling method that embodiments of the invention provide and device, the mark of process or thread scheduling whether can be carried out by the core cpu arranged under User space as required in Linux equipment, under kernel state, obtain core cpu in Linux equipment whether can carry out the mark of process or thread scheduling, and determine in Linux equipment, whether arbitrary core cpu can carry out process or thread scheduling according to this mark, when process or thread scheduling can be carried out, at enterprising journey or the thread scheduling of advancing of this core cpu.The process scheduling method that embodiments of the invention provide is when the core cpu of Linux equipment runs the higher process of importance or thread, avoid this core cpu to be switched to by process scheduling mechanism and run other processes or thread, when the software originally operated on VxWorks is run in Linux, can not operationally be switched out core cpu because of the higher process of importance or thread and occur mistake, thus in Linux, realize task scheduling in VxWorks seize lock function, reduce and transplant cost needed for software to Linux from VxWorks, improve the income brought to Linux from VxWorks transplanting software.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The schematic flow sheet of a kind of process scheduling method that Fig. 1 provides for the embodiment of the present invention;
The schematic flow sheet of the another kind of process scheduling method that Fig. 2 provides for the embodiment of the present invention;
The schematic diagram of a kind of process scheduling device that Fig. 3 provides for the embodiment of the present invention;
The schematic diagram of the another kind of process scheduling device that Fig. 4 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The term used in this application is only for the object describing specific embodiment, and not intended to be limiting the application.The term of the odd number shape used in the application and appended claims as " one ", " as described in " and " being somebody's turn to do " be also intended to comprise most form, unless context clearly represents other implications.It is also understood that simultaneously the term "and/or" used in the application refer to and comprise one or more project of listing be associated any or all may combine.
Under normal circumstances, in Linux, process be there is standalone feature program to certain data set implementation on treaters and the base unit of Resources allocation, and thread is an entity in process, by the base unit that system is independently dispatched and assigned, therefore in Linux, the concept of process or thread and task is of equal value.In VxWorks, each separate program is called task, task is the unit of VxWorks Resourse Distribute, is also the base unit of processor scheduling.
Due in VxWorks; all tasks coexist in single linear address space; when the data structure of multiple task sharing overall situation; need by exclusive reference mechanism access critical section; therefore need to provide the mechanism protected exclusive reference on task dispatch layer is secondary; that in critical section, namely forbids task seizes scheduling, ensures that the task that importance is higher operationally exclusively enjoys CPU, this CPU can not be scheduled and switch to other tasks of operation.But in Linux, what process adopted is Preemptive multitask process or equity dispatching multitasking, so when linux system is in User space, do not have to ensure that process or thread operationally can monopolize the mechanism of CPU, time in the software transplanting that will originally operate on VxWorks to Linux, other processes may be run because of the CPU scheduling running this process being switched to during the process higher in operation importance, thus cause the running software be transplanted on Linux from VxWorks to make mistakes.
Based on above-mentioned principle of carrying out process scheduling in VxWorks and Linux, with reference to shown in Fig. 1, embodiments of the invention provide a kind of process scheduling method, be applied to the Linux equipment comprising one or more core cpu, wherein Linux equipment refers to the equipment running and have linux system, specifically comprises the steps:
101, when core cpu is in User space, the scheduling controlling mark that core cpu is corresponding is set.
Wherein User space refers to, when process or thread perform the code of user oneself in Linux equipment, this process or thread are in User space.Core cpu is in User space, under referring to that the program operated on this core cpu is in User space.
Wherein core cpu refers to the processor for running process or thread in linux system, scheduling controlling mark is used for mark and identifies corresponding core cpu with this scheduling controlling and whether allow the process of carrying out or thread scheduling, wherein process or thread scheduling refer to process or thread that to be distributed to immediately by core cpu and be scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread will yield this core cpu.Scheduling controlling mark can for the variable that comprise at least two states corresponding with each core cpu, two states that this variable at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, and this variable can be logical type variable or numeric type variable; Scheduling controlling mark also can for the identifier group that comprise at least two identifiers corresponding with each core cpu, two identifiers that this tag mark group at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, as long as whether scheduling controlling mark can allow the state of the process of carrying out or thread scheduling to identify to the core cpu of correspondence.Scheduling controlling mark is stored on Linux equipment in read-write mode, concrete scheduling controlling mark can be stored in one piece of region of memory, also can be stored in the storage area of hard disk, as long as scheduling controlling mark is stored on Linux equipment in read-write mode.
The scheduling controlling mark that core cpu is corresponding being set, referring to that the scheduling controlling mark corresponding with core cpu to being stored on Linux equipment is arranged.
102, when core cpu is in kernel state, the scheduling controlling mark that core cpu is corresponding is obtained.
Wherein kernel state refers to, when process or thread perform kernel code in Linux equipment, this process or thread are in kernel state.Core cpu is in kernel state, is under the program operated on this core cpu is in kernel state.
Obtain the scheduling controlling mark that core cpu is corresponding, refer to the scheduling controlling mark corresponding with core cpu reading and be stored on Linux equipment.
Exemplary:
4 core cpus are comprised in Linux equipment, scheduling controlling is designated the shaping variable being stored in Linux equipment, when scheduling controlling ident value is 0, the core cpu of this scheduling controlling mark correspondence allows the process of carrying out or thread scheduling, when scheduling controlling ident value is non-zero, the core cpu of this scheduling controlling mark correspondence does not allow the process of carrying out or thread scheduling.When needs determine whether the first core cpu allows the process of carrying out or thread scheduling, reading from Linux equipment and identifying B1, B1 with the scheduling controlling corresponding to the first core cpu is 1, namely non-zero.
103, determine whether scheduling controlling mark allows scheduling.
Determine whether scheduling controlling mark allows scheduling, refer to that the scheduling controlling mark corresponding to the core cpu obtained in step 101 processes, thus determine whether the core cpu corresponding to this scheduling controlling mark allows scheduling.
Exemplary:
Scheduling controlling is designated shaping variable, when scheduling controlling ident value is 0, the core cpu of this scheduling controlling mark correspondence allows the process of carrying out or thread scheduling, when scheduling controlling ident value is non-zero, the core cpu of this scheduling controlling mark correspondence does not allow the process of carrying out or thread scheduling, the scheduling controlling mark B1 value that the first core cpu obtained is corresponding is 1 that is non-zero, and therefore the first core cpu does not allow the process of carrying out or thread scheduling.
According to the judged result of step 102, when scheduling controlling mark allows scheduling, then carry out following steps:
103, process or thread scheduling is carried out at core cpu.
According to step 102 judged result, process scheduling is carried out when scheduling controlling mark allows to identify corresponding core cpu with this scheduling controlling, this core cpu is distributed to immediately the process or thread that are scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread have not remained running on this core cpu.
The process scheduling method that embodiments of the invention provide, first when CPU is in User space, arranges the scheduling controlling mark that core cpu is corresponding; When core cpu is in kernel state, obtain the scheduling controlling mark that core cpu is corresponding; Determine whether scheduling controlling mark allows scheduling, finally when scheduling controlling mark allows scheduling, carry out process or thread scheduling at core cpu.Therefore the process scheduling method that provides of above-described embodiment, the mark of process or thread scheduling whether can be carried out by the core cpu arranged under User space as required in Linux equipment, under kernel state, obtain core cpu in Linux equipment whether can carry out the mark of process or thread scheduling, and determine in Linux equipment, whether arbitrary core cpu can carry out process or thread scheduling according to this mark, when process or thread scheduling can be carried out, at enterprising journey or the thread scheduling of advancing of this core cpu.The process scheduling method that embodiments of the invention provide is when the core cpu of Linux equipment runs the higher process of importance or thread, avoid this core cpu to be switched to by process scheduling mechanism and run other processes or thread, when the software originally operated on VxWorks is run in Linux, can not operationally be switched out core cpu because of the higher process of importance or thread and occur mistake, thus in Linux, realize task scheduling in VxWorks seize lock function, reduce and transplant cost needed for software to Linux from VxWorks, improve the income brought to Linux from VxWorks transplanting software.
Based on above-mentioned principle of carrying out process scheduling in VxWorks and Linux, with reference to shown in Fig. 2, embodiments of the invention provide a kind of process scheduling method, be applied to the Linux equipment comprising one or more core cpu, wherein Linux equipment refers to the equipment running and have linux system, specifically comprises the steps:
201, when core cpu is in User space, the scheduling controlling mark that core cpu is corresponding is set.
Wherein User space refers to, when process or thread perform the code of user oneself in Linux equipment, this process or thread are in User space.Core cpu is in User space, under referring to that the program operated on this core cpu is in User space.
Wherein core cpu refers to the processor for running process or thread in linux system, scheduling controlling mark is used for mark and identifies corresponding core cpu with this scheduling controlling and whether allow the process of carrying out or thread scheduling, wherein process or thread scheduling refer to process or thread that to be distributed to immediately by core cpu and be scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread will yield this core cpu.Scheduling controlling mark can for the variable that comprise at least two states corresponding with each core cpu, two states that this variable at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, and this variable can be logical type variable or numeric type variable; Scheduling controlling mark also can for the identifier group that comprise at least two identifiers corresponding with each core cpu, two identifiers that this tag mark group at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, as long as whether scheduling controlling mark can allow the state of the process of carrying out or thread scheduling to identify to the core cpu of correspondence.Scheduling controlling mark is stored on Linux equipment in read-write mode, wherein, scheduling controlling mark can be stored in the shared drive on Linux equipment, also can be stored in hard disk on Linux equipment or other storage medium, as long as can write or read scheduling controlling mark from Linux equipment, be about to read scheduling controlling mark and be stored in Linux equipment in read-write mode.
The scheduling controlling mark that core cpu is corresponding being set, referring to that the scheduling controlling mark corresponding with core cpu to being stored on Linux equipment is arranged.
202, when core cpu is in kernel state, close kernel and seize.
Wherein kernel state refers to, when process or thread perform kernel code in Linux equipment, this process or thread are in kernel state.Core cpu is in kernel state, is under the program operated on this core cpu is in kernel state.
Kernel is seized and is referred to that the process that operates in Linux equipment on core cpu or thread can by temporary suspensions, can run than this process or high other processes of thread priority or thread on this core cpu.Closedown kernel is seized, and refers in Linux, not allow the high process of priority or thread to replace the low process of priority or thread runs on core cpu.
203, the mark of core cpu is obtained.
Wherein core cpu refers to the processor for running process or thread in linux system, scheduling controlling mark is used for mark and identifies corresponding core cpu with this scheduling controlling and whether allow the process of carrying out or thread scheduling, wherein process or thread scheduling refer to process or thread that to be distributed to immediately by core cpu and be scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread will yield this core cpu.
Core cpu mark is corresponding with each core cpu in Linux equipment, is used for the identity of each core cpu in mark Linux equipment.Core cpu mark can for the mark of carrying out with numerical value or sign format core cpu one or more in Linux equipment, and exemplary, Linux equipment comprises 4 core cpus, first core cpu correspondence 1, second core cpu correspondence the 2, three core cpu correspondence the 3, four core cpu correspondence 4.
204, the scheduling controlling mark of core cpu is obtained according to the mark of core cpu.
Wherein, the mark of each core cpu has corresponding scheduling controlling mark, and namely each core cpu has corresponding scheduling controlling mark.Scheduling controlling mark is used to mark and identifies corresponding core cpu with this scheduling controlling and whether allow the process of carrying out or thread scheduling, wherein process or thread scheduling refer to process or thread that to be distributed to immediately by core cpu and be scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread will yield this core cpu.Scheduling controlling mark can for the variable that comprise at least two states corresponding with each core cpu, two states that this variable at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, and this variable can be logical type variable or numeric type variable; Scheduling controlling mark also can for the identifier group that comprise at least two identifiers corresponding with each core cpu, two identifiers that this tag mark group at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, as long as scheduling controlling mark can identify the state whether corresponding core cpu allows the process of carrying out or thread scheduling.Scheduling controlling mark is stored on Linux equipment in read-write mode, concrete scheduling controlling mark can be stored in one piece of region of memory, also can be stored in the storage area of hard disk, as long as scheduling controlling mark is stored on Linux equipment in read-write mode.
Obtain scheduling controlling mark corresponding to core cpu according to the mark of core cpu, refer to that reading according to the mark of core cpu the scheduling controlling corresponding with core cpu be stored on Linux equipment identifies.
Exemplary:
Scheduling controlling mark is stored in the internal memory of Linux equipment in array mode, show as kernel_sched_lock [NR_CPUS], the memory headroom size storing scheduling controlling mark is one page, be defaulted as 4096 bytes, it is 4*C that scheduling controlling is identified at shared size in this memory headroom, C is comprised CPU check figure by this Linux equipment, wherein NR_CPUS represents core cpu number, if the value of the scheduling controlling mark of corresponding arbitrary core cpu is 0 in kernel_sched_lock [NR_CPUS], represent that this core cpu allows to carry out process scheduling; If the value of the scheduling controlling mark of corresponding arbitrary core cpu is non-zero in kernel_sched_lock [NR_CPUS], then represent that this core cpu does not allow to carry out process scheduling.If Linux equipment comprises 4 core cpus, when whether needs confirmation first core cpu allows the process of carrying out or thread scheduling, because of the first core cpu be designated 1, this block region is accessed by the kernel_sched_lock pointer pointing to this array, the value obtaining kernel_sched_lock [1] is 1, then represent that the scheduling controlling ident value of the first core cpu is non-zero, therefore the first core cpu does not allow to carry out process scheduling.
205, determine whether scheduling controlling mark is zero.
According to the scheduling controlling mark obtained in step 203, judge whether the core cpu of this scheduling controlling mark correspondence allows the process of carrying out or thread scheduling, namely determine whether this scheduling controlling mark is zero, when this scheduling controlling is designated zero, allow to carry out process or thread scheduling at the core cpu of correspondence, when this scheduling controlling is designated non-zero, do not allow to carry out process or thread scheduling at the core cpu of correspondence.
According to the judged result of step 204, when scheduling controlling is designated non-zero, then carry out following steps:
206, process or thread scheduling is not carried out at core cpu.
According to step 204 judged result, when scheduling controlling is designated non-zero, namely do not allow to identify corresponding core cpu with this scheduling controlling and carry out process scheduling, if before this this core cpu has run process or thread, then keep this process or thread to remain running on this core cpu.
According to the judged result of step 204, when scheduling controlling is designated zero, then carry out following steps:
207, process or thread scheduling is carried out at core cpu.
According to step 204 judged result, when scheduling controlling is designated zero, namely allow to identify corresponding core cpu with this scheduling controlling and carry out process scheduling, then this core cpu is distributed to immediately the process or thread that are scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread have not remained running on this core cpu.
208, remove process or thread corresponding reschedule mark.
Wherein reschedule mark is used to indicate whether corresponding process or thread are in the state needing process or thread scheduling.Removing process or thread corresponding reschedule mark, the process to not dispatching in step 205 or thread, or carry out the process of dispatching or thread in step 206, the severe scheduling identification of its correspondence is set to the state not needing the process of carrying out or thread scheduling.
209, open kernel to seize.
Unlatching kernel is seized, and refers to that the process that allows priority high in Linux or thread replace the low process of priority or thread runs on core cpu.
Further, process scheduling method can also comprise:
210, determine whether that core cpu forbids process or thread scheduling.
Determine whether that core cpu forbids process or thread scheduling, refer to determine whether corresponding core cpu exists importance or priority higher or can not the process of interrupt run or thread run, the process that corresponding core cpu is running or thread whether be in importance or priority higher or can not moment of interrupt run, if at enterprising journey or the thread scheduling of advancing of this core cpu, then there will be mistake.
211, the scheduling controlling of core cpu mark is subtracted 1.
The scheduling controlling of core cpu mark is subtracted 1, namely to represent on corresponding core cpu the process or the thread that do not run that significance level is higher or priority is higher or do not allow interrupt run, another process or thread can be called in this core cpu and run.
212, the scheduling controlling of core cpu mark is added 1.
The scheduling controlling of core cpu mark is added 1, namely the process or thread significance level run on corresponding core cpu is represented or priority is higher or do not allow interrupt run, when this process or thread operate on this core cpu, do not allow this process or thread are switched out this core cpu and calls in another process or thread.
The process scheduling method that embodiments of the invention provide, first when core cpu is in User space, arranges the scheduling controlling mark that core cpu is corresponding; Secondly when core cpu is in kernel state, close kernel and seize; Obtain the mark of core cpu; The scheduling controlling mark of core cpu is obtained according to the mark of core cpu; Determine whether scheduling controlling mark is zero; Scheduling controlling mark is for non-zero does not then carry out process or thread scheduling at core cpu; Scheduling controlling mark carries out process or thread scheduling for zero at core cpu; Removing process or thread corresponding reschedule mark; Unlatching kernel is seized; Determine whether that core cpu forbids process or thread scheduling; If do not forbid, the scheduling controlling of core cpu mark is subtracted 1; If forbid, the scheduling controlling of core cpu mark is added 1.Therefore the process scheduling method that provides of embodiments of the invention, the mark of process or thread scheduling whether can be carried out by the core cpu arranged under User space as required in Linux equipment, close after kernel seizes under kernel state, by obtaining the mark of each core cpu in Linux equipment, and according to the mark of this core cpu obtain this core cpu scheduling controlling mark namely this core cpu whether can carry out the mark of process or thread scheduling, by judging whether this mark is zero, determine in Linux equipment, whether arbitrary core cpu can carry out process or thread scheduling, when allowing the process of carrying out or thread scheduling on this core cpu, at enterprising journey or the thread scheduling of advancing of this core cpu, when not allowing the process of carrying out or thread scheduling on this core cpu, not at enterprising journey or the thread scheduling of advancing of this core cpu, afterwards remove process or thread corresponding reschedule mark, unlatching kernel is seized, when this core cpu forbids process or thread scheduling, scheduling controlling corresponding for this core cpu mark is added 1 simultaneously, when this core cpu allows process or thread scheduling, the scheduling controlling of this core cpu mark is subtracted 1, thus in control Linux equipment, whether core cpu can carry out process scheduling, when the software originally operated on VxWorks is run in Linux, can not operationally be switched out core cpu because of the higher process of importance or thread and cause occurring mistake, what the process scheduling method that therefore embodiments of the invention provide can realize task scheduling in VxWorks in Linux seizes lock function, reduce and transplant cost needed for software to Linux from VxWorks, improve the income brought to Linux from VxWorks transplanting software.
Embodiments of the invention also provide a kind of process scheduling device, and for performing process scheduling method as shown in Figure 1, as shown in Figure 3, this device comprises: setting unit 301, acquiring unit 302, scheduling unit 303.
Setting unit 301, for being in User space when core cpu, arranges the scheduling controlling mark that core cpu is corresponding.
Wherein User space refers to, when process or thread perform the code of user oneself in Linux equipment, this process or thread are in User space.Core cpu is in User space, is under the program operated on this core cpu is in User space.
Wherein core cpu refers to the processor for running process or thread in linux system, scheduling controlling mark is used for mark and identifies corresponding core cpu with this scheduling controlling and whether allow the process of carrying out or thread scheduling, wherein process or thread scheduling refer to process or thread that to be distributed to immediately by core cpu and be scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread will yield this core cpu.Scheduling controlling mark can for the variable that comprise at least two states corresponding with each core cpu, two states that this variable at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, and this variable can be logical type variable or numeric type variable; Scheduling controlling mark also can for the identifier group that comprise at least two identifiers corresponding with each core cpu, two identifiers that this tag mark group at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, as long as whether scheduling controlling mark can allow the state of the process of carrying out or thread scheduling to identify to the core cpu of correspondence.Wherein, scheduling controlling mark can be stored in the shared drive on Linux equipment, also can be stored in hard disk on Linux equipment or other storage medium, as long as can write or read scheduling controlling mark from Linux equipment, be about to read scheduling controlling mark and be stored in Linux equipment in read-write mode.
The scheduling controlling mark that core cpu is corresponding being set, referring to that the scheduling controlling mark corresponding with core cpu to being stored on Linux equipment is arranged.
Acquiring unit 302, for being in kernel state when core cpu, obtains the scheduling controlling mark that core cpu is corresponding.
Wherein kernel state refers to, when process or thread perform kernel code in Linux equipment, this process or thread are in kernel state.Core cpu is in kernel state, is under the program operated on this core cpu is in kernel state.
Obtain the scheduling controlling mark that core cpu is corresponding, refer to the scheduling controlling mark corresponding with core cpu reading and be stored on Linux equipment.
Exemplary:
4 core cpus are comprised in Linux equipment, scheduling controlling is designated the shaping variable being stored in Linux equipment, when scheduling controlling ident value is 0, the core cpu of this scheduling controlling mark correspondence allows the process of carrying out or thread scheduling, when scheduling controlling ident value is non-zero, the core cpu of this scheduling controlling mark correspondence does not allow the process of carrying out or thread scheduling.When needs determine whether the first core cpu allows the process of carrying out or thread scheduling, reading from Linux equipment and identifying B1, B1 with the scheduling controlling corresponding to the first core cpu is 1, namely non-zero.
Scheduling unit 303, for determining whether scheduling controlling mark allows scheduling, when scheduling controlling mark allows scheduling, carries out process or thread scheduling at core cpu.
Determine whether scheduling controlling mark allows scheduling, refer to that the scheduling controlling mark that the core cpu of scheduling unit 303 pairs of acquiring units 302 acquisitions is corresponding processes, thus determine whether the core cpu corresponding to this scheduling controlling mark allows scheduling.Process scheduling is carried out when scheduling controlling mark allows to identify corresponding core cpu with this scheduling controlling, this core cpu is distributed to the process or thread that are scheduled for this core cpu by scheduling unit 303 immediately, if before this this core cpu has run process or thread, then this process or thread have not remained running on this core cpu.
The process scheduling device that embodiments of the invention provide, comprises setting unit, for being in User space when core cpu, arranges the scheduling controlling mark that core cpu is corresponding; Acquiring unit, when core cpu is in kernel state, for obtaining scheduling controlling mark corresponding to core cpu; Scheduling unit, for determining whether scheduling controlling mark allows scheduling, when scheduling controlling mark allows scheduling, carries out process or thread scheduling at core cpu; Therefore the process scheduling method that provides of above-described embodiment, the mark of process or thread scheduling whether can be carried out by the core cpu arranged under User space as required in Linux equipment, under kernel state, obtain core cpu in Linux equipment whether can carry out the mark of process or thread scheduling, and determine in Linux equipment, whether arbitrary core cpu can carry out process or thread scheduling according to this mark, when process or thread scheduling can be carried out, at enterprising journey or the thread scheduling of advancing of this core cpu.The process scheduling method that embodiments of the invention provide is when the core cpu of Linux equipment runs the higher process of importance or thread, avoid this core cpu to be switched to by process scheduling mechanism and run other processes or thread, when the software originally operated on VxWorks is run in Linux, can not operationally be switched out core cpu because of the higher process of importance or thread and occur mistake, thus in Linux, realize task scheduling in VxWorks seize lock function, reduce and transplant cost needed for software to Linux from VxWorks, improve the income brought to Linux from VxWorks transplanting software.
Further, embodiments of the invention also provide a kind of process scheduling device, for performing process scheduling method as shown in Figure 2, as shown in Figure 4, this device comprises: setting unit 301, acquiring unit 302, scheduling unit 303, processing unit 304, identify unit 305.
Setting unit 301, for being in User space when core cpu, arranges the scheduling controlling mark that core cpu is corresponding.
Wherein User space refers to, when process or thread perform the code of user oneself in Linux equipment, this process or thread are in User space.Core cpu is in User space, is under the program operated on this core cpu is in User space.
Wherein core cpu refers to the processor for running process or thread in linux system, scheduling controlling mark is used for mark and identifies corresponding core cpu with this scheduling controlling and whether allow the process of carrying out or thread scheduling, wherein process or thread scheduling refer to process or thread that to be distributed to immediately by core cpu and be scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread will yield this core cpu.Scheduling controlling mark can for the variable that comprise at least two states corresponding with each core cpu, two states that this variable at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, and this variable can be logical type variable or numeric type variable; Scheduling controlling mark also can for the identifier group that comprise at least two identifiers corresponding with each core cpu, two identifiers that this tag mark group at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, as long as whether scheduling controlling mark can allow the state of the process of carrying out or thread scheduling to identify to the core cpu of correspondence.Scheduling controlling mark is stored on Linux equipment in read-write mode, concrete scheduling controlling mark can be stored in one piece of region of memory, also can be stored in the storage area of hard disk, as long as scheduling controlling mark is stored on Linux equipment in read-write mode.
The scheduling controlling mark that core cpu is corresponding being set, referring to that the scheduling controlling mark corresponding with core cpu to being stored on Linux equipment is arranged.
Acquiring unit 302, for obtaining the mark of core cpu, obtains the scheduling controlling mark of core cpu according to the mark of core cpu.
Wherein core cpu mark is corresponding with each core cpu in Linux equipment, is used for the identity of each core cpu in mark Linux equipment.Core cpu mark can for the mark of carrying out with numerical value or sign format core cpu one or more in Linux equipment, and exemplary, Linux equipment comprises 4 core cpus, first core cpu correspondence 1, second core cpu correspondence the 2, three core cpu correspondence the 3, four core cpu correspondence 4.
In Linux equipment, the mark of each core cpu has corresponding scheduling controlling mark, namely each core cpu has corresponding scheduling controlling mark, scheduling controlling mark is used to mark and identifies corresponding core cpu with this scheduling controlling and whether allow the process of carrying out or thread scheduling, wherein process or thread scheduling refer to process or thread that to be distributed to immediately by core cpu and be scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread will yield this core cpu.Scheduling controlling mark can for the variable that comprise at least two states corresponding with each core cpu, two states that this variable at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, and this variable can be logical type variable or numeric type variable; Scheduling controlling mark also can for the identifier group that comprise at least two identifiers corresponding with each core cpu, two identifiers that this tag mark group at least comprises are used for representing that this core cpu allows the process of carrying out or thread scheduling or do not allow the process of carrying out or thread scheduling respectively, as long as scheduling controlling mark can identify the state whether corresponding core cpu allows the process of carrying out or thread scheduling.Scheduling controlling mark is stored on Linux equipment in read-write mode, concrete scheduling controlling mark can be stored in one piece of region of memory, also can be stored in the storage area of hard disk, as long as scheduling controlling mark is stored on Linux equipment in read-write mode.
Obtain scheduling controlling mark corresponding to core cpu according to the mark of core cpu, refer to that acquiring unit 302 reads the scheduling controlling mark corresponding with core cpu be stored on Linux equipment according to the mark of core cpu.
Exemplary:
Scheduling controlling mark is stored in the internal memory of Linux equipment in array mode, show as kernel_sched_lock [NR_CPUS], the memory headroom size storing scheduling controlling mark is one page, be defaulted as 4096 bytes, it is 4*C that scheduling controlling is identified at shared size in this memory headroom, C is comprised CPU check figure by this Linux equipment, wherein NR_CPUS represents core cpu number, if the value of the scheduling controlling mark of corresponding arbitrary core cpu is 0 in kernel_sched_lock [NR_CPUS], represent that this core cpu allows to carry out process scheduling; If the value of the scheduling controlling mark of corresponding arbitrary core cpu is non-zero in kernel_sched_lock [NR_CPUS], then represent that this core cpu does not allow to carry out process scheduling.If Linux equipment comprises 4 core cpus, when whether needs confirmation first core cpu allows the process of carrying out or thread scheduling, because of the first core cpu be designated 1, this block region is accessed by the kernel_sched_lock pointer pointing to this array, the value obtaining kernel_sched_lock [1] is 1, then represent that the scheduling controlling ident value of the first core cpu is non-zero, therefore the first core cpu does not allow to carry out process scheduling.
Scheduling unit 303, for determining whether scheduling controlling mark is zero, does not carry out process or thread scheduling, carry out process or thread scheduling when scheduling controlling is designated zero at core cpu when scheduling controlling is designated non-zero at core cpu.
According to the scheduling controlling mark that acquiring unit 302 obtains, judge whether the core cpu of this scheduling controlling mark correspondence allows the process of carrying out or thread scheduling, namely determine whether this scheduling controlling mark is zero, when this scheduling controlling is designated zero, allow to carry out process or thread scheduling at the core cpu of correspondence, when this scheduling controlling is designated non-zero, do not allow to carry out process or thread scheduling at the core cpu of correspondence.
When scheduling controlling is designated non-zero, namely do not allow to identify corresponding core cpu with this scheduling controlling and carry out process scheduling, if before this this core cpu has run process or thread, then keep this process or thread to remain running on this core cpu.
When scheduling controlling is designated zero, namely allow to identify corresponding core cpu with this scheduling controlling and carry out process scheduling, then this core cpu is distributed to immediately the process or thread that are scheduled for this core cpu, if before this this core cpu has run process or thread, then this process or thread have not remained running on this core cpu.
Processing unit 304, for obtain scheduling controlling mark corresponding to core cpu at acquiring unit 302 before, when core cpu is in User space, closes kernel and seizes; Processing unit 304 also for remove process or thread corresponding reschedule mark, open kernel seize.
Wherein User space refers to, when process or thread perform the code of user oneself in Linux equipment, this process or thread are in User space.Core cpu is in User space, is under the program operated on this core cpu is in User space.
Kernel is seized and is referred to that the process that operates in Linux equipment on core cpu or thread can by temporary suspensions, can run than this process or high other processes of thread priority or thread on this core cpu.Closedown kernel is seized, and refers in Linux, not allow the high process of priority or thread to replace the low process of priority or thread runs on core cpu; Unlatching kernel is seized, and refers to that the process that allows priority high in Linux or thread replace the low process of priority or thread runs on core cpu.
Wherein reschedule mark is used to indicate whether corresponding process or thread are in the state needing process or thread scheduling.Removing process or reschedule mark corresponding to thread are the states being set to process or severe scheduling identification corresponding to thread not to need the process of carrying out or thread scheduling.
Further, process scheduling device can also comprise:
Identify unit 305, during for forbidding process or thread scheduling when core cpu, adds 1 by the scheduling controlling of core cpu mark, when core cpu allows process or thread scheduling, the scheduling controlling of core cpu mark is subtracted 1.
Core cpu forbids process or thread scheduling, refer to because of corresponding core cpu exists importance or priority higher or can not the process of interrupt run or thread run, the process that corresponding core cpu is running or thread be in importance or priority higher or can not moment of interrupt run, this core cpu forbids process or thread scheduling, if at enterprising journey or the thread scheduling of advancing of this core cpu, then there will be mistake.
The scheduling controlling of core cpu mark is subtracted 1, namely to represent on corresponding core cpu the process or the thread that do not run that significance level is higher or priority is higher or do not allow interrupt run, another process or thread can be called in this core cpu and run.
The scheduling controlling of core cpu mark is added 1, namely the process or thread significance level run on corresponding core cpu is represented or priority is higher or do not allow interrupt run, when this process or thread operate on this core cpu, do not allow this process or thread are switched out this core cpu and calls in another process or thread.
The process scheduling device that embodiments of the invention provide, comprises setting unit, for being in User space when core cpu, arranges the scheduling controlling mark that core cpu is corresponding; Acquiring unit, for being in kernel state when core cpu, obtains the mark of core cpu, obtains the scheduling controlling mark of core cpu according to the mark of core cpu; Scheduling unit, for determining whether scheduling controlling mark is zero, does not carry out process or thread scheduling, carry out process or thread scheduling when scheduling controlling is designated zero at core cpu when scheduling controlling is designated non-zero at core cpu; Processing unit, for obtain scheduling controlling mark corresponding to core cpu at acquiring unit before, when core cpu is in User space, closes kernel and seizes; Processing unit also for remove process or thread corresponding reschedule mark, open kernel seize; Identify unit, during for forbidding process or thread scheduling when core cpu, adds 1 by the scheduling controlling of core cpu mark, when core cpu allows process or thread scheduling, the scheduling controlling of core cpu mark is subtracted 1.Therefore the process scheduling method that provides of embodiments of the invention, the mark of process or thread scheduling whether can be carried out by the core cpu arranged under User space as required in Linux equipment, close after kernel seizes under kernel state, by obtaining the mark of each core cpu in Linux equipment, and according to the mark of this core cpu obtain this core cpu scheduling controlling mark namely this core cpu whether can carry out the mark of process or thread scheduling, by judging whether this mark is zero, determine in Linux equipment, whether arbitrary core cpu can carry out process or thread scheduling, when allowing the process of carrying out or thread scheduling on this core cpu, at enterprising journey or the thread scheduling of advancing of this core cpu, when not allowing the process of carrying out or thread scheduling on this core cpu, not at enterprising journey or the thread scheduling of advancing of this core cpu, afterwards remove process or thread corresponding reschedule mark, unlatching kernel is seized, when this core cpu forbids process or thread scheduling, scheduling controlling corresponding for this core cpu mark is added 1 simultaneously, when this core cpu allows process or thread scheduling, the scheduling controlling of this core cpu mark is subtracted 1, thus in control Linux equipment, whether core cpu can carry out process scheduling, when the software originally operated on VxWorks is run in Linux, can not operationally be switched out core cpu because of the higher process of importance or thread and cause occurring mistake, what the process scheduling method that therefore embodiments of the invention provide can realize task scheduling in VxWorks in Linux seizes lock function, reduce and transplant cost needed for software to Linux from VxWorks, improve the income brought to Linux from VxWorks transplanting software.
Wherein, it should be noted that, unit in the present embodiment can be the processor or sensor set up separately, also can be integrated in some processors or sensor and realize, in addition, also can be stored in the storer of touch point recognition device with the form of program code, called by processor and perform the function of above unit.Processor described here can be a central processing unit (English full name: CentralProcessingUnit, English abbreviation: CPU), or be configured to the one or more integrated circuit (English full name: IntegratedCircuit, English abbreviation: IC) implementing the embodiment of the present invention; Sensor can be an electronic component, or the circuit structure of multiple electronic component composition, or is configured to the one or more integrated circuit implementing the embodiment of the present invention.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (14)

1. a process scheduling method, is applied to the Linux equipment comprising one or more core cpu, it is characterized in that, comprising:
When core cpu is in User space, the scheduling controlling mark that described core cpu is corresponding is set;
When core cpu is in kernel state, obtain the scheduling controlling mark that described core cpu is corresponding, wherein said core cpu is used for process or thread scheduling;
When described scheduling controlling mark allows scheduling, carry out process or thread scheduling at described core cpu.
2. process scheduling method according to claim 1, is characterized in that, described scheduling controlling corresponding to described core cpu that arrange identifies, and comprising:
Arrange scheduling controlling mark corresponding to described core cpu at shared drive, described shared drive is positioned at described Linux equipment;
The scheduling controlling mark that the described core cpu of described acquisition is corresponding, comprising:
Scheduling controlling mark corresponding to described core cpu is read at described shared drive.
3. process scheduling method according to claim 1, is characterized in that, the scheduling controlling mark that the described core cpu of described acquisition is corresponding, specifically comprises:
Obtain the mark of described core cpu;
The scheduling controlling mark of described core cpu is obtained according to the mark of described core cpu.
4. process scheduling method according to claim 1, is characterized in that, described process scheduling method also comprises:
When described scheduling controlling mark does not allow scheduling, do not carry out process or thread scheduling at described core cpu.
5. process scheduling method according to claim 3, is characterized in that, described when described scheduling controlling is designated permission scheduling, carries out process or thread scheduling, specifically comprise at described core cpu:
When described scheduling controlling is designated zero, carry out process or thread scheduling at described core cpu;
Described when described scheduling controlling mark does not allow scheduling, do not carry out process or thread scheduling at described core cpu, specifically comprise:
When described scheduling controlling is designated non-zero, do not carry out process or thread scheduling at described core cpu.
6. the process scheduling method according to claim 1-5, is characterized in that, before the scheduling controlling mark that described acquisition core cpu is corresponding, also comprises:
Closedown kernel is seized;
Described process scheduling method also comprises:
Removing process or reschedule mark corresponding to thread, open kernel and seize, and described reschedule mark is used for identification process or thread the need of scheduling.
7. the process scheduling method according to claim 1-5, is characterized in that, also comprises:
When described core cpu forbids process or thread scheduling, the scheduling controlling of described core cpu mark is added 1;
When described core cpu allows process or thread scheduling, the scheduling controlling of described core cpu mark is subtracted 1.
8. a process scheduling device, is positioned at the Linux equipment comprising one or more core cpu, it is characterized in that, comprising:
Setting unit, for being in User space when core cpu, arranges the scheduling controlling mark that described core cpu is corresponding;
Acquiring unit, for being in kernel state when core cpu, obtain the scheduling controlling mark that described core cpu is corresponding, wherein said core cpu is used for process or thread scheduling;
Scheduling unit, for when described scheduling controlling mark allows scheduling, carries out process or thread scheduling at described core cpu.
9. process scheduling device according to claim 8, is characterized in that, described setting unit specifically for:
When core cpu is in User space, arrange scheduling controlling mark corresponding to described core cpu at shared drive, described shared drive is positioned at described Linux equipment;
Described acquiring unit specifically for:
When core cpu is in kernel state, read scheduling controlling mark corresponding to described core cpu at described shared drive.
10. process scheduling device according to claim 8, is characterized in that, described acquiring unit specifically for:
Obtain the mark of described core cpu;
The scheduling controlling mark of described core cpu is obtained according to the mark of described core cpu.
11. process scheduling devices according to claim 8, is characterized in that, described scheduling unit also for:
When described scheduling controlling mark does not allow scheduling, do not carry out process or thread scheduling at described core cpu.
12. process scheduling devices according to claim 11, is characterized in that, described scheduling unit specifically for:
When described scheduling controlling is designated zero, carry out process or thread scheduling at described core cpu;
When described scheduling controlling is designated non-zero, do not carry out process or thread scheduling at described core cpu.
13. process scheduling devices according to Claim 8 described in-12, it is characterized in that, described process scheduling device also comprises:
Administrative unit, for obtain scheduling controlling mark corresponding to core cpu at described acquiring unit before, closes kernel and seizes;
Described administrative unit also for removing process or reschedule mark corresponding to thread, being opened kernel and being seized, and described reschedule mark is used for identification process or thread the need of scheduling.
14. process scheduling devices according to Claim 8 described in-12, it is characterized in that, described process scheduling device also comprises:
Identify unit, for when described core cpu forbids process or thread scheduling, adds 1 by the scheduling controlling of described core cpu mark, when described core cpu allows process or thread scheduling, the scheduling controlling of described core cpu mark is subtracted 1.
CN201510991456.3A 2015-12-24 2015-12-24 A kind of process scheduling method and device Active CN105550029B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510991456.3A CN105550029B (en) 2015-12-24 2015-12-24 A kind of process scheduling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510991456.3A CN105550029B (en) 2015-12-24 2015-12-24 A kind of process scheduling method and device

Publications (2)

Publication Number Publication Date
CN105550029A true CN105550029A (en) 2016-05-04
CN105550029B CN105550029B (en) 2019-07-23

Family

ID=55829227

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510991456.3A Active CN105550029B (en) 2015-12-24 2015-12-24 A kind of process scheduling method and device

Country Status (1)

Country Link
CN (1) CN105550029B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315631A (en) * 2017-06-23 2017-11-03 迈普通信技术股份有限公司 A kind of method for scheduling task and device
CN107797848A (en) * 2016-08-29 2018-03-13 华为数字技术(苏州)有限公司 Process scheduling method, device and host device
CN109254849A (en) * 2018-08-31 2019-01-22 北京小米移动软件有限公司 The operation method and device of application program
CN109697112A (en) * 2018-12-24 2019-04-30 广东亿迅科技有限公司 Distributed intensive one-stop operating system and implementation method
CN109800073A (en) * 2019-01-28 2019-05-24 Oppo广东移动通信有限公司 Dispatching method, device, terminal and the storage medium of real-time process
CN109840137A (en) * 2017-11-28 2019-06-04 大唐移动通信设备有限公司 A kind of operating system transplantation method and apparatus
CN116909801A (en) * 2023-09-14 2023-10-20 飞腾信息技术有限公司 Error reporting method, microprocessor and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
莫尔勒: "《深入Linux内核架构》", 30 June 2010, 人民邮电出版社 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107797848A (en) * 2016-08-29 2018-03-13 华为数字技术(苏州)有限公司 Process scheduling method, device and host device
CN107797848B (en) * 2016-08-29 2020-10-23 华为数字技术(苏州)有限公司 Process scheduling method and device and host equipment
CN107315631B (en) * 2017-06-23 2020-08-14 迈普通信技术股份有限公司 Task scheduling method and device
CN107315631A (en) * 2017-06-23 2017-11-03 迈普通信技术股份有限公司 A kind of method for scheduling task and device
CN109840137B (en) * 2017-11-28 2021-01-22 大唐移动通信设备有限公司 Cross-core scheduling method and device
CN109840137A (en) * 2017-11-28 2019-06-04 大唐移动通信设备有限公司 A kind of operating system transplantation method and apparatus
CN109254849B (en) * 2018-08-31 2021-03-30 北京小米移动软件有限公司 Application program running method and device
CN109254849A (en) * 2018-08-31 2019-01-22 北京小米移动软件有限公司 The operation method and device of application program
CN109697112A (en) * 2018-12-24 2019-04-30 广东亿迅科技有限公司 Distributed intensive one-stop operating system and implementation method
CN109800073A (en) * 2019-01-28 2019-05-24 Oppo广东移动通信有限公司 Dispatching method, device, terminal and the storage medium of real-time process
CN109800073B (en) * 2019-01-28 2021-06-18 Oppo广东移动通信有限公司 Real-time process scheduling method, device, terminal and storage medium
CN116909801A (en) * 2023-09-14 2023-10-20 飞腾信息技术有限公司 Error reporting method, microprocessor and computer equipment
CN116909801B (en) * 2023-09-14 2023-12-12 飞腾信息技术有限公司 Error reporting method, microprocessor and computer equipment

Also Published As

Publication number Publication date
CN105550029B (en) 2019-07-23

Similar Documents

Publication Publication Date Title
CN105550029A (en) Process scheduling method and device
CN107851036B (en) Processor with advanced operating system support
US9798595B2 (en) Transparent user mode scheduling on traditional threading systems
JP5071913B2 (en) Concurrent physical processor reallocation method, system, and program
US7971205B2 (en) Handling of user mode thread using no context switch attribute to designate near interrupt disabled priority status
US9378069B2 (en) Lock spin wait operation for multi-threaded applications in a multi-core computing environment
US9286108B2 (en) Method to track application context and application identification
CN109582590B (en) Pointers in a memory managed system
CN100530111C (en) Multi-thread access indirect register scheduling method
US9781120B2 (en) System on chip and method therefor
GB2499277A (en) Checking write access to shared resources in a multithreaded processor
CN114168271B (en) Task scheduling method, electronic device and storage medium
US20120226849A1 (en) Virtual computer system, area management method, and program
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
US10967813B2 (en) Vehicle control device
EP2548118A1 (en) Dual mode reader writer lock
US9038077B1 (en) Data transfer protection in a multi-tasking modeling environment
CN114490054A (en) Context switching method and device, accelerating unit, electronic equipment and system on chip
CN103154894B (en) For the method managing the task in microprocessor or microprocessor components
CN103593606A (en) Contextual information managing method and system
US20130160019A1 (en) Method for Resuming an APD Wavefront in Which a Subset of Elements Have Faulted
US20130227238A1 (en) Device and method for a time and space partitioned based operating system on a multi-core processor
US20020184473A1 (en) Method and system for tracking and recycling physical register assignment
US20140298352A1 (en) Computer with plurality of processors sharing process queue, and process dispatch processing method
CN113296910B (en) File system calling method and device, terminal equipment and readable storage medium

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