WO2023020010A1 - 一种运行进程的方法及相关设备 - Google Patents

一种运行进程的方法及相关设备 Download PDF

Info

Publication number
WO2023020010A1
WO2023020010A1 PCT/CN2022/090190 CN2022090190W WO2023020010A1 WO 2023020010 A1 WO2023020010 A1 WO 2023020010A1 CN 2022090190 W CN2022090190 W CN 2022090190W WO 2023020010 A1 WO2023020010 A1 WO 2023020010A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
resource
numa node
processor cores
numa
Prior art date
Application number
PCT/CN2022/090190
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 华为技术有限公司
Publication of WO2023020010A1 publication Critical patent/WO2023020010A1/zh

Links

Images

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/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the embodiments of the present application relate to the field of computer technology, and in particular, to a method for running a process and related equipment.
  • a computer device may adopt a non-uniform memory access (NUMA) system, and each processor and each memory may be configured as multiple different NUMA nodes.
  • NUMA non-uniform memory access
  • the time it takes for different processors to access different memories is not the same.
  • the time it takes for a processor in each NUMA node to access the memory in this node is less than the time it takes to access the memory on other NUMA nodes. Therefore, in order to reduce the occurrence of the above-mentioned cross-node access during process running, each process is generally bound to a corresponding processor to run, thereby isolating and restricting each process.
  • the number of processor cores required by most processes at runtime is not an integer, such as 0.5, 0.8, or 1.2, etc.
  • the The required number of processor cores is rounded up. For example, when a certain process requires 0.5 processor cores, one processor is allocated to the process, and for example, when a certain process requires 1.2 processor cores, two processors are allocated to the process. However, in this resource allocation mode, most processes do not make full use of processor resources, and there is a lot of waste of resources.
  • Embodiments of the present application provide a method for running a process and related equipment, which are used to improve the utilization rate of each processor core in a NUMA node and reduce waste of resources.
  • the embodiment of the present application provides a method for running a process.
  • the method is applied to a computer system.
  • the computer system includes a target NUMA node and a controller.
  • the controller obtains resource allocation information, and the resource allocation information is used to indicate the target NUMA node.
  • the computing resources corresponding to the multiple processor cores are used to run multiple processes, and when each process is running, the computing resources corresponding to each of the multiple processor cores can be used.
  • the controller runs multiple processes on the target NUMA node according to the resource allocation information.
  • the number of processor cores used to run processes in the target NUMA node is not limited in this embodiment of the present application. That is, in the target NUMA node, the above-mentioned “multiple processor cores" may be a part of processor cores in the target NUMA node, or may be all processor cores in the target NUMA node, which is not specifically limited here.
  • the computing resources used when a process is running are quantified by the share of processor cores occupied by the process. For example, if the computing resource used by a certain process when running is the computing resource corresponding to 1.5 processor cores, for the convenience of description, it can be said that the process occupies 1.5 processor cores.
  • a method for running a process in a target NUMA node is provided, and the method for running a process can also be applied to other NUMA nodes in a computer system, so as to achieve the same technical effect.
  • each process can run on any of the above processor cores. Therefore, in the NUMA node, different processes can also run on the same processor core, thereby improving the utilization rate of each processor core in the NUMA node and reducing waste of resources. On the other hand, each process runs only on its allocated NUMA node, thereby avoiding the situation that a certain process accesses resources across nodes and improving the operating efficiency of the process.
  • the resource requirements of the process often fluctuate up and down within a certain range.
  • the number of processor cores occupied by some processes may exceed the resource requirements of the process in the standard running state.
  • the process can use the computing resources of other idle processor cores in the current NUMA node to Finish running.
  • the number of processor cores occupied by a certain process is lower than the resource requirement of the process in a standard running state, the computing resources released by the process can also be used by other processes. Therefore, the method for running processes in the present application can also meet the resource requirements of each process in different running states, further improving the resource utilization rate of computer equipment.
  • the multiple processor cores may be all processor cores in the target NUMA node, that is, all processor cores in the target NUMA node are all used to run the target NUMA node Multiple processes in , and when running each process, the computing resources corresponding to each processor core in the target NUMA node can be used.
  • the processor cores in the NUMA node can be shared, so that other unshared processor cores can be used to execute other specific processes, then This particular process has its own processor core available for use.
  • a specific number of processor cores ie, the first processor core
  • the computing resources of the first processor core are different from those of other processor cores in the target NUMA node.
  • Computing resources are not shared, but isolated from each other.
  • the resource allocation information in this application is also used to indicate that the target NUMA node uses the first processor core to run a specific process, and the computing resource corresponding to the first processor core can only be used by the specific process.
  • these specific processes have independent processor cores (first processor cores) available for use during the running process, and do not need to use computing resources of other processor cores, and the computing resources of their independent processor cores do not need to be used. It will be used by other processes, thereby ensuring the resource requirements of a specific process during operation.
  • the multiple processes in the target NUMA node include the target process, and when the target process needs to be run, the controller determines according to the resource allocation information that the target NUMA node can be used to run Multiple processor cores for the target process. Further, the controller determines idle processor cores from a plurality of processor cores, wherein some or all computing resources of these idle processor cores are not used, and the controller can run on the idle processor cores the target process.
  • the computer system includes multiple NUMA nodes, and each of the multiple NUMA nodes can use the method for running a process in this application.
  • the controller Before running the processes, the controller needs to allocate each process to the appropriate NUMA node.
  • the allocation logic adopted by the controller when allocating NUMA nodes to each process is consistent. The following takes the allocation process of the first process among the multiple processes as an example for illustration.
  • the controller When the controller allocates corresponding NUMA nodes for each process, the controller needs to obtain current allocatable resource information of each NUMA node among the multiple NUMA nodes, and the allocatable resource information includes the first computing resource and the first memory resource, Then calculate the ratio between the first computing resource and the first memory resource of each NUMA node as the first ratio of the NUMA node.
  • the configurable resource information of a NUMA node includes computing resources (number of processor cores) and storage resources (memory capacity) of the NUMA node, so as to determine how many resources are left in each NUMA node and can be allocated to each process.
  • the controller also needs to obtain resource requirement information of each process, wherein the resource requirement information of a process indicates the computing resources (number of processor cores) and storage resources (memory capacity) that the process needs to occupy when running.
  • the resource requirements of the processes often fluctuate up and down within a certain range.
  • resources are allocated based on the resource requirements of each process in a standard operating state.
  • the controller obtains the resource requirement information of the first process, the resource requirement information includes the first computing resource requirement and the first memory resource requirement, and the difference between the first computing resource requirement and the first memory resource requirement
  • the ratio is a second ratio.
  • the controller compares the difference between the first ratio corresponding to the multiple NUMA nodes and the second ratio of the first process, and then selects the NUMA node with the smallest difference from the multiple NUMA nodes as the target NUMA node.
  • the difference between the first ratio of the target NUMA node and the second ratio of the first process is the one of the smallest differences between the first ratios of the respective NUMA nodes and the second ratio of the first process.
  • the controller can allocate each process to the corresponding NUMA node according to the unified allocation logic, and when each process allocates a NUMA node, the corresponding resource demand ratio and the NUMA node's allocable resource ratio is the closest. Therefore, after the corresponding processes are allocated, the proportion of resources that can be allocated to the NUMA node is least affected, thereby ensuring the adaptability of the NUMA node.
  • the corresponding allocated resources of the target NUMA node will be correspondingly reduced. Therefore, in order to To continue to be used in the subsequent process allocation process, it is necessary to update the allocatable resource information of the target NUMA node.
  • the updated allocatable resource information of the target NUMA node includes the second computing resource, and the second computing resource is a difference between the first computing resource and the required amount of the first computing resource. After the allocatable resource information of the target NUMA node is updated, it can also be allocated to other processes. In the subsequent process of process allocation, the latest allocatable resource information of the target NUMA node is used for calculation.
  • the allocatable resource information of the NUMA node is updated in a timely manner, which improves the timeliness of the NUMA node's allocatable resource information, and facilitates the NUMA node to continue to participate in In the process of subsequent process allocation.
  • the updated allocatable resource information includes a second memory resource, and the second memory resource is a difference between the first memory resource and the required amount of the first memory resource.
  • the multiple processes further include a second process, and after the controller allocates the first process to a target NUMA node, the target NUMA node can also be used to allocate other processes (including the second process).
  • the controller obtains the allocatable resource information of each NUMA node among the multiple NUMA nodes, the allocatable resource information includes the second computing resource and the second memory resource, and calculates the second computing The ratio between the resource and the second memory resource is used as the third ratio.
  • the allocatable resource information of the target NUMA node is updated allocatable resource information. It should be noted that after the first process is allocated to the target NUMA node, it is possible that the next process is to allocate a NUMA node to the second process. At this time, among the NUMA nodes of the computer device, only the resources of the target NUMA node can be allocated.
  • the information is changed, but other NUMA nodes are not used to allocate other processes during the period, and the allocatable resource information of other NUMA nodes has not changed, that is, the first computing resource and the first memory resource of other NUMA nodes at this time , and the second computing resource and the second memory resource are the same; on the other hand, after the first process is allocated to the target NUMA node, it is possible to allocate corresponding NUMA node, and then it is the turn of the second process to allocate a NUMA node.
  • the value of the first computing resource and the value of the second computing resource may or may not be the same; the value of the first memory resource and the value of the second memory resource may or may not be the same.
  • the controller acquires resource requirement information of the second process, the resource requirement information includes a second computing resource requirement and a second memory resource requirement, and the ratio between the second computing resource requirement and the second memory resource requirement is a fourth ratio .
  • the controller determines, from the multiple NUMA nodes, the NUMA node with the smallest difference as the target NUMA node according to the difference between the third ratio and the fourth ratio corresponding to each of the multiple NUMA nodes. After the target NUMA node corresponding to the second process is determined, the second process can be assigned to the target NUMA node, so that the target NUMA node can be used to run the second process.
  • the same NUMA node can be used to be allocated to multiple different processes, thereby improving the resource utilization rate of the NUMA node.
  • the first computing resource requirement is expressed as M processor cores, where M is a positive number including decimals.
  • M is a positive number including decimals.
  • the number of processor cores required by each process can be an integer or a non-integer number.
  • the method for running a process provided in the present application is not affected by whether the number of processor cores required by the process is an integer.
  • the embodiment of the present application provides a method for running a process.
  • the method is applied to a computer system.
  • the computer system includes a target non-uniform memory access NUMA node and a controller.
  • the target NUMA node includes multiple processor cores.
  • the method Including: when the first process requests to run in the target NUMA node.
  • the controller may determine a target processor core from a plurality of processor cores, the target processor core includes a first computing resource and a second computing resource, wherein the first computing resource has been used to run the second process, and the second computing resource are free resources. Then the controller can use the second computing resource of the target processor core to run the first process.
  • the process to be run can be continuously assigned to those processor cores that already run other processes to run. That is, in this application, the same processor core can run multiple different processes at the same time, which avoids the situation that after a certain processor core runs a process, its remaining idle processes cannot be used by other processes, thereby improving
  • the utilization rate of each processor core in the NUMA node reduces the waste of resources.
  • each process runs only on its allocated NUMA node, thereby avoiding the situation that a certain process accesses resources across nodes and improving the operating efficiency of the process.
  • the multiple processor cores may be all processor cores in the target NUMA node, that is, all processor cores in the target NUMA node are all used to run the target NUMA node Multiple processes in , wherein the computing resources corresponding to each processor core in the target NUMA node can be used to run each process in the multiple processes.
  • the processor cores in the NUMA node can be shared, so that other unshared processor cores can be used to execute other specific processes, then the Certain processes have separate processor cores available for use.
  • a specific number of processor cores ie, the first processor core
  • the computing resources of the first processor core are different from those of other processor cores in the target NUMA node.
  • Computing resources are not shared, but isolated from each other.
  • the resource allocation information in this application is also used to indicate that the target NUMA node uses the first processor core to run a specific process, and the computing resource corresponding to the first processor core can only be used by the specific process.
  • these specific processes have independent processor cores (first processor cores) available for use during the running process, and do not need to use computing resources of other processor cores, and the computing resources of their independent processor cores do not need to be used. It will be used by other processes, thereby ensuring the resource requirements of a specific process during operation.
  • an embodiment of the present application provides a computer device, which includes:
  • the obtaining unit is used to obtain resource allocation information, and the resource allocation information is used to instruct the target NUMA node to use computing resources corresponding to multiple processor cores to run multiple processes, and when running each process, each of the multiple processor cores Computing resources corresponding to each processor core can be used;
  • the running unit is used to run multiple processes on the target NUMA node according to resource allocation information.
  • the multiple processor cores are all processor cores in the target NUMA node.
  • the target NUMA node further includes a first processor core
  • the resource allocation information is also used to instruct the target NUMA node to use the first processor core to run a specific process
  • the first processor core Computing resources corresponding to cores can only be used by specific processes.
  • the multiple processes include the target process, and the running unit is specifically used for:
  • the computer device includes multiple NUMA nodes, the multiple processes include the first process, and the computer device further includes a determining unit;
  • the obtaining unit is also used to obtain the allocatable resource information of each NUMA node among the plurality of NUMA nodes, the allocatable resource information includes the first computing resource and the first memory resource, and the ratio between the first computing resource and the first memory resource is the first ratio;
  • the obtaining unit is also used to obtain the resource requirement information of the first process, the resource requirement information includes the first computing resource requirement and the first memory resource requirement, and the ratio between the first computing resource requirement and the first memory resource requirement is the second ratio;
  • the determination unit is used to determine the NUMA node with the smallest difference from the multiple NUMA nodes as the target NUMA node according to the difference between the first ratio and the second ratio corresponding to each NUMA node in the multiple NUMA nodes, and the target NUMA node uses to run the first process.
  • the computer device further includes:
  • An update unit configured to update the allocatable resource information of the target NUMA node according to the resource requirement information of the first process, so as to obtain updated allocatable resource information, the updated allocatable resource information includes a second computing resource, and the second computing The resource is a difference between the first computing resource and the demanded amount of the first computing resource.
  • the updated allocatable resource information includes a second memory resource, and the second memory resource is a difference between the first memory resource and the required amount of the first memory resource.
  • the multiple processes further include a second process
  • the acquiring unit is further configured to acquire the allocatable resource information of each NUMA node in the plurality of NUMA nodes, wherein the allocatable resource information includes the second computing resource and the second memory resource, and the distance between the second computing resource and the second memory resource
  • the ratio of is the third ratio, and the allocatable resource information of the target NUMA node is the updated allocatable resource information
  • the obtaining unit is also used to obtain the resource requirement information of the second process, the resource requirement information includes the second computing resource requirement and the second memory resource requirement, and the ratio between the second computing resource requirement and the second memory resource requirement is the fourth ratio;
  • the determination unit is used to determine the NUMA node with the smallest difference from the plurality of NUMA nodes as the target NUMA node according to the difference between the third ratio and the fourth ratio corresponding to each NUMA node in the plurality of NUMA nodes, and the target NUMA node uses to run the second process.
  • the first computing resource requirement is expressed as M processor cores, where M is a positive number including decimals.
  • an embodiment of the present application provides a computer device, the computer device includes a target non-uniform memory access NUMA node, the target NUMA node includes multiple processor cores, and the computer device includes:
  • a determining unit configured to determine a first process, where the first process is a process to be run in the target NUMA node;
  • the determination unit is further configured to determine a target processor core from a plurality of processor cores, the target processor core includes a first computing resource and a second computing resource, the first computing resource is used to run the second process, and the second computing resource is idle resources;
  • the running unit is configured to use the second computing resource of the target processor core to run the first process.
  • the multiple processor cores are all processor cores in the target NUMA node.
  • the target NUMA node further includes a first processor core, the first processor core is used to run a specific process, and the computing resources corresponding to the first processor core Can only be used by certain processes.
  • the embodiment of the present application provides a computer device, the computer device includes a target non-uniform memory access NUMA node, and the target NUMA node includes a plurality of processors;
  • the target NUMA node is configured to use computing resources corresponding to multiple processors to run multiple processes, and when running each process, computing resources corresponding to each of the multiple processors can be used.
  • the embodiment of the present application provides a computer device, the computer device includes a target non-uniform memory access NUMA node and a controller, and the target NUMA node includes multiple processors;
  • the target NUMA node is used to run multiple processes using computing resources corresponding to multiple processors
  • a controller configured to determine a first process, where the first process is a process to be executed among multiple processes
  • the controller is further configured to determine a target processor core from a plurality of processor cores, the target processor core includes a first computing resource and a second computing resource, the first computing resource is used to run a second process, and the second computing resource is idle resources;
  • the controller is further configured to use the second computing resource of the target processor core to run the first process.
  • the embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when it runs on a computer, it causes the computer to perform the operations described in any one of the above-mentioned aspects. method of the process.
  • the embodiment of the present application provides a computer program product or computer program, the computer program product or computer program includes computer instructions, when it is run on a computer, it causes the computer to execute the operation process described in any of the above aspects Methods.
  • the embodiment of the present application provides a chip system
  • the chip system includes a processor, configured to implement the functions involved in the above aspects, for example, send or process the data and/or information involved in the above methods .
  • the chip system further includes a memory, and the memory is configured to store necessary program instructions and data of the server or the communication device.
  • the system-on-a-chip may consist of chips, or may include chips and other discrete devices.
  • FIG. 1 is a schematic structural diagram of a NUMA system 100 provided by an embodiment of the present application.
  • FIG. 2 is a system framework diagram of a method for running a process provided by an embodiment of the present application
  • FIG. 3 is a schematic flow diagram of an operation process provided by an embodiment of the present application.
  • FIG. 4 is a schematic flow diagram of process allocation in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of another computer device provided by an embodiment of the present application.
  • Embodiments of the present application provide a method for running a process and related equipment, which are used to improve the utilization rate of each processor core in a NUMA node and reduce waste of resources.
  • FIG. 1 is a schematic structural diagram of a NUMA system 100 provided by an embodiment of the present application.
  • the architecture of the NUMA system 100 may be a multi-socket system 100 .
  • NUMA system 100 includes socket 101a and socket 101b.
  • the slots 101a and 101b may be collectively referred to as slots herein, and may be used to install a central processing unit (CPU).
  • the sockets may be communicatively coupled to each other by an interconnect 104 .
  • each socket may be connected to each of the other sockets via a point-to-point quick path interconnect (QPI) link.
  • QPI is an interconnection architecture
  • the interconnection between slots in the embodiment of the present application may also be implemented through other interconnection architectures, such as other point-to-point architectures, ring architectures, and bus architectures, which are not limited here.
  • the number of sockets depicted in NUMA system 100 is one example only, and those skilled in the art will understand that there may be a different number of sockets.
  • NUMA system 100 may include a number of sockets such as six, four or less, or NUMA system 100 may include a number of sockets such as sixteen, thirty-two or more.
  • the slot can include a plurality of nodes (node), each node has its own CPU and memory, and the nodes are connected and communicated through interconnection 104, as shown in Figure 1, the slot 101a includes nodes 102a and Node 102b, socket 101b includes node 103a and node 103b, each node includes a memory and six CPUs. It should be noted that the number of nodes and CPUs depicted in NUMA system 100 is only an example, and those skilled in the art will understand that each socket may include other numbers of nodes, and each node may include other numbers of CPU.
  • the NUMA system shown in FIG. 1 above is often applied to a computer device configured with multiple processors and multiple memories.
  • the time required for the processor in each NUMA node to access the memory in this node is far less than the time it takes to access the memory on other NUMA nodes.
  • each process is generally bound to a corresponding processor to run, thereby isolating and restricting each process. That is, each process can only run on the processor to which it is bound, but the process cannot run on other processors in the local NUMA node or on processors on other NUMA nodes.
  • each processor can only be used by the bound process, and the processor cannot be used by other processes in the local NUMA node or processes on other NUMA nodes.
  • the number of processor cores required by most processes is not an integer, such as 0.5, 0.8, or 1.2, etc.
  • the number of processor cores required by the process is The number of required processor cores is rounded up. For example, when a certain process requires 0.5 processor cores, one processor is allocated to the process, and for example, when a certain process requires 1.2 processor cores, two processors are allocated to the process. With this allocation method, for a processor, after being bound to a process, the computing resources of the processor cannot be fully utilized. Furthermore, generally speaking, processes often do not always have the highest resource demands, and at the same time, processes have high and low resource demands in different time periods.
  • a process may require 1.2 processor cores during allocation, but in actual operation, the resource requirements of the process may be lower than expected in some cases, and only need to occupy 0.8 processor cores. organ core.
  • the embodiment of the present application provides a method for running processes, which can reasonably assign each process to the corresponding NUMA node to run. On the one hand, it can reduce the above-mentioned cross-node access during the running process of the process. On the other hand, the utilization rate of each processor core in the NUMA node is improved, and the waste of resources is reduced.
  • FIG. 2 is a system framework diagram of a method for running a process provided by an embodiment of the present application.
  • the system framework mainly includes a hardware resource layer (processor core and memory layer), an application resource management layer, a resource division rule and allocation strategy technology layer, and an application layer.
  • the specific division of labor at each level is as follows:
  • NUMA node means the shortest distance between multiple processor cores and the memory, that is, the combination of multiple processor cores and local memory forms a NUMA node, which is determined by the hardware resources of the computer device.
  • the processor core and memory are fixed, the processor core in the node has the shortest time to access the memory, and the access efficiency is the highest.
  • Processors and memories between nodes can access each other, and the access time depends on the distance between the memory and the processor.
  • Application resource management layer The application resource management layer mainly divides the processor core and memory in the hardware resources twice, that is, determines the allocation path according to the calculation results of the "resource division rules and allocation strategy technology layer", so as to arrange each resource in the application layer.
  • the application resource management layer needs to obtain the current allocatable resource information of each NUMA node and the resource demand information of each process, and calculate the corresponding resource allocation principles by resource division rules and allocation strategy technical layer.
  • Resource division rules and allocation strategy technical layer In order to improve the efficiency and time of processor core access to memory, and improve the utilization rate of the processor, various resource arrangement strategies and resource usage strategies are invented. Specifically, the optimal resource allocation principle may be calculated according to the resource requirement information of each process and the allocatable resources of each NUMA node, so as to allocate corresponding NUMA nodes for each process.
  • Application layer Processes corresponding to various businesses are deployed in this layer, and the operation of each process needs to consume certain computing resources and storage resources.
  • FIG. 3 is a schematic flow diagram of a running process provided by the embodiment of the present application. As shown in FIG. 3, the method for running the process in the embodiment of the present application includes:
  • the controller acquires configurable resource information of each NUMA node
  • the method for running a process provided in this application is applied to a computer device (such as a server) configured with multiple processor cores and multiple memories.
  • a computer device such as a server
  • multiple processor cores and multiple memories are divided into multiple NUMA nodes using the NUMA system.
  • Each NUMA node includes several processor cores and memories.
  • the number of processor cores and memory capacity between each NUMA node can be exchanged.
  • the deployment of computing resources (number of processor cores) and storage resources (memory capacity) in a specific NUMA node can be configured according to actual needs, which is not limited here.
  • the computer device includes a controller, which may be the operating system of the computer device, and the functions of the application resource management layer and the resource division rules and allocation strategy technical layer as shown in Figure 2 can be controlled by the computer device device for execution.
  • a controller which may be the operating system of the computer device, and the functions of the application resource management layer and the resource division rules and allocation strategy technical layer as shown in Figure 2 can be controlled by the computer device device for execution.
  • the controller before running the process, the controller needs to allocate each process to a suitable NUMA node, so that the computing resources (number of processor cores) and storage resources (memory capacity) in each NUMA node can meet the requirements of the nodes. All processes need to run, and at the same time, avoid excessive computing resources and storage resources allocated to the process.
  • the controller In the process of allocating corresponding NUMA nodes for each process, the controller needs to acquire configurable resource information of each NUMA node.
  • the configurable resource information of a NUMA node includes the computing resources (number of processor cores) and storage resources (memory capacity) of the NUMA node, so as to determine how many resources are left in each NUMA node that can be allocated to to each process.
  • the computing resources used when a process is running are quantified by the share of processor cores occupied by the process. For example, if the computing resource used by a certain process when running is the computing resource corresponding to 1.5 processor cores, for the convenience of description, it can be said that the process occupies 1.5 processor cores.
  • the configurable resource information of node A is 10 processor cores And 100G memory capacity, it means that there are still 10 processor cores and 100G memory capacity in the A node that can be allocated to each process;
  • the configurable resource information of B node is 15 processor cores and 120G memory capacity, it means There are currently 15 processor cores and 120G memory capacity left in the B node that can be allocated to each process;
  • the configurable resource information of the C node is 8 processor cores and 100G memory capacity, which means that the current C node still has remaining 8 processor cores and 100G memory capacity can be allocated to each process.
  • the controller acquires resource requirement information of each process
  • the container creates a "boundary" by constraining and modifying the dynamic performance of the process, so that when the process is running, the resources, files, state, or configuration it accesses are constrained by the container. That is to say, a container is actually a special process, and each container has its own independent process space, which is isolated from other processes.
  • the dynamic performance of the process is not limited, that is, the process in the method of running the process provided by this application can exist in the state of a program, or it can be It exists in the form of a container, which is not limited here.
  • the controller also needs to obtain resource requirement information of each process.
  • the resource requirement information of the process indicates the computing resources (number of processor cores) and storage resources (memory capacity) that the process needs to occupy when running.
  • the resource requirements of the processes often fluctuate up and down within a certain range.
  • resources are allocated based on the resource requirements of each process in a standard operating state.
  • the resource requirement information of No. 1 process is 1.5 processor cores and 10G memory capacity, it means that the No. 1 process needs to consume 1.5 processor cores and 10G memory capacity during operation;
  • the resource requirement information of the No. 2 process is 1.8 processor cores and 15G memory capacity, which means that the No. 2 process is running It needs to consume 1.8 processor cores and 15G memory capacity during operation;
  • the resource requirement information of No. 3 process is 2 processor cores and 20G memory capacity, which means that No. 3 process needs to consume 2 processor cores and 20G memory capacity during operation. Memory Capacity.
  • step 301 the timing relationship between step 301 and step 302 is not limited, the controller may first execute step 301, and then execute step 302; it may also execute first step 302, and then execute step 301, Specifically, there is no limitation here.
  • the process after obtaining the configurable resource information of each NUMA node and the resource requirement information of each process, the process can be allocated to each NUMA node. Theoretically, as long as the configurable resources of the NUMA node meet the resource requirements of the process, the process can be allocated to the NUMA node. However, in practical applications, there are many processes in the computer device, so it is necessary to prioritize each process, and allocate NUMA nodes one by one according to the priority order. On the other hand, the configurable resource information of each NUMA node is different, and the resource requirements of each process are also different. For example, the configurable resource information of a NUMA node is 6 processor cores and 8G memory capacity.
  • each process will be allocated to each NUMA node according to a certain allocation standard, so as to avoid waste of computing resources and storage resources due to unreasonable allocation.
  • FIG. 4 is a schematic flowchart of a process allocation in the embodiment of the present application. As shown in FIG. 4, the process allocation process in the embodiment of the present application includes:
  • the memory requirement of the process can be used to determine the priority of the process.
  • the priority A lookup in the level relationship table determines the priority of the process. It should be understood that in practical applications, the criteria for determining the process priority may also be formulated according to actual needs, which is not specifically limited here.
  • the first process and the second process are assigned a target NUMA node as an example, and the process is explained, wherein the priority of the first process is higher than the second priority.
  • the controller obtains the current allocatable resource information of each NUMA node in the plurality of NUMA nodes, the allocatable resource information includes the first computing resource and the first memory resource, and further calculates the first resource of each NUMA node A ratio between a computing resource and the first memory resource is used as the first ratio of the NUMA node.
  • the controller obtains the current resource requirement information of each process, the resource requirement information includes the first computing resource requirement and the first memory resource requirement, and further calculates the first computing resource requirement and the first memory resource requirement of each process The ratio of the first memory resource requirement is used as the second ratio.
  • the second ratio corresponding to the first process needs to be acquired.
  • step 3032 and step 3033 the timing relationship between step 3032 and step 3033 is not limited, the controller may first execute step 3032, and then execute step 3033; or first execute step 3033, and then execute step 402, Specifically, there is no limitation here.
  • the first process is preferentially assigned to the target NUMA node. Specifically, for the target NUMA node allocated by the first process, the first computing resource of the target NUMA node should meet the first computing resource demand of the first process, and the first memory resource of the target NUMA node should meet the first process The first memory resource requirement. Further, after step 402, the controller has acquired the first ratios of multiple NUMA nodes, compares the first ratios corresponding to multiple NUMA nodes with the second ratio of the first process, and then obtains the difference from the multiple Select the NUMA node with the smallest difference among the NUMA nodes as the target NUMA node. In other words, the difference between the first ratio of the target NUMA node and the second ratio of the first process is the difference between the first ratio of each NUMA node and the first process The one with the smallest difference between the second ratio values.
  • the first ratio of node A is 0.2
  • the first ratio of node B is 0.15
  • the first ratio of node C is 0.25
  • the first process The second ratio of 0.1.
  • the difference between the first ratio of the B node and the second ratio of the first process ie
  • 0.05
  • the B node is the target NUMA node corresponding to the first process.
  • the first process can be assigned to the target NUMA node, so that the target NUMA node can be used to run the first process.
  • the target NUMA node After the first process is allocated to the target NUMA node, the allocated resources of the corresponding target NUMA node will be reduced accordingly. Therefore, in order to continue to use the target NUMA node for the subsequent process allocation process, the target NUMA node needs to be
  • the node's allocatable resource information is updated.
  • the updated allocatable resource information of the target NUMA node includes the second computing resource and the second memory resource, the second computing resource is the difference between the first computing resource and the demand of the first computing resource, and the second memory resource is the first memory resource The difference from the first memory resource requirement.
  • the allocatable resource information of the target NUMA node After the allocatable resource information of the target NUMA node is updated, it can also be used for allocation to other processes (including the second process). In the subsequent process of process allocation, the latest allocatable resource information of the target NUMA node is used for calculation. Since the priority of the first process is higher than that of the second process, it is necessary to allocate the corresponding NUMA node to the second process after the resource allocation is performed by the first process. In this application, the second process is the same as the first process and is also allocated to the target NUMA node as an example for illustration.
  • the controller obtains the allocatable resource information of each NUMA node among the multiple NUMA nodes, the allocatable resource information includes the second computing resource and the second memory resource, and calculates the second computing The ratio between the resource and the second memory resource is used as the third ratio.
  • the allocatable resource information of the target NUMA node is updated allocatable resource information. It should be noted that after the first process is allocated to the target NUMA node, it is possible that the next process is to allocate a NUMA node to the second process. At this time, among the NUMA nodes of the computer device, only the resources of the target NUMA node can be allocated.
  • the information is changed, but other NUMA nodes are not used to allocate other processes during the period, and the allocatable resource information of other NUMA nodes has not changed, that is, the first computing resource and the first memory resource of other NUMA nodes at this time , and the second computing resource and the second memory resource are the same; on the other hand, after the first process is allocated to the target NUMA node, it is possible to allocate corresponding NUMA node, and then it is the turn of the second process to allocate a NUMA node.
  • the value of the first computing resource and the value of the second computing resource may or may not be the same; the value of the first memory resource and the value of the second memory resource may or may not be the same.
  • the controller acquires resource requirement information of the second process, the resource requirement information includes a second computing resource requirement and a second memory resource requirement, and the ratio between the second computing resource requirement and the second memory resource requirement is a fourth ratio .
  • the controller determines, from the multiple NUMA nodes, the NUMA node with the smallest difference as the target NUMA node according to the difference between the third ratio and the fourth ratio corresponding to each of the multiple NUMA nodes. After the target NUMA node corresponding to the second process is determined, the second process can be assigned to the target NUMA node, so that the target NUMA node can be used to run the second process.
  • steps 3031 to 3034 describe the process allocation process in this application, and the process allocation process is applicable to any process. If other process tasks are added to the computer device during the running of the subsequent process, the process allocation process described in step 3031 to step 3034 can also be used to allocate the newly added process, and details will not be repeated here. .
  • each process in the computer device can be assigned to the corresponding NUMA node to run through the process allocation process shown in the above step 301 to step 303 .
  • the process of assigning other processes to their respective NUMA nodes please refer to the description of step 301 to step 303 for details, which will not be repeated here.
  • the controller After assigning each process to the corresponding NUMA node, the controller will obtain the resource allocation information, which is used to indicate the computing power corresponding to each processor core in the NUMA node when the NUMA node is running each process in the node. resources are available. Therefore, the controller runs corresponding processes on each NUMA node according to the resource allocation information.
  • the controller determines the multiple processor cores in the target NUMA node that can be used to run the target process according to the resource allocation information. Further, the controller determines idle processor cores from a plurality of processor cores, wherein some or all computing resources of these idle processor cores are not used, and the controller can run on the idle processor cores the target process.
  • each process is no longer bound to a fixed processor core to run, but the computing resources in the NUMA node are shared with each process in the node, and each process can use the assigned NUMA node Therefore, in a NUMA node, different processes can also run on the same processor core, thereby improving the utilization rate of each processor core in a NUMA node and reducing resource consumption. waste.
  • each process runs only on its allocated NUMA node, thereby avoiding the situation that a certain process accesses resources across nodes and improving the operating efficiency of the process.
  • the same processor core can be used by multiple processes during the running of the processes.
  • the controller may determine the target processor core from multiple processor cores, and the target processor core includes a first computing resource and a second computing resource, wherein the first computing The resource is already used to run the second process, and the second computing resource is an idle resource. Then the controller can use the second computing resource of the target processor core to run the first process.
  • the process to be run can be continuously assigned to those processor cores that already run other processes to run.
  • the same processor core can run multiple different processes at the same time, which avoids the situation that after a certain processor core runs a process, its remaining idle processes cannot be used by other processes, thereby improving
  • the utilization rate of each processor core in the NUMA node reduces the waste of resources.
  • the resource requirements of the process often fluctuate up and down within a certain range.
  • the number of processor cores occupied by some processes may exceed the resource requirements of the process in the standard running state.
  • the process can use the computing resources of other idle processor cores in the current NUMA node to Finish running.
  • the number of processor cores occupied by a certain process is lower than the resource requirement of the process in a standard running state, the computing resources released by the process can also be used by other processes. Therefore, the method for running processes in the present application can also meet the resource requirements of each process in different running states, further improving the resource utilization rate of computer equipment.
  • the processor cores in the NUMA node can be shared, so that other unshared processor cores can be used to execute other specific processes, and the specific process has an independent Processor cores are available.
  • a specific number of processor cores ie, the first processor core
  • the computing resources of the first processor core are different from those of other processor cores in the target NUMA node.
  • Computing resources are not shared, but isolated from each other.
  • the resource allocation information in this application is also used to indicate that the target NUMA node uses the first processor core to run a specific process, and the computing resource corresponding to the first processor core can only be used by the specific process.
  • these specific processes have independent processor cores (first processor cores) available for use during the running process, and do not need to use computing resources of other processor cores, and the computing resources of their independent processor cores do not need to be used. It will be used by other processes, thereby ensuring the resource requirements of a specific process during operation.
  • FIG. 5 is a schematic structural diagram of a computer device provided in an embodiment of the present application.
  • the computer device includes:
  • the obtaining unit 501 is configured to obtain resource allocation information, the resource allocation information is used to indicate that the target NUMA node uses computing resources corresponding to multiple processor cores to run multiple processes, and when running each process, the multiple processor cores Computing resources corresponding to each processor core in can be used;
  • the running unit 502 is configured to run multiple processes on the target NUMA node according to the resource allocation information.
  • the multiple processor cores are all processor cores in the target NUMA node.
  • the target NUMA node further includes a first processor core
  • the resource allocation information is further used to instruct the target NUMA node to use the first processor core to run a specific process, and the The computing resource corresponding to the first processor core can only be used by the specific process.
  • the multiple processes include a target process, and the running unit 502 is specifically configured to:
  • the computer device includes multiple NUMA nodes, the multiple processes include a first process, and the computer device further includes a determining unit 503;
  • the acquiring unit 501 is further configured to acquire the allocatable resource information of each NUMA node in the plurality of NUMA nodes, the allocatable resource information includes the first computing resource and the first memory resource, and the distance between the first computing resource and the first memory resource The ratio is the first ratio;
  • the acquiring unit 501 is further configured to acquire resource requirement information of the first process, where the resource requirement information includes a first computing resource requirement and a first memory resource requirement, and a distance between the first computing resource requirement and the first memory resource requirement
  • the ratio is the second ratio
  • the determining unit 503 is configured to, according to the difference between the first ratio and the second ratio corresponding to each NUMA node in the plurality of NUMA nodes, determine the NUMA node with the smallest difference from the plurality of NUMA nodes as the target NUMA node, and the target NUMA node Used to run the first process.
  • the computer equipment also includes:
  • the updating unit 504 is configured to update the allocatable resource information of the target NUMA node according to the resource requirement information of the first process, so as to obtain updated allocatable resource information, the updated allocatable resource information includes the second computing resource, the second The computing resource is the difference between the first computing resource and the first computing resource requirement.
  • the updated allocatable resource information includes the second memory resource, and the second memory resource is a difference between the first memory resource and the required amount of the first memory resource.
  • the multiple processes further include a second process
  • the acquiring unit 501 is further configured to acquire information about allocatable resources of each NUMA node among the plurality of NUMA nodes, where the information about allocatable resources includes a second computing resource and a second memory resource, and between the second computing resource and the second memory resource The ratio between is the third ratio, and the allocatable resource information of the target NUMA node is the updated allocatable resource information;
  • the acquiring unit 501 is further configured to acquire resource requirement information of the second process, where the resource requirement information includes a second computing resource requirement and a second memory resource requirement, and a distance between the second computing resource requirement and the second memory resource requirement
  • the ratio is the fourth ratio
  • the determination unit 503 is configured to, according to the difference between the third ratio and the fourth ratio corresponding to each NUMA node in the plurality of NUMA nodes, determine the NUMA node with the smallest difference from the plurality of NUMA nodes as the target NUMA node, and the target NUMA node Used to run the second process.
  • the first computing resource requirement is expressed as M processor cores, where M is a positive number including decimals.
  • FIG. 6 is a schematic structural diagram of the computer device provided in the embodiment of the present application.
  • the computer described in the embodiment corresponding to FIG. 5 can be deployed on the computer device 600 , used to implement the functions of the controller in the embodiment corresponding to FIG. 3 or FIG. 4.
  • the computer device 600 is implemented by one or more servers, and the computer device 600 may have relatively large differences due to different configurations or performances, which may include One or more central processing units (central processing units, CPU) 622 (for example, one or more processors) and memory 632, one or more storage media 630 for storing application programs 642 or data 644 (for example, one or more mass storage devices).
  • CPU central processing units
  • storage media 630 for storing application programs 642 or data 644 (for example, one or more mass storage devices).
  • the memory 632 and the storage medium 630 may be temporary storage or persistent storage.
  • the program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the computer device.
  • the central processing unit 622 may be configured to communicate with the storage medium 630 , and execute a series of instruction operations in the storage medium 630 on the computer device 600 .
  • the computer device 600 may also include one or more power sources 626, one or more wired or wireless network interfaces 650, one or more input and output interfaces 658, and/or, one or more operating systems 641, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM , etc.
  • operating systems 641 such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM , etc.
  • the embodiment of the present application also provides a computer program product that, when running on a computer, causes the computer to execute the steps performed by the controller in the method described in the embodiment shown in FIG. 3 or FIG. 4 .
  • An embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a program for signal processing, and when it is run on a computer, the computer executes the program shown in Figure 3 or Figure 4 above. The steps performed by the controller in the method described in the embodiment are illustrated.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be It is not a physical unit, that is, it can be located in one place, or it can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the connection relationship between the modules indicates that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines.
  • the essence of the technical solution of this application or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a floppy disk of a computer , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to make a computer device (which can be a personal computer, training device, or network device, etc.) execute the instructions described in various embodiments of the present application method.
  • a computer device which can be a personal computer, training device, or network device, etc.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transferred from a website, computer, training device, or data
  • the center transmits to another website site, computer, training device or data center via wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • wired eg, coaxial cable, fiber optic, digital subscriber line (DSL)
  • wireless eg, infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a training device or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)), etc.

Abstract

提供了一种运行进程的方法,应用于计算机系统,计算机系统包括目标NUMA节点和控制器,方法包括:控制器获取资源分配信息,资源分配信息用于指示目标NUMA节点使用多个处理器核对应的计算资源运行多个进程,且在运行每个进程时,多个处理器核中的每个处理器核对应的计算资源均可被使用,控制器根据资源分配信息,在目标NUMA节点上运行多个进程。从而在NUMA节点所选定的多个处理器核中,每个进程都可以在任意处理器核上运行,因此NUMA节点中,不同的进程也可以在同一个处理器核上运行,从而提高了NUMA节点中各个处理器核的利用率,减少了资源的浪费。

Description

一种运行进程的方法及相关设备
本申请要求于2021年08月16日提交中国专利局、申请号为202110937787.4、发明名称为“一种运行进程的方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及计算机技术领域,尤其涉及一种运行进程的方法及相关设备。
背景技术
随着计算技术的发展,各个类型的计算机设备的硬件资源越来越丰富。尤其对于需要处理大量的进程任务的计算机设备,其硬件资源往往包括了多个处理器以及多个存储器。
计算机设备可以采用非统一内存访问(non uniform memory access,NUMA)系统,对各个处理器以及各个存储器配置为多个不同的NUMA节点。不同处理器访问不同存储器所花费的时长并不相同,每个NUMA节点中的处理器访问本节点内的存储器所需要的时间,比访问其他NUMA节点上的存储器所花费的时间要少。因此,为了减少进程运行过程中,出现上述跨节点访问的情况,一般将各个进程绑定到对应的处理器上来运行,从而对各个进程进行隔离和限制。
大多数进程在运行时所需要的处理器核的个数并非整数,例如0.5个、0.8个或1.2个等等,针对这种所需要的处理器核个数非整数的情况,一般会对进程所需要的处理器核个数进行向上取整。例如,某个进程需要0.5个处理器核时,则向该进程分配1个处理器,又例如,某个进程需1.2个处理器核时,则向该进程分配2个处理器。然而,这种资源分配模式下,大多数进程都没有充分利用处理器的资源,存在较多的资源浪费。
发明内容
本申请实施例提供了一种运行进程的方法及相关设备,用于提高NUMA节点中各个处理器核的利用率,减少资源的浪费。
第一方面,本申请实施例提供了一种运行进程的方法,该方法应用于计算机系统,计算机系统包括目标NUMA节点和控制器,控制器获取资源分配信息,资源分配信息用于指示目标NUMA节点使用多个处理器核对应的计算资源运行多个进程,且在运行每个进程时,多个处理器核中的每个处理器核对应的计算资源均可被使用。控制器根据资源分配信息,在目标NUMA节点上运行多个进程。
针对目标NUMA节点中的用于运行进程的处理器核的个数,本申请实施例中并不做限定。即该目标NUMA节点中,上述“多个处理器核”可以为目标NUMA节点其中的一部分处理器核,也可以为目标NUMA节点中的全部处理器核,具体此处不做限定。
需要说明的是,为了便于描述,本申请实施例中,针对进程运行时所使用的计算资源,以该进程所占用的处理器核的份额来进行量化。例如,若某个进程运行时所使用的计算资源为1.5个处理器核对应的计算资源,则为了便于描述,可以说该进程占用了1.5个处理器核。
本申请中,提供了目标NUMA节点中的运行进程的方法,该运行进程的方法同样可以适用于计算机系统中的其他NUMA节点,从而达到同样的技术效果。
通过上述方式,在NUMA节点所选定的多个处理器核中,每个进程都可以在上述任意处理器核上运行。因此该NUMA节点中,不同的进程也可以在同一个处理器核上运行,从而提高了NUMA节点中各个处理器核的利用率,减少了资源的浪费。另一方面,各个进程只在其所分配的NUMA节点上运行,从而避免了某个进程出现跨节点访问资源的情况,提高了进程的运行效率。
进一步的,在进程的实际运行过程中,进程的资源需求往往会有一定范围内的上下波动。例如,某些进程所占用的处理器核数量可能会超出了该进程在标准运行状态下的资源需求,此时,该进程便可以使用当前NUMA节点中,其他空闲的处理器核的计算资源来完成运行。又例如,某些进程所占用的处理器核数量低于该进程在标准运行状态下的资源需求,则该进程所释放出来的计算资源也可以被其他进程所使用。因此,本申请中的运行进程的方法,还可以满足各个进程在不同运行状态下的资源需求,进一步提高了计算机设备的资源利用率。
基于第一方面,一种可选的实施方式中,多个处理器核可以为目标NUMA节点中的全部处理器核,即将目标NUMA节点中的所有处理器核,全部用于运行该目标NUMA节点中的多个进程,且在运行每个进程时,目标NUMA节点中的每个处理器核对应的计算资源均可被使用。
基于第一方面,一种可选的实施方式中,还可以仅对NUMA节点中的部分处理器核进行共享,从而其他未被共享的处理器核,则可以用于执行其他的特定进程,则该特定进程拥有独立的处理器核可供使用。具体的,本申请实施例中,可以在该目标NUMA节点选出特定的若干个处理器核(即第一处理器核),第一处理器核的计算资源与目标NUMA节点中其他处理器核的计算资源互不共享,而是互相隔离的。其中,本申请中的资源分配信息还用于指示目标NUMA节点使用第一处理器核来运行特定进程,并且,第一处理器核对应的计算资源仅可被特定进程所使用。因此,这些特定进程在运行的过程中有独立的处理器核(第一处理器核)可供使用,不需要去使用其他处理器核的计算资源,其独立的处理器核的计算资源也不会被其他进程所使用,从而保证了特定进程在运行过程中的资源需求。
基于第一方面,一种可选的实施方式中,目标NUMA节点中的多个进程包括目标进程,在需要运行该目标进程时,控制器根据资源分配信息确定出目标NUMA节点中,可用于运行目标进程的多个处理器核。进一步的,控制器从多个处理器核中确定出空闲处理器核,其中,这些空闲处理器核中尚有一部分或者全部的计算资源未被使用,则控制器可以在空闲处理器核上运行该目标进程。
基于第一方面,一种可选的实施方式中,计算机系统包括多个NUMA节点,多个NUMA节点均可以使用本申请中的运行进程的方法。在运行进程之前,控制器需要将各个进程分配到合适的NUMA节点当中。本申请实施例中,控制器在为各个进程分配NUMA节点时所采用的分配逻辑是一致的。下面以多个进程其中的第一进程的分配流程为示例进行阐述。
控制器在为各个进程分配相应的NUMA节点的过程中,控制器需要获取多个NUMA节点中每个NUMA节点当前的可分配资源信息,可分配资源信息包括第一计算资源和第一内存资源,然后再计算每个NUMA节点的第一计算资源和第一内存资源之间的比值作为该NUMA节 点的第一比值。NUMA节点的可配置资源信息包括了该NUMA节点的计算资源(处理器核数量)和存储资源(内存容量),从而确定当前各个NUMA节点中还剩余多少资源可用于分配给到各个进程。
控制器还需要获取各个进程的资源需求信息,其中,进程的资源需求信息表示了该进程在运行时所需要占用的计算资源(处理器核数量)和存储资源(内存容量)。当然,在实际运行过程中,进程的资源需求往往会有一定范围内的上下波动,本申请中,以每个进程标准运行状态下的资源需求为准来进行分配资源。控制器获取的各个进程当前的资源需求信息中。此时,控制器便获取了第一进程的资源需求信息,资源需求信息包括第一计算资源需求量和第一内存资源需求量,第一计算资源需求量与第一内存资源需求量之间的比值为第二比值。
控制器将多个NUMA节点对应的第一比值与第一进程的第二比值进行比较差异,然后从多个NUMA节点中选出差异最小的NUMA节点作为目标NUMA节点。换句话说,目标NUMA节点的第一比值与第一进程的第二比值的差异,是各个NUMA节点的第一比值与第一进程的第二比值之间的差异最小的一个。
通过上述方式,控制器可以按照统一的分配逻辑来将各个进程分配至相应的NUMA节点当中,且每个进程在分配NUMA节点时,其对应的资源需求比值与该NUMA节点的可分配资源占比是最为接近的。因此,在分配了相应的进程之后,对该NUMA节点的可分配资源占比是影响最小的,从而保证了该NUMA节点的可适配性。
基于第一方面,一种可选的实施方式中,在第一进程分配给到目标NUMA节点之后,相应的该目标NUMA节点的可分配资源则会相应的减少,因此,为了将该目标NUMA节点继续用于后续的进程分配流程,需要对该目标NUMA节点的可分配资源信息进行更新。目标NUMA节点更新后的可分配资源信息包括第二计算资源,第二计算资源为第一计算资源与第一计算资源需求量的差值。目标NUMA节点的可分配资源信息更新过后,还可用于分配给其他进程。而在后续的进程分配的流程中,则以目标NUMA节点最新的可分配资源信息来进行计算。
通过上述方式,在每个进程分配到相应的NUMA节点之后,及时地对该NUMA节点的可分配资源信息进行更新,提高了NUMA节点的可分配资源信息的时效性,便于该NUMA节点继续参与到后续的进程分配的流程当中。
基于第一方面,一种可选的实施方式中,更新后的可分配资源信息包括第二内存资源,第二内存资源为第一内存资源与第一内存资源需求量的差值。
基于第一方面,一种可选的实施方式中,多个进程还包括第二进程,控制器将第一进程分配到目标NUMA节点之后,该目标NUMA节点还可用于分配其他进程(包括第二进程)。
具体的,与前述分配第一进程的过程类似,控制器获取多个NUMA节点中每个NUMA节点的可分配资源信息,可分配资源信息包括第二计算资源和第二内存资源,计算第二计算资源和第二内存资源之间的比值作为第三比值。其中,目标NUMA节点的可分配资源信息为更新后的可分配资源信息。需要说明的是,在经过第一进程分配到目标NUMA节点之后,有可能下一个就是为第二进程分配NUMA节点,则此时计算机设备的各个NUMA节点中,唯有目标NUMA节点的可分配资源信息是发生变化的,而其他NUMA节点期间并没有用于分配其 他进程,则其他NUMA节点的可分配资源信息是没有发生变化的,即此时其他NUMA节点的第一计算资源和第一内存资源,与,第二计算资源和第二内存资源是相同的;另一方面,在经过第一进程分配到目标NUMA节点之后,有可能接下来是为其他进程(不包括第二进程)分配相应的NUMA节点,然后才轮到为第二进程分配NUMA节点。则此时计算机设备的各个NUMA节点中,凡是参与了其他进程的资源分配的NUMA节点,其对应的可分配资源信息是都发生变化的,即此时这些NUMA节点的第一计算资源和第一内存资源,与,第二计算资源和第二内存资源是不相同的。而只有那些期间没有用于分配其他进程的NUMA节点,其对应的可分配资源信息才没有发生变化。
因此,本申请中,第一计算资源的值和第二计算资源的值可以相同,也可以不相同;第一内存资源的值和第二内存资源的值可以相同,也可以不相同。
控制器获取第二进程的资源需求信息,资源需求信息包括第二计算资源需求量和第二内存资源需求量,第二计算资源需求量和第二内存资源需求量之间的比值为第四比值。控制器根据多个NUMA节点中每个NUMA节点对应的第三比值和第四比值之间的差异,从多个NUMA节点中确定差异最小的NUMA节点为目标NUMA节点。确定了第二进程对应的目标NUMA节点之后,则可以将该第二进程分配到该目标NUMA节点,使得目标NUMA节点可以用于运行该第二进程。
通过上述方式,同一个NUMA节点,可以用于分配给到多个不同的进程,从而提高了NUMA节点的资源利用率。
基于第一方面,一种可选的实施方式中,第一计算资源需求量表示为M个处理器核,M为包含小数的正数。换句话说,各个进程所需要的处理器核的个数可以为整数或者非整数。而本申请所提供的运行进程的方法中,并不受进程所需要的处理器核的个数是否为整数所影响。
第二方面,本申请实施例提供了一种运行进程的方法,该方法应用于计算机系统,计算机系统包括目标非统一内存访问NUMA节点和控制器,目标NUMA节点包括多个处理器核,该方法包括:当目标NUMA节点中,第一进程请求运行时。控制器可以从多个处理器核中确定目标处理器核,目标处理器核包括第一计算资源和第二计算资源,其中,第一计算资源已经用于运行第二进程,而第二计算资源则为空闲资源。则控制器可以使用目标处理器核的第二计算资源来运行第一进程。
通过上述方式,对于NUMA节点中待运行的进程,可以将待运行的进程继续分配到那些已经运行有其他进程的处理器核上来运行。即本申请中,同一个处理器核可以同时运行多个不同的进程,避免了某个处理器核在运行了一个进程之后,其剩余的空闲进程无法被其他进程所使用的情况,从而提高了NUMA节点中各个处理器核的利用率,减少了资源的浪费。另一方面,各个进程只在其所分配的NUMA节点上运行,从而避免了某个进程出现跨节点访问资源的情况,提高了进程的运行效率。
基于第二方面,一种可选的实施方式中,多个处理器核可以为目标NUMA节点中的全部处理器核,即将目标NUMA节点中的所有处理器核,全部用于运行该目标NUMA节点中的多个进程,其中,目标NUMA节点中的每个处理器核中对应的计算资源均可用于运行多个进程 中的每个进程。
基于第二方面,一种可选的实施方式中,可以仅对NUMA节点中的部分处理器核进行共享,从而其他未被共享的处理器核,则可以用于执行其他的特定进程,则该特定进程拥有独立的处理器核可供使用。具体的,本申请实施例中,可以在该目标NUMA节点选出特定的若干个处理器核(即第一处理器核),第一处理器核的计算资源与目标NUMA节点中其他处理器核的计算资源互不共享,而是互相隔离的。其中,本申请中的资源分配信息还用于指示目标NUMA节点使用第一处理器核来运行特定进程,并且,第一处理器核对应的计算资源仅可被特定进程所使用。因此,这些特定进程在运行的过程中有独立的处理器核(第一处理器核)可供使用,不需要去使用其他处理器核的计算资源,其独立的处理器核的计算资源也不会被其他进程所使用,从而保证了特定进程在运行过程中的资源需求。
第三方面,本申请实施例提供了一种计算机设备,该计算机设备包括:
获取单元,用于获取资源分配信息,资源分配信息用于指示目标NUMA节点使用多个处理器核对应的计算资源运行多个进程,且在运行每个进程时,多个处理器核中的每个处理器核对应的计算资源均可被使用;
运行单元,用于根据资源分配信息,在目标NUMA节点上运行多个进程。
基于第三方面,一种可选的实施方式中,多个处理器核为目标NUMA节点中的全部处理器核。
基于第三方面,一种可选的实施方式中,目标NUMA节点还包括第一处理器核,资源分配信息还用于指示目标NUMA节点使用第一处理器核运行特定进程,且第一处理器核对应的计算资源仅可被特定进程所使用。
基于第三方面,一种可选的实施方式中,多个进程包括目标进程,运行单元具体用于:
根据资源分配信息确定多个处理器核;
从多个处理器核中确定空闲处理器核;
在空闲处理器核上运行目标进程。
基于第三方面,一种可选的实施方式中,计算机设备包括多个NUMA节点,多个进程包括第一进程,计算机设备还包括确定单元;
获取单元,还用于获取多个NUMA节点中每个NUMA节点的可分配资源信息,可分配资源信息包括第一计算资源和第一内存资源,第一计算资源和第一内存资源之间的比值为第一比值;
获取单元,还用于获取第一进程的资源需求信息,资源需求信息包括第一计算资源需求量和第一内存资源需求量,第一计算资源需求量与第一内存资源需求量之间的比值为第二比值;
确定单元,用于根据多个NUMA节点中每个NUMA节点对应的第一比值和第二比值之间的差异,从多个NUMA节点中确定差异最小的NUMA节点为目标NUMA节点,目标NUMA节点用于运行第一进程。
基于第三方面,一种可选的实施方式中,计算机设备还包括:
更新单元,用于根据第一进程的资源需求信息,更新目标NUMA节点的可分配资源信息, 以得到更新后的可分配资源信息,更新后的可分配资源信息包括第二计算资源,第二计算资源为第一计算资源与第一计算资源需求量的差值。
基于第三方面,一种可选的实施方式中,更新后的可分配资源信息包括第二内存资源,第二内存资源为第一内存资源与第一内存资源需求量的差值。
基于第三方面,一种可选的实施方式中,多个进程还包括第二进程;
获取单元,还用于获取多个NUMA节点中每个NUMA节点的可分配资源信息,其中,可分配资源信息包括第二计算资源和第二内存资源,第二计算资源和第二内存资源之间的比值为第三比值,且目标NUMA节点的可分配资源信息为更新后的可分配资源信息;
获取单元,还用于获取第二进程的资源需求信息,资源需求信息包括第二计算资源需求量和第二内存资源需求量,第二计算资源需求量和第二内存资源需求量之间的比值为第四比值;
确定单元,用于根据多个NUMA节点中每个NUMA节点对应的第三比值和第四比值之间的差异,从多个NUMA节点中确定差异最小的NUMA节点为目标NUMA节点,目标NUMA节点用于运行第二进程。
基于第三方面,一种可选的实施方式中,第一计算资源需求量表示为M个处理器核,M为包含小数的正数。
第四方面,本申请实施例提供了一种计算机设备,计算机设备包括目标非统一内存访问NUMA节点,目标NUMA节点包括多个处理器核,计算机设备包括:
确定单元,用于确定第一进程,第一进程为目标NUMA节点中待运行的进程;
确定单元,还用于从多个处理器核中确定目标处理器核,目标处理器核包括第一计算资源和第二计算资源,第一计算资源用于运行第二进程,第二计算资源为空闲资源;
运行单元,用于使用目标处理器核的第二计算资源运行第一进程。
基于第四方面,一种可选的实施方式中,其特征在于,多个处理器核为目标NUMA节点中的全部处理器核。
基于第四方面,一种可选的实施方式中,其特征在于,目标NUMA节点还包括第一处理器核,第一处理器核用于运行特定进程,且第一处理器核对应的计算资源仅可被特定进程所使用。
第五方面,本申请实施例提供了一种计算机设备,计算机设备包括目标非统一内存访问NUMA节点,目标NUMA节点包括多个处理器;
多个处理器,用于为目标NUMA节点提供计算资源;
目标NUMA节点用于使用多个处理器对应的计算资源运行多个进程,且在运行每个进程时,多个处理器中的每个处理器对应的计算资源均可被使用。
第六方面,本申请实施例提供了一种计算机设备,计算机设备包括目标非统一内存访问NUMA节点和控制器,目标NUMA节点包括多个处理器;
多个处理器,用于为目标NUMA节点提供计算资源;
目标NUMA节点用于使用多个处理器对应的计算资源运行多个进程,
控制器,用于确定第一进程,第一进程为多个进程中待运行的进程;
控制器,还用于从多个处理器核中确定目标处理器核,目标处理器核包括第一计算资源和第二计算资源,第一计算资源用于运行第二进程,第二计算资源为空闲资源;
控制器,还用于使用目标处理器核的第二计算资源运行第一进程。
第七方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述任一方面所述的运行进程的方法。
第八方面,本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,当其在计算机上运行时,使得计算机执行上述任一方面所述的运行进程的方法。
第九方面,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,用于实现上述各个方面中所涉及的功能,例如,发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存服务器或通信设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例提供的一种NUMA系统100的示意性架构示意图;
图2为本申请实施例所提供的运行进程的方法的系统框架图;
图3为本申请实施例提供的一种运行进程的流程示意图;
图4为本申请实施例中一种进程分配的流程示意图;
图5为本申请实施例提供的一种计算机设备的结构示意图;
图6为本申请实施例提供的另一种计算机设备的结构示意图。
具体实施方式
本申请实施例提供了一种运行进程的方法及相关设备,用于提高NUMA节点中各个处理器核的利用率,减少资源的浪费。
下面结合本发明实施例中的附图对本发明实施例进行描述。本发明的实施方式部分使用的术语仅用于对本发明的具体实施例进行解释,而非旨在限定本发明。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的 或对于这些过程、方法、产品或设备固有的其它步骤或单元。
下面首先介绍一下本申请的应用场景,本申请实施例中的运行进程的方法可以应用于基于NUMA的计算机系统。请参照图1,图1为本申请实施例提供的一种NUMA系统100的示意性架构示意图。其中,在NUMA系统100的架构中,可以为多插槽系统100。如图1中示出的那样,NUMA系统100包括插槽(socket)101a和插槽101b。插槽101a和插槽101b在本文中可被统称为插槽,可以用于安装中央处理器(central processing unit,CPU)。插槽可以通过互联(interconnect)104彼此通信地耦合。示例性的,每个插槽可经由点对点快速路径互连(quick path interconnect,QPI)链路来连接至其他插槽中的每一个。需要说明的是,QPI是一种互连架构,本申请实施例中各个插槽之间的互联还可以通过其他互连架构实现,诸如其他点对点架构、环架构以及总线架构,这里并不限定。NUMA系统100中所描绘插槽的数量仅为一种示例,并且本领域技术人员将理解,可存在不同数量的插槽。例如,NUMA系统100可包括诸如,六个、四个或更少数量的插槽,又或者NUMA系统100可以包括诸如,十六个、三十二个或更多数量的插槽。
插槽可以包括多个节点(node),每个节点有自己的CPU和内存,节点和节点之间通过互联104进行连接和通信,如图1中示出的那样,插槽101a包括节点102a和节点102b,插槽101b包括节点103a和节点103b,每个节点包括一个内存和六个CPU。需要说明的是,NUMA系统100中所描绘的节点和CPU的数量仅为一种示例,并且本领域技术人员将理解,每个插槽可以包括其他数量的节点,每个节点可以包括其他数量的CPU。
上述图1所示出的NUMA系统,往往应用于配置有多个处理器以及多个存储器的计算机设备。在计算机设备中,每个NUMA节点中的处理器访问本节点内的存储器所需要的时间,远远比访问其他NUMA节点上的存储器所花费的时间要少。现有技术中,一般将各个进程绑定到对应的处理器上来运行,从而对各个进程进行隔离和限制。即每个进程只能在其所绑定的处理器上运行,而该进程则无法在本地NUMA节点中的其他处理器或其他NUMA节点上的处理器上运行。另一方面,每个处理器也只能被所绑定的进程所使用,而该处理器则无法被本地NUMA节点中的其他进程或其他NUMA节点上的进程所使用。然而,大多数进程所需要的处理器核的个数并非整数,例如0.5个、0.8个或1.2个等等,针对这种所需要的处理器核个数非整数的情况,一般会对进程所需要的处理器核个数进行向上取整。例如,某个进程需要0.5个处理器核时,则向该进程分配1个处理器,又例如,某个进程需1.2个处理器核时,则向该进程分配2个处理器。通过这种分配方式,对于处理器而言,在与进程进行绑定后,该处理器的计算资源往往无法得到充分利用。进一步的,一般来说进程往往不会一直处于最高的资源诉求,同时进程在各个不同时间段对资源的诉求有高有底。例如,某个进程在分配时可能需要的处理器核的个数为1.2个,但在实际运行过程中,某些情况下该进程的资源诉求可能比预期的要低,仅需要占用0.8个处理器核。然而该进程已经与2个处理器核进行了绑定,则此时会有1.2(2-0.8=1.2)个逻辑的资源被浪费。所以,这种资源分配模式下,完全没有充分利用已有的资源,且比预期浪费更多的资源。
有鉴于此,本申请实施例提供了一种运行进程的方法,可以为各个进程合理地分配到对应的NUMA节点当中去运行,一方面可以减少进程的运行过程中,出现上述跨节点访问的 情况,另一方面,提高了NUMA节点中各个处理器核的利用率,减少了资源的浪费。
为了各个进程能够合理且高效地在本地的NUMA节点上运行,本申请实施例中,需要在各个进程运行之前,为各个进程分配到合适的NUMA节点当中,使得各个NUMA节点中的计算资源(处理器核数量)和存储资源(内存容量)能够满足节点内所有进程运行时的需要,同时,避免为进程分配的计算资源和存储资源过剩,导致资源的浪费。请参阅图2,图2为本申请实施例所提供的运行进程的方法的系统框架图。如图2所示,该系统框架主要包含硬件资源层(处理器核和存储器层)、应用资源管理层、资源划分规则和分配策略技术层以及应用层。其中,具体每个层级的分工如下:
硬件资源层:该层是计算机设备中所有处理器核和存储器的集合。具体的,计算机设备中所有处理器核和存储器会划分到各个NUMA节点中。其中,“NUMA节点”表示多个处理器核下与存储器最近的距离,即多个处理器核与本地存储器的结合为一个NUMA节点,这是计算机设备的硬件资源决定的。在硬件资源固定的情况下,处理器核和存储器固定,节点内的处理器核访问存储器时间最短,访问效率最高。节点与节点间的处理器和存储器可以互相访问,访问时间的长短取决与存储器与处理器间的距离。
应用资源管理层:应用资源管理层主要对硬件资源中的处理器核和存储器进行二次划分,即根据“资源划分规则和分配策略技术层”的计算结果确定分配路径,从而编排应用层中各个进程的使用资源。应用资源管理层需要获取各个NUMA节点当前的可分配资源信息,以及各个进程的资源需求信息,并由资源划分规则和分配策略技术层来计算相应的资源分配原则。
资源划分规则和分配策略技术层:为了提升处理器核访问存储器的效率和时间,并且,提高处理器的利用率,而发明出来的各种资源编排策略和资源使用策略。具体的,可以根据各个进程资源需求信息和各个NUMA节点的可分配资源,来计算最优的资源分配原则,从而为各个进程分配对应的NUMA节点。
应用层:该层中部署有各个业务对应的进程,每个进程的运行都需要消费一定的计算资源和存储资源。
接下来,对本申请提出的运行进程的方法进行说明。请参阅图3,图3为本申请实施例提供的一种运行进程的流程示意图,如图3所示,本申请实施例中运行进程的方法包括:
301.控制器获取各个NUMA节点的可配置资源信息;
本申请所提供的运行进程的方法,应用于配置有多个处理器核以及多个存储器的计算机设备(例如服务器)。其中,上述多个处理器核以及多个存储器采用NUMA系统划分为多个NUMA节点,每个NUMA节点包括若干个处理器核以及存储器,各个NUMA节点之间的处理器核数量以及内存容量可以互不相同,具体NUMA节点中的计算资源(处理器核数量)和存储资源(内存容量)的部署情况,可以根据实际的需要来配置,此处不做限定。
进一步的,计算机设备中包括控制器,该控制器可以是计算机设备的操作系统,则如图2所示的应用资源管理层以及资源划分规则和分配策略技术层的功能,可以由计算机设备的控制器来进行执行。
本申请实施例中,在运行进程之前,控制器需要将各个进程分配到合适的NUMA节点当 中,使得各个NUMA节点中的计算资源(处理器核数量)和存储资源(内存容量)能够满足节点内所有进程运行时的需要,同时,避免为进程分配的计算资源和存储资源过剩。而控制器在为各个进程分配相应的NUMA节点的过程中,需要获取各个NUMA节点的可配置资源信息。本申请实施例中,NUMA节点的可配置资源信息包括了该NUMA节点的计算资源(处理器核数量)和存储资源(内存容量),从而确定当前各个NUMA节点中还剩余多少资源可用于分配给到各个进程。
需要说明的是,为了便于描述,本申请实施例中,针对进程运行时所使用的计算资源,以该进程所占用的处理器核的份额来进行量化。例如,若某个进程运行时所使用的计算资源为1.5个处理器核对应的计算资源,则为了便于描述,可以说该进程占用了1.5个处理器核。
示例性的,以计算机设备中存在A、B和C这三个NUMA节点为例,假设所获取到的各个NUMA节点的可配置资源信息中,A节点的可配置资源信息为10个处理器核以及100G内存容量,则表示当前该A节点中还剩余10个处理器核以及100G内存容量可用于分配给各个进程;B节点的可配置资源信息为15个处理器核以及120G内存容量,则表示当前该B节点中还剩余15个处理器核以及120G内存容量可用于分配给各个进程;C节点的可配置资源信息为8个处理器核以及100G内存容量,则表示当前该C节点中还剩余8个处理器核以及100G内存容量可用于分配给各个进程。
302.控制器获取各个进程的资源需求信息;
进程:某个程序被执行时,该程序就从磁盘上的二进制文件,变成了计算机内存中的数据、寄存器里的值、堆栈中的指令、被打开的文件,以及计算机设备的各个状态信息的一个集合。像这样一个程序运行起来后的计算机设备执行环境的总和,就是进程。
对于进程来说,它的静态表现就是程序;而一旦运行起来,它就变成了计算机里的数据和状态的总和,这就是进程的动态表现。
而容器就是通过约束和修改进程的动态表现,从而为其创造出一个“边界”,使得该进程在运行时,其所访问的资源、文件、状态,或者配置是受到该容器所约束的。也就是说,容器其实就是一种特殊的进程,每个容器都有自己独立的进程空间,与其他进程之间是相互隔离的。
结合上述针对于进程和容器的介绍,本申请实施例中,并不限定进程运行时的动态表现,即本申请所提供的运行进程的方法中的进程可以是以程序的状态存在,也可以是以容器的方式存在,具体此处不做限定。
控制器在为各个进程分配相应的NUMA节点的过程中,还需要获取各个进程的资源需求信息。其中,进程的资源需求信息表示了该进程在运行时所需要占用的计算资源(处理器核数量)和存储资源(内存容量)。当然,在实际运行过程中,进程的资源需求往往会有一定范围内的上下波动,本申请中,以每个进程标准运行状态下的资源需求为准来进行分配资源。
示例性的,以计算机设备中存在1号进程、2号进程和3号进程为例,假设所获取到的各个进程的资源需求信息中,1号进程的资源需求信息为1.5个处理器核和10G内存容 量,则表示该1号进程在运行时需要消耗1.5个处理器核和10G内存容量;2号进程的资源需求信息为1.8个处理器核和15G内存容量,则表示该2号进程在运行时需要消耗1.8个处理器核和15G内存容量;3号进程的资源需求信息为2个处理器核和20G内存容量,则表示该3号进程在运行时需要消耗2个处理器核和20G内存容量。
需要说明的是,本申请实施例中,并不限定步骤301与步骤302之间的时序关系,控制器可以先执行步骤301,然后执行步骤302;也可以先执行步骤302,然后执行步骤301,具体此处不做限定。
303.为各个进程分配对应的NUMA节点;
本申请实施例中,在获取到各个NUMA节点的可配置资源信息以及各个进程的资源需求信息之后,便可以将进程分配到各个NUMA节点中。从理论上来说,只要NUMA节点的可配置资源满足进程的资源需求,便可以将该进程分配到该NUMA节点当中。然而,在实际应用中,计算机设备中的进程数量较多,因此需要对各个进程进行优先级排序,按照优先级的顺序来逐个分配NUMA节点。另一方面,各个NUMA节点的可配置资源信息不尽相同,且各个进程的资源需求也互有差异,例如,某个NUMA节点的可配置资源信息为6个处理器核和8G内存容量,若此时将处理器核需求量较大,内存需求量较小的进程分配到该NUMA节点中的话,很有可能出现该NUMA节点的处理器核已经全部被占用,但该NUMA节点的内存容量缺过剩的情况。因此,本申请中将按照一定的分配标准来将各个进程分配到各个NUMA节点,避免因为分配不合理导致计算资源和存储资源的浪费。
下面,对本申请实施例中进程分配到NUMA节点的分配逻辑进行介绍。请参阅图4,图4为本申请实施例中一种进程分配的流程示意图,如图4所示,本申请实施例中进程分配的流程包括:
3031.确定进程的优先级;
由于在实际应用中,计算机设备中的进程数量较多,因此需要对各个进程进行优先级排序,按照优先级的顺序来逐个分配NUMA节点。具体的,本申请中,可以采用进程的内存需求量的大小来确定进程的优先级,内存需求量越大,其对应的优先级越高;也可以采用进程的处理器核需求量的大小来确定进程的优先级,处理器核需求量越大,其对应的优先级越高;还可以按照进程的业务类型,提前确定优先级关系表,当需要为该进程分配NUMA节点时,则从优先级关系表中查找确定该进程的优先级。应理解,在实际应用中,还可以根据实际需要来制定进程优先级的确定标准,具体此处不做限定。
在后续描述中,以为第一进程和第二进程分配目标NUMA节点为例,进程阐述,其中,第一进程的优先级高于第二优先级。
3032.计算多个NUMA节点中的计算资源与存储资源的比值;
经过步骤301,控制器获取了多个NUMA节点中每个NUMA节点当前的可分配资源信息,可分配资源信息包括第一计算资源和第一内存资源,进一步的,再计算每个NUMA节点的第一计算资源和第一内存资源之间的比值作为该NUMA节点的第一比值。
示例性的,假设某个NUMA节点的第一计算资源为10个处理器核,第一内存资源为100G内存容量,则当前该NUMA节点的第一比值为10:100=0.1;若某个NUMA节点的第一计算资 源为20个处理器核,第一内存资源为100G内存容量,则当前该NUMA节点的第一比值为20:100=0.2。
3033.计算进程所需求的计算资源与存储资源的比值;
经过步骤301,控制器获取了各个进程当前的资源需求信息,资源需求信息包括第一计算资源需求量和第一内存资源需求量,进一步的,再计算每个进程的第一计算资源需求量与第一内存资源需求量的比值作为第二比值。
由于需要先为第一进程相应的NUMA节点,则需要获取第一进程对应的第二比值。
示例性的,假设第一进程的第一资源需求量为2.5个处理器核以及25G内存,则第一进程的第二比值为2.5:25=0.1;第二进程的第一资源需求量为2个处理器核以及10G内存,则第一进程的第二比值为2:10=0.2。
需要说明的是,本申请实施例中,并不限定步骤3032与步骤3033之间的时序关系,控制器可以先执行步骤3032,然后执行步骤3033;也可以先执行步骤3033,然后执行步骤402,具体此处不做限定。
3034.将各个进程分配到对应的NUMA节点;
由于第一进程的优先级高于第二进程,则优先为第一进程分配至目标NUMA节点。具体的,对于第一进程所分配的目标NUMA节点,目标NUMA节点的第一计算资源应当满足于第一进程的第一计算资源需求量,目标NUMA节点的第一内存资源应当满足于第一进程的第一内存资源需求量。进一步的,由于经过步骤402后,控制器已经获取到多个NUMA节点的第一比值,则将多个NUMA节点对应的第一比值与第一进程的第二比值进行比较差异,然后从多个NUMA节点中选出差异最小的NUMA节点作为目标NUMA节点,换句话说,目标NUMA节点的第一比值与第一进程的第二比值的差异,是各个NUMA节点的第一比值与第一进程的第二比值之间的差异最小的一个。
示例性的,假设计算机设备存在A、B和C这三个NUMA节点,A节点的第一比值为0.2,B节点的第一比值为0.15,C节点的第一比值为0.25,而第一进程的第二比值0.1。经过比较,则B节点的第一比值与第一进程的第二比值差异(即|0.1-0.15|=0.05)最为接近,即可以确定B节点为第一进程所对应的目标NUMA节点。
在确定了第一进程对应的目标NUMA节点之后,则可以将该第一进程分配到该目标NUMA节点,使得目标NUMA节点可以用于运行该第一进程。
在第一进程分配给到目标NUMA节点之后,相应的该目标NUMA节点的可分配资源则会相应的减少,因此,为了将该目标NUMA节点继续用于后续的进程分配流程,需要对该目标NUMA节点的可分配资源信息进行更新。目标NUMA节点更新后的可分配资源信息包括第二计算资源和第二内存资源,第二计算资源为第一计算资源与第一计算资源需求量的差值,第二内存资源为第一内存资源与第一内存资源需求量的差值。
目标NUMA节点的可分配资源信息更新过后,还可用于分配给其他进程(包括第二进程)。而在后续的进程分配的流程中,则以目标NUMA节点最新的可分配资源信息来进行计算。由于第一进程的优先级高于第二进程,则需要在第一进程进行了资源分配之后,才对第二进程进行分配相应的NUMA节点。本申请中,以第二进程和第一进程相同,同样分配至目标 NUMA节点为例,进行说明。
具体的,与前述分配第一进程的过程类似,控制器获取多个NUMA节点中每个NUMA节点的可分配资源信息,可分配资源信息包括第二计算资源和第二内存资源,计算第二计算资源和第二内存资源之间的比值作为第三比值。其中,目标NUMA节点的可分配资源信息为更新后的可分配资源信息。需要说明的是,在经过第一进程分配到目标NUMA节点之后,有可能下一个就是为第二进程分配NUMA节点,则此时计算机设备的各个NUMA节点中,唯有目标NUMA节点的可分配资源信息是发生变化的,而其他NUMA节点期间并没有用于分配其他进程,则其他NUMA节点的可分配资源信息是没有发生变化的,即此时其他NUMA节点的第一计算资源和第一内存资源,与,第二计算资源和第二内存资源是相同的;另一方面,在经过第一进程分配到目标NUMA节点之后,有可能接下来是为其他进程(不包括第二进程)分配相应的NUMA节点,然后才轮到为第二进程分配NUMA节点。则此时计算机设备的各个NUMA节点中,凡是参与了其他进程的资源分配的NUMA节点,其对应的可分配资源信息是都发生变化的,即此时这些NUMA节点的第一计算资源和第一内存资源,与,第二计算资源和第二内存资源是不相同的。而只有那些期间没有用于分配其他进程的NUMA节点,其对应的可分配资源信息才没有发生变化。
因此,本申请中,第一计算资源的值和第二计算资源的值可以相同,也可以不相同;第一内存资源的值和第二内存资源的值可以相同,也可以不相同。
控制器获取第二进程的资源需求信息,资源需求信息包括第二计算资源需求量和第二内存资源需求量,第二计算资源需求量和第二内存资源需求量之间的比值为第四比值。控制器根据多个NUMA节点中每个NUMA节点对应的第三比值和第四比值之间的差异,从多个NUMA节点中确定差异最小的NUMA节点为目标NUMA节点。确定了第二进程对应的目标NUMA节点之后,则可以将该第二进程分配到该目标NUMA节点,使得目标NUMA节点可以用于运行该第二进程。
应理解,上述步骤3031至步骤3034描述了本申请中的进程分配的流程,该进程分配的流程适用于任意进程。若后续进程运行的过程中,计算机设备新增了其他的进程任务,那么同样也可以使用3031至步骤3034所描述的进程分配的流程来对该新增的进程进行分配,具体此处不再赘述。
本申请实施例中,计算机设备中的各个进程,都可以通过上述步骤301至步骤303所示的进程分配流程,将各个进程分配到对应的NUMA节点中去运行。关于其他进程分配至各自的NUMA节点的流程,具体请参阅步骤301至步骤303的描述,此处不再进行赘述。
304.将NUMA节点中的计算资源共享给节点中的各个进程;
在对各个进程分配到相应的NUMA节点之后,控制器会获取到资源分配信息,资源分配信息用于指示NUMA节点在运行节点内的每个进程时,NUMA节点中的各个处理器核对应的计算资源均可被使用。从而,控制器根据该资源分配信息,在各个NUMA节点上运行相应的进程。
以分配至目标NUMA节点中的多个进程包括目标进程为例,在需要运行该目标进程时,控制器根据资源分配信息确定出目标NUMA节点中,可用于运行目标进程的多个处理器核。 进一步的,控制器从多个处理器核中确定出空闲处理器核,其中,这些空闲处理器核中尚有一部分或者全部的计算资源未被使用,则控制器可以在空闲处理器核上运行该目标进程。
本申请实施例中,各个进程不再绑定到某个固定的处理器核上运行,而是将NUMA节点中的计算资源共享给节点中的各个进程,则各个进程可以使用所分配的NUMA节点的任意处理器核的计算资源来完成运行,因此,NUMA节点中,不同的进程也可以在同一个处理器核上运行,从而提高了NUMA节点中各个处理器核的利用率,减少了资源的浪费。另一方面,各个进程只在其所分配的NUMA节点上运行,从而避免了某个进程出现跨节点访问资源的情况,提高了进程的运行效率。
换句话说,本申请实施例中,在进程运行的过程中,同一个处理器核是可以被多个进程所使用的。以目标NUMA节点中,第一进程请求运行为例,控制器可以从多个处理器核中确定目标处理器核,目标处理器核包括第一计算资源和第二计算资源,其中,第一计算资源已经用于运行第二进程,而第二计算资源则为空闲资源。则控制器可以使用目标处理器核的第二计算资源来运行第一进程。通过上述方式,对于NUMA节点中待运行的进程,可以将待运行的进程继续分配到那些已经运行有其他进程的处理器核上来运行。即本申请中,同一个处理器核可以同时运行多个不同的进程,避免了某个处理器核在运行了一个进程之后,其剩余的空闲进程无法被其他进程所使用的情况,从而提高了NUMA节点中各个处理器核的利用率,减少了资源的浪费。
进一步的,在进程的实际运行过程中,进程的资源需求往往会有一定范围内的上下波动。例如,某些进程所占用的处理器核数量可能会超出了该进程在标准运行状态下的资源需求,此时,该进程便可以使用当前NUMA节点中,其他空闲的处理器核的计算资源来完成运行。又例如,某些进程所占用的处理器核数量低于该进程在标准运行状态下的资源需求,则该进程所释放出来的计算资源也可以被其他进程所使用。因此,本申请中的运行进程的方法,还可以满足各个进程在不同运行状态下的资源需求,进一步提高了计算机设备的资源利用率。
进一步的,在实际应用中,还可以仅对NUMA节点中的部分处理器核进行共享,从而其他未被共享的处理器核,则可以用于执行其他的特定进程,则该特定进程拥有独立的处理器核可供使用。具体的,本申请实施例中,可以在该目标NUMA节点选出特定的若干个处理器核(即第一处理器核),第一处理器核的计算资源与目标NUMA节点中其他处理器核的计算资源互不共享,而是互相隔离的。其中,本申请中的资源分配信息还用于指示目标NUMA节点使用第一处理器核来运行特定进程,并且,第一处理器核对应的计算资源仅可被特定进程所使用。因此,这些特定进程在运行的过程中有独立的处理器核(第一处理器核)可供使用,不需要去使用其他处理器核的计算资源,其独立的处理器核的计算资源也不会被其他进程所使用,从而保证了特定进程在运行过程中的资源需求。
在图2至图4所对应的实施例的基础上,为了更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关设备。具体请参阅图5,图5为本申请实施例提供的一种计算机设备的结构示意图,计算机设备包括:
获取单元501,用于获取资源分配信息,所述资源分配信息用于指示目标NUMA节点使 用多个处理器核对应的计算资源运行多个进程,且在运行每个进程时,多个处理器核中的每个处理器核对应的计算资源均可被使用;
运行单元502,用于根据资源分配信息,在目标NUMA节点上运行多个进程。
在一种可能的设计中,多个处理器核为目标NUMA节点中的全部处理器核。
在一种可能的设计中,所述目标NUMA节点还包括第一处理器核,所述资源分配信息还用于指示所述目标NUMA节点使用所述第一处理器核运行特定进程,且所述第一处理器核对应的计算资源仅可被所述特定进程所使用。
在一种可能的设计中,所述多个进程包括目标进程,所述运行单元502具体用于:
根据所述资源分配信息确定所述多个处理器核;从所述多个处理器核中确定空闲处理器核;在所述空闲处理器核上运行所述目标进程。
在一种可能的设计中,计算机设备包括多个NUMA节点,多个进程包括第一进程,计算机设备还包括确定单元503;
获取单元501,还用于获取多个NUMA节点中每个NUMA节点的可分配资源信息,可分配资源信息包括第一计算资源和第一内存资源,第一计算资源和第一内存资源之间的比值为第一比值;
获取单元501,还用于获取第一进程的资源需求信息,资源需求信息包括第一计算资源需求量和第一内存资源需求量,第一计算资源需求量与第一内存资源需求量之间的比值为第二比值;
确定单元503,用于根据多个NUMA节点中每个NUMA节点对应的第一比值和第二比值之间的差异,从多个NUMA节点中确定差异最小的NUMA节点为目标NUMA节点,目标NUMA节点用于运行第一进程。
在一种可能的设计中,计算机设备还包括:
更新单元504,用于根据第一进程的资源需求信息,更新目标NUMA节点的可分配资源信息,以得到更新后的可分配资源信息,更新后的可分配资源信息包括第二计算资源,第二计算资源为第一计算资源与第一计算资源需求量的差值。
在一种可能的设计中,更新后的可分配资源信息包括第二内存资源,第二内存资源为第一内存资源与第一内存资源需求量的差值。
在一种可能的设计中,多个进程还包括第二进程;
获取单元501,还用于获取多个NUMA节点中每个NUMA节点的可分配资源信息,其中,可分配资源信息包括第二计算资源和第二内存资源,第二计算资源和第二内存资源之间的比值为第三比值,且目标NUMA节点的可分配资源信息为更新后的可分配资源信息;
获取单元501,还用于获取第二进程的资源需求信息,资源需求信息包括第二计算资源需求量和第二内存资源需求量,第二计算资源需求量和第二内存资源需求量之间的比值为第四比值;
确定单元503,用于根据多个NUMA节点中每个NUMA节点对应的第三比值和第四比值之间的差异,从多个NUMA节点中确定差异最小的NUMA节点为目标NUMA节点,目标NUMA节点用于运行第二进程。
在一种可能的设计中,第一计算资源需求量表示为M个处理器核,M为包含小数的正数。
需要说明的是,计算机设备中各模块/单元之间的信息交互、执行过程等内容,与本申请中图2至图4对应的各个方法实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例还提供了一种计算机设备,请参阅图6,图6是本申请实施例提供的计算机设备一种结构示意图,计算机设备600上可以部署有图5对应实施例中所描述的计算机,用于实现图3或图4对应实施例中控制器的功能,具体的,计算机设备600由一个或多个服务器实现,计算机设备600可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)622(例如,一个或一个以上处理器)和存储器632,一个或一个以上存储应用程序642或数据644的存储介质630(例如一个或一个以上海量存储设备)。其中,存储器632和存储介质630可以是短暂存储或持久存储。存储在存储介质630的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对计算机设备中的一系列指令操作。更进一步地,中央处理器622可以设置为与存储介质630通信,在计算机设备600上执行存储介质630中的一系列指令操作。
计算机设备600还可以包括一个或一个以上电源626,一个或一个以上有线或无线网络接口650,一个或一个以上输入输出接口658,和/或,一个或一个以上操作系统641,例如Windows Server TM,Mac OS X TM,Unix TM,Linux TM,FreeBSD TM等等。
本申请实施例中还提供一种包括计算机程序产品,当其在计算机上运行时,使得计算机执行如前述图3或图4所示实施例描述的方法中控制器所执行的步骤。
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有用于进行信号处理的程序,当其在计算机上运行时,使得计算机执行如前述图3或图4所示实施例描述的方法中控制器所执行的步骤。
所另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得 一台计算机设备(可以是个人计算机,训练设备,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、训练设备或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。

Claims (21)

  1. 一种运行进程的方法,其特征在于,所述方法应用于计算机系统,所述计算机系统包括目标非统一内存访问NUMA节点和控制器,所述方法包括:
    所述控制器获取资源分配信息,所述资源分配信息用于指示所述目标NUMA节点使用多个处理器核对应的计算资源运行多个进程,且在运行每个进程时,所述多个处理器核中的每个处理器核对应的计算资源均可被使用;
    所述控制器根据所述资源分配信息,在所述目标NUMA节点上运行所述多个进程。
  2. 根据权利要求1所述的方法,其特征在于,所述多个处理器核为所述目标NUMA节点中的全部处理器核。
  3. 根据权利要求1所述的方法,其特征在于,所述目标NUMA节点还包括第一处理器核,所述资源分配信息还用于指示所述目标NUMA节点使用所述第一处理器核运行特定进程,且所述第一处理器核对应的计算资源仅可被所述特定进程所使用。
  4. 根据权利要求1、2或3所述的方法,其特征在于,所述多个进程包括目标进程,所述控制器根据所述资源分配信息,在所述目标NUMA节点上运行所述多个进程包括:
    所述控制器根据所述资源分配信息确定所述多个处理器核;
    所述控制器从所述多个处理器核中确定空闲处理器核;
    所述控制器在所述空闲处理器核上运行所述目标进程。
  5. 根据权利要求1、2或3所述的方法,其特征在于,所述计算机系统包括多个NUMA节点,所述多个进程包括第一进程,所述控制器获取资源分配信息之前,所述方法还包括:
    所述控制器获取多个NUMA节点中每个NUMA节点的可分配资源信息,所述可分配资源信息包括第一计算资源和第一内存资源,所述第一计算资源和所述第一内存资源之间的比值为第一比值;
    所述控制器获取所述第一进程的资源需求信息,所述资源需求信息包括第一计算资源需求量和第一内存资源需求量,所述第一计算资源需求量与第一内存资源需求量之间的比值为第二比值;
    所述控制器根据所述多个NUMA节点中每个NUMA节点对应的所述第一比值和所述第二比值之间的差异,从所述多个NUMA节点中确定所述差异最小的NUMA节点为所述目标NUMA节点,所述目标NUMA节点用于运行所述第一进程。
  6. 一种运行进程的方法,其特征在于,所述方法应用于计算机系统,所述计算机系统包括目标非统一内存访问NUMA节点和控制器,所述目标NUMA节点包括多个处理器核,所述方法包括:
    所述控制器确定第一进程,所述第一进程为所述目标NUMA节点中待运行的进程;
    所述控制器从所述多个处理器核中确定目标处理器核,所述目标处理器核包括第一计算资源和第二计算资源,所述第一计算资源用于运行第二进程,所述第二计算资源为空闲资源;
    所述控制器使用所述目标处理器核的所述第二计算资源运行所述第一进程。
  7. 根据权利要求6所述的方法,其特征在于,所述多个处理器核为所述目标NUMA节点 中的全部处理器核。
  8. 根据权利要求6所述的方法,其特征在于,所述目标NUMA节点还包括第一处理器核,所述第一处理器核用于运行特定进程,且所述第一处理器核对应的计算资源仅可被所述特定进程所使用。
  9. 一种计算机设备,其特征在于,所述计算机设备包括:
    获取单元,用于获取资源分配信息,所述资源分配信息用于指示目标非统一内存访问NUMA节点使用多个处理器核对应的计算资源运行多个进程,且在运行每个进程时,所述多个处理器核中的每个处理器核对应的计算资源均可被使用;
    运行单元,用于根据所述资源分配信息,在所述目标NUMA节点上运行所述多个进程。
  10. 根据权利要求9所述的计算机设备,其特征在于,所述多个处理器核为所述目标NUMA节点中的全部处理器核。
  11. 根据权利要求9所述的计算机设备,其特征在于,所述目标NUMA节点还包括第一处理器核,所述资源分配信息还用于指示所述目标NUMA节点使用所述第一处理器核运行特定进程,且所述第一处理器核对应的计算资源仅可被所述特定进程所使用。
  12. 根据权利要求9、10、11所述的计算机设备,其特征在于,所述多个进程包括目标进程,所述运行单元具体用于:
    根据所述资源分配信息确定所述多个处理器核;
    从所述多个处理器核中确定空闲处理器核;
    在所述空闲处理器核上运行所述目标进程。
  13. 根据权利要求9、10、11所述的计算机设备,其特征在于,所述计算机设备包括多个NUMA节点,所述多个进程包括第一进程,所述计算机设备还包括确定单元;
    所述获取单元,还用于获取多个NUMA节点中每个NUMA节点的可分配资源信息,所述可分配资源信息包括第一计算资源和第一内存资源,所述第一计算资源和所述第一内存资源之间的比值为第一比值;
    所述获取单元,还用于获取所述第一进程的资源需求信息,所述资源需求信息包括第一计算资源需求量和第一内存资源需求量,所述第一计算资源需求量与第一内存资源需求量之间的比值为第二比值;
    所述确定单元,用于根据所述多个NUMA节点中每个NUMA节点对应的所述第一比值和所述第二比值之间的差异,从所述多个NUMA节点中确定所述差异最小的NUMA节点为所述目标NUMA节点,所述目标NUMA节点用于运行所述第一进程。
  14. 一种计算机设备,其特征在于,所述计算机设备包括目标非统一内存访问NUMA节点,所述目标NUMA节点包括多个处理器核,所述计算机设备包括:
    确定单元,用于确定第一进程,所述第一进程为所述目标NUMA节点中待运行的进程;
    所述确定单元,还用于从所述多个处理器核中确定目标处理器核,所述目标处理器核包括第一计算资源和第二计算资源,所述第一计算资源用于运行第二进程,所述第二计算资源为空闲资源;
    运行单元,用于使用所述目标处理器核的所述第二计算资源运行所述第一进程。
  15. 根据权利要求14所述的计算机设备,其特征在于,所述多个处理器核为所述目标NUMA节点中的全部处理器核。
  16. 根据权利要求14所述的计算机设备,其特征在于,所述目标NUMA节点还包括第一处理器核,所述第一处理器核用于运行特定进程,且所述第一处理器核对应的计算资源仅可被所述特定进程所使用。
  17. 一种计算机设备,其特征在于,所述计算机设备包括目标非统一内存访问NUMA节点,所述目标NUMA节点包括多个处理器;
    所述多个处理器,用于为所述目标NUMA节点提供计算资源;
    所述目标NUMA节点用于使用所述多个处理器对应的计算资源运行多个进程,且在运行每个进程时,所述多个处理器中的每个处理器对应的计算资源均可被使用。
  18. 一种计算机设备,其特征在于,所述计算机设备包括目标非统一内存访问NUMA节点和控制器,所述目标NUMA节点包括多个处理器;
    所述多个处理器,用于为所述目标NUMA节点提供计算资源;
    所述目标NUMA节点,用于使用所述多个处理器对应的计算资源运行多个进程;
    所述控制器,用于确定第一进程,所述第一进程为所述多个进程中待运行的进程;
    所述控制器,还用于从所述多个处理器核中确定目标处理器核,所述目标处理器核包括第一计算资源和第二计算资源,所述第一计算资源用于运行第二进程,所述第二计算资源为空闲资源;
    所述控制器,还用于使用所述目标处理器核的所述第二计算资源运行所述第一进程。
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至5中任一项所述的方法,或,所述计算机程序被处理器执行时实现如权利要求6至8中任一项所述的方法。
  20. 一种计算机程序产品,其特征在于,所述计算机程序产品中存储有计算机可读指令,当所述计算机可读指令被处理器执行时实现如权利要求1至5中任一项所述的方法,或,所述计算机可读指令被处理器执行时实现如权利要求6至8中任一项所述的方法。
  21. 一种芯片系统,其特征在于,所述芯片系统包括至少一个处理器,当程序指令在所述至少一个处理器中执行时,使得如权利要求1至5中任一所述的方法被执行,或,使得如权利要求6至8中任一项所述的方法被执行。
PCT/CN2022/090190 2021-08-16 2022-04-29 一种运行进程的方法及相关设备 WO2023020010A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110937787.4A CN115705247A (zh) 2021-08-16 2021-08-16 一种运行进程的方法及相关设备
CN202110937787.4 2021-08-16

Publications (1)

Publication Number Publication Date
WO2023020010A1 true WO2023020010A1 (zh) 2023-02-23

Family

ID=85180393

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/090190 WO2023020010A1 (zh) 2021-08-16 2022-04-29 一种运行进程的方法及相关设备

Country Status (2)

Country Link
CN (1) CN115705247A (zh)
WO (1) WO2023020010A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117389749A (zh) * 2023-12-12 2024-01-12 深圳市吉方工控有限公司 基于双主板的任务处理方法、装置、设备及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116483013B (zh) * 2023-06-19 2023-09-05 成都实时技术股份有限公司 一种基于多通道采集器的高速信号采集系统及方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107479976A (zh) * 2017-08-14 2017-12-15 郑州云海信息技术有限公司 一种多程序实例同时运行下cpu资源分配方法及装置
CN107969153A (zh) * 2016-08-19 2018-04-27 华为技术有限公司 一种资源分配方法、装置及numa系统
CN110597639A (zh) * 2019-09-23 2019-12-20 腾讯科技(深圳)有限公司 Cpu分配控制方法、装置、服务器及存储介质
CN112486679A (zh) * 2020-11-25 2021-03-12 北京浪潮数据技术有限公司 一种kubernetes集群的pod调度方法、装置及设备
US20210157658A1 (en) * 2019-11-25 2021-05-27 Fujitsu Limited Information processing apparatus and computer-readable storage medium storing parallel computing program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107969153A (zh) * 2016-08-19 2018-04-27 华为技术有限公司 一种资源分配方法、装置及numa系统
CN107479976A (zh) * 2017-08-14 2017-12-15 郑州云海信息技术有限公司 一种多程序实例同时运行下cpu资源分配方法及装置
CN110597639A (zh) * 2019-09-23 2019-12-20 腾讯科技(深圳)有限公司 Cpu分配控制方法、装置、服务器及存储介质
US20210157658A1 (en) * 2019-11-25 2021-05-27 Fujitsu Limited Information processing apparatus and computer-readable storage medium storing parallel computing program
CN112486679A (zh) * 2020-11-25 2021-03-12 北京浪潮数据技术有限公司 一种kubernetes集群的pod调度方法、装置及设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117389749A (zh) * 2023-12-12 2024-01-12 深圳市吉方工控有限公司 基于双主板的任务处理方法、装置、设备及存储介质
CN117389749B (zh) * 2023-12-12 2024-03-26 深圳市吉方工控有限公司 基于双主板的任务处理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN115705247A (zh) 2023-02-17

Similar Documents

Publication Publication Date Title
CN108319563B (zh) 一种基于fpga的网络功能加速方法和系统
WO2023020010A1 (zh) 一种运行进程的方法及相关设备
JP5159884B2 (ja) 論理区分の間におけるネットワーク・アダプタ・リソース割振り
US8478926B1 (en) Co-processing acceleration method, apparatus, and system
US8893148B2 (en) Performing setup operations for receiving different amounts of data while processors are performing message passing interface tasks
CN110098946B (zh) 虚拟化网元设备的部署方法以及装置
US20090064168A1 (en) System and Method for Hardware Based Dynamic Load Balancing of Message Passing Interface Tasks By Modifying Tasks
JP6275119B2 (ja) メモリ要素の割当てのために一方向リンク付けリストを区分化するシステム及び方法
WO2012049247A1 (en) A computer cluster arrangement for processing a computation task and method for operation thereof
KR102204670B1 (ko) 프록시 기반 멀티스레딩 메시지 전달 통신을 위한 기술
JP7467593B2 (ja) リソース割振り方法、記憶デバイス、および記憶システム
US20140068625A1 (en) Data processing systems
US11635981B2 (en) Virtualizing shared computing resources
US20160210171A1 (en) Scheduling in job execution
WO2020108337A1 (zh) 一种cpu资源调度方法及电子设备
WO2022111466A1 (zh) 任务调度方法、控制方法、电子设备、计算机可读介质
CN115934624A (zh) 多主机远程直接内存访问网络管理的方法、设备及介质
CN107590000B (zh) 二次随机资源管理方法/系统、计算机存储介质及设备
WO2022063273A1 (zh) 一种基于numa属性的资源分配方法及装置
CN115202859A (zh) 一种内存扩展方法以及相关设备
CN110399206B (zh) 一种基于云计算环境下idc虚拟化调度节能系统
US11797342B2 (en) Method and supporting node for supporting process scheduling in a cloud system
WO2024087663A1 (zh) 作业调度方法、装置和芯片
US20240012750A1 (en) Memory expansion method and related device
WO2023066180A1 (zh) 一种数据处理的方法和相关装置

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: 22857328

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE