Software and hardware tight coupling order preserving method and system

By using blocking and non-blocking instructions between the main core and the slave core, the main core applies for locks from the order-preserving module based on calls from the slave core, solving the problem of low order-preserving efficiency in tightly coupled software and hardware in a multi-core environment, and achieving system-level Order preservation and communication improve system performance and reduce energy consumption.

CN118550598APending Publication Date: 2024-08-27HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310212387.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In a multi-core environment, it is difficult for the existing technology to effectively realize order preservation of tightly coupled software and hardware, resulting in high polling and interrupt overhead for locks and asynchronous calls, affecting system performance.

Method used

By designing blocking and non-blocking instructions between the master core and the slave core, the master core applies for locks from the order-preserving module based on calls from the slave core, and uses the global order-preserving mechanism to determine whether to block subsequent programs, reducing software interaction and asynchronous call overhead.

Benefits of technology

It achieves system-level order preservation and communication, reduces the polling and interrupt overhead of locks and asynchronous calls, improves system performance, and enters a low-power state when blocking to reduce energy consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550598A
    Figure CN118550598A
Patent Text Reader

Abstract

The embodiment of the invention provides a software and hardware tight coupling order preserving method and system. The order preserving method comprises the steps that the master core executes slave core calling; the slave core applies for a lock from the order-preserving module based on slave core calling of the master core; the order-preserving module provides a lock application instruction for the main core based on a global order-preserving mechanism; and the main core determines to block the subsequent program or not block the subsequent program based on the instruction of the lock application. In the scheme, whether the subsequent program is blocked or not can be determined based on the instruction, so that system-level order-preserving and communication can be realized, polling and interruption overhead of lock and asynchronous calling and the like are reduced, and system performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computers, and more specifically, to a method and system for preserving order by tightly coupling software and hardware, and a computer device. Background Art

[0002] In storage services involving multi-core environments, in order to ensure that code or key resources are not called concurrently, semaphores can be used to ensure process order preservation, where semaphores can also be called semaphores or flags (semaphores, sem), etc. Before code execution or resource use, the user can obtain the semaphore through the get operation, and release the semaphore after completing the corresponding processing. For the code or resource whose semaphore has been obtained by the user, if there are other codes and hardware that also want to use the same code or resource, then the other code and hardware must wait until the previous process releases the semaphore before trying to obtain the semaphore. Summary of the invention

[0003] The exemplary embodiments of the present disclosure provide an order-preserving solution with tight coupling of software and hardware, which can improve system performance.

[0004] In a first aspect, a method for maintaining an order with tight coupling of software and hardware is provided. The method comprises: a master core executes a slave core call; the slave core applies for a lock from an order maintaining module based on the slave core call of the master core; the order maintaining module provides a lock application instruction to the master core based on a global order maintaining mechanism; and the master core determines whether to block a subsequent program or not based on the lock application instruction.

[0005] In this way, it is possible to determine whether to block subsequent programs based on instructions, thereby achieving system-level order preservation and communication, reducing polling and interrupt overhead of locks and asynchronous calls, and improving system performance.

[0006] In some implementations of the first aspect, the method further includes: after executing the slave core call, the master core asynchronously executes another operation.

[0007] In this way, the master core can call the slave core so that the slave core can apply for the lock, avoiding the master core software directly acquiring the lock, which can reduce the number of software interactions and improve performance. In addition, the master core can perform other operations asynchronously, which can improve software performance and processing efficiency.

[0008] In some implementations of the first aspect, the slave core applying for a lock from the order-preserving module based on the slave core call of the master core includes: the slave core applying for a lock from the order-preserving module based on a service executed on the slave core.

[0009] In this way, the slave core can apply for locks according to the business, thereby greatly reducing software lock conflicts and waiting.

[0010] In some implementations of the first aspect, the lock request instruction is a blocking instruction. In some implementations of the first aspect, the method further includes: the master core determines the acquired count value based on the blocking instruction; if the acquired count value is lower than a threshold, the master core determines to block a subsequent program; the sequence preservation module returns a failure result to the slave core; and the slave core determines to poll and wait or switch to another service based on the failure result.

[0011] In this way, subsequent programs can be blocked by blocking instructions and count values, thereby achieving system-level order preservation and communication, reducing polling and interruption overheads of locks and asynchronous calls, etc.

[0012] In some implementations of the first aspect, the process further includes: if the slave core determines to wait for polling, the slave core enters a low power consumption state.

[0013] In this way, a low-power state can be entered when blocked to reduce energy consumption and improve resource utilization.

[0014] In some implementations of the first aspect, the lock request instruction is a non-blocking instruction. In some implementations of the first aspect, the main core determines not to block subsequent programs based on the non-blocking instruction.

[0015] In this way, multiple services can be executed asynchronously through non-blocking instructions, reducing the polling and interruption overhead of locks and asynchronous calls, thereby improving system performance.

[0016] In some implementations of the first aspect, the method further includes: the order-preserving module determining a semaphore event associated with the lock application of the slave core; and generating a lock application instruction based on the semaphore event.

[0017] In some implementations of the first aspect, the method further includes: the main core applying for another lock from the order preservation module based on the business executed on the main core.

[0018] In a second aspect, a software-hardware tightly coupled order-preserving system is provided. The system includes a master core, an order-preserving module, and a slave core: the master core is configured to execute a slave core call; the slave core is configured to apply for a lock from the order-preserving module based on the slave core call of the master core; the order-preserving module is configured to provide a lock application instruction to the master core based on a global order-preserving mechanism; and the master core is further configured to determine whether to block a subsequent program or not based on the lock application instruction.

[0019] The system described in the second aspect can be used to implement the method described in the first aspect or any of its implementations.

[0020] In a third aspect, a computer device is provided. The computer device includes the system as described in the second aspect. In some implementations of the third aspect, the computer device also includes a memory.

[0021] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed, it at least partially implements the operation of the method according to the first aspect or any of its implementations.

[0022] In a fifth aspect, a computer program or a computer program product is provided. The computer program or computer program product is tangibly stored on a computer readable medium and includes computer executable instructions, which, when executed, cause a computer device to at least partially implement the operations of the method according to the first aspect or any implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0024] Figure 1 A schematic diagram showing a system in which some embodiments of the present disclosure can be applied;

[0025] Figure 2 A schematic flow chart of an order preservation process according to some embodiments of the present disclosure is shown;

[0026] Figure 3 A schematic diagram of an order preservation process according to some embodiments of the present disclosure is shown;

[0027] Figure 4 A schematic diagram showing an order-preserving process of table query and rewrite according to some embodiments of the present disclosure; and

[0028] Figure 5 A schematic block diagram of an example computer device that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0030] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0031] In the storage business process, data consistency needs to be guaranteed. Taking the field of Solid State Drive (SSD) as an example, the Flash Translation Layer (FTL) table can realize the mapping of host logical block addressing (LBA) to flash physical block addressing (PBA), and the modification process of the FTL table needs to be carried out in order. For example, if you want to update the FTL table, you should first apply for a mutex lock. After obtaining the mutex lock, you can write the modification to the FTL table. After writing, you need to release the mutex lock. Similarly, processes such as the management of Redundant Array of Independent Disks (RAID) stripe units (SU) also need to be carried out in order.

[0032] In a multi-core environment, semaphores can be used to ensure that the same code or resources are not called concurrently to avoid errors. The order preservation process can be implemented on the software side, for example, software order preservation can be achieved within the processor subsystem. However, most of the current chips have a tightly coupled hardware and software architecture, and special hardware accelerators need to be designed to participate in the business processing process. Therefore, for efficiency and performance considerations, hardware accelerators need to be considered in the order preservation process.

[0033] On systems that support hardware consistency, lock operations can be coordinated with software through cache consistency operations to achieve efficient order preservation. However, the hardware consistency protocol is complex and the implementation cost is relatively high, which is proportional to the size of the consistency area.

[0034] On systems that do not support hardware consistency, special locks, semaphores, queues, linked lists and other dedicated logic outside the processor can be used for maintenance and for software and hardware calls. However, the process and delay of such coordination between software and hardware to maintain order are relatively long, especially in the context of the simultaneous improvement of chip business requirements and the capabilities of hardware accelerators outside the processor, the proportion of software performance overhead occupied has gradually increased, and in some scenarios has become a performance bottleneck.

[0035] In addition, in order to improve the utilization efficiency of the processor, the call results of the external hardware accelerator are usually returned asynchronously. The returned results can be obtained by the processor through direct polling of the hardware queue, interruption, production-consumption model, etc. However, the direct polling of the hardware queue and the production-consumption model will increase the query overhead, and its operation delay is related to the design of the system on chip (SoC). The interrupt method has context switching overhead. The overhead of these methods is in the order of hundreds of nanoseconds, so their proportion in scenarios such as small-grained read and write is gradually increasing.

[0036] In view of this, the embodiments of the present disclosure provide a tightly coupled software and hardware order preservation solution. In this solution, whether to block subsequent programs can be determined based on blocking instructions or non-blocking instructions, thereby achieving system-level order preservation and communication, reducing the polling and interruption overhead of locks and asynchronous calls, and improving system performance.

[0037] Figure 1 A schematic diagram of a system 100 in which some embodiments of the present disclosure can be applied is shown. The system 100 includes a master core 110, an order-preserving module 120 and a slave core 130.

[0038] In some embodiments, the main core 110 may be referred to as a main core processor or simply referred to as a processor. For example, the main core 110 may be implemented as a central processing unit (CPU), and the main core 110 may be referred to as a CPU core. In some embodiments, the sequence-preserving module 120 may be referred to as a sequence-preserving logic, a lock module, a lock logic, or other names, etc., which are not limited in this disclosure. The sequence-preserving module 120 may be used to cooperate with the instructions and logic in the main core 110 to implement the overall sequence-preserving operation. In some embodiments, the slave core 130 may be referred to as a slave core processor. For example, the slave core 130 may include a slave CPU, an accelerator (ACC) or a hardware accelerator (HAC). For example, the slave core 130 may include a digital signal processor (DSP), a field programmable gate array (FPGA), a network processing unit (NPU), etc., which are not limited in this disclosure.

[0039] In the system 100, the master core 110 and the sequence-preserving module 120, and the sequence-preserving module 120 and the slave core 130 are connected by hardware through a dedicated path. Accordingly, the system 100 can be called a system with tight coupling of software and hardware. In this way, instructions and the like do not need to be transmitted through the bus, which can reduce latency and overhead.

[0040] Exemplarily, part of the business originally on the master core 110 can be offloaded to the slave core 130. For example, the slave core 130 can offload complex order preservation and locking algorithms, and support common logic such as multiple locks, linked lists, queues, atomic operations, etc. In some examples, simple repetitive business can be offloaded to the slave core 130. In some examples, the offloaded business can be determined based on the processing capabilities of the master core 110 and the slave core 130 and business requirements. Exemplarily, the master core 110 can call the slave core 130 through software, such as software calling a hardware accelerator.

[0041] In an embodiment of the present disclosure, the main core 110 designs blocking instructions and non-blocking instructions. Exemplarily, the blocking instruction can be represented as a semaphore get (sem get) instruction, and the non-blocking instruction can be represented as a semaphore try to get (sem try_get) instruction. When the main core 110 obtains the blocking instruction, it can determine whether a sufficient count value is obtained, and if not, the subsequent program execution is blocked. When the main core 110 obtains the non-blocking instruction, regardless of whether a sufficient count value is obtained, the subsequent program execution is not blocked. Specifically, the main core 110 can implement system-level order preservation and communication together with the external order preservation module 120 based on customized blocking instructions and non-blocking instructions. For a detailed description of blocking instructions and non-blocking instructions, please refer to the following combined description. Figures 2 to 4 Embodiment described.

[0042] In some embodiments, the master core 110 and the slave core 130 may be implemented as a single chip. In some embodiments, the master core 110 and the slave core 130 may be implemented as multiple chips or chip systems, for example, the master core 110 is implemented as a first chip and the slave core 130 is implemented as a second chip. Exemplarily, the chip is a chip with tight hardware and software coupling.

[0043] It should be noted that Figure 1 The number of each component in the system 100 shown is only for illustration. For example, in an actual scenario, more or less number may be included.

[0044] Figure 2 FIG. 2 is a schematic flow chart of an order preservation process 200 according to some embodiments of the present disclosure. The process 200 may be performed as follows: Figure 1 The system 100 shown is implemented.

[0045] In block 210, the master core executes the slave core call. In block 220, the slave core applies for a lock from the order-preserving module based on the slave core call of the master core. In block 230, the order-preserving module provides the master core with a lock application instruction based on the global order-preserving mechanism. In block 240, the master core determines whether to block or not block subsequent programs based on the lock application instruction.

[0046] In some embodiments, the slave core call at block 210 may also be referred to as an accelerator call. Exemplarily, the master core asynchronously performs another operation after executing the slave core call. For example, the master core may continue to asynchronously perform other operations while performing an accelerator call, which can improve software performance and processing efficiency.

[0047] Exemplarily, the slave core call may involve one or more locks. Specifically, the master core may determine the number of locks involved in the slave core call based on the business (eg, tasks, threads, programs, etc.) it is executing and about to execute.

[0048] In this way, the master core applies for the lock through the slave core calling the slave core, rather than the master core software directly acquiring the lock, which can reduce the number of software interactions and background some operations, thereby improving performance.

[0049] In some embodiments, the slave core can unload the order preservation and locking algorithms of the load, and support multiple locks, linked lists, queues, atomic operations, etc. Exemplarily, the slave core can apply for locks from the order preservation module based on the business executed on the slave core. In this way, the slave core can apply for locks according to the business, thereby greatly reducing software lock conflicts and waiting. In the process of semaphore acquisition and release, the release operation of the semaphore can be implemented.

[0050] In some embodiments, the order-preserving module may be referred to as lock logic, which may abstractly normalize the order-preserving into semaphore events, such as semaphore events. For example, an event may be associated with a semaphore, such as a 1-bit processor direct connection line. Optionally, the order-preserving module may report the abstractly normalized semaphore events to the master core through a 1-bit interface. Exemplarily, the order-preserving module may determine the associated semaphore events based on the lock application from the slave core; and then may generate lock application instructions based on the semaphore events.

[0051] Specifically, the order-preserving module may generate a lock application instruction based on a global order-preserving mechanism. For example, it may be considered whether multiple cores apply for locks for the same code or resource.

[0052] In some examples, semaphore events can support an out-of-order counting mode or an ordered queue mode. For example, the order-preserving module can use an out-of-order counting mode, such as an instruction for the core and a semaphore algorithm for the hardware accelerator. For example, the order-preserving module can use an ordered queue mode, such as sorting in the order of application to complete the order preservation. As an example, the order-preserving module may receive multiple applications from multiple cores, and then the order preservation can be completed based on the order of the multiple applications.

[0053] The semaphore events in the disclosed embodiments can support one-to-one and one-to-many group mappings to support pipeline and run-to-completion (RTC) drive models, etc., thereby achieving features such as load balancing and affinity scheduling.

[0054] The lock application instruction in the embodiments of the present disclosure may be a blocking instruction or a non-blocking instruction. It is understood that if the business involved is strongly dependent on other businesses, for example, has the highest priority, then the corresponding lock application instruction is a blocking instruction. On the contrary, if the business involved is not dependent on other businesses, then the corresponding lock application instruction may be a non-blocking instruction.

[0055] The main core may support multiple semaphore events, and accordingly, the main core may obtain multiple count values ​​corresponding to the multiple semaphore events. For example, the main core may support obtaining multiple count values ​​simultaneously (i.e., at one time). Optionally, the multiple count values ​​may be distinguished by different immediate values.

[0056] In some embodiments, the processor may determine whether the count value obtained reaches a threshold. In some examples, for a blocking instruction, if the count value obtained is lower than a threshold, a subsequent program may be blocked. That is, for a blocking instruction, if a sufficient count value is not obtained, the subsequent program is blocked, so that the subsequent instructions are no longer executed. In other examples, for a non-blocking instruction, the subsequent program is not blocked. That is, for a non-blocking instruction, even if a sufficient count value is not obtained, the subsequent program is not blocked, that is, the subsequent instructions continue to execute. Optionally, the threshold value may be the total count of creating a semaphore.

[0057] In response to the determination of whether to block the subsequent program, the order-preserving module can return a success or failure result to the slave core. In some examples, if the subsequent program is not blocked, for example, a sufficient count value is obtained for the blocking instruction or for the non-blocking instruction, a success instruction can be returned. In other examples, if the subsequent program is blocked, for example, a sufficient count value is not obtained for the blocking instruction, a failure instruction can be returned.

[0058] Accordingly, after receiving the failure instruction, the slave core can determine to poll and wait or switch to another service. For example, the software of the slave core can decide to switch to other services to improve software performance. For example, the software of the slave core can decide to continue the next step of polling and waiting; optionally, the slave core can enter a low-power state. In this way, the slave core (such as a thread of a hardware accelerator) can enter a low-power state to reduce power consumption, and can continue to execute after being awakened by an event. For example, if a sufficient number of semaphore release (seg put) instructions are executed to satisfy the blocking instruction, it can be awakened to re-execute.

[0059] In some embodiments of the present disclosure, the main core can apply for another lock from the order-preserving module based on the business executed on the main core. In this way, the main core can apply for a lock based on the business, thereby greatly reducing software lock conflicts and waiting. In the process of semaphore acquisition and release, the semaphore release operation can be implemented.

[0060] Furthermore, another lock applied by the main core may correspond to a blocking instruction or a non-blocking instruction. For a blocking instruction, if the count value obtained is lower than a threshold, that is, if not enough count values ​​are obtained, the subsequent program execution is blocked. Similarly, the main core may enter a low power consumption state to reduce power.

[0061] It can be understood that the solutions of the embodiments of the present disclosure can be applied to various scenarios. For example, this solution is suitable for scenarios where software and hardware collaborate to complete complex control and computing tasks; for example, this solution is suitable for scenarios where global order preservation and software calls hardware accelerators.

[0062] It can be understood that the solutions of the embodiments of the present disclosure can be applied to various systems. For example, for systems that do not support hardware consistency, the software performance is improved through tight coupling of software and hardware, so the overhead of software lock management can be reduced; for example, for large-scale systems that require asynchronous returns, the overhead of hardware asynchronous calls is reduced due to the design of blocking and non-blocking instructions.

[0063] Based on the above combination Figure 2 The embodiment provides an end-to-end order preservation solution with tight coupling of software and hardware, and in particular, can determine whether to block subsequent programs based on instructions, thereby achieving system-level order preservation and communication and improving system performance.

[0064] Figure 3 A schematic diagram of an order preservation process 300 according to some embodiments of the present disclosure is shown. In the process 300, a master core 110, an order preservation module 120 and a slave core 130 are involved, for example, the slave core 130 is a hardware accelerator.

[0065] At 310, the main core 110 makes an accelerator call. At 320, the slave core 130 can acquire a lock to apply for order preservation. At 330, the order preservation module 120 returns a successful result. At 340, 1 to 3 beats are completed. It can be understood that a beat represents a clock cycle in the sequential logic. Since the dedicated path hardware connection is used in this solution, the time consumption of 1 to 3 involving signal logic processing is relatively short, and the execution time can be determined. At 350, the beat is completed due to blocking waiting. For example, for a blocking instruction (such as segget), if not enough count values ​​are obtained, the subsequent program is blocked and polling and waiting. In some examples, the main core 110 can decide to switch to other tasks during the polling and waiting process, such as executing other tasks at 352, and after other tasks, continue to poll and wait at 354. In this way, performance can be improved. At 360, the order preservation module determines that enough sem puts are executed after n beats. After this, the thread at the main core 110 can be woken up and continued to execute at 370. It is understandable that n beats represent the delay of blocking waiting, and it is understandable that the blocking waiting time depends on other services and is therefore uncontrollable.

[0066] Figure 4 A schematic diagram of a table query and rewrite order preservation process 400 according to some embodiments of the present disclosure is shown. In process 400, a master core 110, an order preservation module 120 and a slave core 130 are involved, for example, the slave core 130 is an accelerator. Process 400 involves querying and rewriting the order preservation of the TRIM table and FTL table on the SSD controller logic and asynchronously returning the accelerator call result.

[0067] At 410, the main core 110 makes an accelerator call. At 420, the slave core 130 can acquire the trim lock. At 430, the order-preserving module 120 returns a successful result. At 440, the trim table processing is completed, and the slave core 130 (accelerator) processing is completed, and the trim lock is released. At 450, the beat is completed due to blocking waiting. For example, for a blocking instruction (such as seg get), if not enough count values ​​are obtained, the subsequent program is blocked and polling and waiting. In some examples, the main core 110 may decide to switch to other tasks during the polling and waiting process, such as executing other tasks at 452, and after the other tasks, continue to poll and wait at 454. In this way, performance can be improved. At 460, the order-preserving module determines that enough sem puts have been executed after n beats.

[0068] At 462, the slave core 130 applies for the FTL lock. At 464, the order-preserving module 120 feeds back to the master core 110 that the FTL lock application is successful. Thus, at 470, the master core 110 can perform the FTL table rewrite operation. After the operation is completed, the FTL lock can be released at 480.

[0069] Through the embodiments of the present disclosure, a tightly coupled software and hardware order preservation solution is provided, which implements blocking and non-blocking instructions on the processor core, thereby realizing system-level order preservation and communication together with an external order preservation module. This solution can improve software performance, reduce the overhead of software lock management, and reduce the overhead of hardware asynchronous calls, thereby improving system performance.

[0070] Understandable, combined Figures 2 to 4 The described process can be accomplished by Figure 1 For the sake of brevity, it will not be described in detail in this article.

[0071] It should also be understood that the methods, situations, categories and divisions of the embodiments in the present application are only for the convenience of description and should not constitute special limitations. The features in various methods, categories, situations and embodiments can be combined with each other when it is logical.

[0072] It should also be understood that the above content is only to help those skilled in the art to better understand the embodiments of the present application, rather than to limit the scope of the embodiments of the present application. Those skilled in the art can make various modifications or changes or combinations based on the above content. Such modifications, changes or combined solutions are also within the scope of the embodiments of the present application.

[0073] It should also be understood that the description of the above content focuses on emphasizing the differences between the various embodiments, and the same or similar points can be referenced or borrowed from each other. For the sake of brevity, they will not be repeated here.

[0074] Figure 5 A schematic block diagram of an example computer device 500 that can be used to implement an embodiment of the present disclosure is shown. As shown in the figure, the computer device 500 includes a processor system 502 and a memory 504. The processor system 502 is connected to the memory 504 via a double data rate (DDR) bus 503. Here, different memories 504 may use different data buses to communicate with the processor system 502, so the DDR bus 503 may also be replaced with other types of data buses, and the embodiments of the present disclosure do not limit the type of the DDR bus 503. In addition, the computer device 500 also includes various (Input / Output, I / O) devices 507, and the processor system 502 can access the I / O device 507 through a peripheral component interconnect express (Peripheral Component Interconnect Express, PCIe) bus 505.

[0075] The processor system 502 is the computing core and control core of the computer device 500. The processor system 502 can be implemented as a very large scale integrated circuit. An operating system and other software programs are installed in the processor system 502, so that the processor system 502 can access the memory 504 and various I / O devices 507. The processor system 502 may include one or more processor cores. As an example, the processor system 502 can be implemented as described above. Figure 1 System 100 is shown.

[0076] The memory controller is a bus circuit controller inside the computer device 500 for controlling the memory 504 and for managing and planning data transmission from the memory 504 to the processor core. Through the memory controller, data can be exchanged between the memory 504 and the processor core. The memory controller can be a separate chip and connected to the processor core through the system bus. Those skilled in the art should understand that the memory controller can also be integrated into the processor system 502, can also be built into the north bridge, and can also be an independent memory controller chip. The embodiments of the present disclosure do not limit the specific location and existence form of the memory controller. In practical applications, the memory controller can control the necessary logic to write data to the memory 504 or read data from the memory 504. The memory controller can be a memory controller in a processor system such as a general-purpose processor, a dedicated accelerator, a GPU, an FPGA, an embedded processor, etc.

[0077] The memory 504 is the main memory of the computer device 500. The memory 504 is usually used to store various running software in the operating system, input and output data, and information exchanged with external memory. In order to improve the access speed of the processor system 502, the memory 504 needs to have the advantage of fast access speed. In the traditional computer system architecture, dynamic random access memory (DRAM) is usually used as the memory 504. The processor system 502 can access the memory 504 at high speed through the memory controller, and perform read operations and / or write operations on any storage unit in the memory 504. In addition to DRAM, the memory 504 can also be other random access memories, such as static random access memory (SRAM). In addition, the memory 504 can also be a read-only memory (ROM). As for the read-only memory, for example, it can be a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), etc. The embodiments of the present disclosure do not limit the number and type of memory 504. In addition, the memory 504 can be configured to have a power-saving function. The power-saving function means that when the system loses power and then powers on again, the data stored in the memory will not be lost. The memory 504 with the power-saving function is called a non-volatile memory.

[0078] I / O device 507 refers to hardware that can perform data transmission, and can also be understood as a device that is connected to an I / O interface. Common I / O devices 507 include network cards, printers, keyboards, mice, etc. All external memories can also be used as I / O devices 507, such as hard disks, floppy disks, optical disks, etc. The processor system 502 can access each I / O device 507 through the PCIe bus 505. It should be noted that the PCIe bus 505 is only an example, and the bus between the processor system 502 and the I / O device 507 can be replaced by other buses, such as a unified bus (UB) bus, etc.

[0079] The embodiments of the present disclosure also provide a chip system, including a processor system, for supporting a computer device to implement the functions involved in any of the above embodiments. In one possible design, the chip system may also include a memory for storing necessary program instructions and data, so that when the processor system runs the program instructions, the device on which the chip system is installed implements the method involved in any of the above embodiments. Exemplarily, the chip system may be composed of one or more chips, and may also include chips and other discrete devices.

[0080] An embodiment of the present disclosure further provides a processor system for coupling with a memory, wherein the memory stores instructions. When the processor system executes the instructions, the processor system at least partially executes the methods and functions involved in any of the above embodiments.

[0081] An embodiment of the present disclosure also provides a computer program product including instructions, which, when executed on a computer, enables the computer to at least partially execute the methods and functions involved in any of the above embodiments.

[0082] An embodiment of the present disclosure further provides a computer-readable storage medium having computer instructions stored thereon. When a processor system executes the instructions, the processor system at least partially executes the methods and functions involved in any of the above embodiments.

[0083] In general, various embodiments of the present disclosure may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects may be implemented in hardware, while other aspects may be implemented in firmware or software, which may be performed by a controller, microprocessor, or other computing device. Although various aspects of the embodiments of the present disclosure are shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that the blocks, devices, systems, techniques, or methods described herein may be implemented as, by way of non-limiting example, hardware, software, firmware, dedicated circuits or logic, general purpose hardware or controllers or other computing devices, or some combination thereof.

[0084] The present disclosure also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer executable instructions, such as instructions included in a program module, which are executed in a device on a real or virtual processor of the target to perform the process / method as described above with reference to the accompanying drawings. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of program modules can be combined or divided between program modules as needed. Machine executable instructions for program modules can be executed in local or distributed devices. In distributed devices, program modules can be located in local and remote storage media.

[0085] The computer program code for realizing the method of the present disclosure can be written in one or more programming languages. These computer program codes can be provided to the processor of general-purpose computer, special-purpose computer or other programmable data processing device, so that the program code, when being executed by computer or other programmable data processing device, causes the function / operation specified in flow chart and / or block diagram to be implemented. The program code can be executed completely on computer, partly on computer, as independent software package, partly on computer and partly on remote computer or completely on remote computer or server.

[0086] In the context of the present disclosure, computer program codes or related data may be carried by any appropriate carrier to enable a device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, and the like. Examples of signals may include electrical, optical, radio, acoustic or other forms of propagation signals, such as carrier waves, infrared signals, and the like.

[0087] A computer readable medium may be any tangible medium that contains or stores a program for or related to an instruction execution system, device, or apparatus. A computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of computer readable storage media include an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0088] In addition, although the operation of the method of the present disclosure is described in a particular order in the accompanying drawings, this does not require or imply that these operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flow chart can change the order of execution. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution. It should also be noted that the features and functions of two or more devices according to the present disclosure can be embodied in one device. Conversely, the features and functions of a device described above can be further divided into being embodied by multiple devices.

[0089] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. 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 implementations. The selection of terms used herein is intended to explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.

Claims

1. A method for preserving order by tightly coupling software and hardware, characterized in that: include: The master core executes the slave core call; The slave core applies for a lock from the order-preserving module based on the slave core call of the master core; The order-preserving module provides a lock application instruction to the main core based on a global order-preserving mechanism; and The main core determines whether to block a subsequent program or not based on the instruction of the lock request.

2. The method according to claim 1, characterized in that Also includes: The master core asynchronously executes another operation after executing the slave core call.

3. The method according to claim 1 or 2, characterized in that: The slave core applying for a lock from the order-preserving module based on the slave core call of the master core includes: The slave core applies for a lock from the order-preserving module based on the business executed on the slave core.

4. The method according to any one of claims 1 to 3, characterized in that The lock request instruction is a blocking instruction.

5. The method according to claim 4, characterized in that Also includes: The main core determines the acquired count value based on the blocking instruction; If the acquired count value is lower than a threshold, the main core determines to block the subsequent program; The sequence preservation module returns a failure result to the slave core; and The slave core determines to poll and wait or switch to another service based on the failure result.

6. The method according to claim 54, characterized in that Also includes: If the slave core determines to wait for polling, the slave core enters a low power consumption state.

7. The method according to any one of claims 1 to 3, characterized in that The lock request instruction is a non-blocking instruction.

8. The method according to claim 7, characterized in that Also includes: The main core determines not to block the subsequent program based on the non-blocking instruction.

9. The method according to any one of claims 1 to 8, characterized in that Also includes: The order-keeping module determines a semaphore event associated with the lock application of the slave core; as well as Based on the semaphore event, an instruction for the lock application is generated.

10. The method according to any one of claims 1 to 9, characterized in that Also includes: The main core applies for another lock from the order preservation module based on the business executed on the main core.

11. A software-hardware tightly coupled order-preserving system, characterized in that: include: The master core is configured to execute slave core calls; The slave core is configured to apply for a lock from the order-preserving module based on the slave core call of the master core; The order-preserving module is configured to provide a lock application instruction to the main core based on a global order-preserving mechanism; and The main core is further configured to determine whether to block a subsequent program or not based on the lock request instruction.

12. A computer device, characterized in that: Comprising the order preservation system as claimed in claim 11.