Process processing method

By partitioning processes and creating target control groups in the computer system, and dynamically adjusting resource allocation, the problems of low resource utilization and energy waste are solved, achieving efficient resource utilization and improved energy efficiency.

CN121455693APending Publication Date: 2026-02-03BEIJING LINX SOFTWARE CORP
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202511936814.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing technologies in computer systems suffer from low resource utilization and energy waste. In particular, in business applications with fluctuating computing demands, traditional static CPU allocation strategies cannot dynamically adjust resources, resulting in latency during high loads and energy waste during low loads.

Method used

By partitioning the computer system into a primary partition and other system resources, a target control group is created based on the urgency and resource requirements of the target process. Firmware protocols are used to perform online power-on processing of the target system resources, enabling on-demand wake-up and exclusive use of resources, thus avoiding resource contention and context switching.

Benefits of technology

It significantly reduces context switching and scheduling overhead, improves system response speed and energy efficiency, solves the problem of high latency and low cache hit rate caused by resource contention in critical processes, and improves resource utilization and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121455693A_ABST
    Figure CN121455693A_ABST
Patent Text Reader

Abstract

The invention discloses a process processing method, which comprises the following steps of: partitioning system resources in a computer system, when a new target process is processed, distributing the target process with the processing emergency degree meeting the processing requirement of a first partition to the first partition, and creating a target control group; furthermore, online power-on processing is carried out on the target system resources in the target control group through a firmware protocol so as to process the target process through the target control group, so that resource exclusive occupation and on-demand wakeup of the key process are realized, resource competition with other processes is further avoided, context switching and scheduling overhead is remarkably reduced, and user experience is improved. And by accurately controlling the power supply state of the hardware resources, the power supply is kept in a non-use state, so that the technical effect of reducing the power consumption of the system can be achieved. According to the method, the problems of high delay, low cache hit rate and the like caused by resource scrambling in the key process in the prior art are solved, and the system response speed, the processing efficiency and the energy efficiency performance are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure generally relates to the field of system resource monitoring and scheduling, and specifically to a process handling method. Background Technology

[0002] With the development of computer hardware, the number of CPUs and cores has increased rapidly, providing greater computing power. However, during periods of low workload, the overall system power consumption remains high, leading to unreasonable resource scheduling, low resource utilization, and energy waste. This problem mainly exists in business applications where computing demands fluctuate significantly at different times, such as bank settlement transactions concentrated at night and e-commerce platforms experiencing a surge in requests during promotional periods. Traditional technical solutions typically employ static CPU allocation strategies, which cannot dynamically adjust computing resources according to real-time task requirements. This results in all CPUs remaining online during low loads, causing energy waste; while during high loads, unreasonable resource allocation may lead to processing delays. Furthermore, existing technologies lack support for dynamically adjusting the scheduling of various resources based on process resource requirements, making it difficult to achieve optimized scheduling of various resources and impacting system performance. Therefore, a method is needed to improve system performance while controlling power consumption to adapt to the changing needs of different business scenarios. Summary of the Invention

[0003] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a process processing method and a computer-readable storage medium.

[0004] A first aspect provides a process processing method applied to a computer system, the computer system including a first partition, the first partition including various system resources in the computer system used for processing processes, the method comprising: The processing urgency of the target process is used to determine whether the target process meets the processing requirements of the first partition, and each system resource in the first partition is in an offline and power-off state; If the conditions are met, the target process is assigned to the first partition. A target control group is created based on the resource requirement data of the target process and the idle status of each system resource. The target system resources in the target control group are powered on online through the firmware protocol so as to process the target process according to the target system resources in the target control group. If the conditions are not met, the target process will be processed based on the available system resources in the computer system other than the system resources in the first partition.

[0005] The process processing method provided in this application addresses the problems of low resource utilization and energy waste in current process processing methods that rely on system resources. This application offers a novel process processing method that partitions system resources within a computer system. When processing a new target process, it determines whether to allocate it to the first partition (which is offline and powered off) based on the urgency of the target process. If the first partition is selected, a target control group is created based on the target process's resource requirements and the idle status of various system resources in the first partition. Furthermore, a firmware protocol is used to power on the target system resources in the target control group online, enabling exclusive resource allocation and on-demand wake-up for critical processes. Because the target process is isolated to the first partition and exclusively uses system resources, resource contention with other processes is avoided, significantly reducing context switching and scheduling overhead. Moreover, by precisely controlling the power supply status of hardware resources and keeping them powered off when not in use, the method effectively reduces system power consumption. This method solves the problems of high latency and low cache hit rate caused by resource contention for critical processes in existing technologies, improving system response speed, processing efficiency, and energy efficiency. Attached Figure Description

[0006] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 A flowchart of the steps of a process processing method provided in this application; Figure 2 A flowchart of the steps of a process processing method provided in this application; Figure 3 A flowchart of the steps of a process processing method provided in this application; Figure 4 A flowchart of the steps of a process processing method provided in this application; Figure 5 A flowchart of the steps of a process processing method provided in this application; Figure 6 A flowchart of the steps of a process processing method provided in this application; Figure 7 A flowchart of the steps of a process processing method provided in this application; Figure 8 A flowchart illustrating the steps of a process processing method provided in this application. Detailed Implementation

[0007] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0008] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0009] In existing technologies, with the widespread adoption of multi-core processor architectures, computer systems often face the problem of uneven resource utilization. This is especially true in scenarios with cyclical business fluctuations, such as the load differences between daytime transactions and nighttime settlements in banking, where traditional scheduling strategies struggle to dynamically adapt to changing computing demands. Current technologies typically employ fixed system resource allocation strategies, resulting in a large amount of system resources that are normally online and powered on remaining idle during low-load periods, leading to energy waste. When sudden task requests occur, system resources may be unable to respond quickly due to rigid resource allocation, impacting overall process processing efficiency and response speed.

[0010] To address the aforementioned problems, this application provides a process processing method. Before describing this method, this application first activates the partitioning function of the computer system, dividing the system resources of the computer system into system resources in a first partition and other system resources outside the first partition. These system resources include CPU cores, memory regions, network interface cards (NICs), disk devices, etc. It should be noted that there can be multiple resources of each different type.

[0011] Based on the above introduction, the following will combine... Figure 1 The process processing method provided in this application will be described by way of example. Figure 1 A flowchart of a process processing method provided in this application is shown, the method comprising the following steps: Step S20: Determine whether the target process meets the processing requirements of the first partition based on the processing urgency of the target process. All system resources in the first partition are in an offline and power-off state. The target process refers to the application instance or service process that needs to be scheduled and executed. It can be a user-initiated task, a background daemon, or a containerized workload. The urgency of the target process is an indicator used to measure its sensitivity to real-time performance and response latency. It can be quantitatively evaluated through preset priority labels, service quality levels, historical performance requirements, or external scheduling instructions. For example, the urgency of the processes corresponding to financial trading systems, industrial control systems, or autonomous driving perception modules can be defined as urgent.

[0012] The processing requirements for the first partition can be pre-defined first partition admission criteria, which can be based on, for example, the processing urgency of the target process. For instance, this application can define a processing urgency level of three or higher as the processing requirements for the first partition. Then, if the processing urgency of the target process is level two, it can be determined that the target process meets the processing requirements of the first partition.

[0013] It's important to note that at this point, all system resources in the first partition are in an offline, power-off state. This setting prevents resource waste caused by system resources in the first partition remaining powered on even when they are idle.

[0014] Through the above steps, this application establishes an allocation mechanism based on processing urgency, which only enables dedicated resource paths when a process has a processing urgency that meets the requirements, thus achieving a balance between performance and energy efficiency.

[0015] Step S30: If satisfied, the target process is assigned to the first partition. A target control group is created based on the resource requirement data of the target process and the idle status of each system resource. The target system resources in the target control group are powered on online through the firmware protocol so as to process the target process according to the target system resources in the target control group. Based on the above judgment process, it can be determined whether the target process can be allocated to the first partition. When the processing urgency of the target process meets the processing requirements of the first partition, the target process will be allocated to the first partition. This means that the scheduling affiliation of the target process is migrated from the global resource pool to this dedicated first partition. Furthermore, this application further selects target system resources from the first partition to specifically process the target process. The selection criteria are the resource requirement data of the target process and the idle status of various system resources.

[0016] Resource requirements data for the target process may include, for example, the number of CPU cores, memory capacity, bandwidth throughput, NUMA affinity preference, and device access type required by the target process. This resource requirements data can be derived from static declarations (such as container resource configuration), dynamic prediction models, historical runtime statistics, etc.

[0017] The idle state of system resources indicates that each system resource is not currently occupied or locked by other processes. Whether a system resource is in an idle state can be determined by querying the system resource occupancy table, monitoring the scheduler status, polling hardware registers, etc.

[0018] After determining the resource requirements of the target process and the idle status of each system resource in the first partition, a target control group can be created by selecting target system resources that meet the resource and hardware requirements of the target process from the first partition. This allows the target process to be processed only through the target system resources in the target control group, thus achieving resource isolation and exclusive use of resources.

[0019] As shown above, to conserve resources, the system resources in the first partition are in an offline, power-off state. Once the target control group is created, and the target process needs to be processed, the power management interface provided by firmware protocols (such as UEFI, ACPI, and the Platform Management Controller (BMC)) needs to be used to send a power-on signal to the designated target system resources, transitioning them from an offline, power-off state to an online, runnable state. This allows the target process to run independently on its dedicated system resources. This achieves both on-demand wake-up and precise supply of system resources, while ensuring that critical processes receive the optimal execution environment, avoiding the energy waste caused by keeping all system resources constantly on.

[0020] If the conditions are not met in step S40, then the target process is processed based on the available system resources in the computer system other than the system resources in the first partition.

[0021] If, based on the above judgment, it is determined that the processing urgency of the target process does not meet the processing requirements of the first partition, then it means that the current processing urgency of the process is low. In this case, this application can process it without using the aforementioned exclusive system resource method, but instead use other unoccupied CPU, memory, and other peripheral resources in the computer system other than the system resources in the first partition. These system resources are usually located in the default scheduling domain or general resource pool, and can be arranged to run on available system resources using conventional scheduling strategies (such as the CFS scheduler).

[0022] This step ensures the normal execution of non-urgent processes, maintains the compatibility and stability of the computer system, and reserves dedicated partition resources for higher-priority target process tasks.

[0023] This application determines whether to allocate a process to a dedicated processing environment based on its urgency, thus effectively isolating critical processes from other processes and reducing context switching frequency and cross-CPU scheduling latency. Furthermore, it performs firmware-level power-on operations only on the required system resources, achieving fine-grained system resource activation control and significantly reducing static power consumption while ensuring performance. Simultaneously, for processes that do not meet the criteria, this application reverts them to the general resource pool for processing, maintaining system flexibility. This method achieves a good balance between improving critical task responsiveness, enhancing resource utilization, and optimizing energy efficiency.

[0024] In an optional embodiment, such as Figure 2 As shown, Figure 2 The operations provided in this application prior to processing the target process according to the target system resources in the target control group include the following steps: Step S201: Determine the target device that the target process needs to access based on the resource access requirements of the target process; This process occurs after the target process is assigned to the first partition and before formal execution begins after a target control group is created. The computer system can identify the hardware peripherals that the target process frequently interacts with during its execution by analyzing its historical runtime data, resource usage patterns, and current task type. These hardware peripherals include, but are not limited to, high-bandwidth, low-latency sensitive devices such as network interface controllers (NICs), storage controllers (e.g., NVMe SSD controllers), GPU accelerator cards, FPGA coprocessors, or DMA engines.

[0025] This application can determine the target device that the target process needs to access by, for example, collecting information such as the process's file descriptor usage, memory mapping regions, and system call sequences from a user-mode monitoring module.

[0026] For example, for a video stream forwarding service process, the system can determine that it mainly relies on a certain physical network card based on its continuous calls to the `sendto()` and `recvfrom()` system calls and its binding to a specific port; similarly, if a database query process frequently accesses a specific block device path, the target device to be accessed can be identified as the disk controller.

[0027] Step S202: If the target device has a configurable CPU affinity attribute, then configure the target device's CPU affinity to the CPU in the target system resources.

[0028] After identifying the target device using the above method, this application needs to further determine whether the target device has the attribute of configurable CPU affinity.

[0029] The target device having the attribute of configurable CPU affinity means that the target device supports binding its interrupt handlers, polling threads, or packet processing contexts to one or more specified logical CPUs for execution.

[0030] After identifying the target device and confirming its affinity configuration capability using the steps described above, the computer system can automatically schedule the data processing path of the target device to the CPU resources exclusively allocated to the current target control group. This process can be achieved through command-line tools provided by the operating system, dynamically responding to device loading events using udev rules, or by using a custom daemon to monitor cgroup lifecycle changes.

[0031] For example, when the target device supports binding its interrupt handler, polling thread, or packet processing context to a specified CPU numbered 0, 1, or 2, and the target control group happens to contain CPUs numbered 0, 1, or 2, the computer system will redirect all receive queue interrupts of the associated network card to these three CPUs and disable other CPUs from responding to such interrupts. This ensures that the device interrupt context and the application run in the same computing unit, reducing the performance loss caused by cross-CPU cache invalidation and remote memory access.

[0032] Before the target process begins processing, this application proactively identifies the high-performance peripherals (target devices) that the target process depends on, and, provided that the target device supports it, binds the interrupts and data processing threads of the target device to the CPU cores within the target control group. In this way, the target device and the target process share the same computing resource domain, which can significantly reduce memory access latency. At the same time, it avoids the context switching overhead and TLB refresh problems caused by interrupts potentially being triggered on any CPU in the traditional mode, and reduces bus contention and consistency traffic.

[0033] In an optional embodiment, such as Figure 3 As shown, it includes the following steps: Step S301: Determine whether the target process includes child processes; The target process may create new child processes during its execution. This can be determined using the process relationship tree structure provided by the operating system kernel, such as reading the ` / proc / [pid] / task / [tid] / children` interface information, or through kernel notification mechanisms that listen for process creation events (such as `netlink` sockets or `inotify`).

[0034] Step S302, if included, then the child processes of the target process are allocated to the first partition, and the child processes of the target process are processed according to the target system resources in the target control group.

[0035] If the target process is determined to include child processes based on the above judgment process, in order to solve the problem that child processes may be scheduled to remote NUMA nodes or shared CPUs in traditional scheduling mechanisms, resulting in frequent context switching and decreased cache hit rate, this application may limit the scheduling scope of the target process's child processes to the first partition, ensuring that the child processes run in the same resource environment as the parent process from startup.

[0036] Furthermore, this application can also completely share the target system resources used to process the target process with the child process. This resource inheritance mechanism can maintain low-latency communication and high cache consistency between parent and child processes, and ensure resource exclusivity.

[0037] The above steps can achieve the technical effects of improving the overall execution efficiency of multi-process applications, reducing cross-node memory access overhead, and enhancing the predictability of system behavior.

[0038] In another embodiment, such as Figure 4 As shown, it includes the following steps: Step S401: During the process of processing the target process according to the target system resources in the target control group, the resource access requirements of the target process are obtained. This application can utilize mechanisms such as operating system kernel modules, performance monitoring units, I / O schedulers, and user-space agents to collect real-time data on the target process's actual usage of various system resources during runtime. Resource access requirements include, but are not limited to: CPU utilization, memory bandwidth consumption, cache hit rate, I / O read / write frequency and throughput, network packet processing rate, storage device access latency, and memory access patterns between NUMA nodes. For example, the `perf` tool or the eBPF (extended Berkeley Packet Filter) program can be used to capture the target process's system call history, page fault rate, and cross-node memory access ratio. This application establishes a feedback channel by acquiring the resource access requirements of the target process, enabling the computer system to perceive the actual resource pressure of the target process under different workloads and avoiding resource mismatch caused by relying solely on static configuration. For example, in a video encoding scenario, the initial estimate may only require 2 CPU cores and 1GB of memory, but in actual operation, a sudden increase in bitrate may cause the GPU data output to accelerate, leading to a memory bandwidth bottleneck. In this case, it is necessary to identify this change in a timely manner.

[0039] Step S402: Dynamically adjust parameters related to computer system performance based on the resource access requirements of the target process.

[0040] Among them, parameters related to computer system performance include resource allocation parameters, scheduling-related parameters, affinity configuration parameters, firmware / hardware level parameters, topology-aware parameters, etc.

[0041] Resource allocation parameters include increasing or decreasing the number of CPU cores allocated to the target control group, adjusting memory quotas, and expanding I / O bandwidth reservations; scheduling-related parameters include modifying process scheduling priorities and changing CPU bandwidth limits for the control group; affinity configuration parameters include resetting CPU affinity, binding processes to higher-performance cores, and migrating interrupt handlers for associated devices (such as network cards and GPUs) to the same NUMA node as the target process; firmware / hardware level parameters include adjusting CPU frequency via ACPI or P-states / C-states interfaces and enabling Turbo Boost to handle short-term high loads; topology-aware parameters include optimizing cross-node communication paths based on the current NUMA topology, enabling Huge Pages to reduce TLB misses, or activating RCU acceleration mechanisms to reduce synchronization overhead.

[0042] The resource access requirements of the target process can provide a basis for subsequent decisions; dynamic adjustment means that adjustment decisions are based on actual observed resource usage patterns, rather than preset rules or fixed strategies. This application can enable computer systems to maintain efficient operation under load fluctuations, sudden traffic surges, or application behavior variations through continuous monitoring and adaptive optimization. For example, in a financial trading system, when the frequency of market data pushes suddenly increases, causing network receiving queue congestion, the system can automatically identify this phenomenon and immediately allocate a dedicated CPU core to the control group where the trading process resides, and bind the network card RX queue to that core, thereby significantly reducing message processing latency.

[0043] Because traditional static resource configuration is difficult to adapt to changes in dynamic workloads, it can easily lead to resource waste or performance degradation. This application solves the problems of low system resource utilization and high response latency in complex and ever-changing application scenarios by introducing a runtime feedback mechanism, thereby achieving the technical effect of improving the overall performance stability of the system and enhancing the elastic scheduling capability of resources.

[0044] Optionally, this application can allocate the target process to the first partition through the following steps: Obtain the process ID of the target process; The target command tool is invoked to add the process ID of the target process to the configuration file corresponding to the first partition.

[0045] The process ID (PID) of the target process is a unique identifier used to uniquely identify and manage the lifecycle and resource ownership of that process in a multitasking environment. The PID is typically dynamically assigned by the operating system kernel when the process is created, stored in the process control block, and can be accessed through computer system calls such as `getpid()` or the `task_struct` structure.

[0046] Specific methods for obtaining the process ID include, but are not limited to: directly reading the current process PID through system interface functions (such as `syscall(SYS_getpid)` in Linux); or traversing the system process list through process monitoring modules (such as the backend logic of `ps`, `top` commands, or the ` / proc / [pid]` virtual file system) to locate the target process and extract its PID value.

[0047] Target command-line tools are standardized command-line tools or system API interfaces used to modify the relationship between system resource groups and process ownership. These tools have the ability to interact with the operating system resource controller and can safely update the control group or partition configuration to which a process belongs.

[0048] The configuration file corresponding to the first partition is a persistent or runtime file used to define the resource boundaries, access permissions, and member process set of that partition, usually located in a specific path. This file records a list of process PIDs (Process IDs) allowed to run within the first partition, and the operating system's resource scheduler uses the contents of this file to implement isolation and restriction policies for resources such as CPU and memory.

[0049] The process of adding the process ID of the target process to the configuration file corresponding to the first partition includes, for example: first, verifying whether the target command tool has sufficient permissions; then, establishing a connection to the path where the configuration file is located and opening the target file; next, performing a write operation to append or overwrite the obtained PID to a file like `cgroup.procs` in text form; and finally, triggering the kernel notification mechanism so that the resource scheduler immediately notices the member change and begins to apply the resource constraint policy of the first partition to the process.

[0050] This application explicitly writes the target process's PID into the configuration file of the first partition using standard command-line tools. This allows the operating system to accurately identify the resource ownership of the target process, ensuring that its subsequent execution is constrained and protected by the resource policy of the first partition. This method is compatible with mainstream operating system platforms, possesses good integrability and automated deployment capabilities, and solves the resource contention and scheduling chaos caused by ambiguous process ownership in existing technologies. It improves system resource utilization efficiency and the determinism of critical task processing.

[0051] In yet another alternative method embodiment, such as Figure 5 As shown, Figure 5 An optional method embodiment for creating a target control group, provided as an exemplary embodiment of this application, includes the following steps: Step S501: Determine the initial system resources that match the resource demand data from each system resource based on the resource demand data; Resource requirement data includes, for example, information about the target process's demand for various system resources in the computer system during its operation, including but not limited to the number of central processing unit (CPU) cores, memory capacity, input / output (I / O) bandwidth, network throughput, and storage access speed. Initial system resources are the schedulable hardware units in the first partition, including physical or logical resource modules such as CPU cores, memory channels, I / O controllers, network interface cards, and storage interfaces.

[0052] The process of determining initial system resources involves performing resource matching and retrieval within the first partition based on resource requirement data, filtering out a set of candidate resources that meet the requirements in terms of quantity, performance level, and topology location. For example, when the target process is a high-throughput video encoding task, its resource requirement data may indicate the need to allocate 4 high-performance CPU cores, 8GB of dedicated memory, and a high-speed PCIe network card bound to a specific NUMA node; the system then locates a combination of resources with the appropriate configuration and that meets affinity constraints from the first partition accordingly.

[0053] Step S502: If all initial system resources are in an idle state, then the initial system resources are used as the target system resources to create a target control group; The fact that all initial system resources are in an idle state indicates that the initial system resources are not currently occupied by any other process or control group, and are in an online or standby state that can be used immediately.

[0054] Determining whether initial system resources are idle can be achieved by querying the resource scheduling table, control group management structure, or firmware layer resource mapping table in the operating system kernel. Once it is confirmed that the initial system resources are idle, these initial [r1] system resources can be directly designated as target system resources, and a target control group can be constructed based on them. The target process has been isolated using the target system resources in the target control group to prevent external interference.

[0055] Step S503: If there are initial system resources in the initial system resources that are not idle, then after reclaiming the initial system resources in the non-idle state, create a target control group using the initial system resources as the target system resources.

[0056] The initial non-idle state of system resources indicates that these resources are occupied by other low-urgency processes, temporary tasks, or existing control groups, and cannot be directly used for resource allocation to new processes. In this case, the system initiates a resource reclamation mechanism to proactively release the occupied resources. Reclamation operations include terminating or migrating the occupying process, unbinding the original control group, clearing the resource lock state, and resetting cache associations. Subsequently, a target control group is created in the aforementioned manner. This mechanism ensures that high-priority tasks can still obtain the necessary resources when resources are scarce, improving the system's elastic scheduling capability and resource utilization.

[0057] Optionally, this application also sets a resource preemption threshold for the computer system, triggering reclamation only when the urgency of the target process is higher than that of the current occupant, thus avoiding performance loss caused by frequent context switching.

[0058] This application eliminates potential resource occupancy relationships before resource allocation, avoiding task scheduling failures or performance fluctuations caused by resource contention, and improving the success rate of critical process startup and operational stability. Simultaneously, the recycling and reuse mechanism enhances the flexibility and fairness of the overall system resource scheduling.

[0059] In one alternative method embodiment, such as Figure 6 As shown, Figure 6 Another alternative method embodiment for creating a target control group, provided as an exemplary embodiment of this application, includes the following steps: Step S601: Determine the initial system resources from each system resource based on the resource requirement data; The process of determining the initial system resources from each system resource based on resource demand data is described above and will not be repeated here.

[0060] Step S602: Determine the distance between the target resource and other resources in the initial system resources, take other resources within a preset range from the target resource and the target resource as target system resources, and create a target control group based on the target system resources.

[0061] Based on the steps described above, initial system resources can be determined from the system resources of the first partition. The next step is to create a target control group based on the distance between the target resource and other resources. This target resource can be a core processing unit (such as the main CPU core) used to process the target process, while other resources can include memory controllers, I / O devices (such as PCIe devices), DMA engines, etc., that work in conjunction with the target resource.

[0062] The distance between a target resource and other resources is not a geometric length, but rather refers to the proximity of resources in terms of communication latency, data transfer bandwidth, or shared cache levels. This is typically reflected in metrics such as inter-node hop count, interconnect bus type, and cache consistency domain partitioning in a non-uniform memory access architecture. This application allows determining the distance between the target resource and other resources by reading a NUMA topology table or using a toolchain.

[0063] Then, the determined distance is compared with a preset range. This preset range can be determined based on human experience, historical data, etc. For example, the area within the same NUMA node can be defined as the preset range. Finally, this application can create a target control group by simultaneously including other resources that meet the requirements and the target resource as target system resources to handle the target process.

[0064] This application solves the problems of frequent cross-node access, high memory latency, and large cache consistency overhead caused by neglecting the internal topology of the system in traditional resource allocation methods by identifying and aggregating other resources within a preset range when creating a target control group. Therefore, it achieves the technical effects of reducing the overall system access latency, improving the efficiency of multi-resource collaboration, and enhancing the performance of application operation.

[0065] In one alternative method embodiment, such as Figure 7 As shown, the method also includes the following steps: Step S701: After creating the target control group, call the target command tool to add the process ID of the target process to the configuration file of the target control group, and periodically obtain the current running data and historical running data of the computer system; In this application, after establishing a logically isolated set of resources specifically for the target process, a configuration write operation can be performed through an interface provided by the operating system or a dedicated management program to write the target process's unique operating system identifier into the task list file of the corresponding target control group, thereby establishing the affiliation between the process and the control group. Once the write is successful, the operating system scheduler will implement isolated scheduling of the target process according to the resource limitation policy set by the target control group.

[0066] Target command-line tools can interact with kernel-level resource management modules to dynamically configure control group attributes. For example, in Linux systems, a shell script can call `echo $$> / sys / fs / cgroup / cpu / target_group / tasks` to add the current process to a specified control group. Target command-line tools are not limited to a specific syntax; they can also be encapsulated API interfaces, daemon services, or container runtime plugins, as long as their functionality involves writing process identifiers to the control group configuration file.

[0067] Periodicity is used to specify the active collection of computer system operating status information at preset time intervals (such as every 10ms, 100ms, or 1s), forming a continuous time-series data stream. The sampling frequency can be adaptively adjusted according to the system load fluctuation characteristics; for example, the sampling density can be increased during high-load periods, and the polling frequency can be reduced during idle periods to reduce overhead. Data acquisition can be achieved through kernel probes, performance monitoring units, eBPF programs, system call tracing, or user-space daemons.

[0068] The current operating data of a computer system includes, but is not limited to, real-time performance metrics such as CPU core utilization, cache hit rate, context switch count, interrupt frequency, memory bandwidth usage, I / O latency, network throughput, queue length, and temperature sensor readings. This data reflects the system's actual workload and resource bottlenecks at the current moment. For example, a significant increase in memory access latency on a NUMA node may indicate intensified local memory contention, necessitating a reassessment of resource allocation strategies.

[0069] Historical operational data of a computer system can be accumulated operational logs and statistical information over a period of time, typically stored in a local database or distributed storage system. Its content includes: historical resource consumption patterns of similar processes, peak load periods, average response time trends, device access hotspot distribution, and control group lifecycle characteristics. Through learning and analysis of historical data, periodic load patterns (such as daily business peaks), abnormal event patterns, and trends in resource demand evolution can be identified.

[0070] Current and historical operating data of a computer system together form the data foundation for resource optimization decisions. Current data provides immediate feedback, supporting rapid response to sudden load surges; historical data supports long-term trend prediction and intelligent inference. The combination of the two can improve the foresight and stability of resource scheduling.

[0071] Step S702: Adjust the system resources in the first partition according to the current and historical operating data of the computer system.

[0072] After obtaining the current and historical operating data of the computer system based on the above steps, this application can dynamically change resource configuration parameters such as CPU core allocation, memory bandwidth quota, I / O priority settings, or power management status within the first partition based on the data analysis results. Specific adjustments may include, for example, increasing the number of CPUs allocated to a control group, releasing idle resources, migrating a control group from one NUMA node to another better node, modifying the affinity binding between processes and CPUs, and adjusting power consumption.

[0073] For example, when it is detected that the CPU load of the target control group is experiencing periodic peaks and high memory bandwidth requirements while historical data shows that similar tasks occur in concentrated periods at night, the computer system can pre-expand the number of available CPUs in the control group before the peak period and bind them to low-latency NUMA nodes close to the DDR controller; and automatically reclaim the excess resources after the load decreases for use by other tasks.

[0074] The adjustment strategy can also be differentiated based on service quality levels. For high-priority critical business operations, the computer system can tend to conservatively reduce its size or even reserve redundant resources; while for elastic computing tasks, a wider range of dynamic scaling is allowed to maximize resource utilization.

[0075] This application implements a technical approach that continuously incorporates processes into a controlled environment and rebalances resources based on system operational status after creating a target control group. By introducing a periodic data collection and historical trend analysis mechanism, the originally static resource allocation structure gains dynamic evolution capabilities, solving the problems of rigid resource configuration and difficulty in adapting to load changes in traditional partitioning methods. This results in improved overall system resource utilization efficiency, guaranteed service quality for critical processes, and reduced energy consumption and latency.

[0076] In one alternative method embodiment, such as Figure 8 As shown, the method also includes the following steps: Step S801: If the target control group has finished processing the target process, determine whether there are other processes being processed within the target control group. In this context, the completion of the target control group's processing of the target process means that the target process has completed all its computational tasks and exited normally or been terminated. The operating system has reclaimed the runtime resources occupied by the process, such as memory and file descriptors, and the scheduler no longer includes it in the executable queue.

[0077] Determining whether other processes are being processed within a target control group can be achieved by enumerating the set of processes associated with the target control group. For example, in a cgroup architecture, one can read the cgroup.procs or tasks file in the target control group's mount directory to obtain a list of all process IDs currently belonging to that target control group, and then query the running status of each process one by one.

[0078] In step S802, if the target system resources in the target control group are not found, the firmware protocol is used to power off and delete them offline, and the partitioning function of the computer system is disabled through a dedicated command-line tool.

[0079] One possible scenario is that if all processes are in a terminated, zombie, or waiting-to-be-reclaimed state, and no new processes are scheduled to the control group, then the decision is made that "there are no other processes being processed".

[0080] If the requirement is not met, this application may send power control commands to the hardware management module via firmware protocols (such as ACPI - Advanced Configuration and Power Interface, UEFI - Unified Extensible Firmware Interface Runtime Services, or BMC / IPMI instruction sets provided by specific vendors) to power it off offline, thereby achieving fine-grained power consumption management.

[0081] Optionally, the computer system can choose to perform offline power-down only on some high-power resources (such as large CPU cores and discrete graphics cards), while keeping lightweight resources (such as small cores and shared cache) in a low-frequency standby state to balance wake-up latency and energy saving. Another optional implementation is to adopt a tiered power-down strategy, gradually entering deeper energy-saving modes based on the duration of resource idle time, rather than completely shutting down the power all at once.

[0082] Deletion refers to removing the configuration information of the control group at the operating system level, including removing the corresponding directory from the cgroup hierarchy, releasing quota management data structures, clearing CPU set binding rules, and unbinding memory node affinity settings. This operation ensures that subsequently created processes will not mistakenly inherit deprecated resource policies, while also freeing up kernel memory overhead.

[0083] A dedicated command-line tool is a privileged user-space program (such as a shell script-based `partitionctl` or a binary tool that calls the kernel's `ioctl` interface) used to perform system-level resource configuration changes. This tool typically needs to run as root or a specific security role and has the ability to access low-level system interfaces (such as ` / sys / devices / system / node / `, ` / sys / fs / cgroup / `) and invoke firmware services. Its command syntax can be designed as: `partitionctl --disable`<partition_name> During execution, the current partition status, dependencies, and permissions are verified.

[0084] Disabling partitioning functionality on a computer system means revoking the logical isolation mechanism of the entire first partition, rendering it no longer an independent resource domain. This includes reintegrating the system resources originally belonging to that partition into the global resource pool, allowing the operating system's general scheduler to manage and allocate them uniformly. This operation marks the end of this dedicated resource management mode, and the system reverts to a regular multi-task scheduling mode.

[0085] This application enables automatic identification of resource idle status after dedicated task processing is completed, and coordinates the firmware and operating system layers to completely reclaim and release resources from isolation. Since power-down and deletion operations are triggered only after confirming there are no other active processes, accidental shutdown of running task resources is avoided, improving the reliability of the computer system. Physical-level power-off is achieved through firmware protocols, significantly reducing static power consumption, making it particularly suitable for energy-sensitive scenarios such as edge computing and data centers. Standardized partition shutdown via dedicated command-line tools enhances operational security and auditability. The overall mechanism forms a "task-driven, closed-loop management" resource lifecycle model, improving the dynamic allocation efficiency and energy utilization efficiency of system resources.

[0086] Alternatively, this application may disable the partitioning function of the computer system through the following steps: Add the system resource IDs in the first partition to the process access list, and add the system resource IDs to the scheduling domain; And delete the first partition and the configuration file corresponding to the first partition.

[0087] The resource ID refers to a unique logical number or physical index that identifies each resource within the system firmware or operating system kernel, such as a CPU core ID, memory node number, or PCIe device address. Re-registering each resource ID in the process access list restores the resource's visibility and schedulability to all processes globally. This access list is one of the data structures used by the operating system scheduler to determine which resources are available to processes; it is typically represented by a CPU mask or memory node affinity list in the scheduling policy. By reincluding the resource IDs originally belonging to the first partition in this list, all user-mode and kernel-mode processes can legally request and use these resources, thus removing the access restrictions previously imposed due to the partition.

[0088] A scheduling domain is a core concept in the multi-core scheduling framework of modern operating systems. It describes a set of CPUs that can work together to perform load balancing, commonly found in the `sched_domain` mechanism of the Linux kernel. The scheduling domain determines when and how tasks are migrated between multiple CPUs, affecting context switching frequency, cache locality, and NUMA performance. When the first partition exists, its internal resources may be excluded from the default scheduling domain, forming an independent scheduling boundary.

[0089] This step ensures that the system resources within the original first partition participate in the computer system's dynamic load balancing process by re-adding their IDs to the global or local scheduling domain structure. For example, the standard scheduling hierarchy can be rebuilt by calling the kernel-provided `partition_sched_domains()` interface and passing in a topology configuration array containing all the original CPU IDs. Furthermore, on platforms supporting ACPI firmware management, the firmware abstraction layer can be used to notify the operating system to update the scheduling domain topology information.

[0090] For example, a scheduling domain template can be pre-generated before the partition is closed, recording the domain partitioning status at the initial system startup. During the function shutdown phase, the template can be directly loaded to complete the recovery operation.

[0091] Deleting the first partition involves a dual cleanup of both logical structure and physical resource configuration. Logically, the corresponding control group node needs to be removed from the operating system resource management layer (such as the cgroup v1 / v2 hierarchy tree). Physically, the memory space of the data structures bound to this partition should be released, and the related reference lists should be disconnected. Meanwhile, configuration files, which are persistent text or binary files stored in the file system, define the resource composition, permission policies, and behavioral parameters of the first partition, including typical paths, `tasks` files, etc. Deleting these files prevents misreading of residual configurations during subsequent system restarts or service loading, which could lead to abnormal behavior.

[0092] For example, a partition can be marked as "pending destruction" in memory, and the file system deletion action can be submitted uniformly after all dependent resources have been released, thus avoiding inconsistencies in intermediate states.

[0093] Through the above steps, this application achieves the safe and orderly shutdown of the computer system's partitioning function after the target process has been completed and no other running tasks have been confirmed. By re-registering the previously isolated first partition resources back into the process access list and scheduling domain, the problems of long-term resource locking and inability to participate in global scheduling present in the background technology are resolved, allowing the system to seamlessly transition back to normal operation mode. Simultaneously, by thoroughly clearing the partition entity and its configuration files, scheduling chaos or resource conflicts caused by configuration remnants are avoided. This achieves the technical effects of maintaining system state consistency, maximizing resource utilization, and improving operational manageability.

[0094] It should be noted that although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart may be performed in a different order.

[0095] In another aspect, this application also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the process processing methods described in this application.

[0096] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A process processing method, characterized in that, The method is applied to a computer system, the computer system including a first partition, the first partition including various system resources in the computer system used for processing processes, the method including: The processing urgency of the target process is used to determine whether the target process meets the processing requirements of the first partition, and each system resource in the first partition is in an offline and power-off state; If the conditions are met, the target process is assigned to the first partition. A target control group is created based on the resource requirement data of the target process and the idle status of each system resource. The target system resources in the target control group are powered on online through the firmware protocol so as to process the target process according to the target system resources in the target control group. If the conditions are not met, the target process will be processed based on the available system resources in the computer system other than the system resources in the first partition.

2. The method according to claim 1, characterized in that, Before processing the target process according to the target system resources in the target control group, the following is included: The target device that the target process needs to access is determined based on the resource access requirements of the target process. If the target device has a configurable CPU affinity attribute, then the CPU affinity of the target device is configured to be that of the CPU in the target system resources.

3. The method according to claim 1, characterized in that, The method further includes: Determine whether the target process includes child processes; If included, the child processes of the target process are assigned to the first partition, and the child processes of the target process are processed according to the target system resources in the target control group.

4. The method according to claim 1, characterized in that, Also includes: During the process of processing the target process according to the target system resources in the target control group, the resource access requirements of the target process are obtained; The parameters related to the computer system performance are dynamically adjusted based on the resource access requirements of the target process.

5. The method according to claim 1, characterized in that, Assigning the target process to the first partition includes: Obtain the process ID of the target process; The target command tool is invoked to add the process ID of the target process to the configuration file corresponding to the first partition.

6. The method according to claim 1, characterized in that, The creation of the target control group based on the resource requirement data of the target process and the idle status of each system resource includes: Based on the resource requirement data, an initial system resource matching the resource requirement data is determined from each of the system resources; If all the initial system resources are in an idle state, then the initial system resources are used as the target system resources to create the target control group; If any of the initial system resources are in a non-idle state, then after reclaiming the non-idle initial system resources, the initial system resources are used as the target system resources to create the target control group.

7. The method according to claim 1, characterized in that, The creation of the target control group based on the resource requirement data of the target process and the idle status of each system resource includes: Initial system resources are determined from each of the system resources based on the resource requirement data; Determine the distance between the target resource and other resources in the initial system resources, take other resources that are within a preset range from the target resource and the target resource as the target system resources, and create the target control group based on the target system resources.

8. The method according to claim 1, characterized in that, The method further includes: After creating the target control group, the target command tool is invoked to add the process ID of the target process to the configuration file of the target control group, and the current running data and historical running data of the computer system are periodically obtained. The system resources in the first partition are adjusted based on the current and historical operating data of the computer system.

9. The method according to claim 1, characterized in that, The method further includes: If the target control group has finished processing the target process, determine whether there are other processes being processed within the target control group; If it does not exist, the firmware protocol is used to power off and delete the target system resources in the target control group, and the partitioning function of the computer system is disabled through a dedicated command-line tool.

10. The method according to claim 9, characterized in that, Disabling partitioning functionality on the computer system via a dedicated command-line tool includes: Add the number of each system resource in the first partition to the process access list, and add the number of each system resource to the scheduling domain; And delete the first partition and the configuration file corresponding to the first partition.

Citation Information

Patent Citations

  • Memory hot plug control method of server non-aware security container and electronic equipment

    CN119718539A

  • CPU core binding method and system for cloud native application

    CN119938341A

  • Task concurrent scheduling method and related device

    CN120315828A

  • Thread scheduling method, electronic equipment, storage medium and program product

    CN121008898A

  • Assigning pre-existing processes to select sets of non-uniform memory access (NUMA) aligned resources

    US20140237069A1