Disclosure of Invention
The invention aims to provide a computer task management method and computer equipment, which are improved on the existing X86 and ARM mixed architecture processor system, so that different instruction tasks can be processed simultaneously.
In order to achieve the above object, an embodiment of the present invention provides a computer task management method applied to an X86 and ARM hybrid architecture, where the method includes the following steps:
step S10, the first X86 processor receives a new task;
step S20, the first X86 processor analyzes all complex instructions adopted for executing the new task based on the X86 complex instruction set, and judges whether the second X86 processor or the ARM processor executes the new task according to all complex instructions and the ARM reduced instruction set;
in step S30, the first X86 processor allocates the new task to the second X86 processor or the ARM processor according to the determination result in step S20, so that the second X86 processor executes the new task or the ARM processor executes the new task.
Preferably, the step S20 includes:
and the first X86 processor acquires all complex instructions adopted for executing the new task by adopting an X86 architecture trial run mode, translates all the complex instructions, judges that the new task is executed by the ARM processor alone or the ARM processor and the second X86 processor execute the new task alternately if at least more than 90% of the complex instructions can be translated into simplified instructions in the ARM simplified instruction set directly, and judges that the new task is executed by the second X86 processor alone.
Preferably, the step S20 includes:
the method comprises the steps that a first X86 processor obtains all complex instructions adopted for executing a new task in an X86 architecture trial operation mode, all the complex instructions are translated, if at least more than 90% of the complex instructions can be directly translated into simplified instructions in an ARM simplified instruction set, the translated instruction amount is not increased by more than 130%, the new task is judged to be executed by an ARM processor alone, or the ARM processor and a second X86 processor alternately execute the new task, and otherwise, the new task is judged to be executed by a second X86 processor alone.
Preferably, the determining whether the new task is executed by the ARM processor alone or the ARM processor alternates with the second X86 processor comprises:
if all the complex instructions can be directly translated into simplified instructions in the ARM simplified instruction set, the ARM processor executes the new task; if a portion of the complex instructions cannot be directly translated into reduced instructions in the ARM reduced instruction set, the new task is executed alternately by the ARM processor and the second X86 processor, the ARM processor processes the portion of the instructions that can be directly translated into reduced instructions in the ARM reduced instruction set, and the second X86 processor processes the portion of the instructions that cannot be directly translated into reduced instructions in the ARM reduced instruction set.
Preferably, the step S30 further includes:
when it is determined at step S20 that the new task is executed alternately by the ARM processor and the second X86 processor, an interrupt point is set for the new task and allocated to the second X86 processor or the ARM processor, so that the second X86 processor and the ARM processor execute the new task alternately according to the interrupt point.
Preferably, during the process that the second X86 processor and the ARM processor alternately execute the tasks allocated by the first X86 processor,
when the task processed by the second X86 processor reaches an interrupt point, requesting the ARM processor to acquire a related processing result of the ARM processor required by the task processing, performing task interrupt to wait for the related processing result of the ARM processor, and after receiving the related processing result of the ARM processor, continuing to execute the task according to the related processing result of the ARM processor;
when the task processed by the ARM processor reaches an interrupt point, requesting the second X86 processor to acquire a related processing result of the second X86 processor required for processing the task, performing task interrupt to wait for the processing result of the second X86 processor, and after receiving the related processing result of the second X86 processor, continuing to execute the task according to the related processing result of the second X86 processor.
Preferably, the step S30 further includes:
when it is determined at step S20 that the new task is executed by the ARM processor and the second X86 processor alternately, an interrupt point and a priority are set for the new task and allocated to the second X86 processor or the ARM processor, so that the second X86 processor and the ARM processor alternately execute the new task according to the interrupt point and the priority.
Preferably, during the process that the second X86 processor and the ARM processor alternately execute the tasks allocated by the first X86 processor,
when the second X86 processor receives a request sent by the ARM processor for acquiring a related processing result of the second X86 processor required for processing a task, the request carries a task priority flag, the second X86 processor compares the priority of the task being interrupted by the ARM processor with the priority of the task being processed by the second X86 processor, and the second X86 processor prioritizes the request sent by the ARM processor for acquiring the related processing result of the second X86 processor required for processing the task or the task being processed by the second X86 processor according to the priority comparison result;
when the ARM processor receives a request for acquiring relevant processing results of the ARM processor required by processing tasks, which is sent by the second X86 processor, the request carries a task priority label, the ARM processor compares the priority of the task being interrupted by the second X86 processor with the priority of the task being processed by the ARM processor, and the ARM processor preferentially processes the request for acquiring relevant processing results of the ARM processor required by processing tasks, which is sent by the second X86 processor, or the task being processed by the ARM processor according to the priority comparison result.
Preferably, the processing of the second X86 processor according to the request for obtaining the relevant processing result of the second X86 processor required by the processing task sent by the ARM processor or the task being processed by the second X86 processor by the priority comparison result includes:
when the priority of the task interrupted by the ARM processor is higher, the request for acquiring the relevant processing result of the second X86 processor required by the processing task, sent by the ARM processor, is processed preferentially, the relevant task is processed according to the request of the ARM processor, the processing result is fed back to the ARM processor, and then the task processed by the second X86 processor is continued;
the processing method includes that the ARM processor preferentially processes a request for acquiring a relevant processing result of the ARM processor required by a processing task sent by a second X86 processor or a task being processed by the ARM processor according to a priority comparison result, and includes the following steps:
when the priority of the task being interrupted by the second X86 processor is higher, the request for obtaining the relevant processing result of the ARM processor required by the processing task, sent by the second X86 processor, is processed preferentially, the relevant task is processed according to the request of the second X86 processor, the processing result is fed back to the second X86 processor, and then the task being processed by the ARM processor is continued.
The embodiment of the invention also provides computer equipment which comprises a first X86 processor, a second X86 processor and an ARM processor and is used for realizing the computer task management method.
The embodiment of the invention at least has the following beneficial effects:
the embodiment of the invention is improved on the existing X86 and ARM mixed architecture processor system, so that different instruction tasks can be processed simultaneously, an X86 processor is added for distributing and guiding the execution of the tasks, and the X86 processor and the ARM processor perform operation processing in a division or alternative mode according to the difference of programs or the difference of transactions to be processed, so that the X86 and ARM mixed architecture processor system can process different instruction tasks simultaneously.
Additional features and advantages of embodiments of the invention will be set forth in the description which follows.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In addition, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present invention. It will be understood by those skilled in the art that the present invention may be practiced without some of these specific details. In some instances, well known means have not been described in detail so as not to obscure the present invention.
Referring to fig. 1, an embodiment of the present invention provides a computer task management method applied to an X86 and ARM hybrid architecture, the method including the following steps:
step S10, the first X86 processor receives a new task;
step S20, the first X86 processor analyzes all complex instructions adopted for executing the new task based on the X86 complex instruction set, and judges whether the second X86 processor or the ARM processor executes the new task according to all complex instructions and the ARM reduced instruction set;
in step S30, the first X86 processor allocates the new task to the second X86 processor or the ARM processor according to the determination result in step S20, so that the second X86 processor executes the new task or the ARM processor executes the new task.
Specifically, if the tasks to be processed are suitable for processing by the complex instruction set of X86, the tasks are distributed to the complex instruction set of X86 as much as possible for processing; such as a complex operation, a non-standard task. If the tasks required to be processed are suitable for being processed by the ARM simplified instruction set, the tasks are distributed as much as possible and are processed by the ARM simplified instruction set; such as mathematical operations, image processing, and the like.
The embodiment of the invention is improved on the existing X86 and ARM mixed architecture processor system, so that different instruction tasks can be processed simultaneously, an X86 processor is added for distributing and guiding the execution of the tasks, and the X86 processor and the ARM processor perform operation processing in a division or alternative mode according to the difference of programs or the difference of transactions to be processed, so that the X86 and ARM mixed architecture processor system can process different instruction tasks simultaneously.
In some embodiments, the step S20 includes:
and the first X86 processor acquires all complex instructions adopted for executing the new task by adopting an X86 architecture trial run mode, translates all the complex instructions, judges that the new task is executed by the ARM processor alone or the ARM processor and the second X86 processor execute the new task alternately if at least more than 90% of the complex instructions can be translated into simplified instructions in the ARM simplified instruction set directly, and judges that the new task is executed by the second X86 processor alone.
In some embodiments, the step S20 includes:
the method comprises the steps that a first X86 processor obtains all complex instructions adopted for executing a new task in an X86 architecture trial operation mode, all the complex instructions are translated, if at least more than 90% of the complex instructions can be directly translated into simplified instructions in an ARM simplified instruction set, the translated instruction amount is not increased by more than 130%, the new task is judged to be executed by an ARM processor alone, or the ARM processor and a second X86 processor alternately execute the new task, and otherwise, the new task is judged to be executed by a second X86 processor alone.
In the implementation process of the method, two results appear, a new task is processed by an ARM processor and a second X86 processor in a division manner or alternatively runs, the division manner is simple, and only a single processor is needed to finish the processing in the processing process; for larger tasks, tasks that yield results need to be run alternately through the second X86 processor and the ARM processor, which requires special design, and specifically, in some embodiments, the determining is performed by the ARM processor alone to execute the new task, or the ARM processor is run alternately with the second X86 processor to execute the new task, including:
if all the complex instructions can be directly translated into simplified instructions in the ARM simplified instruction set, the ARM processor executes the new task; if a portion of the complex instructions cannot be directly translated into reduced instructions in the ARM reduced instruction set, the new task is executed alternately by the ARM processor and the second X86 processor, the ARM processor processes the portion of the instructions that can be directly translated into reduced instructions in the ARM reduced instruction set, and the second X86 processor processes the portion of the instructions that cannot be directly translated into reduced instructions in the ARM reduced instruction set.
Further, in some embodiments, the step S30 further includes:
when it is determined at step S20 that the new task is executed alternately by the ARM processor and the second X86 processor, an interrupt point is set for the new task and allocated to the second X86 processor or the ARM processor, so that the second X86 processor and the ARM processor execute the new task alternately according to the interrupt point.
Further, in the process that the second X86 processor and the ARM processor alternately execute the tasks allocated by the first X86 processor according to the interrupt point,
when the task processed by the second X86 processor reaches an interrupt point, requesting the ARM processor to acquire a related processing result of the ARM processor required by the task processing, performing task interrupt to wait for the related processing result of the ARM processor, and after receiving the related processing result of the ARM processor, continuing to execute the task according to the related processing result of the ARM processor;
when the task processed by the ARM processor reaches an interrupt point, requesting the second X86 processor to acquire a related processing result of the second X86 processor required for processing the task, performing task interrupt to wait for the processing result of the second X86 processor, and after receiving the related processing result of the second X86 processor, continuing to execute the task according to the related processing result of the second X86 processor.
In some embodiments, the step S30, further includes:
when it is determined at step S20 that the new task is executed by the ARM processor and the second X86 processor alternately, setting an interrupt point and a priority to the new task, and assigning the interrupt point and the priority to the second X86 processor or the ARM processor, so that the second X86 processor and the ARM processor alternately execute the new task according to the interrupt point and the priority;
specifically, the second X86 processor or the ARM processor performs priority comparison on all the tasks being processed or to be processed according to task priorities, and preferentially processes the tasks with higher priorities.
Further, in the process that the second X86 processor and the ARM processor alternately execute the tasks allocated by the first X86 processor according to the interrupt point and the priority,
when the second X86 processor receives a request sent by the ARM processor for obtaining the relevant processing result of the second X86 processor required for processing the task, the request carrying a task priority flag (given by the first X86 processor), the second X86 processor compares the priority of the task being interrupted by the ARM processor with the priority of the task being processed by the second X86 processor, and the second X86 processor prioritizes the request sent by the ARM processor for obtaining the relevant processing result of the second X86 processor required for processing the task or the task being processed by the second X86 processor according to the priority comparison result;
when the ARM processor receives a request for acquiring relevant processing results of the ARM processor required by processing tasks, which is sent by the second X86 processor, the request carries a task priority label (given by the first X86 processor), the ARM processor compares the priority of the task being interrupted by the second X86 processor with the priority of the task being processed by the ARM processor, and the ARM processor preferentially processes the request for acquiring relevant processing results of the ARM processor required by processing tasks, which is sent by the second X86 processor, or the task being processed by the ARM processor according to the priority comparison result;
the data transmission between the second X86 processor and the ARM processor is realized by forwarding through the first X86 processor, that is, the requests and the related processing results between the second X86 processor and the ARM processor are both sent to the first X86 processor by a sender and forwarded to a receiver by the first X86 processor;
when the ARM processor executes a task to a task interrupt point and can continue subsequent processing only when a related processing result which is helped by the second X86 processor to be executed alternately is acquired, the ARM processor makes a request for a part of tasks which need to be processed by the second X86 processor to the first X86 processor, and the first X86 processor sets a priority for the part of tasks and then forwards the priority to the second X86 processor;
when the task executed by the second X86 processor reaches a task interruption point and the subsequent processing can continue without acquiring the related processing result which is helped by the ARM processor to be executed alternately, the second X86 processor requests a part of tasks which need to be processed by the ARM processor to the first X86 processor, and the first X86 processor sets a priority for the part of tasks and then forwards the priority to the ARM processor.
In some embodiments, the processing of the second X86 processor according to the request for obtaining the relevant processing result of the second X86 processor required by the processing task sent by the priority comparison result priority processing ARM processor or the task being processed by the second X86 processor, includes:
when the priority of the task interrupted by the ARM processor is higher, the request for acquiring the relevant processing result of the second X86 processor required by the processing task, sent by the ARM processor, is processed preferentially, the relevant task is processed according to the request of the ARM processor, the processing result is fed back to the ARM processor, and then the task processed by the second X86 processor is continued;
wherein, the processing of the request for obtaining the relevant processing result of the ARM processor required by the processing task sent by the second X86 processor or the task being processed by the ARM processor according to the priority comparison result by the ARM processor includes:
when the priority of the task being interrupted by the second X86 processor is higher, the request for obtaining the relevant processing result of the ARM processor required by the processing task, sent by the second X86 processor, is processed preferentially, the relevant task is processed according to the request of the second X86 processor, the processing result is fed back to the second X86 processor, and then the task being processed by the ARM processor is continued.
Specifically, in the present embodiment, for a task that requires the other party to interrupt the current task processing and perform the insertion processing during the task processing, the following method is implemented: the second X86 processor and the sending party in the ARM processor send the request to the first X86 processor, after receiving the request, the first X86 processor judges the priority of the task being processed by the receiving party, sets a level higher than the priority of the other party for the requested task, and gives the requested task to the other party for priority processing, because the part of tasks needing to be processed by the other party is only few and is processed very fast, the embodiment can avoid the long-time interrupt waiting of the processors in the alternative execution task, thereby improving the efficiency of the alternative execution task.
It should be noted that, in the past, the program interrupt and the priority are both the same processor, the internal setting and allocation is performed, and the scheduling is performed at the chip processing level, and the interrupt and the priority in this embodiment are scheduled at the software level, and the important feature is that, for the X86 and ARM mixed architecture processing, the first X86 processor provided with the preprocessing is scheduled, and the target task is to fully utilize the operation efficiency of different instruction sets of the two processor structures to schedule the program.
Referring to fig. 2, another embodiment of the present invention further provides a computer device, which includes a first X86 processor 1, a second X86 processor 2, and an ARM processor 3, and is configured to implement the steps of the computer task management method according to the above embodiment.
It should be noted that the computer device in this embodiment corresponds to the method in the foregoing embodiment, and therefore, details of the computer device in this embodiment may be obtained by referring to the contents of the method in the foregoing embodiment, which are not described herein again.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.