NUMA multi-core processor switching between lock modes, operating method, and instructions therefor
AssigneeShanghai Zhaoxin Semiconductor Co., Ltd.
InventorYong Li
Life of this patent
Estimating the term…
Abstract
An efficient multi-core processor is provided, with processor instructions and an operating method associated with lock competition of a shared computing resource. A lock-application instruction is provided. Accordingly, the different processes executed by the different central processing unit (CPU) cores stand in a queue for right-of-access to the shared computing resources. The execution of the lock-application instruction is accompanied by the monitoring of a competition-level indicator. Based on the competition-level indicator, the lock of the shared computing resource is switched from a primitive lock mode that follows the first-in and first-out rule, to a Non-Uniform Memory Access (NUMA) lock mode.
Claims24
A multi-core processor, comprising:
- a plurality of central processing unit (CPU) cores configured to form a plurality of non-uniform memory access (NUMA) nodes,
- wherein:
- by executing a lock-application instruction, different processes running on different CPU cores applying for a lock of a shared computing resource are queued, to be locked with the shared computing resource to gain access rights to the shared computing resource;
- the execution of the lock-application instruction involves monitoring a competition-level indicator;
- in response to the competition-level indicator satisfying a first switching condition, the lock of the shared computing resource is switched from a primitive lock mode to a NUMA lock mode;
- in the primitive lock mode, the processes follow a first-in and first-out rule to gain the lock of the shared computing resource, regardless of their NUMA nodes;
- in the NUMA lock mode, the processes on a same NUMA node with the shared computing resource gain the lock of the shared computing resource first;
- and
- after the first switching condition is satisfied, through the execution of the lock-application instruction, subsequent processes applying for the lock are not permitted to enter the queue until all processes already queued gain a primitive lock for operations in turn, and then the subsequent processes are queued to gain a NUMA lock.
A method for operating a multi-core processor, comprising:
- allocating a plurality of central processing unit (CPU) cores to configure a plurality of non-uniform memory access (NUMA) nodes;
- providing a lock-application instruction;
- executing the lock-application instruction to queue different processes running on different CPU cores applying for a lock of the shared computing resource to be locked with the shared computing resource to gain access rights to the shared computing resource;
- monitoring a competition-level indicator during the execution of the lock- application instruction;
- determining that the competition-level indicator satisfies a first switching condition;
- and switching the lock of the shared computing resource from a primitive lock mode to a NUMA lock mode;
- wherein in the primitive lock mode, the processes follow the first-in and first-out rule to gain the lock of the shared computing resource, regardless of their NUMA nodes;
- wherein in the NUMA lock mode, the processes on a NUMA node with the shared computing resource gain the lock of the shared computing resource first;
- and
- after the first switching condition is satisfied, refusing entry to the queue for subsequent processes applying for the lock through the execution of the lock-application instruction until processes already queued gain a primitive lock for operations in turn, and then queuing the subsequent processes to gain a NUMA lock.
Dependencies are inferred from the claim text.