CPC G06F 9/4881 (2013.01) [G06F 9/3877 (2013.01); G06F 9/4401 (2013.01); G06F 9/44505 (2013.01); G06F 9/451 (2018.02); G06F 9/505 (2013.01); G06F 9/5027 (2013.01); G06F 9/541 (2013.01); G06F 11/3428 (2013.01); G06F 11/3433 (2013.01); G06F 11/3495 (2013.01)] | 20 Claims |
1. A method for scheduling a processor core, wherein the method is applied to a terminal, a processor in the terminal comprises at least one first performance core and at least one second performance core, a performance of the first performance core is higher than a performance of the second performance core, an operating system and at least one application run on the terminal, and the method comprises:
sending, by a target application, a target request to the operating system by calling a first application programming interface (API) provided by an embedded software development kit (SDK), the target request being used to indicate the operating system to feed back core information of the processor, and the core information comprising configuration conditions of the first performance core and the second performance core;
feeding, by the operating system, the core information back to the target application; and
scheduling, by the target application, a target core to operate a process of the target application via system calls based on the core information, comprising:
determining, by the target application, the target core corresponding to the process;
setting, by the target application, an affinity degree between the process and each core via system calls based on a core number of the target core and a process identifier of the process, wherein an affinity degree between the process and the target core is greater than an affinity degree between the process and another core; and
binding, by the operating system, the process and the target core based on the affinity degree, wherein the bound process operates on the target core.
|