Method and apparatus for system call command batch processing
AssigneeHuawei Technologies Co., Ltd.
InventorsKai Qi, Wei Wang, Yi Cai
Life of this patent
Estimating the term…
Abstract
A method and apparatus for system call command batch processing are provided. The method enable system call commands of a same type to be processed in a same CPU core according to a sequence of entering a kernel, thereby ensuring that returned results of the system call commands are sequential.
Claims12
A method for system call command batch processing performed by a multi-core system comprising multiple central processing unit (CPU) cores, the method comprising:
- obtaining multiple system call commands comprising commands that need to call a kernel function;
- classifying the multiple system call commands according to task identifiers of the multiple system call commands, wherein system call commands of a same type have a same task identifier;
- obtaining a call count of each system call command processed by a first CPU core in the multiple CPU cores, wherein the call count of each system call command is an execution count of each system call command in the multi-core system;
- determining a priority of each system call task according to the call count of each system call command processed by the first CPU core, wherein the first CPU core processes system call tasks of at least two different types, the system call tasks of the different types have different task identifiers, and each system call task comprises multiple system call commands that have a same task identifier;
- and
- sending, according to a sequence of obtaining the multiple system call commands, system call commands of a same type to a same CPU core for processing, the sending comprising:
- separately sending, according to a sequence of priorities based on the determined priority of each system call task, the system call tasks of the different types to the first CPU core for processing, wherein the multiple system call commands in each system call task are separately sent to the first CPU core according to an obtaining sequence.
A computing system, comprising:
- multiple central processing unit (CPU) cores;
- a memory coupled to the multiple CPU cores, the memory comprising instructions that, when executed by one or more CPU cores in the multiple CPU cores , cause the computing system to;
- obtain multiple system call commands comprising commands that need to call a kernel function;
- classify the multiple system call commands according to task identifiers of the multiple system call commands, wherein system call commands of a same type have a same task identifier;
- obtain a call count of each system call command processed by a first CPU core in the multiple CPU cores, wherein the call count of each system call command is an execution count of each system call command in the computing system;
- determine a priority of each system call task according to the call count of each system call command processed by the first CPU core, wherein the first CPU core processes system call tasks of at least two different types, the system call tasks of the different types have different task identifiers, and each system call task comprises multiple system call commands that have a same task identifier;
- and
- send, according to a sequence of obtaining the multiple system call commands, system call commands of a same type to a same CPU core for processing, the send comprising:
- separately send in the send, according to a sequence of priorities based on the determined priority of each system call task, the system call tasks of the different types to the first CPU core for processing, wherein the multiple system call commands in each system call task are separately sent to the first CPU core according to an obtaining sequence.
A non-transitory computer readable medium, for use in a multi-core system comprising multiple central processing unit (CPU) cores, comprising computer executable instructions stored on the non-transitory computer readable medium such that when executed by one or more CPU cores in the multi-core system, cause the multi-core system to:
- obtain multiple system call commands, wherein the multiple system call commands are commands that need to call a kernel function;
- classify the multiple system call commands according to task identifiers of the multiple system call commands, wherein system call commands of a same type have a same task identifier;
- obtain a call count of each system call command processed by a first CPU core in the multiple CPU cores, wherein the call count of each system call command is an execution count of each system call command in the multi-core system;
- determine a priority of each system call task according to the call count of each system call command processed by the first CPU core, wherein the first CPU core processes system call tasks of at least two different types, the system call tasks of the different types have different task identifiers, and each system call task comprises multiple system call commands that have a same task identifier;
- and
- send, according to a sequence of obtaining the multiple system call commands, system call commands of a same type to a same CPU core for processing, wherein the send comprising:
- separately send, according to a sequence of priorities based on the determined priority of each system call task, the system call tasks of the different types to the first CPU core for processing, wherein the multiple system call commands in each system call task are separately sent to the first CPU core according to an obtaining sequence.
Dependencies are inferred from the claim text.