WO2014082421A1 - 一种众核处理器进程间相互通信的方法、装置及系统 - Google Patents

一种众核处理器进程间相互通信的方法、装置及系统 Download PDF

Info

Publication number
WO2014082421A1
WO2014082421A1 PCT/CN2013/074709 CN2013074709W WO2014082421A1 WO 2014082421 A1 WO2014082421 A1 WO 2014082421A1 CN 2013074709 W CN2013074709 W CN 2013074709W WO 2014082421 A1 WO2014082421 A1 WO 2014082421A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
destination
message body
qmc
message header
Prior art date
Application number
PCT/CN2013/074709
Other languages
English (en)
French (fr)
Inventor
刘潭义
颜友亮
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP13859349.6A priority Critical patent/EP2908246B1/en
Publication of WO2014082421A1 publication Critical patent/WO2014082421A1/zh
Priority to US14/725,066 priority patent/US9678813B2/en

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/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • 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/466Transaction processing
    • G06F9/467Transactional memory
    • 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/54Interprogram communication

Definitions

  • the present invention relates to the field of many-core operating systems, and in particular, to a method, device and system for communicating among a multi-core processor process.
  • the processor of electronic equipment has evolved from a single core to a multi-core, and then to the many cores.
  • Many-core processors use the non_cache_coherent (non-cache coherent) architecture and the multi-kernel OS (multi-core operating system). Communicate with messages in each process in a many-core processor.
  • inter-core communication is achieved by shared memory, polling, and IP I (Inter-Process Interrupt Interrupt Interrupt) on a non-cache-coherent many-core processor platform.
  • the shared memory is divided into multiple blocks equal in size to the cache line.
  • the sender puts the message body in the shared memory, and places the channel ID (channel identifier) containing the memory address information in the MPB (Message Passing Buffer), and notifies the receiving end to obtain the channel ID from the MPB through the IPI, and finally
  • the user layer application at the receiving end reads the message body from the shared memory.
  • the user layer application needs to read the message body from the shared memory, which reduces the reading speed of the message body and reduces the user experience.
  • the embodiments of the present invention provide a method, an apparatus, and a system for communicating between a multi-core processor process, which are used to improve the reading speed of the message body and improve the user experience.
  • an embodiment of the present invention provides a method for inter-communication between a multi-core processor process, which is performed by a destination kernel K er na l, the destination core corresponding to a destination processor core, and the method includes: The message channel QMC acquires a message header of the message; executing a CPU prefetch instruction according to the message header, so that a message body corresponding to the message header in the message stored in the shared memory is loaded to the destination processor core Corresponding to the cache cec he; switching to the destination process, causing the destination process to obtain the message body from the cac he.
  • the message header includes a start address stored by the message body in the shared memory, and a size S i ze of the message body, the start address, and the message.
  • the size of the body is used to indicate the message body stored in the shared memory; or the message header includes a start address and an end address stored by the message body in the shared memory, the start address And the ending is for indicating the message body stored in the shared memory.
  • the message header includes: identifier information, where the identifier information is used to indicate that the message body of the message passes The QMC is transmitted.
  • the method before the executing the CPU prefetch instruction according to the message header, the method further includes: detecting whether the message header is included in the message header
  • the performing the CPU prefetching instruction according to the message header includes: if it is detected that the identifier does not include the identifier information, executing a CPU prefetching instruction according to the message header.
  • the message header includes a first destination process identifier, and is used to identify the destination process corresponding to the message header.
  • the method further includes: before acquiring the message header of the message from the fast message channel QMC, Includes: Receive source a first interrupt trigger signal sent by the kernel; performing a first interrupt processing according to the first interrupt trigger signal, in the first interrupt processing, reading the message header from the QMC, according to the header in the message header
  • the first destination process identifier inserts the message header into a message receiving queue corresponding to the destination process; and performs process scheduling after exiting the first interrupt processing;
  • the message header of the message obtained from the fast message channel QMC includes: And when the destination process is performed, the message header is obtained from a message receiving queue corresponding to the destination process.
  • a fifth possible implementation manner if it is detected that the identifier information is included in the message header, the process is switched to the destination process, so that the destination process is The message body corresponding to the message header in the message is obtained in the QMC.
  • the message header further includes: a second destination process identifier; the method further includes: acquiring a message from the fast message channel QMC Before the message header, comprising: receiving a second interrupt trigger signal sent by the source core; performing a second interrupt processing according to the second interrupt trigger signal, and reading from the QMC during the second interrupt processing
  • the message header and the message body, the message header and the message body are placed in a message receiving queue corresponding to the destination process according to the second destination process identifier in the message header; and the process scheduling is performed after exiting the second interrupt processing
  • detecting, if the identifier includes the identifier information, switching to the destination process, so that the destination process obtains, from the QMC, the message body corresponding to the message header in the message includes: Detecting that the identifier includes the identifier information, and when scheduling to the destination process, switching to the destination process, so that Acquiring the queue message body from the destination process receives the message corresponding to the destination process.
  • the message body is processed by a source
  • the core is sent by the following method: Determining whether the size size of the message body is greater than a maximum load that the QMC can send; if it is detected that the size size of the message body is greater than a maximum load that the QMC can send, the source processor core sends the message.
  • the storage is stored in the shared memory; the source kernel stores information of the message body of the message stored in the shared memory as a message header into the QMC, and sends the information to the destination core; if the The size of the message body is not greater than the maximum payload that can be sent by the QMC, and the source kernel stores the message body of the message to the QMC, and will indicate the message stored in the QMC.
  • the information of the message body is stored as a message header in the QMC and sent to the destination kernel.
  • an embodiment of the present invention provides a multi-core processor, including: a source processor core and a destination processor core, where the destination processor core runs a target kernel, and the destination kernel includes: an acquiring unit, a message header for obtaining a message from the fast message channel QMC; an instruction prefetching unit, configured to execute a CPU prefetch instruction according to the message header acquired by the acquiring unit, so that the message stored in the shared memory is in the message
  • the message body corresponding to the message header is loaded into the cache cache corresponding to the destination processor core; the process switching unit is configured to switch to the destination process after the instruction prefetch unit executes the CPU prefetch instruction, so that the purpose is The process obtains the message body from the cache.
  • an embodiment of the present invention provides a core processor system, including: a source processor core, a destination processor core, and a memory; the memory, configured to store the source processor core and the destination processing
  • the code of the core running is used to read the code stored in the memory for execution by the target kernel Kernal.
  • the kernel program By running the kernel program, the following method is performed: obtaining a message header of the message from the fast message channel QMC; Performing a CPU prefetch instruction according to the message header, so that a message body corresponding to the message header in the message stored in the shared memory is loaded into a cache cache corresponding to the destination processor core; switching to the destination process Causing the destination process to retrieve the message body from the cache.
  • Embodiments of the present invention provide a method, apparatus, and system for intercommunication between processes of a multi-core processor.
  • the destination core of the destination processor core obtains a message header from the QMC, and executes a CPU prefetch instruction according to the obtained message header. Instructs to load the message body to the destination In the corresponding cca he of the processor core, switch to the destination process, so that the destination process obtains the message body from cac he. In this way, during the inter-process communication process, the message body is loaded into the cac he, so that the destination process can directly obtain the message body from the cac he, without accessing the shared memory to obtain the message body, thereby improving the reading speed of the message body. And improve the user experience.
  • FIG. 1 is a schematic diagram of a method for mutual communication between processes of a many-core processor according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of another method for communicating between processes of a many-core processor according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of another method for communicating between processes of a many-core processor according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of another method for communicating between processes of a many-core processor according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a multi-core processor according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a target kernel shown in FIG. 5;
  • Figure 7 is another schematic structural view of the target core shown in Figure 5;
  • Figure 8 is another schematic structural view of the target core shown in Figure 5;
  • Figure 9 is another schematic structural view of the target core shown in Figure 5;
  • Figure 10 is a schematic structural diagram of the source processor core shown in Figure 5;
  • FIG. 11 is a schematic structural diagram of a multi-core processor system according to an embodiment of the present invention.
  • the embodiment of the present invention provides a method for communicating between processes of a multi-core processor, which is executed by a target kernel Kernal.
  • the destination core corresponds to a destination processor core. As shown in FIG. 1, the method includes:
  • the message header of the message is used to indicate the message body stored in the shared memory.
  • the message header of the message includes: a start address stored in the shared memory by the message body and a size s i ze of the message body.
  • the start address and the size of the message body are used to indicate the message body stored in the shared memory.
  • the message header of the message includes: a start address and an end address stored by the message body in the shared memory.
  • the start address and the end address are used to indicate the message body stored in the shared memory.
  • message header may also indicate the message body stored in the shared memory by other methods, which is not limited by the present invention.
  • the message header further includes a first target process identifier.
  • the process identifier of the first destination is used to identify the target process corresponding to the message header.
  • each process has its corresponding process identifier.
  • the target kernel obtains the message header of the message from the QMC, the destination kernel is in the kernel state.
  • the destination kernel obtains the message header of the message, if the message header includes: a starting address of the message body stored in the shared memory and a size of the message body, the destination kernel is configured according to the a start address of the message body stored in the shared memory and a size of the message body, and executing a CPU (Central Processing Unit) prefetch instruction, so that the destination kernel sends the message body of the message from the shared memory.
  • a CPU Central Processing Unit
  • the destination kernel executes the CPU according to the start address and the end address stored in the shared memory by the message body.
  • the prefetch instruction causes the destination kernel to load the message body of the message from the shared memory into the cache corresponding to the destination processor core.
  • the destination kernel switches to the destination process.
  • the destination kernel simultaneously switches to the destination process, so that the purpose is The process obtains the message body from the cache.
  • the destination kernel switches to the destination kernel including: The destination kernel switches from kernel mode to user mode.
  • An embodiment of the present invention provides a method for mutually communicating among a multi-core processor process.
  • the destination core of the destination processor core obtains a message header from the QMC, and executes a CPU prefetch instruction according to the obtained message header to indicate a message body.
  • the message body is loaded into the cache, so that the destination process can directly obtain the message body from the cache without accessing the shared memory to obtain the message body, thereby improving the reading speed of the message body, and Improve the user experience.
  • Embodiments of the present invention provide a method for mutually communicating among a multi-core processor process, which is performed by a destination kernel Kerna 1 and a source core, where the destination core corresponds to a destination processor core, and the source core corresponds to a source processor core. , including:
  • the first process of the source processor core invokes a library function in MsgLib to send a message.
  • the library function in MsgLib needs to be called.
  • the source processor core there are two methods for the source processor core to send a message to the destination processor core.
  • One is that the library function in the source processor core MsgLib does not detect the message body size size of the message, directly the message The message body is stored in the shared memory, so that the destination kernel obtains the message body of the message through the shared memory. If the source processor core uses this method, the shell performs a step 202a, 203-206, 208b-209b, ⁇ Figure 2 and Figure 3 are shown.
  • the second method is that the library function in the MsgLib of the source processor core detects the message body size of the message, and stores the message body of the message according to the detection result. If the source processor core uses the second method, the step is performed. 202b, 203-207, 208a or step 202b, 203-207, 208b-209b, as shown in FIG. 4 and FIG.
  • the library function in the source processor core's MsgLib stores the message body of the message into the shared memory and switches to the kernel state.
  • the library function in the source processor core MsgLib stores the message body of the message to the shared memory, and then switches the source processor core from the user state to the kernel state through a system call, and then enters the source kernel.
  • the library function in the MsgLib of the source processor core detects whether the size size of the message body is greater than a maximum load that the QMC can send, and switches to a kernel state.
  • the maximum load that QMC can send is preset.
  • the maximum load that the QMC can send can be preset in three ways, as follows.
  • the multi-core processor performing inter-process communication includes at least two processor cores, and determining that the processor core is the first processor core that is started when the multi-core processor is started may be the source processing described above.
  • the core of the device, or the destination processor core after determining that the processor core determines the maximum load that the QMC can send, the determined QMC can send The maximum load is sent to other processor cores.
  • the first method of determining the maximum core load that the processor core can determine is: Determine the processor core to determine the amount of QMC transmission data equal to the Cache Line, then according to the formula S payl .
  • Ad S cache - S addr - S size - S dstp determines the maximum payload that the QMC can send.
  • S. a ⁇ represents the byte occupied by the QMC's transmission data amount
  • S addr represents the byte occupied by the start address of the shared memory
  • S size represents the size of the body size of the message
  • S dstp represents the destination process identifier.
  • Ad represents the byte occupied by the maximum payload that the QMC can send.
  • S T is the number of bytes carried in the first channel.
  • the first channel is a channel for transmitting a message body allocated for each processor core.
  • the second way to determine the processor core to determine the maximum load that the QMC can send is: Determine the processor core according to the formula Determine the amount of data transferred by QMC.
  • S T represents the number of bytes carried in the first channel; the first channel is a channel of a transmission object allocated for each processor core of the many-core processor; N-1 represents the number of QMCs; byte cache Cache Line represents the share.
  • processor cores in the multi-core processor there are at least two processor cores in the multi-core processor that performs inter-process communication, so that one QMC is multiplexed between each two processor cores. If many people There are N processor cores in the processor, and there are N1 QMCs.
  • N 48
  • the number of QMC is 47
  • the size of the Cache Line is 32 bytes
  • the size of the message is 5 bytes.
  • the size of the message body is 1 byte
  • the destination process identifier is byte.
  • the first channel The number of bytes carried in the byte is byte, and the amount of transmitted data determined according to the formula s (N-1)*S is byte. According to the formula, the maximum payload that can be sent is byte.
  • a third method of determining the maximum amount of load that the processor core can determine is: Determining that the processor core divides the first channel into portions for inter-core communication and portions for communication between applications. Determine the processor core according to the formula.
  • (nl)*S Determines the amount of transmitted data used for inter-core communication. According to the formula. Dstp determines the maximum payload that can be sent for inter-core communication. Wherein, indicates the percentage of the first channel that determines the processor core for inter-core communication; indicates the number of communications for inter-core communication.
  • the number of inter-core communication is determined by using at least two processor cores in the multi-core processor performing inter-process communication, so that between each two processor cores Reuse one. For example, if there is a processor core in a many-core processor, there is one.
  • the processor core determines the amount of transmitted data for determining the processor core for inter-application communication according to equation L".
  • the maximum load that can be transmitted by the processor core for inter-application communication is determined according to the formula d stp . Where is the number of communications used for inter-application communication.
  • the number of uses for inter-core communication is first 50% of the channel is used for inter-core communication, then? ⁇ is 50%, Cache Line size is 32 bytes, Addr is 5 bytes, message body size is ze, 1 byte, destination process ID is 2 bytes, and bytes of inter-core communication are carried in the first channel.
  • the number is 8192 bytes, then according to the formula (Nl)*5
  • S t is determined for inter-core communications QMC the amount of data transmission is 64 bytes, then according to the formula S payl.
  • Ad S chanell _ S addr - S size - S dstE determines that the maximum payload that can be sent by the QMC for inter-core communication is 56 bytes.
  • the amount of transmitted data for the QMC used to determine communication between applications is 1024 bytes, according to the formula S payl .
  • Ad S ehanel2 - S addr - S size - S dstp determines that the maximum payload that the QMC used for inter-application communication can send is 1016 bytes.
  • the amount of data carried in the first channel of the at least two processor cores of the many-core processor performing inter-process communication is the same.
  • processor core may also determine the maximum load that the QMC can send by other methods, which is not limited by the present invention.
  • the library function in the MsgLib detects whether the size size of the message body of the message to be sent by the first process is greater than the maximum load that the QMC can send.
  • the message body of the detected message is larger than the maximum load that the QMC can send, the message body is stored in the shared memory. And through the system call, the source processor core is switched from the user state to the kernel state, and then enters the source kernel.
  • the message body is first written to the cache unit, and after all data of the message body is written into the value buffer unit, all data of the message body in the cache unit is written to In the shared memory. In this way, it is guaranteed that the body of the message read from the shared memory is complete and correct.
  • the size of the shared memory in the message body is a cache line.
  • the first integer is an integer greater than zero.
  • the source processor core is switched from the user state to the kernel state by a system call, and then the source kernel is entered.
  • the source kernel writes a message to the QMC.
  • step 202a when the source core processor executes step 202a, or step 202b is performed, and in step 202b, it is detected that the message body of the message is larger than the maximum load that the QMC can carry, because the message body of the message has already been
  • the storage is stored in the shared memory, so the source kernel only needs to store the information of the message body indicating the message stored in the shared memory as a message header to the QMC and send it to the destination kernel.
  • the message header of the message includes: a start address stored by the message body in the shared memory and a size s i ze of the message body.
  • the starting address stored in the shared memory is not empty.
  • the start address and the size of the message body are used to indicate the body of the message stored in the shared memory.
  • the message header of the message includes: a start address and an end address stored by the message body in the shared memory.
  • the start address and the end address are used to indicate the message body stored in the shared memory. And the start address and the end address are not empty.
  • message header of the message may also indicate the message body stored in the shared memory by other methods, which is not limited in the present invention.
  • the message header further includes: a first destination process identifier.
  • the process identifier of the first destination is used to identify the target process corresponding to the message header.
  • the message header further includes: the first data of the message body, so that the destination process detects whether it is from the cache according to the first data of the message body included in the message header.
  • the obtained first data in the message body is consistent, and if they are consistent, the processing flow of the subsequent message body is executed. If they are inconsistent, The message body obtained from the cache is discarded and is not processed.
  • step 2 02 b In the case where step 2 02 b is performed and the message body of the message is detected in step 2 02 b is not greater than the maximum load that the QMC can carry, the source kernel stores the message body of the message to the QMC, and Information indicating a message body of the message stored in the QMC is stored as a message header in the QMC and sent to the destination core. That is, the message header and message body of the message are stored in the QMC.
  • the message header and the message body are all stored in the QMC, the message is called a small message.
  • the message header of the small message includes: the size of the message body s i z e , and the identification information.
  • the identifier information is used to indicate that the message body of the message is transmitted through the QMC.
  • the identifier information includes: information that the start address stored in the shared memory is empty.
  • the size of the message body s i z e is set to a fixed value as the identification information, which is not limited by the present invention.
  • the message header of the small message further includes: a second target process identifier. 2 04.
  • the source core sends an interrupt trigger signal to the destination core of the destination processor core to trigger the destination core to perform interrupt processing.
  • the destination core receives an interrupt trigger signal.
  • the source kernel may determine the target processor core where the target kernel is located according to the destination process identifier carried in the message header of the message, and send an interrupt trigger signal to the destination processor core.
  • the destination process identifier in the message header of the message is the first destination process identifier
  • the source kernel determines the first destination processor core according to the first destination process identifier.
  • the first destination processor core transmits a first interrupt trigger signal.
  • the destination core of the first core processor core receives the first interrupt trigger signal.
  • the destination process flag in the message header of the message is determined by the source core according to the second destination process identifier, and the second interrupt trigger signal is sent to the second destination processor core. At this time, the destination core located in the second destination processor core receives the second interrupt trigger signal.
  • first interrupt trigger signal and the second interrupt trigger signal may be the same or different, and the present invention does not limit this.
  • the destination core performs interrupt processing according to the interrupt trigger signal, and dumps the message stored in the QMC to the corresponding message receiving queue.
  • the destination core receives the interrupt trigger signal and performs interrupt processing. At this time, the destination processor stops executing the current process, that is, the user state is switched to the kernel state.
  • the message body of the message is stored in the shared memory, and the source kernel stores the message header of the message into the QMC.
  • the destination core performs interrupt processing according to the first interrupt trigger signal, and reads the message header from the QMC during the first interrupt processing, according to the first destination process identifier in the message header.
  • the message header is placed in a message receiving queue corresponding to the destination process.
  • the message body of the message is stored in the QMC, and the source kernel stores the message header and the message body of the message into the QMC, that is, the source kernel will send a small message.
  • the destination core performs a second interrupt processing according to the second interrupt trigger signal, and reads the message header and the message body from the QMC during the second interrupt processing, according to the second purpose in the message header
  • the process identifier puts the message header and the message body as a small message into the message receiving queue corresponding to the destination process.
  • the process scheduling is performed after the first interrupt processing is exited. If the interrupt processing performed by the target core is the second interrupt processing, the second interrupt processing is exited and the process scheduling is performed.
  • the target kernel After the target kernel performs process scheduling, if the currently scheduled process is the process of the first process of the source processor core to send a message, that is, the destination process is scheduled, the destination kernel finds the message receiving queue of the destination process, and obtains the message receiving queue. Stored message headers. It should be noted that, if the currently scheduled process is not the process of the first process of the source processor core to send a message, that is, the third process is scheduled, the target kernel finds the message receiving queue of the third process, and obtains the message receiving queue. Stored message headers. The processing is consistent with the processing of scheduling the destination process. The following is an example of scheduling the destination process.
  • the kernel detects whether the identifier information is included in the message header.
  • the message header of the message contains the identifier information. If the message body of the message is stored in shared memory, the message header of the message does not contain identification information.
  • step 2 08 a If the destination kernel detects that the header contains the identification information, step 2 08 a is performed. If the target kernel detects that the header does not contain the identification information, then go to step 2 08 b_ 2 09 b.
  • the destination kernel switches to the destination process.
  • the message body of the message is also transmitted to the destination core through the QMC, and the message body is stored in the message receiving queue of the destination process in step 205.
  • the destination process is not required.
  • the target kernel does not need to perform process switching. It only needs to switch from kernel mode to user mode to switch to the destination process.
  • the destination process receives the message corresponding to the destination process. Get the message body directly in the queue.
  • the target kernel needs to execute the process switching program and switch to the destination process, so that the target process directly obtains the message body from the message receiving queue corresponding to the destination process.
  • the destination kernel executes a CPU prefetch instruction according to the message header.
  • the CPU prefetch instruction is executed according to the message header, so that the The message body is loaded into the cache ca che corresponding to the destination processor core.
  • the destination kernel stores a start address in the shared memory according to the message body and The size of the message body S i ze , executing a CPU (Central Processing Unit) prefetch instruction, so that the destination kernel shares the message body corresponding to the message header in the message stored in the shared memory
  • the memory is loaded into the cac he (cache) corresponding to the destination processor core.
  • the destination kernel executes the CPU according to the start address and the end address stored in the shared memory by the message body.
  • CPU Central Processing Unit, central processing unit
  • prefetching instructions so that the destination kernel loads the message body corresponding to the message header in the message stored in the shared memory from the shared memory to the cache corresponding to the destination processor core ( Cache).
  • the destination kernel switches to the destination process.
  • the destination kernel simultaneously switches to the destination process, so that the purpose is The process obtains the message body from the cache.
  • the destination process is the destination process.
  • the destination kernel does not need to perform process switching. It only needs to switch from the kernel mode to the user mode, and then can switch to the destination process, and the destination process obtains the location from the ca che. The body of the message.
  • the kernel state switches to the user state and switches to the destination process.
  • the target kernel needs to execute the process switching program and switch to the destination process, so that the target process obtains the message body from the cache.
  • the process switching program is executed at the same time, and the process is switched to the destination process.
  • Embodiments of the present invention provide a method for mutual communication between processes of a many-core processor.
  • the destination kernel detects whether the corresponding message body is transmitted by the QMC according to the message header of the message. If not transmitted by the QMC, the destination kernel learns that the message body is stored in the shared memory, and executes a CPU prefetch instruction according to the obtained message header, indicating that the message body is loaded from the shared memory into the cache corresponding to the destination processor core, and switches to the destination. Process, so that the destination process gets the message body from the cache. If the message body is directly transmitted by the QMC, the process is switched to the destination process, so that the destination process obtains the message from the message queue corresponding to the destination process.
  • the message body is loaded into the cache, so that the destination process can directly obtain the message body from the cache without accessing the shared memory to obtain the message body, thereby improving the reading speed of the message body, and Improve the user experience.
  • the size of the message body is not greater than the maximum load that can be carried by the QMC, the message body is transmitted through the QMC, and the destination core does not need to access the shared memory transmission, and directly obtains the message body from the QMC, thereby further improving the reading speed of the message body.
  • the user experience if the size of the message body is not greater than the maximum load that can be carried by the QMC, the message body is transmitted through the QMC, and the destination core does not need to access the shared memory transmission, and directly obtains the message body from the QMC, thereby further improving the reading speed of the message body.
  • An embodiment of the present invention provides a multi-core processor, as shown in FIG. 5, including: a source processor core 401, a destination processor core 402, the destination processor core running a destination core 403, the source processor The core 401 runs an active core 404, and the destination core, as shown in FIG. 6, includes:
  • the obtaining unit 4031 is configured to obtain a message header of the message from the fast message channel QMC.
  • the message header includes: a start address stored by the message body in the shared memory, and a size of the message body, where the start address and the size of the message body are used to indicate The body of the message stored in the shared memory.
  • the message header includes: a start address and an end address stored by the message body in the shared memory, where the start address and the end are used to indicate the message stored in the shared memory body.
  • the instruction prefetching unit 4032 is configured to execute a CPU prefetch instruction according to the message header acquired by the acquiring unit 4031, so that a message body corresponding to the message header in the message stored in the shared memory is loaded into the The cache cache corresponding to the destination processor core.
  • the process switching unit 4033 is configured to switch to the destination process after the instruction prefetch unit 4032 executes the CPU prefetch instruction, so that the destination process is from the cache. Get the message body.
  • the target kernel 4 0 3 also includes:
  • the foregoing message header includes: identifier information.
  • the identifier information is used to indicate information that the message body of the message transmits through the QMC.
  • the first detecting unit 4 0 34 is configured to detect whether the identifier information is included in the message header.
  • the instruction prefetching unit 4 032 is specifically configured to: when the first detecting unit 4 034 detects that the message header does not include the identifier information, according to the acquiring by the acquiring unit 4 031 The message header executes the CPU prefetch instruction.
  • the destination core 4 03 as shown in FIG. 8 , further includes:
  • the first transceiver unit 4 0 35 is configured to receive the first interrupt trigger signal sent by the source core 04 04.
  • the first processing unit 4 036 is configured to perform a first interrupt processing according to the first interrupt trigger signal received by the first transceiver unit 4 035.
  • the message header further includes: a first destination process identifier, configured to identify the target process corresponding to the message header.
  • the obtaining unit 4 031 is specifically configured to: when the first processing unit 4 036 performs the first interrupt processing, read the message header from the QMC, according to the first in the message header The destination process identifier puts the message header into a message receiving queue corresponding to the destination process.
  • the message header further includes: the first data of the message body, so that the destination process is based on the message body included in the message header.
  • the first data is detected whether it is consistent with the first data in the message body obtained from the ca che, and if they are consistent, the processing flow of the subsequent message body is executed. If they are inconsistent, the message body obtained from the c a che may be discarded without processing.
  • the first processing unit 4 0 36 is further configured to perform process scheduling after exiting the first interrupt processing.
  • the obtaining unit 4 031 is specifically configured to: when the first processing unit 4 036 schedules the destination process, obtain the message header from a message receiving queue corresponding to the destination process.
  • the process switching unit 403 is specifically configured to: when the first detecting unit 4 034 detects that the identifier includes the identifier information, switch to the destination process, so that the destination process is obtained from the QMC.
  • the message header further includes: a second destination process identifier.
  • the target kernel as shown in Figure 9, also includes:
  • the second transceiver unit 4 0 37 is configured to receive a second interrupt trigger signal sent by the source core 04 04.
  • the second processing unit 4 038 is further configured to perform a second interrupt processing according to the second interrupt trigger signal received by the second transceiver unit 4 037.
  • the obtaining unit 4 031 is specifically configured to: when the second processing unit 4 038 performs a second interrupt processing, read the message header and the message body from the QMC, according to the information in the message header The second destination process identifier puts the message header and the message body into a message receiving queue corresponding to the destination process.
  • the second processing unit 4 0 38 is further configured to perform process scheduling after exiting the second interrupt processing.
  • the process switching unit 403 3 is further configured to: when the first detecting unit 4 034 detects that the identifier includes the identifier information, scheduling, by the second processing unit 4 038, the When the destination process is performed, the process is switched to the destination process, so that the destination process acquires the message body from a message receiving queue corresponding to the destination process.
  • first processing unit and the second processing unit may be integrated into one processing unit, or may be separately configured as two processing units.
  • the first transceiver unit and the second transceiver unit may be integrated into one transceiver unit, or may be separately configured as two transceiver units, which is not limited in the present invention.
  • the source processor core 4 01 includes:
  • the second detecting unit 4 01 1 is configured to detect whether the size of the message body is large The maximum load that can be sent by the QMC.
  • the storage unit 4012 is configured to store the message body in the shared memory when the second detecting unit 4011 detects that the size size of the message body is greater than a maximum load that the QMC can transmit.
  • the storage unit 4012 is specifically configured to: first write all data of the message body to a cache unit, and then write all data of the message body in the cache unit to the shared memory. .
  • the size of the shared memory of the message body is a first integer multiple of a size of a cache line Cache Line; and the first integer is an integer greater than 0.
  • the source kernel 404 includes:
  • the third processing unit 4041 stores information indicating the message body of the message stored in the shared memory as a message header to the QMC, and transmits the information to the destination core.
  • the third processing unit 4041 is further configured to: when the detecting unit 4011 of the source processor core 401 detects that the size of the message body is not greater than a maximum load that can be sent by the QMC, the message body is stored. To the QMC, information for indicating a message body of the message stored in the QMC is stored as a message header in the QMC, and sent to the destination core.
  • the message header is used to indicate the message body stored in the shared memory.
  • the message header is used to indicate the message body of the message stored in the QMC.
  • the embodiment of the present invention provides a multi-core processor, the message header transmitted by the destination core of the destination processor core from the QMC, and stored in a message receiving queue corresponding to the destination process.
  • the destination kernel detects whether the corresponding message body is transmitted by the QMC according to the message header of the message. If not transmitted by the QMC, the destination kernel learns that the message body is stored in the shared memory, and executes a CPU prefetch instruction according to the obtained message header, indicating that the message body is loaded from the shared memory to the cache corresponding to the destination processor core, and switches to the destination. Process, so that the destination process gets the message body from the cache.
  • the process is switched to the destination process, so that the destination process obtains the message from the message queue corresponding to the destination process.
  • the message body is loaded into the cache, so that the destination process can directly obtain the message body from the cache without accessing the shared memory to obtain the message body, thereby improving the reading speed of the message body, and Improve the user experience.
  • the size of the message body is not greater than the maximum load that can be carried by the QMC, the message body is transmitted through the QMC, and the destination core does not need to access the shared memory transmission, and directly obtains the message body from the QMC, thereby further improving the reading speed of the message body. Improve the user experience.
  • the embodiment of the present invention provides a multi-core processor system, as shown in FIG. 11, comprising: a source processor core 801, a destination processor core 802, and a memory 803.
  • the memory 803 is configured to store code of the source processor core and the target processor core.
  • the destination processor core 802 is configured to read the code stored in the memory 803 for execution by the destination kernel Kernal.
  • the destination kernel Kernal executing the message header for obtaining the message from the fast message channel QMC .
  • the message header includes: a start address stored by the message body in the shared memory and a size size of the message body, where the start address and the size of the message body are used to indicate storage The body of the message in the shared memory.
  • the message header includes: a start address and an end address stored by the message body in the shared memory, where the start address and the end are used to indicate the message stored in the shared memory body.
  • the target kernel Kernal further performs a CPU prefetch instruction according to the message header, so that a message body corresponding to the message header in the message stored in the shared memory is loaded into a cache cache corresponding to the destination processor core. in.
  • the destination kernel Kernal also performs a switch to the destination process, causing the target process to retrieve the message body from the cache.
  • the foregoing message header includes: identifier information.
  • the identifier information is used to indicate information that the message body of the message transmits through the QMC.
  • the destination kernel Kernal further performs detecting whether the identifier includes the identifier information. Specifically, when it is detected that the identifier does not include the identifier information, the CPU prefetch instruction is executed according to the message header.
  • the destination core Kernal further performs a first interrupt trigger signal sent by the source processor core 801. And performing a first interrupt processing according to the received first interrupt trigger signal.
  • the message header further includes: a first destination process identifier, configured to identify the target process corresponding to the message header.
  • the destination kernel Kernal further performs reading the message header from the QMC during the first interrupt processing, and inserts the message header into the destination according to the first destination process identifier in the message header.
  • the message header further includes: part of the data of the message body, so that the destination process detects the slave according to part of the data of the message body.
  • the body of the message obtained in the cache.
  • the target kernel Kernal also performs process scheduling after exiting the first interrupt processing.
  • the message header is obtained from a message receiving queue corresponding to the target process.
  • the target kernel Kernal switches to the destination process, so that the destination process obtains the message body corresponding to the message header in the message from the QMC.
  • the message header further includes: a second destination process identifier.
  • the target kernel Kernal also performs a second interrupt trigger signal sent by the source processor core 801. And performing a second interrupt processing according to the received second interrupt trigger signal.
  • the target kernel Kernal reads the message header and the message body from the QMC during the execution of the second interrupt processing, and the message header is determined according to the second destination process identifier in the message header.
  • the message body is placed in the message receiving queue corresponding to the destination process.
  • the destination kernel Kernal also performs a process after exiting the second interrupt processing Scheduling.
  • the process is switched to the target process, so that the target process obtains the message body from the message receiving queue corresponding to the destination process.
  • the source processor core 801 is configured to read the code stored in the memory 803 for execution by the source kernel Kernal. By running the kernel program, the following method is performed:
  • the source processor core 801 performs to detect whether the size size of the message body is greater than a maximum load that the QMC can transmit.
  • the message body is stored in the shared memory.
  • the source processor core 801 is specifically executed, first writing all data of the message body to the cache unit, and then writing all data of the message body in the cache unit to the share In memory.
  • the size of the shared memory of the message body is a first integer multiple of a size of a cache line Cache Line; and the first integer is an integer greater than 0.
  • the source kernel Kernal executes information indicating a message body of the message stored in the shared memory as a message header to be stored in the QMC and sent to the destination core.
  • the source kernel Kernal is further configured to detect, when the size size of the message body is not greater than a maximum load that the QMC can send, the message body is stored to the QMC, and the indication is stored in the The information of the message body of the message in the QMC is stored as a message header in the QMC and sent to the destination core.
  • the message header is used to indicate the message body stored in the shared memory.
  • the message header is used to indicate the message body of the message stored in the QMC.
  • the embodiment of the present invention provides a multi-core processor system, in which the destination core of the destination processor core transmits messages from the QMC and stores them in a message receiving queue corresponding to the destination process.
  • the destination kernel detects whether the corresponding message body is transmitted by the QMC according to the message header of the message. If not transmitted by the QMC, the destination kernel learns that the message body is stored in the shared memory.
  • the CPU prefetch instruction is executed according to the obtained message header, and the message body is loaded from the shared memory into the cache corresponding to the destination processor core, and is switched to the destination process, so that the destination process obtains the message body from the cache.
  • the process is switched to the destination process, so that the destination process obtains the message from the message queue corresponding to the destination process.
  • the message body is loaded into the cache, so that the destination process can directly obtain the message body from the cache without accessing the shared memory to obtain the message body, thereby improving the reading speed of the message body, and Improve the user experience.
  • the size of the message body is not greater than the maximum load that can be carried by the QMC, the message body is transmitted through the QMC, and the destination core does not need to access the shared memory transmission, and directly obtains the message body from the QMC, thereby further improving the reading speed of the message body. Improve the user experience.
  • the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Multi Processors (AREA)

Abstract

一种众核处理器进程间相互通信的方法、装置及系统,涉及众核操作系统领域。该方法由目的内核Kernal执行,所述目的内核对应于目的处理器核;所述方法包括:从快速消息通道QMC获取消息的消息头(101);根据所述消息头执行CPU预取指令,使得存储在共享内存中的所述消息中与所述消息头对应的消息体被加载到所述目的处理器核对应的缓存cache中(102);切换到目的进程,使得所述目的进程从所述cache中获取所述消息体(103)。本方法适用于众核处理器的进程间相互通信的场景,用以实现提高消息体的读取速度,提高用户体验。

Description

一种众核处理器进程间相互通信的方法、 装置及系统 本申请要求于 2012 年 11 月 30 日提交中国专利局、 申请号为 201210505157.0 , 发明名称为 "一种众核处理器进程间相互通信的 方法、 装置及系统" 的中国专利申请的优先权, 其全部内容通过引 用结合在本申请中。
技术领域
本发明涉及众核操作系统领域, 尤其涉及一种众核处理器进程 间相互通信的方法、 装置及系统。
背景技术
随着移动通信技术的迅速发展, 人们对通信系统的高性能、 高 速率、 低延时的要求也越来越迫切, 因此对电子设备的处理器要求 也越来越高。 电子设备的处理器由单核发展到多核, 再发展到众核。 众核处理器釆用了 non_cache_coherent (非高速緩存一致) 体系 架构和 multi-kernel OS (多内核操作系统)。 在众核处理器中各进 程间釆用消息传递进行通信。
在现有技术中,通过在 non-cache-coherent 的众核处理器平台 上通过共享内存、 轮询和 IP I ( Inter-Process Interrupt 核 间 中断) 实现核间通信。 其中, 共享内存被分为与 cache line ( 高速 緩存线) 大小相等的多个块。 发送端将消息体放在共享内存中, 将 包含内存地址信息的 channel ID (通道标识) 放在 MPB ( Message Passing Buffer 消息传递緩存) 中, 通过 I P I通知接收端从 MPB中 获得 channel ID, 最后由接收端的用户层应用从共享内存中读取消 息体。
在实现上述核间通信的过程中, 发明人发现现有技术中至少存 在如下问题: 用户层应用需从共享内存中读取消息体, 降低了消息 体的读取速度, 降低了用户体验。
发明内容 本发明的实施例提供一种众核处理器进程间相互通信的方法、 装置及系统, 用以实现提高消息体的读取速度, 提高用户体验。
为达到上述目的, 本发明的实施例釆用如下技术方案:
第一方面, 本发明实施例提供了一种众核处理器进程间相互通 信的方法, 由目的内核 K e r na l执行, 所述目的内核对应于目的处理 器核, 所述方法包括: 从快速消息通道 QMC 获取消息的消息头; 根 据所述消息头执行 C PU预取指令, 使得存储在共享内存中的所述消 息中与所述消息头对应的消息体被加载到所述目 的处理器核对应的 緩存 c a c he 中; 切换到目 的进程, 使得所述目 的进程从所述 c a c he 中获取所述消息体。
在第一种可能的实现方式中, 所述消息头包括所述消息体在所 述共享内存中存储的起始地址以及所述消息体的大小 S i z e , 所述起 始地址以及所述消息体的大小用于指示存储在所述共享内存中的所 述消息体; 或者, 所述消息头包括所述消息体在所述共享内存中存 储的起始地址以及结束地址, 所述起始地址以及所述结束用于指示 存储在所述共享内存中的所述消息体。
结合第一方面或第一方面的第一种可能的实现方式, 在第二种 可能的实现方式中, 所述消息头包括: 标识信息; 所述标识信息用 于标示所述消息的消息体通过所述 QMC传输。
结合第一方面的第二种可能的实现方式, 在第三种可能的实现 方式中, 在所述根据所述消息头执行 CPU 预取指令之前, 还包括: 检测所述消息头中是否包含所述标识信息; 所述根据所述消息头执 行 CPU预取指令包括: 若检测出所述消息头中不包含所述标识信息, 则根据所述消息头执行 CPU预取指令。
结合第一方面, 或第一方面的第一种可能的实现方式, 或第一 方面的第二种可能的实现方式, 或第一方面的第三种可能的实现方 式, 在第四种可能的实现方式中, 所述消息头包括第一目 的进程标 识, 用于标识所述消息头对应的所述目 的进程; 所述方法还包括, 在所述从快速消息通道 QMC 获取消息的消息头之前, 包括: 接收源 内核发送的第一中断触发信号; 根据所述第一中断触发信号进行第 一中断处理, 在第一中断处理过程中, 从所述 QMC 中读取所述消息 头, 根据所述消息头中的所述第一目 的进程标识将所述消息头放入 所述目 的进程对应的消息接收队列; 退出第一中断处理后进行进程 调度; 所述从快速消息通道 QMC 获取消息的消息头包括: 当调度到 所述目 的进程时, 从所述目 的进程对应的消息接收队列中获取所述 消息头。
结合第一方面的第三种可能的实现方式, 在第五种可能的实现 方式中, 若检测出所述消息头中包含所述标识信息 , 则切换到 目 的 进程, 使得所述目 的进程从所述 QMC 中获取所述消息中与所述消息 头对应的消息体。
结合第一方面的第五种可能的实现方式, 在第六种可能的实现 方式中, 所述消息头还包括: 第二目 的进程标识; 所述方法还包括: 在从快速消息通道 QMC 获取消息的消息头之前, 包括: 接收所述源 内核发送的第二中断触发信号; 根据所述第二中断触发信号进行第 二中断处理, 在第二中断处理过程中, 从所述 QMC 中读取所述消息 头及消息体, 根据所述消息头中的所述第二目 的进程标识将所述消 息头及消息体放入所述目 的进程对应的消息接收队列; 退出第二中 断处理后进行进程调度; 所述若检测出所述消息头中包含所述标识 信息, 则切换到目 的进程, 使得所述目 的进程从所述 QMC 中获取所 述消息中与所述消息头对应的消息体包括: 若检测出所述消息头中 包含所述标识信息, 则当调度到所述目 的进程时, 切换到所述目 的 进程, 使得所述目 的进程从与所述目 的进程对应的消息接收队列中 获取所述消息体。
结合第一方面, 或第一方面的第一种可能的实现方式, 或第一 方面的第二种可能的实现方式, 或第一方面的第三种可能的实现方 式, 或第一方面的第四种可能的实现方式, 或第一方面的第五种可 能的实现方式, 或第一方面的第六种可能的实现方式, 在第七种可 能的实现方式中, 所述消息体由源处理器核通过下述方法发送: 检 测所述消息体的大小 size是否大于所述 QMC所能发送的最大载荷; 若检测到所述消息体的大小 size 大于所述 QMC 所能发送的最大载 荷, 则源处理器核将所述消息体存储至共享内存中; 所述源内核将 用于指示存储在共享内存中所述消息的消息体的信息作为消息头存 储至所述 QMC 中, 发送至所述目 的内核; 若检测到所述消息体的大 小 size不大于所述 QMC所能发送的最大载荷, 则所述源内核将所述 消息的消息体存储至所述 QMC, 并将用于指示存储在所述 QMC 中所 述消息的消息体的信息作为消息头存储至所述 QMC 中, 发送至所述 目的内核。
第二方面, 本发明实施例提供了一种众核处理器, 包括: 源处 理器核、 目 的处理器核, 所述目 的处理器核运行有目 的内核, 所述 目的内核包括: 获取单元, 用于从快速消息通道 QMC 获取消息的消 息头; 指令预取单元, 用于根据所述获取单元获取的所述消息头执 行 CPU预取指令, 使得存储在共享内存中的所述消息中与所述消息 头对应的消息体被加载到所述目的处理器核对应的緩存 cache 中; 进程切换单元, 用于在所述指令预取单元执行 CPU预取指令后, 切 换到目的进程, 使得所述目的进程从所述緩存中获取所述消息体。
第三方面, 本发明实施例提供了一种众核处理器系统, 包括: 源处理器核, 目 的处理器核, 存储器; 所述存储器, 用于存储所述 源处理器核及所述目 的处理器核运行的代码; 所述目 的处理器核用 于读取所述存储器中存储的代码以便目 的内核 Kernal执行, 通过运 行内核程序, 执行下述方法: 从快速消息通道 QMC 获取消息的消息 头; 根据所述消息头执行 CPU预取指令, 使得存储在共享内存中的 所述消息中与所述消息头对应的消息体被加载到所述目 的处理器核 对应的緩存 cache 中; 切换到目 的进程, 使得所述目 的进程从所述 cache 中获取所述消息体。
本发明实施例提供了一种众核处理器进程间相互通信的方法、 装置及系统, 通过目 的处理器核的目的内核从 QMC 中获取消息头, 并根据获取的消息头执行 CPU预取指令, 指示将消息体加载到目的 处理器核对应的 c a c he 中, 切换到 目 的进程, 以使得目 的进程从 c a c he 中获取消息体。 这样, 在进程间通信过程中, 将消息体加载 至 c a c he 中, 从而使得目 的进程可以直接从 c a c he 中获取消息体, 而无需访问共享内存获取消息体, 进而提高了消息体的读取速度, 并提高了用户体验。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下 面将对实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于 本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以 根据这些附图获得其他的附图。
图 1 为本发明实施例提供的一种众核处理器进程间相互通信的 方法的示意图;
图 2 为本发明实施例提供的另一种众核处理器进程间相互通信 的方法的示意图;
图 3 为本发明实施例提供的另一种众核处理器进程间相互通信 的方法的示意图;
图 4 为本发明实施例提供的另一种众核处理器进程间相互通信 的方法的示意图;
图 5为本发明实施例提供的一种众核处理器的结构示意图; 图 6为图 5所示的目 的内核的一种结构示意图;
图 7为图 5所示的目 的内核的另一种结构示意图;
图 8为图 5所示的目 的内核的另一种结构示意图;
图 9为图 5所示的目 的内核的另一种结构示意图;
图 1 0为图 5所示的源处理器核的一种结构示意图;
图 1 1 为本发明实施例提供的一种众核处理器系统的结构示意 图。
具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术 方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明 一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本 领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他 实施例, 都属于本发明保护的范围。
本发明实施例提供了一种众核处理器进程间相互通信的方法, 由目 的内核 Kernal执行, 所述目的内核对应于目 的处理器核, 如图 1所示, 包括:
101、 从 QMC ( Quick Message Channel , 快速消息通道) 获取 消息的消息头。
具体的, 若源内核处理器将消息的消息体存储在共享内存中, 则消息的消息头用于指示存储在所述共享内存中的所述消息体。 此 时, 所述消息的消息头包括: 所述消息体在所述共享内存中存储的 起始地址以及所述消息体的大小 s i ze。
其中, 所述起始地址以及所述消息体的大小用于指示存储在所 述共享内存中的所述消息体。
或者, 所述消息的消息头包括: 所述消息体在所述共享内存中 存储的起始地址以及结束地址。
其中, 所述起始地址以及所述结束地址用于指示存储在所述共 享内存中的所述消息体。
需要说明的是, 消息头还可用其他方法指示存储在所述共享内 存中的所述消息体, 本发明对此不做限制。
进一步的, 所述消息头还包括第一目 的进程标识。
其中, 所述第一目 的进程标识用于标识所述消息头对应的所述 目的进程。
需要说明的是, 在本发明所有实施中, 每个进程都有其对应的 进程标识。
需要说明的是, 目 的内核从 QMC 中获取消息的消息头时, 目 的 内核处于内核态。
102、 根据所述消息头执行 CPU预取指令, 使得存储在共享内存 中的所述消息中与所述消息头对应的消息体被加载到所述目 的处理 器核对应的緩存 cache 中。
具体的, 目 的内核在获取了消息的消息头后, 若消息头中包括: 所述消息体在所述共享内存中存储的起始地址以及所述消息体的大 小 size, 则目的内核根据所述消息体在所述共享内存中存储的起始 地址以及所述消息体的大小 size, 执行 CPU ( Central Processing Unit, 中央处理器) 预取指令, 使得目 的内核将所述消息的消息体 从共享内存中加载到目 的处理器核对应的 cache (緩存) 中。
若消息头中包括: 所述消息体在所述共享内存中存储的起始地 址以及结束地址, 则 目 的内核根据所述消息体在所述共享内存中存 储的起始地址以及结束地址, 执行 CPU ( Central Processing Unit, 中央处理器) 预取指令, 使得目 的内核将所述消息的消息体从共享 内存中加载到目的处理器核对应的 cache (緩存) 中。
103、 切换到目 的进程, 使得所述目 的进程从所述 cache 中获取 所述消息体。
具体的, 目 的内核在将执行 CPU预取指令后, 目 的内核切换到 目 的进程, 可选的, 在将消息体加载到目 的处理器核对应的 cache 时, 目的内核同时切换到目 的进程, 使得目 的进程从所述 cache 中 获取所述消息体。
进一步的, 目的内核切换到目 的内核包括: 目 的内核从内核态 切换到用户态。
本发明实施例提供了一种众核处理器进程间相互通信的方法, 通过目的处理器核的目的内核从 QMC 中获取消息头, 并根据获取的 消息头执行 CPU预取指令, 指示将消息体加载到目的处理器核对应 的 cache 中, 切换到目的进程, 以使得目 的进程从 cache 中获取消 息体。 这样, 在进程间通信过程中, 将消息体加载至 cache 中, 从 而使得目 的进程可以直接从 cache 中获取消息体, 而无需访问共享 内存获取消息体, 进而提高了消息体的读取速度, 并提高了用户体 验。 本发明实施例提供了一种众核处理器进程间相互通信的方法, 由目 的内核 Kerna 1和源内核执行, 所述目 的内核对应于目的处理器 核, 所述源内核对应于源处理器核, 包括:
201、 源处理器核的第一进程调用 MsgLib 中的库函数, 用以发 送消息。
具体的, 第一进程需向目 的处理器核的目 的进程发送消息时, 需要调用 MsgLib 中的库函数。
需要说明的是, 在源处理器核将消息发送至目 的处理器核的方 法有两种, 一种是源处理器核的 MsgLib 中的库函数不检测消息的消 息体大小 size, 直接将消息的消息体存储至共享内存中, 使得目的 内核通过共享内存获取所述消息的消息体, 若源处理器核釆用此种 方法, 贝' J执行步 聚 202a, 203-206, 208b-209b, ^口图 2及图 3所示。 第二种方法是, 源处理器核的 MsgLib 中的库函数检测消息的消息体 大小 size, 根据检测结果存储所述消息的消息体, 若源处理器核釆 用第二种方法, 则执行步骤 202b, 203-207, 208a或执行步骤 202b, 203-207, 208b-209b, 如图 4及参考图 3所示。
202a,源处理器核的 MsgLib 中的库函数将消息的消息体存储至 共享内存中, 并切换至内核态。
具体的,源处理器核的 MsgLib 中的库函数将消息的消息体存储 至共享内存后, 通过系统调用, 将源处理器核由用户态切换为内核 态, 此时进入到源内核。
202b,源处理器核的 MsgLib 中的库函数检测所述消息体的大小 size是否大于所述 QMC所能发送的最大载荷, 并切换至内核态。
其中, QMC 所能发送的最大载荷是预先设置。 可以通过三种方 法预先设置 QMC所能发送的最大载荷, 具体如下。
需要说明的是, 进行进程间通信的众核处理器中包括至少两个 处理器核, 确定处理器核是众核处理器启动时, 开启的第一个处理 器核, 可以是上述的源处理器核, 也可是目的处理器核, 在确定处 理器核确定了 QMC所能发送的最大载荷后, 将确定的 QMC所能发送 的最大载荷发送给其他处理器核。
确定处理器核确定 QMC所能发送的最大载荷的第一种方法为: 确定处理器核将 QMC传输数据量确定为与 Cache Line ( 高速緩 存线) 相等, 则可根据公式 Spaylad = Scache - Saddr - Ssize - Sdstp确 定所述 QMC所能发送的最大载荷。 其中, S。a ^表示 QMC 的传输数据 量所占的字节, Saddr表示共享存储器的起始地址所占的字节、 Ssize 表示消息的体的大小 size所占的字节、 Sdstp表示目 的进程标识所占 的字节, Spaylad表示 QMC所能发送的最大载荷所占的字节。 此时, 确 定处理器核中包含的 QMC 的个数为: ST/S he。 其中, ST是第一通道 中承载的字节数。 其中, 第一通道是为每个处理器核分配的传输消 息体的通道。
需要说明的是, 上述过程是将第一通道分成 ST/S。ahe个 QMC。 需要说明的是, 在本发明所有实施例中, 每次消息的传输使用 一个 QMC。
举例说明,假设第一通道中承载的字节数为 8k字节, Cache Line 大小为 32字节, Addr 占 5字节, 消息体的大小 size 占 1字节, 目 的进程标识占 2字节, 则根据公式 Spaylad = Scache _ Saddr - Ssize - Sdstp 计算出 QMC所能发送的最大载荷占 24字节。 确定处理器核可以使用 ST/Scache=8k/ 32 = 256个第 QMC, 即为将第一通道分为 256个 QMC。
确定处理器核确定 QMC所能发送的最大载荷的第二种方法为: 确定处理器核先根据公式
Figure imgf000011_0001
定 QMC的传 输数据量。 在根据公式 Spayioad = S chanel - Saddr - S s i ze - Sd s tp确定所 述 QMC所能发送的最大载荷。
其中, ST表示第一通道中承载的字节数; 所述第一通道是为众 核处理器的每个处理器核分配的传输息体的通道; N-1 表示 QMC 的 个数; Scache表示 Cache Line所占的字节。
需要说明的是, 在此方法中, 进行进程间通信的众核处理器中 有至少两个处理器核, 使每两个处理器核之间复用一 QMC。 若众核 处理器中有 N个处理器核, 则有 N-l个 QMC。
示例性的, 若 N为 48, 则 QMC 的个数为 47, Cache Line 大小 为 32字节 Addr 占 5字节, 消息体的大小 size 占 1字节, 目的进程 标识占 字节, 第一通道中承载的字节数为 字节, 则根据公式 s (N-1)*S 确定 的传输数据量为 字节。 根据公 式 确定 所能发送的最大载 荷为 字节。
确定处理器核确定 所能发送的最大载荷的第三种方法为: 确定处理器核将第一通道分为用于内核间通信的部分和用于应 用 程序 间 通信 的 部 分 。 确 定处 理 器核根据公 式 。
(n-l)*S 确定用于内核间通信的 的传输数据量。 根据公 式 。 d s t p确定用于内核间通信的 所能发送的最大载荷。 其中, 表示确定处理器核用于内核间通 信的占第一通道的百分比; 表示用于内核间通信的 的个数。
进一步的, 在此方法中, 内核间通信的 个数的确定方式是, 在进行进程间通信的众核处理器中有至少两个处理器核的情况下, 使每两个处理器核之间复用一个 。 例如众核处理器中有 个处 理器核, 则有 个 。
ST ^ (\ P * s
确定处理器核根据公式 L 」 确定所述确 定处理器核用于应用程序间通信的 的传输数据量。 根据公式 d s t p确定所述确定处理器核用于应 用程序间通信的 所能发送的最大载荷。 其中, 表示用于应用 程序间通信的 的个数。
需要说明的是, 在此方法中, 都是根据用户需求预设 设置的。
实例性的, 为 则用于核间通信的 的个数为 第一 通道的 50%用于核间通信, 则 ?^^为 50%, Cache Line 大小为 32 字节 Addr 占 5 字节, 消息体的大小 s i ze 占 1 字节, 目的进程标识 占 2字节, 第一通道中承载的内核间通信的字节数为 8192字节, 则 根据公式 (N-l)*5
St 确定用于内核间通信的 QMC的传 输数据量为 64字节, 则根据公式 Spaylad = Schanell _ Saddr - Ssize - SdstE 确定用于内核间通信的 QMC所能发送的最大载荷为 56字节。 假设 M
M为 4, 则根据 Sc 一*Scache
确定用于应用程 序间通信的 QMC的传输数据量为 1024字节,根据公式 Spaylad = Sehanel2 - Saddr - Ssize - Sdstp确定用于应用程序间通信的 QMC所能发送的最 大载荷为 1016字节。
需要说明的是, 进行进程间通信的众核处理器的至少两个处理 器核中第一通道中承载的数据量是相同的。
需要说明的是, 确定处理器核也可用其他方法确定 QMC所能发 送的最大载荷, 本发明对此不做限制。
具体的, 第一进程调用 MsgLib 中的库函数后, MsgLib 中的库 函数检测第一进程要发送的消息的消息体的大小 size 是否大于所 述 QMC所能发送的最大载荷。
若检测到消息的消息体的大小 size大于所述 QMC所能发送的最 大载荷, 则将所述消息体存储至共享内存中。 并通过系统调用, 将 源处理器核由用户态切换为内核态, 此时进入到源内核。
可选的, 先将所述消息体写入到緩存单元, 等到所述消息体的 全部数据都写入值緩存单元后, 再将所述緩存单元中的所述消息体 的全部数据写入到所述共享存储器中。 这样, 能够保证从共享存储 器中读到的消息体是完整和正确的。
需要说明的是, 也可以将消息体的全部数据直接写入到共享存 储器中, 还可是其他方式将消息体的全部数据写入到共享存储器中, 本发明对此不做限制。 可选的, 所述消息体所占共享存储器的大小为高速緩存线
Cache Line的大小的第一整数倍。 所述第一整数为大于 0的整数。
若检测到消息的消息体的大小 size不大于所述 QMC所能发送的 最大载荷, 则通过系统调用, 将源处理器核由用户态切换为内核态, 此时进入到源内核。
203、 源内核将消息写入 QMC。
具体的, 在源内核处理器执行了步骤 202a, 或者, 执行了步骤 202b, 且在步骤 202b 中检测出消息的消息体大于 QMC所能承载的最 大载荷的情况下, 由于此消息的消息体已经存储至共享内存中, 所 以源内核只需将此消息的用于指示存储在共享内存中所述消息的消 息体的信息作为消息头存储至所述 QMC 中, 发送至目的内核。
可选的, 所述消息的消息头包括: 所述消息体在所述共享内存 中存储的起始地址以及所述消息体的大小 s i ze。
其中, 共享内存中存储的起始地址不为空。 所述起始地址以及 所述消息体的大小用于指示存储在所述共享内存中的所述消息体。
或者, 所述消息的消息头包括: 所述消息体在所述共享内存中 存储的起始地址以及结束地址。
其中, 所述起始地址以及所述结束地址用于指示存储在所述共 享内存中的所述消息体。 且所述起始地址以及所述结束地址均不为 空。
需要说明的是, 所述消息的消息头还可用其他方法指示存储在 所述共享内存中的所述消息体, 本发明对此不做限制。
进一步的, 所述消息头还包括: 第一目的进程标识。
其中, 所述第一目 的进程标识用于标识所述消息头对应的所述 目的进程。
更进一步的, 所述消息头还包括: 所述消息体的第一数据, 使 得所述目 的进程根据所述消息头中包括的所述消息体的第一数据检 测其是否与从所述 cache 中获取的所述消息体中的第一数据一致, 如果一致, 则执行后续所述消息体的处理流程。 如果不一致, 则可 将从所述 c a c h e 中获取的所述消息体丟弃, 不作处理。
在执行了步骤 2 02 b , 且在步骤 2 02 b 中检测出消息的消息体不 大于 QMC 所能承载的最大载荷的情况下, 源内核将所述消息的消息 体存储至所述 QMC , 并将用于指示存储在所述 QMC 中所述消息的消 息体的信息作为消息头存储至所述 QMC 中, 发送至目 的内核。 即为 将消息的消息头及消息体均存储至 QMC 中。
需要说明的是, 在本发明所有实施例中, 若消息的消息头及消 息体均存储至 QMC , 则称此消息为小消息。
可选的, 小消息的消息头包括: 所述消息体的大小 s i z e , 及标 识信息。
其中, 所述标识信息用于标示所述消息的消息体通过所述 QMC 传输。
可选的, 所述标识信息包括: 共享内存中存储的起始地址为空 的信息。
需要说明的是, 还可用其他信息作为标识信息, 例如, 通过将 消息体的大小 s i z e设置为一个固定值作为标识信息, 本发明对此不 做限制。
进一步的, 所述小消息的消息头还包括: 第二目 的进程标识。 2 04、 源内核向目的处理器核的目的内核发送中断触发信号, 以 触发目的内核进行中断处理。 目的内核接收中断触发信号。
具体的, 源内核可以根据消息的消息头中携带的目的进程标识 确定目 的内核所在的目 的处理器核, 并向目的处理器核发送中断触 发信号。
在消息的消息体存储在共享内存中的情况下, 消息的消息头中 的目 的进程标识为第 ―目 的进程标识, 则源内核根据第一目 的进程 标识确定出第一目 的处理器核, 向此第一目的处理器核发送第一中 断触发信号。 此时, 位于第一目 的处理器核的目 的内核接收第一中 断触发信号。
若消息的消息体存储在 QMC 时, 消息的消息头中的目 的进程标 识为第二目 的进程标识, 则源内核根据第二目 的进程标识确定出第 二目 的处理器核, 向此第二目 的处理器核发送第二中断触发信号。 此时, 位于第二目 的处理器核的目 的内核接收第二中断触发信号。
需要说明的是, 第一中断触发信号与第二中断触发信号可以相 同, 也可不同, 本发明对此不做限制。
2 05、 目的内核根据中断触发信号进行中断处理, 并将所述 QMC 中存储的所述消息转存至相应的消息接收队列中。
具体的, 目 的内核接收到中断触发信号, 进行中断处理, 此时 目的处理器停止执行当前进程, 即为由用户态切换为内核态。
若目 的内核接收的中断触发信号为第一中断触发信号, 则说明 消息的消息体存储在共享内存中, 源内核将所述消息的消息头存储 至 QMC 中。 目的内核根据第一中断触发信号进行中断处理, 且在第 一中断处理过程中, 从所述 QMC 中读取所述消息头, 根据所述消息 头中的所述第一目 的进程标识将所述消息头放入所述目 的进程对应 的消息接收队列。
若目 的内核接收的中断触发信号为第二中断触发信号, 则说明 消息的消息体存储在 QMC 中, 源内核将所述消息的消息头及消息体 存储至 QMC 中, 即为源内核将小消息存储至 QMC 中。 目的内核根据 第二中断触发信号进行第二中断处理, 并在第二中断处理过程中, 从所述 QMC 中读取所述消息头及消息体, 根据所述消息头中的所述 第二目 的进程标识将所述消息头及消息体作为一个小消息放入所述 目的进程对应的消息接收队列。
2 06、 目 的内核退出中断处理后进行进程调度。
具体的, 若目的内核进行的中断处理为第一中断处理, 则退出 第一中断处理后进行进程调度。 若目 的内核进行的中断处理为第二 中断处理, 则退出第二中断处理后进行进程调度。
目的内核进行进程调度后, 若当前调度的进程为源处理器核的 第一进程要发送消息的进程, 即调度了 目 的进程, 目 的内核找到目 的进程的消息接收队列, 并获取此消息接收队列中存储的消息头。 需要说明的是, 若当前调度的进程不是源处理器核的第一进程 要发送消息的进程, 即调度了第三进程, 目的内核找到第三进程的 消息接收队列, 并获取此消息接收队列中存储的消息头。 其处理过 程与调度了 目 的进程的处理过程一致, 下面以调度了 目 的进程为例 进行说明。
2 07、 目 的内核检测消息头中是否包含所述标识信息。
其中, 若消息的消息体存储在 QMC 时, 此消息的消息头包含有 标识信息。 若消息的消息体存储在共享内存中, 此消息的消息头中 不包含标识信息。
需要说明的是, 根据目 的内核检测的结果不同, 目的内核下面 执行的步骤也不相同, 若目的内核检测到消息头中包含有标识信息, 则执行步骤 2 08 a。 若目 的内核检测到消息头中不包含标识信息, 则 执行步骤 2 08 b_ 2 09 b。
2 08 a , 目的内核切换到目的进程。
具体的, 若目的内核检测到消息头中包含有标识信息, 则说明 消息的消息体也是通过 QMC传输至目的内核, 并在步骤 2 05 中将此 消息体存储至目的进程的消息接收队列中。
若在进行中断处理前, 执行的进程就是目 的进程, 此时目的内 核无需进行进程切换, 只需由内核态切换到用户态, 即可切换至目 的进程, 目 的进程从与 目 的进程对应的消息接收队列中直接获取消 息体。
若在进行中断处理前, 执行的进程不是目 的进程, 则 目 的内核 需执行进程切换程序, 切换到目 的进程, 使得目 的进程从与 目 的进 程对应的消息接收队列中直接获取消息体。
2 08 b , 目的内核根据所述消息头执行 CPU预取指令。
具体的, 在目的内核在不执行步骤 2 07 的情况下, 或者, 在执 行了步骤 2 07 , 且目 的内核检测到消息头中不包含标识信息, 则根 据消息头执行 CPU预取指令, 使得所述消息体被加载到所述目 的处 理器核对应的緩存 c a che 中。 若消息头中包括: 所述消息体在所述共享内存中存储的起始地 址以及所述消息体的大小 size, 则 目的内核根据所述消息体在所述 共享内存中存储的起始地址以及所述消息体的大小 Size, 执行 CPU ( Central Processing Unit, 中央处理器) 预取指令, 使得目的内 核将存储在共享内存中的所述消息中与所述消息头对应的消息体从 共享内存中加载到目的处理器核对应的 cache (緩存) 中。
若消息头中包括: 所述消息体在所述共享内存中存储的起始地 址以及结束地址, 则 目 的内核根据所述消息体在所述共享内存中存 储的起始地址以及结束地址, 执行 CPU ( Central Processing Unit, 中央处理器) 预取指令, 使得目 的内核将存储在共享内存中的所述 消息中与所述消息头对应的消息体从共享内存中加载到目 的处理器 核对应的 cache (緩存 ) 中。
209b, 切换到目 的进程, 使得所述目的进程从所述 cache 中获 取所述消息体。
具体的, 目 的内核在将执行 CPU预取指令后, 目 的内核切换到 目 的进程, 可选的, 在将消息体加载到目 的处理器核对应的 cache 时, 目的内核同时切换到目 的进程, 使得目 的进程从所述 cache 中 获取所述消息体。
若在进行中断处理前, 执行的进程就是目 的进程, 此时目的内 核无需进行进程切换, 只需由内核态切换到用户态, 即可切换至目 的进程, 目的进程从所述 ca che 中获取所述消息体。
可选的, 目 的内核在将消息体加载到 目 的处理器核对应的 cache时, 同时由内核态切换到用户态, 切换到目的进程。
若在进行中断处理前, 执行的进程不是目 的进程, 则 目 的内核 需执行进程切换程序, 切换到目的进程, 使得目 的进程从所述 cache 中获取所述消息体。
可选的, 目 的内核在将消息体加载到 目 的处理器核对应的 cache时, 同时执行进程切换程序, 切换到目的进程。
本发明实施例提供了一种众核处理器进程间相互通信的方法, 目的内核根据消息的消息头检测对应的消息体是否由 QMC 传输。 若 不是由 QMC 传输, 则 目的内核获知消息体存储在共享内存中, 根据 获取的消息头执行 CPU预取指令, 指示将消息体由共享内存加载到 目的处理器核对应的 cache 中, 切换到目 的进程, 以使得目 的进程 从 cache 中获取消息体。 若消息体直接 QMC传输, 则切换至目 的进 程, 以使得目的进程从目的进程对应的消息队列中获取消息。 这样, 在进程间通信过程中, 将消息体加载至 cache 中, 从而使得目 的进 程可以直接从 cache 中获取消息体, 而无需访问共享内存获取消息 体, 进而提高了消息体的读取速度, 并提高了用户体验。 并且, 若 消息体的大小不大于 QMC所能承载的最大载荷时, 通过 QMC传输消 息体, 目 的内核无需访问共享内存传输, 直接从 QMC 中获取消息体, 进一步提高了消息体的读取速度, 提高了用户体验。
本发明实施例提供了一种众核处理器, 如图 5 所示, 包括: 源 处理器核 401、 目的处理器核 402, 所述目 的处理器核运行有目 的内 核 403, 所述源处理器核 401运行有源内核 404, 所述目 的内核, 如 图 6所示, 包括:
获取单元 4031 , 用于从快速消息通道 QMC获取消息的消息头。 可选的, 所述消息头包括: 所述消息体在所述共享内存中存储 的起始地址以及所述消息体的大小 s ize, 所述起始地址以及所述消 息体的大小用于指示存储在所述共享内存中的所述消息体。 或者, 所述消息头包括: 所述消息体在所述共享内存中存储的起始地址以 及结束地址, 所述起始地址以及所述结束用于指示存储在所述共享 内存中的所述消息体。
指令预取单元 4032, 用于根据所述获取单元 4031 获取的所述 消息头执行 CPU预取指令, 使得存储在共享内存中的所述消息中与 所述消息头对应的消息体被加载到所述目 的处理器核对应的緩存 cache 中。
进程切换单元 4033, 用于在所述指令预取单元 4032 执行 CPU 预取指令后, 切换到目 的进程, 使得所述目 的进程从所述 cache 中 获取所述消息体。
所述目 的内核 4 0 3 , 如图 7所示, 还包括:
可选的, 上述所述消息头包括: 标识信息。
其中, 所述标识信息用于标示所述消息的消息体通过所述 QMC 传输的信息。
第一检测单元 4 0 34 , 用于检测所述消息头中是否包含所述标识 信息。
具体的, 所述指令预取单元 4 032具体用于, 在所述第一检测单 元 4 034检测出所述消息头中不包含标识信息的情况下, 根据所述获 取单元 4 031获取的所述消息头执行 CPU预取指令。
进一步的, 所述目的内核 4 03 , 如图 8所示, 还包括:
第一收发单元 4 0 35 , 用于接收源内核 4 04发送的第一中断触发 信号。
第一处理单元 4 036 , 用于根据所述第一收发单元 4 035 接收的 第一中断触发信号进行第一中断处理。
所述消息头还包括: 第一目的进程标识, 用于标识所述消息头 对应的所述目 的进程。
所述获取单元 4 031 具体用于, 在所述第一处理单元 4 036进行 第一中断处理过程中, 从所述 QMC 中读取所述消息头, 根据所述消 息头中的所述第一目 的进程标识将所述消息头放入所述目 的进程对 应的消息接收队列。
进一步的, 在消息的消息体存储在共享内存的情况下, 所述消 息头还包括: 所述消息体的第一数据, 使得所述目 的进程根据所述 消息头中包括的所述消息体的第一数据检测其是否与从所述 c a che 中获取的所述消息体中的第一数据一致, 如果一致, 则执行后续所 述消息体的处理流程。 如果不一致, 则可将从所述 c a che 中获取的 所述消息体丟弃, 不作处理。
所述第一处理单元 4 0 36 , 还用于退出第一中断处理后进行进程 调度。 所述获取单元 4 031 具体用于, 在所述第一处理单元 4 036调度 到所述目 的进程时, 从所述目 的进程对应的消息接收队列中获取所 述消息头。
上述进程切换单元 4 03 3 具体用于, 在所述第一检测单元 4 034 检测出所述消息头中包含所述标识信息, 则切换到目 的进程, 使得 所述目的进程从所述 QMC 中获取所述消息中与所述消息头对应的消 息体。
进一步的, 所述消息头还包括: 第二目的进程标识。
所目的内核, 如图 9所示, 还包括:
第二收发单元 4 0 37 , 用于接收所述源内核 4 04发送的第二中断 触发信号。
第二处理单元 4 038 , 还用于根据所述第二收发单元 4 037 接收 的第二中断触发信号进行第二中断处理。
所述获取单元 4 031 具体用于, 在所述第二处理单元 4 038进行 第二中断处理过程中, 从所述 QMC 中读取所述消息头及消息体, 根 据所述消息头中的所述第二目 的进程标识将所述消息头及消息体放 入所述目 的进程对应的消息接收队列。
所述第二处理单元 4 0 38 , 还用于退出第二中断处理后进行进程 调度。
所述进程切换单元 4 03 3 , 还用于在所述第一检测单元 4 034 检 测出所述消息头中包含所述标识信息的情况下, 在所述第二处理单 元 4 038调度到所述目的进程时, 切换到所述目的进程, 使得所述目 的进程从与所述目 的进程对应的消息接收队列中获取所述消息体。
需要说明的是, 第一处理单元与第二处理单元可以集成为一个 处理单元, 也可单独设置为两个处理单元。 第一收发单元与第二收 发单元可以集成为一个收发单元, 也可单独设置为两个收发单元, 本发明对此不做限制。
所述源处理器核 4 01 , 如图 1 0所示, 包括:
第二检测单元 4 01 1 , 用于检测所述消息体的大小 s i z e 是否大 于所述 QMC所能发送的最大载荷。
存储单元 4012, 用于在所述第二检测单元 4011 检测到所述消 息体的大小 size大于所述 QMC所能发送的最大载荷, 则将所述消息 体存储至共享内存中。
具体的, 所述存储单元 4012具体用于, 先将所述消息体的全部 数据写入到緩存单元, 再将所述緩存单元中的所述消息体的全部数 据写入到所述共享存储器中。
可选的, 所述消息体所述共享存储器的大小为高速緩存线 Cache Line的大小的第一整数倍; 所述第一整数为大于 0的整数。
所述源内核 404 , 参考图 10所示, 包括:
第三处理单元 4041, 将用于指示存储在共享内存中所述消息的 消息体的信息作为消息头存储至所述 QMC 中, 发送至目的内核。
所述第三处理单元 4041, 还用于在所述源处理器核 401 的检测 单元 4011检测到所述消息体的大小 size不大于所述 QMC所能发送 的最大载荷, 则所述消息体存储至所述 QMC, 并将用于指示存储在 所述 QMC中所述消息的消息体的信息作为消息头存储至所述 QMC中, 发送至目 的内核。
具体的,若消息的消息体的大小 size大于 QMC所能承载的最大 载荷, 则所述消息头用于指示存储在所述共享内存中的所述消息体。
若消息的消息体的大小 size不大于 QMC所能承载的最大载荷, 则所述消息头用于指示存储在所述 QMC 中所述消息的消息体。
本发明实施例提供了一种众核处理器, 目 的处理器核的目的内 核从 QMC 中传输的消息头, 并存储至目的进程对应的消息接收队列 中。 目 的内核根据消息的消息头检测对应的消息体是否由 QMC传输。 若不是由 QMC 传输, 则目 的内核获知消息体存储在共享内存中, 根 据获取的消息头执行 CPU 预取指令, 指示将消息体由共享内存加载 到目 的处理器核对应的 cache 中, 切换到目的进程, 以使得目的进 程从 cache 中获取消息体。 若消息体直接 QMC传输, 则切换至目的 进程, 以使得目 的进程从目 的进程对应的消息队列中获取消息。 这 样, 在进程间通信过程中, 将消息体加载至 cache 中, 从而使得目 的进程可以直接从 cache 中获取消息体, 而无需访问共享内存获取 消息体, 进而提高了消息体的读取速度, 并提高了用户体验。 并且, 若消息体的大小不大于 QMC所能承载的最大载荷时, 通过 QMC传输 消息体, 目的内核无需访问共享内存传输, 直接从 QMC 中获取消息 体, 进一步提高了消息体的读取速度, 提高了用户体验。
本发明实施例提供了一种众核处理器系统,如图 11 所示,包括: 源处理器核 801, 目 的处理器核 802, 存储器 803。
所述存储器 803, 用于存储所述源处理器核及所述目 的处理器 核运行的代码。
所述目 的处理器核 802用于读取所述存储器 803 中存储的代码 以便目的内核 Kernal执行, 通过运行内核程序, 执行下述方法: 目的内核 Kernal,执行从快速消息通道 QMC获取消息的消息头。 可选的, 所述消息头包括: 所述消息体在所述共享内存中存储 的起始地址以及所述消息体的大小 size, 所述起始地址以及所述消 息体的大小用于指示存储在所述共享内存中的所述消息体。 或者, 所述消息头包括: 所述消息体在所述共享内存中存储的起始地址以 及结束地址, 所述起始地址以及所述结束用于指示存储在所述共享 内存中的所述消息体。
目的内核 Kernal, 还执行根据所述消息头执行 CPU预取指令, 使得存储在共享内存中的所述消息中与所述消息头对应的消息体被 加载到所述目 的处理器核对应的緩存 cache 中。
目的内核 Kernal, 还执行切换到目 的进程, 使得所述目 的进程 从所述 cache 中获取所述消息体。
进一步的, 上述所述消息头包括: 标识信息。
其中, 所述标识信息用于标示所述消息的消息体通过所述 QMC 传输的信息。
此时, 所述目 的内核 Kernal, 还执行检测所述消息头中是否包 含标识信息。 具体的, 在检测出所述消息头中不包含标识信息, 则根据所述 消息头执行 CPU预取指令。
进一步的, 所述目的内核 Kernal, 还执行接收源处理器核 801 发送的第一中断触发信号。 并根据接收的所述第一中断触发信号进 行第一中断处理。
所述消息头还包括: 第一目的进程标识, 用于标识所述消息头 对应的所述目 的进程。
目的内核 Kernal 在进行第一中断处理过程中, 还执行从所述 QMC 中读取所述消息头, 根据所述消息头中的所述第一目 的进程标 识将所述消息头放入所述目的进程对应的消息接收队列。
进一步的, 在消息的消息体存储在共享内存的情况下, 所述消 息头还包括: 所述消息体的部分数据, 使得所述目 的进程根据所述 消息体的部分数据检测所述从所述 cache 中获取的所述消息体。
目 的内核 Kernal, 还执行在退出第一中断处理后进行进程调 度。
具体的, 在目的内核 Kernal调度到所述目 的进程时, 从所述目 的进程对应的消息接收队列中获取所述消息头。
在检测出所述消息头中包含标识信息的情况下, 则 目 的内核 Kernal切换到目的进程, 使得所述目 的进程从所述 QMC 中获取所述 消息中与所述消息头对应的消息体。
进一步的, 所述消息头还包括: 第二目的进程标识。
此时, 目 的内核 Kernal, 还执行接收所述源处理器核 801发送 的第二中断触发信号。 并根据接收的所述第二中断触发信号进行第 二中断处理。
具体的, 目 的内核 Kernal在执行第二中断处理过程中, 从所述 QMC 中读取所述消息头及消息体, 根据所述消息头中的所述第二目 的进程标识将所述消息头及消息体放入所述目 的进程对应的消息接 收队列。
所述目 的内核 Kernal , 还执行在退出第二中断处理后进行进程 调度。
具体的, 在目的内核 Kernal调度到所述目 的进程时, 切换到所 述目 的进程, 使得所述目 的进程从与所述目的进程对应的消息接收 队列中获取所述消息体。
所述源处理器核 801 用于读取所述存储器 803 中存储的代码, 以便源内核 Kernal执行, 通过运行内核程序, 执行下述方法:
所述源处理器核 801, 执行检测所述消息体的大小 size是否大 于所述 QMC所能发送的最大载荷。
具体的,在检测到所述消息体的大小 size大于所述 QMC所能发 送的最大载荷, 则将所述消息体存储至共享内存中。
可选的, 所述源处理器核 801 具体执行, 先将所述消息体的全 部数据写入到緩存单元, 再将所述緩存单元中的所述消息体的全部 数据写入到所述共享存储器中。
可选的, 所述消息体所述共享存储器的大小为高速緩存线 Cache Line的大小的第一整数倍; 所述第一整数为大于 0的整数。
所述源内核 Kernal, 执行将用于指示存储在共享内存中所述消 息的消息体的信息作为消息头存储至所述 QMC 中, 发送至目的内核。
所述源内核 Kernal, 还执行在检测到所述消息体的大小 size 不大于所述 QMC 所能发送的最大载荷, 则所述消息体存储至所述 QMC, 并将用于指示存储在所述 QMC 中所述消息的消息体的信息作为 消息头存储至所述 QMC 中, 发送至目的内核。
具体的,若消息的消息体的大小 size大于 QMC所能承载的最大 载荷, 则所述消息头用于指示存储在所述共享内存中的所述消息体。
若消息的消息体的大小 size不大于 QMC所能承载的最大载荷, 则所述消息头用于指示存储在所述 QMC 中所述消息的消息体。
本发明实施例提供了一种众核处理器系统, 目 的处理器核的目 的内核从 QMC 中传输的消息, 并存储至目 的进程对应的消息接收队 列中。 目 的内核根据消息的消息头检测对应的消息体是否由 QMC 传 输。 若不是由 QMC传输, 则 目的内核获知消息体存储在共享内存中, 根据获取的消息头执行 CPU预取指令, 指示将消息体由共享内存加 载到目的处理器核对应的 cache 中, 切换到目 的进程, 以使得目的 进程从 cache 中获取消息体。 若消息体直接 QMC传输, 则切换至目 的进程, 以使得目 的进程从目 的进程对应的消息队列中获取消息。 这样, 在进程间通信过程中, 将消息体加载至 cache 中, 从而使得 目的进程可以直接从 cache 中获取消息体, 而无需访问共享内存获 取消息体, 进而提高了消息体的读取速度, 并提高了用户体验。 并 且, 若消息体的大小不大于 QMC 所能承载的最大载荷时, 通过 QMC 传输消息体, 目的内核无需访问共享内存传输, 直接从 QMC 中获取 消息体, 进一步提高了消息体的读取速度, 提高了用户体验。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或 部分步骤可以通过程序指令相关的硬件来完成, 前述的程序可以存 储于一计算机可读取存储介质中, 该程序在执行时, 执行包括上述 方法实施例的步骤; 而前述的存储介质包括: R0M、 RAM, 磁碟或者 光盘等各种可以存储程序代码的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围 并不局限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技 术范围内, 可轻易想到变化或替换, 都应涵盖在本发明的保护范围 之内。 因此, 本发明的保护范围应以所述权利要求的保护范围为准。

Claims

权 利 要 求 书
1、 一种众核处理器进程间相互通信的方法, 其特征在于, 由目 的内核 Ke r na l 执行, 所述目的内核对应于目的处理器核, 所述方法 包括:
从快速消息通道 QMC获取消息的消息头;
根据所述消息头执行 C P U预取指令,使得存储在共享内存中的所 述消息中与所述消息头对应的消息体被加载到所述目 的处理器核对 应的緩存 c a c he中;
切换到目的进程,使得所述目的进程从所述 c a che 中获取所述消 息体。
2、 根据权利要求 1 所述的方法, 其特征在于, 所述消息头包括 所述消息体在所述共享内存中存储的起始地址以及所述消息体的大 小 s i z e , 所述起始地址以及所述消息体的大小用于指示存储在所述 共享内存中的所述消息体;
或者,
所述消息头包括所述消息体在所述共享内存中存储的起始地址 以及结束地址, 所述起始地址以及所述结束地址用于指示存储在所述 共享内存中的所述消息体。
3、 根据权利要求 1所述的方法, 其特征在于, 所述消息头包括: 标识信息; 所述标识信息用于标示所述消息的消息体通过所述 QMC传 输。
4、 根据权利要求 3所述的方法, 其特征在于, 在所述根据所述 消息头执行 CPU预取指令之前, 还包括:
检测所述消息头中是否包含所述标识信息;
所述根据所述消息头执行 CPU预取指令包括:
若检测出所述消息头中不包含所述标识信息,则根据所述消息头 执行 C P U预取指令。
5、 根据权利要求 1 - 4任一项所述的方法, 其特征在于: 所述消息头包括第一目的进程标识,用于标识所述消息头对应的 所述目的进程;
所述方法还包括,在所述从快速消息通道 QMC获取消息的消息头 之前, 包括:
接收源内核发送的第 ―中断触发信号;
根据所述第一中断触发信号进行第一中断处理,在第一中断处理 过程中, 从所述 QMC中读取所述消息头, 根据所述消息头中的所述第 一目 的进程标识将所述消息头放入所述目 的进程对应的消息接收队 列;
退出第一中断处理后进行进程调度;
所述从快速消息通道 QMC获取消息的消息头包括:
当调度到所述目的进程时,从所述目的进程对应的消息接收队列 中获取所述消息头。
6、 根据权利要求 1 - 5任一项所述的方法, 其特征在于, 所述消 息头包括: 所述消息体的第一数据;
所述方法还包括:
使得所述目 的进程根据所述消息头中包括的所述消息体的第一 数据检测其是否与从所述 c a c h e 中获取的所述消息体中的第一数据 一致, 如果一致, 则执行后续对所述消息体的处理流程。
7、 根据权利要求 4所述的方法, 其特征在于, 还包括: 若检测出所述消息头中包含所述标识信息, 则切换到目的进程, 使得所述目的进程从所述 QMC 中获取所述消息中与所述消息头对应 的消息体。
8、 根据权利要求 7述的方法, 其特征在于, 还包括: 所述消息头还包括: 第二目的进程标识;
所述方法还包括:
在从快速消息通道 QMC获取消息的消息头之前, 包括:
接收所述源内核发送的第二中断触发信号;
根据所述第二中断触发信号进行第二中断处理,在第二中断处理 过程中, 从所述 QMC 中读取所述消息头及消息体, 根据所述消息头中 的所述第二目 的进程标识将所述消息头及消息体放入所述目 的进程 对应的消息接收队列;
退出第二中断处理后进行进程调度;
所述若检测出所述消息头中包含所述标识信息,则切换到目的进 程, 使得所述目的进程从所述 QMC 中获取所述消息中与所述消息头对 应的消息体包括:
若检测出所述消息头中包含所述标识信息,则当调度到所述目的 进程时, 切换到所述目的进程, 使得所述目的进程从与所述目的进程 对应的消息接收队列中获取所述消息体。
9、 根据权利要求 1 - 8任一项所述的方法, 其特征在于, 所述消息体由源处理器核通过下述方法发送:
检测所述消息体的大小 s i ze是否大于所述 QMC所能发送的最大 载荷;
若检测到所述消息体的大小 s i z e大于所述 QMC所能发送的最大 载荷, 则源处理器核将所述消息体存储至共享内存中; 所述源内核将 用于指示存储在共享内存中所述消息的消息体的信息作为消息头存 储至所述 QMC 中, 发送至所述目的内核;
若检测到所述消息体的大小 s i z e不大于所述 QMC所能发送的最 大载荷, 则所述源内核将所述消息的消息体存储至所述 QMC , 并将用 于指示存储在所述 QMC 中所述消息的消息体的信息作为消息头存储 至所述 QMC中, 发送至所述目的内核。
10、 根据权利要求 9所述的方法, 其特征在于, 若检测到所述消 息体的大小大于所述 QMC所能发送的最大载荷, 则将所述消息体存储 至共享内存中包括:
将所述消息体的全部数据写入到緩存单元,再将所述緩存单元中 的所述消息体的全部数据写入到所述共享存储器中。
11、 根据权利要求 9或 10所述的方法, 其特征在于, 所述消息 体所占共享存储器的大小为高速緩存线 Cache Line 的大小的第一整 数倍; 所述第一整数为大于 0的整数。
12、 一种众核处理器, 包括: 源处理器核、 目的处理器核, 所述 目的处理器核运行有目的内核, 其特征在于, 所述目的内核包括: 获取单元, 用于从快速消息通道 QMC获取消息的消息头; 指令预取单元, 用于根据所述获取单元获取的所述消息头执行
CPU预取指令, 使得存储在共享内存中的所述消息中与所述消息头对 应的消息体被加载到所述目的处理器核对应的緩存 cache中;
进程切换单元, 用于在所述指令预取单元执行 CPU预取指令后 , 切换到目的进程, 使得所述目的进程从所述 cache 中获取所述消息 体。
13、 根据权利要求 12 所述的众核处理器, 其特征在于, 所述消 息头包括所述消息体在所述共享内存中存储的起始地址以及所述消 息体的大小 size, 所述起始地址以及所述消息体的大小用于指示存 储在所述共享内存中的所述消息体;
或者,
所述消息头包括所述消息体在所述共享内存中存储的起始地址 以及结束地址, 所述起始地址以及所述结束用于指示存储在所述共享 内存中的所述消息体。
1 4、 根据权利要求 1 2 所述的众核处理器, 其特征在于, 所述消 息头包括: 标识信息; 所述标识信息用于标示所述消息的消息体通过 所述 QMC传输。
1 5、 根据权利要求 1 4 所述的众核处理器, 其特征在于, 所述目 的内核还包括:
第一检测单元, 用于检测所述消息头中是否包含所述标识信息; 所述指令预取单元具体用于,在所述第一检测单元检测出所述消 息头中不包含标识信息的情况下, 根据所述获取单元获取的所述消息 头执行 CPU预取指令。
1 6、 根据权利要求 1 2 - 1 5任一项所述的众核处理器, 其特征在 于, 所述消息头包括第一目的进程标识, 用于标识所述消息头对应的 所述目的进程;
所述目的内核还包括:
第一收发单元, 用于接收源内核发送的第一中断触发信号; 第一处理单元,用于根据所述第一收发单元接收的第一中断触发 信号进行第一中断处理;
所述获取单元具体用于,在所述第一处理单元进行第一中断处理 过程中, 从所述 QMC中读取所述消息头, 根据所述消息头中的所述第 一目 的进程标识将所述消息头放入所述目 的进程对应的消息接收队 列;
所述第一处理单元, 还用于退出第一中断处理后进行进程调度; 所述获取单元具体用于,在所述第一处理单元调度到所述目的进 程时, 从所述目的进程对应的消息接收队列中获取所述消息头。
1 7、 根据权利要求 1 5所述的众核处理器, 其特征在于, 所述进程切换单元具体用于,在所述第一检测单元检测出所述消 息头中包含所述标识信息, 则切换到目的进程, 使得所述目的进程从 所述 QMC中获取所述消息中与所述消息头对应的消息体。
1 8、 根据权利要求 1 7所述的众核处理器, 其特征在于,
所述消息头还包括: 第二目的进程标识;
所述目的内核还包括:
第二收发单元, 还用于接收所述源内核发送的第二中断触发信 号;
第二处理单元,还用于根据所述第二收发单元接收的第二中断触 发信号进行第二中断处理;
所述获取单元具体用于,在所述第二处理单元进行第二中断处理 过程中, 从所述 QMC 中读取所述消息头及消息体, 根据所述消息头中 的所述第二目 的进程标识将所述消息头及消息体放入所述目 的进程 对应的消息接收队列;
所述第二处理单元, 还用于退出第二中断处理后进行进程调度; 所述进程切换单元具体用于,在所述第一检测单元检测出所述消 息头中包含所述标识信息的情况下, 若所述第二处理单元调度到所述 目的进程时, 切换到所述目的进程, 使得所述目的进程从与所述目的 进程对应的消息接收队列中获取所述消息体。
1 9、根据权利要求 1 2 - 1 8任一项所述的众核处理器,其特征在于, 所述源处理器核包括:
第二检测单元, 用于检测所述消息体的大小 s i z e是否大于所述 QMC所能发送的最大载荷;
存储单元, 用于在所述第二检测单元检测到所述消息体的大小 s i z e 大于所述 QMC 所能发送的最大载荷, 则将所述消息体存储至共 享内存中;
所述源内核包括:
第三处理单元,将用于指示存储在共享内存中所述消息的消息体 的信息作为消息头存储至所述 QMC 中, 发送至目的内核; 所述第三处理单元,还用于在所述源处理器核的检测单元检测到 所述消息体的大小 size 不大于所述 QMC所能发送的最大载荷, 则所 述消息体存储至所述 QMC, 并将用于指示存储在所述 QMC中所述消息 的消息体的信息作为消息头存储至所述 QMC中, 发送至目的内核。
20、 根据权利要求 19所述的众核处理器, 其特征在于, 所述存储单元具体用于,先将所述消息体的全部数据写入到緩存 单元, 再将所述緩存单元中的所述消息体的全部数据写入到所述共享 存储器中。
21、 根据权利要求 19或 20所述的众核处理器, 其特征在于, 所 述消息体所述共享存储器的大小为高速緩存线 Cache Line 的大小的 第一整数倍; 所述第一整数为大于 0的整数。
22、 一种众核处理器系统, 其特征在于, 包括: 源处理器核, 目 的处理器核, 存储器;
所述存储器,用于存储所述源处理器核及所述目的处理器核运行 所需的代码;
所述目的处理器核用于读取所述存储器中存储的代码以便目 的 内核 Kernal执行, 通过运行内核程序, 执行下述方法:
从快速消息通道 QMC获取消息的消息头;
根据所述消息头执行 C P U预取指令,使得存储在共享内存中的所 述消息中与所述消息头对应的消息体被加载到所述目 的处理器核对 应的緩存 cache中;
切换到目的进程,使得所述目的进程从所述 cache 中获取所述消 息体。
PCT/CN2013/074709 2012-11-30 2013-04-25 一种众核处理器进程间相互通信的方法、装置及系统 WO2014082421A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP13859349.6A EP2908246B1 (en) 2012-11-30 2013-04-25 Method, device and system for inter-process communication of many-core processor
US14/725,066 US9678813B2 (en) 2012-11-30 2015-05-29 Method, apparatus, and system for mutual communication between processes of many-core processor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210505157.0A CN103853620B (zh) 2012-11-30 2012-11-30 一种众核处理器进程间相互通信的方法、装置及系统
CN201210505157.0 2012-11-30

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/725,066 Continuation US9678813B2 (en) 2012-11-30 2015-05-29 Method, apparatus, and system for mutual communication between processes of many-core processor

Publications (1)

Publication Number Publication Date
WO2014082421A1 true WO2014082421A1 (zh) 2014-06-05

Family

ID=50827134

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/074709 WO2014082421A1 (zh) 2012-11-30 2013-04-25 一种众核处理器进程间相互通信的方法、装置及系统

Country Status (4)

Country Link
US (1) US9678813B2 (zh)
EP (1) EP2908246B1 (zh)
CN (1) CN103853620B (zh)
WO (1) WO2014082421A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851289A (zh) * 2019-10-23 2020-02-28 新华三信息安全技术有限公司 协议报文处理方法及交换机

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589829A (zh) * 2014-09-15 2016-05-18 华为技术有限公司 基于多核处理器芯片的数据处理方法、装置以及系统
CN105487933A (zh) * 2015-11-24 2016-04-13 无锡江南计算技术研究所 一种基于核间异步消息队列与共享内存的域间通信方法
CN105912410A (zh) * 2015-12-15 2016-08-31 乐视网信息技术(北京)股份有限公司 一种用于多个进程之间进行通信方法及客户端
KR102578648B1 (ko) 2016-03-14 2023-09-13 삼성전자주식회사 모뎀 데이터에 따라 코어 스위칭이 수행되는 애플리케이션 프로세서 및 이를 포함하는 시스템 온 칩
CN106657327A (zh) * 2016-12-20 2017-05-10 上海银禾油信息技术有限公司 消息推送方法及装置
CN107391278A (zh) * 2017-07-25 2017-11-24 郑州云海信息技术有限公司 一种基于共享内存的前后端通信方法
US11792307B2 (en) 2018-03-28 2023-10-17 Apple Inc. Methods and apparatus for single entity buffer pool management
US10846224B2 (en) * 2018-08-24 2020-11-24 Apple Inc. Methods and apparatus for control of a jointly shared memory-mapped region
CN111382441B (zh) * 2018-12-29 2023-04-25 阿里巴巴集团控股有限公司 一种应用处理器、协处理器及数据处理设备
CN110149262B (zh) * 2019-04-02 2021-03-12 视联动力信息技术股份有限公司 一种信令报文的处理方法和装置、及存储介质
US11477123B2 (en) 2019-09-26 2022-10-18 Apple Inc. Methods and apparatus for low latency operation in user space networking
US11558348B2 (en) 2019-09-26 2023-01-17 Apple Inc. Methods and apparatus for emerging use case support in user space networking
US11829303B2 (en) 2019-09-26 2023-11-28 Apple Inc. Methods and apparatus for device driver operation in non-kernel space
US11606302B2 (en) 2020-06-12 2023-03-14 Apple Inc. Methods and apparatus for flow-based batching and processing
US11775359B2 (en) 2020-09-11 2023-10-03 Apple Inc. Methods and apparatuses for cross-layer processing
US11954540B2 (en) 2020-09-14 2024-04-09 Apple Inc. Methods and apparatus for thread-level execution in non-kernel space
US11799986B2 (en) 2020-09-22 2023-10-24 Apple Inc. Methods and apparatus for thread level execution in non-kernel space
US11876719B2 (en) 2021-07-26 2024-01-16 Apple Inc. Systems and methods for managing transmission control protocol (TCP) acknowledgements
US11882051B2 (en) 2021-07-26 2024-01-23 Apple Inc. Systems and methods for managing transmission control protocol (TCP) acknowledgements

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100424675C (zh) * 2005-10-12 2008-10-08 大唐移动通信设备有限公司 多处理器系统的消息通信方法及装置
CN100471180C (zh) * 2006-02-09 2009-03-18 华为技术有限公司 一种消息传递的方法、装置和系统
CN101448018A (zh) * 2008-12-26 2009-06-03 中兴通讯股份有限公司 进程间通信方法和装置
CN102622329A (zh) * 2011-02-11 2012-08-01 微软公司 多核计算机中的远程核操作
CN102779110A (zh) * 2011-05-11 2012-11-14 扬智科技股份有限公司 基于远端代码调用和数据访问的多核心系统及其控制方法

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3895888B2 (ja) * 1999-06-29 2007-03-22 株式会社日立製作所 パケット通信方法およびノード装置
US6938253B2 (en) * 2001-05-02 2005-08-30 Portalplayer, Inc. Multiprocessor communication system and method
AU2003289844A1 (en) 2002-09-06 2004-05-13 Pact Xpp Technologies Ag Reconfigurable sequencer structure
US7950012B2 (en) 2005-03-16 2011-05-24 Oracle America, Inc. Facilitating communication and synchronization between main and scout threads
US8108863B2 (en) 2005-12-30 2012-01-31 Intel Corporation Load balancing for multi-threaded applications via asymmetric power throttling
US7890488B2 (en) 2007-10-05 2011-02-15 Yahoo! Inc. System and method for caching posting lists
US7953685B2 (en) 2007-12-27 2011-05-31 Intel Corporation Frequent pattern array
US8196147B1 (en) * 2008-10-31 2012-06-05 Netapp, Inc. Multiple-processor core optimization for producer-consumer communication
US8122132B2 (en) 2008-12-16 2012-02-21 International Business Machines Corporation Techniques for dynamically assigning jobs to processors in a cluster based on broadcast information
US8009682B2 (en) * 2009-05-05 2011-08-30 Citrix Systems, Inc. Systems and methods for packet steering in a multi-core architecture

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100424675C (zh) * 2005-10-12 2008-10-08 大唐移动通信设备有限公司 多处理器系统的消息通信方法及装置
CN100471180C (zh) * 2006-02-09 2009-03-18 华为技术有限公司 一种消息传递的方法、装置和系统
CN101448018A (zh) * 2008-12-26 2009-06-03 中兴通讯股份有限公司 进程间通信方法和装置
CN102622329A (zh) * 2011-02-11 2012-08-01 微软公司 多核计算机中的远程核操作
CN102779110A (zh) * 2011-05-11 2012-11-14 扬智科技股份有限公司 基于远端代码调用和数据访问的多核心系统及其控制方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851289A (zh) * 2019-10-23 2020-02-28 新华三信息安全技术有限公司 协议报文处理方法及交换机
CN110851289B (zh) * 2019-10-23 2022-11-08 新华三信息安全技术有限公司 协议报文处理方法及交换机

Also Published As

Publication number Publication date
CN103853620A (zh) 2014-06-11
CN103853620B (zh) 2017-06-09
EP2908246A4 (en) 2015-08-19
US9678813B2 (en) 2017-06-13
US20150261588A1 (en) 2015-09-17
EP2908246B1 (en) 2018-03-21
EP2908246A1 (en) 2015-08-19

Similar Documents

Publication Publication Date Title
WO2014082421A1 (zh) 一种众核处理器进程间相互通信的方法、装置及系统
KR102003089B1 (ko) 효율적인 작업 큐잉을 갖는 프로세서
US9137179B2 (en) Memory-mapped buffers for network interface controllers
CN107046508B (zh) 报文接收方法及网络设备
CN111126589B (zh) 神经网络数据处理装置、方法和电子设备
US20220261367A1 (en) Persistent kernel for graphics processing unit direct memory access network packet processing
US20100199275A1 (en) Server switch integration in a virtualized system
CN109688058B (zh) 报文处理方法、装置及网络设备
US10896001B1 (en) Notifications in integrated circuits
US20200286203A1 (en) Direct memory access for graphics processing unit packet processing
US20060282560A1 (en) Method and apparatus to reduce latency and improve throughput of input/output data in a processor
CN111190854B (zh) 通信数据处理方法、装置、设备、系统和存储介质
US11671382B2 (en) Technologies for coordinating access to data packets in a memory
CN113037649B (zh) 网络中断数据包的收发方法和装置、电子设备和存储介质
CN112306693B (zh) 数据包的处理方法和设备
JP2009237872A (ja) メモリ制御装置,メモリ制御方法および情報処理装置
CN115904259B (zh) 非易失性存储器标准NVMe指令的处理方法及相关装置
JP2009301101A (ja) プロセッサ間通信システム、プロセッサ、プロセッサ間通信方法、および、通信方法
US8706923B2 (en) Methods and systems for direct memory access (DMA) in-flight status
CN117499351A (zh) 报文转发装置及方法、通信芯片及网络设备
US10820371B1 (en) Hardware data transport in wireless data transceiver
CN112019450A (zh) 设备间流式通信
US11792139B2 (en) Efficient packet reordering using hints
JP2008152580A (ja) 通信装置、及び通信方法
US9330036B2 (en) Interrupt reduction by dynamic application buffering

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13859349

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2013859349

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE