Memory resource allocation processing method, device, storage medium and product

By monitoring the matching degree of memory resources and link interface requirements at the server startup, and prioritizing the status of hot plug function, the problem of key devices being unable to be enabled due to unreasonable allocation of memory resources at the server startup is solved, and resource utilization efficiency and system stability are improved.

CN120216206BActive Publication Date: 2025-08-22INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510669437.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-08-22
Estimated Expiration
2045-05-23

AI Technical Summary

Technical Problem

When the server is started and entered the operating system, in the prior art, the key expansion devices cannot be enabled normally or performance is limited due to unreasonable allocation of memory resources, resulting in inefficient overall resource utilization.

Method used

When the server starts and enters the operating system, it monitors the matching degree of the total memory resources and the requirements of each link interface, accurately determines whether memory resources need to be reassigned, and prioritizes the link interface based on the hot-swap function status, prioritizes the memory resource requirements of key devices, and uses the original allocation method when there is no need to reassign.

Benefits of technology

It improves the overall resource utilization efficiency of the server, reduces the problem of device inability to enable due to insufficient resources, and ensures system compatibility and operation stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216206B_ABST
    Figure CN120216206B_ABST
Patent Text Reader

Abstract

This application discloses a memory resource allocation processing method, device, storage medium, and product, which relate to the field of computer technology. When a server boots up and enters the operating system, by real-time monitoring the matching degree between total memory resources and the requirements of each link interface, it accurately determines whether memory reallocation is required, thus avoiding unnecessary resource adjustment overhead. Link interfaces are prioritized based on the hot-swap function status, giving priority to guaranteeing the memory resource requirements of the first link interface of key equipment, significantly reducing the problem of equipment being unable to be enabled due to insufficient resources. In addition, through intelligent management of the boot loader configuration parameters, the original allocation method can be stably used when memory reallocation is not required, which not only ensures system compatibility but also enhances overall operational stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a memory resource allocation processing method, device, storage medium and product. Background Art

[0002] External expansion devices, such as SmartNICs, connect to the server through PCI (Peripheral Component Interconnect) interfaces. Because external expansion devices connected via PCI links perform critical tasks such as high-speed data processing, impacting overall system performance and efficiency, and server memory address resources are limited, it's necessary to reserve resources for some external expansion devices connected via PCI links.

[0003] In the related art, when the server enters the operating system, it will reallocate the memory resources already allocated by the basic input and output system. The method of allocating memory resources according to the expansion device that is identified first will result in the expansion device that needs to be used later being identified later and lacking effective memory resource allocation, thereby reducing the overall resource utilization efficiency of the server. Summary of the Invention

[0004] The present application provides a memory resource allocation processing method, device, storage medium and product to at least solve the problem of low overall resource utilization efficiency in related technologies.

[0005] The present application provides a memory resource allocation processing method, comprising: when detecting that a server has completed booting and entered an operating system, determining whether it is necessary to reallocate memory resources for each link interface based on total memory resources, wherein each link interface is used to connect each expansion device; if it is determined that memory resources need to be reallocated, detecting resource reservation configuration information of each link interface, wherein the resource reservation configuration information is used to indicate whether the corresponding link interface needs to be preferentially allocated memory resources, and the resource reservation configuration information is configured for each link interface before the server enters the operating system; for each first link interface detected to which memory resources need to be preferentially allocated, allocating memory resources to each first link interface according to a first preset rule; for each second link interface detected to which memory resources do not need to be preferentially allocated, after completing the allocation of memory resources to each first link interface, allocating memory resources to each second link interface according to a second preset rule; if it is determined that memory resources do not need to be reallocated, setting parameter configuration instructions to enable the server to allocate memory resources to each link interface according to the original allocation method configured before entering the operating system.

[0006] The present application also provides a memory resource allocation processing device, comprising:

[0007] The resource reallocation judgment module is used to judge whether it is necessary to reallocate memory resources for each link interface according to the total memory resources when detecting that the server has completed booting and entered the operating system, wherein each link interface is used to connect each expansion device.

[0008] The configuration information detection module is used to detect the resource reservation configuration information of each link interface if it is determined that memory resources need to be reallocated. The resource reservation configuration information is used to indicate whether the corresponding link interface needs to prioritize the allocation of memory resources. The resource reservation configuration information is configured for each link interface before the server enters the operating system.

[0009] The first allocation module is configured to allocate memory resources to each first link interface detected to which memory resources need to be allocated first according to a first preset rule.

[0010] The second allocation module is configured to allocate memory resources to each second link interface detected to not require priority allocation of memory resources according to a second preset rule after completing allocation of memory resources to each first link interface.

[0011] The resource inheritance module is used to set parameter configuration instructions to enable the server to allocate memory resources to each link interface according to the original allocation method configured before entering the operating system if it is determined that memory resources do not need to be reallocated.

[0012] The present application also provides a server, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned memory resource allocation processing methods when executing the computer program.

[0013] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned memory resource allocation processing methods are implemented.

[0014] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned memory resource allocation processing methods when executed by a processor.

[0015] The memory resource allocation processing method, device, storage medium, and product of this application accurately determine whether memory reallocation is necessary by monitoring the matching degree between total memory resources and the requirements of each link interface in real time during the server boot-up and operating system phase, thus avoiding unnecessary resource adjustment overhead. Link interfaces are prioritized based on the hot-swap function status, prioritizing the memory resource requirements of the first link interface of key devices, significantly reducing the problem of device inactivation due to insufficient resources. Furthermore, through intelligent management of boot loader configuration parameters, the original allocation method can be stably used when memory reallocation is not required, ensuring system compatibility and enhancing overall operational stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0017] Figure 1 A schematic diagram of the physical connection of the server provided in the embodiment of the present application;

[0018] Figure 2 This is a flowchart of the memory resource allocation method provided in the embodiment of the present application;

[0019] Figure 3 Schematic diagram of the link interface configuration process provided in the embodiment of the present application;

[0020] Figure 4 A schematic diagram of the structure of a memory resource allocation processing device provided in an embodiment of the present application;

[0021] Figure 5 A schematic diagram of the structure of the server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making any creative work are within the scope of protection of this application.

[0023] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0024] To clearly understand the technical solution of this application, we first provide a detailed introduction to existing solutions. In modern data center server architectures, external expansion devices such as smart network cards (SmartNICs) and data processing units (DPUs) are primarily connected to the server system via PCI link interfaces. These devices typically perform critical tasks such as high-speed data forwarding, network protocol offloading, and encryption and decryption. Their performance directly impacts the server's data processing efficiency and overall operational stability. However, a server's memory address resources are limited in total. A lack of proper allocation of allocable physical memory and other resources can easily lead to resource contention and performance bottlenecks. Under traditional server resource allocation mechanisms, when a server completes the boot process and enters the operating system phase, the system typically reallocates the memory resources allocated to the basic input and output system (BIOS) during initial boot. Memory resources are allocated preferentially to the expansion devices identified first during system boot. However, many expansion devices responsible for critical services are not identified until later in the system boot process due to lengthy boot-up self-test processes or reliance on specific initialization conditions. By the time these devices are identified, the limited memory resources have already been consumed by earlier devices, resulting in the inability to properly activate critical expansion devices or severely limited performance, significantly reducing overall server resource utilization.

[0025] In order to solve the above technical problems, the inventors have come up with the idea that when the server completes the startup and enters the operating system, it is first determined whether the memory needs to be reallocated based on the total memory resources. If reallocation is required, the resource reservation configuration information of each link interface configured before the server is started is retrieved, and the link interface is classified according to whether memory resources need to be allocated first. For the first link interface that needs priority allocation of resources, the first preset rule to ensure real-time requirements is used to allocate memory. For the second link interface that does not need priority allocation, after completing the allocation of the former, the second preset rule to improve resource utilization is used to allocate memory. If reallocation is not required, the original allocation method before startup is used. Through this prioritized memory resource allocation strategy, the performance requirements of key expansion devices are guaranteed, and the overall resource utilization efficiency of the server is improved.

[0026] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0027] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the memory resource allocation processing method depends, the specific application environment architecture or specific hardware architecture is described herein. Figure 1 A schematic diagram of the physical connection of the server provided in the embodiment of the present application is shown in FIG. Figure 1 As shown, the server includes a baseboard management controller, an intelligent platform management interface, a basic input and output system (BIOS), a first processor, a second processor, and multiple PCI link interfaces. The baseboard management controller is connected to the BIOS via the intelligent platform management interface, and both are connected to the first processor via a low pin count bus / peripheral component interconnect standard link. The baseboard management controller can also perform related operations through USB network sharing. The first processor and the second processor are connected by a computer rapid link / high-speed serial computer expansion bus standard, and are respectively connected to multiple PCI link interfaces. These interfaces can be connected to external expansion devices such as disk array cards and optical modules. In addition, the motherboard is provided with a universal serial bus interface and a serial ATA interface for connecting external devices and storage devices. The memory resource allocation processing method provided in the embodiment of the present application is to determine whether memory resources need to be reallocated based on the total memory resources for these expansion devices connected via the PCI link interfaces when the server completes booting and enters the operating system. If reallocation is required, memory resources are allocated to each link interface according to different rules based on the resource reservation configuration information of each link interface configured before booting. If reallocation is not required, the original allocation method before booting is retained.

[0028] In the embodiment provided in this application, the execution subject of the memory resource allocation processing method is Figure 1 The server shown in FIG. 10a and FIG. 11b describe in detail the memory resource allocation processing method as follows:

[0029] S201: When it is detected that the server has completed booting and entered the operating system, it is determined whether memory resources need to be reallocated for each link interface according to total memory resources, wherein each link interface is used to connect to each expansion device.

[0030] Specifically, when it is monitored that the server has completed the basic input and output system startup process and successfully entered the operating system running state, by comparing the total memory resources of the system and the memory resources used by each link interface connected to the expansion device, it is determined whether the memory resources of each link interface need to be reallocated.

[0031] Specifically, the steps of determining whether to reallocate memory resources for each link interface based on the total memory resources include Sa1-Sa3:

[0032] Sa1: Obtain the total memory capacity of the server and the memory resources required by each link interface.

[0033] Sa2: If the total memory resource capacity is not less than the memory resources required by each link interface, there is no need to reallocate memory resources for each link interface.

[0034] Sa3: If the total memory resource capacity is smaller than the memory resources required by each link interface, memory resources need to be reallocated for each link interface.

[0035] S202: If it is determined that memory resources need to be reallocated, the resource reservation configuration information of each link interface is detected, where the resource reservation configuration information is used to indicate whether the corresponding link interface needs to prioritize memory resource allocation. The resource reservation configuration information is configured for each link interface before the server enters the operating system.

[0036] Specifically, if the system determines that memory resources need to be reallocated, it immediately retrieves the resource reservation configuration information for each link interface pre-configured during the basic input / output system startup phase. By reading whether the hot-swap function corresponding to each link interface is enabled, it distinguishes the priority flag corresponding to each link interface and divides all link interfaces into first-link interfaces to which memory resources need to be allocated first, and second-link interfaces to which memory resources are allocated routinely. For example, the interface connecting to key devices such as smart network cards and data processors is the first-link interface, and the interface connecting to ordinary storage devices is the second-link interface.

[0037] Specifically, the step of detecting the resource reservation configuration information of each link interface includes Sb1-Sb4:

[0038] Sb1: Scans the device configuration information of each link interface, including the hot-swap function.

[0039] Specifically, after the system begins the detection process, it first performs a traversal scan of each link interface. During this process, the system reads and parses the device configuration information corresponding to each link interface one by one. The device configuration information covers various attributes and functional parameters of the link interface, including status indicators related to the hot-swap function.

[0040] Sb2: Determine whether the hot-swap function of each link interface is enabled.

[0041] Specifically, the system determines whether the hot-swap function of each link interface is enabled or disabled by identifying a specific identification bit or parameter value in the configuration information.

[0042] Sb3: If the hot-swap function of any link interface is enabled, the link interface is determined to be a first link interface to which memory resources need to be allocated preferentially.

[0043] Specifically, once the system detects that the hot-swap function of a certain link interface is in an enabled state, the system immediately determines the link interface as the first link interface to which memory resources need to be allocated preferentially.

[0044] Sb4: If the hot-swap function of any link interface is not enabled, the link interface is determined to be a second link interface that does not require priority allocation of memory resources.

[0045] Specifically, when the system determines that the hot-swap function of a certain link interface is not enabled, the system classifies the link interface as a second link interface that does not require priority allocation of memory resources.

[0046] S203: Allocate memory resources to each first link interface detected to which memory resources need to be allocated first according to a first preset rule.

[0047] Specifically, the process of allocating memory resources to each first link interface according to the first preset rule includes Sc1-Sc3:

[0048] Sc1: Determine whether there is an expansion device under each first link interface.

[0049] Specifically, when allocating memory resources to the first link interface, the system first performs an expansion device presence check on each first link interface by sending a detection signal to a specific register of the first link interface and reading the return value to determine whether the link interface is actually connected to an expansion device.

[0050] Sc2: If an expansion device exists under any first link interface, the first link interface is allocated according to the reserved memory resources, where the reserved memory resources are configured for each first link interface before the server enters the operating system.

[0051] Specifically, when it is detected that an expansion device exists under a first link interface, the system immediately calls the reserved memory resources pre-configured during the server startup phase for allocation.

[0052] Sc3: If no expansion device exists under any first link interface, memory resources are allocated to any first link interface according to preset resource parameters.

[0053] Specifically, if it is detected that no expansion device is connected to a certain first link interface, the system will not idle the resource allocation authority of the link interface, but will dynamically allocate resources according to preset resource parameters.

[0054] Exemplarily, 2 MB of memory resources are reserved for the first link interface where no expansion device exists, so as to facilitate the insertion of the expansion device.

[0055] S204: for each second link interface that is detected and does not require priority allocation of memory resources, after completing allocation of memory resources to each first link interface, allocate memory resources to each second link interface according to a second preset rule.

[0056] Specifically, after completing resource allocation for all first link interfaces, the system starts processing memory allocation requirements for second link interfaces. The steps of allocating memory resources to each second link interface according to the second preset rule include Sd1-Sd4:

[0057] Sd1: After completing the allocation of memory resources for each first link interface, determine whether there is an expansion device under each second link interface.

[0058] Specifically, the system starts detecting the presence of expansion devices on each second link interface. This process obtains the device identification information of each second link interface by sending a configuration space read command to the link. For link interfaces where expansion devices are detected, the system further reads the device ready bit in the status register of the expansion device to confirm whether the device is in a normal working state.

[0059] Sd2: If there is an expansion device under any second-link interface, the binding relationship between any second-link interface and the reserved memory resources of any second-link interface will be released, and the reserved memory resources will be updated to the current remaining memory resources of the server, where the reserved memory resources are configured for the second-link interface before the server enters the operating system.

[0060] Specifically, when an expansion device is detected under a second-link interface, the system immediately unbinds and reclaims the reserved resources. During server startup, the BIOS pre-configures a certain amount of reserved memory resources for each second-link interface. The system then clears the original reserved address mapping and marks the corresponding physical memory page frame as "available."

[0061] Sd3: Allocate memory resources to any second link interface according to the current remaining memory resources and a third preset rule.

[0062] Specifically, after completing the reserved resource recovery and updating the current remaining memory resources, the system allocates memory resources to the second link interface with the expansion device according to the third preset rule. The steps of allocating memory resources to any second link interface according to the third preset rule based on the current remaining memory resources include Se1-Se3:

[0063] Se1: Acquires the memory resources required by the expansion device under any second link interface.

[0064] Specifically, the memory resource requirement parameters declared when the device is initialized are obtained.

[0065] Se2: Determine whether the current remaining memory resources meet the memory resources required for the expansion device.

[0066] Specifically, after obtaining the specific resource requirements of the expansion device, first check whether there are continuous physical memory blocks that meet the device alignment requirements in the remaining memory pool, and then calculate whether the total amount of remaining available memory reaches the device minimum requirement threshold.

[0067] Se3: If the current remaining memory resources meet the memory resources required by the expansion device, memory resources are allocated to any second link interface.

[0068] Specifically, when the system determines that the current remaining memory resources can meet the requirements of the expansion device, the memory resources are allocated to the second link interface.

[0069] Se4: If the current remaining memory resources do not meet the memory resources required by the expansion device, no memory resources are allocated to any second link interface, and resources of any second link interface are isolated.

[0070] Specifically, the remaining memory resources are insufficient to meet the needs of the expansion device. To avoid resource competition and system instability, strict resource isolation measures will be implemented for this second link interface. Memory access and bus mastering functions on this link interface will be disabled to prevent devices from initiating invalid memory requests.

[0071] Sd4: If no expansion device exists under any second link interface, no memory resources are allocated to any second link interface, and resources of any second link interface are isolated.

[0072] Specifically, if it detects that no expansion device exists under a second link interface, the system will implement resource isolation measures to prevent resource waste. Memory access permissions for the link interface will be disabled, and the system will release all reserved memory resources corresponding to the link interface back to the system resource pool.

[0073] S205: If it is determined that the memory resources do not need to be reallocated, parameter configuration instructions are set to enable the server to allocate memory resources to each link interface according to the original allocation method configured before entering the operating system.

[0074] Specifically, if the system determines that the current memory resources are sufficient and do not need to be reallocated, the memory resource allocation state completed by the basic input and output system is forcibly maintained by modifying the parameter configuration instruction.

[0075] Specifically, the steps of setting parameter configuration instructions to enable the server to allocate memory resources to each link interface according to the original allocation method configured before entering the operating system include Sf1-Sf3:

[0076] Sf1: Gets the configuration parameter set of the server's boot loader.

[0077] Specifically, first locate the storage location of the configuration file of the server's boot loader, read the content of the configuration file through the file system interface, and parse the configuration parameter set therein.

[0078] Sf2: Determine whether the configuration parameter set includes a parameter configuration instruction corresponding to the need to reallocate memory resources, where the parameter configuration instruction is used to instruct a reallocation operation on the memory resources of the server.

[0079] Specifically, after obtaining a complete set of configuration parameters, the system checks each parameter one by one to find parameter configuration instructions directly related to the memory resource reallocation operation, such as, for example, the pci=realloc parameter.

[0080] Sf3: If the configuration parameter set includes a parameter configuration instruction, the parameter configuration instruction is deleted so that the server allocates memory resources to each link interface according to the original allocation method configured before entering the operating system.

[0081] Specifically, when the system identifies a parameter configuration instruction related to memory reallocation within the configuration parameter set, it immediately deletes the parameter. After the modification is complete, the system saves the configuration file and synchronizes the disk cache to ensure the modification is persistent. The system then triggers the bootloader configuration update mechanism to make the modification effective.

[0082] In summary, during server bootup and the operating system phase, real-time monitoring of the match between total memory resources and the requirements of each link interface accurately determines whether memory reallocation is necessary, avoiding unnecessary resource adjustment overhead. Link interfaces are prioritized based on hot-swap functionality, prioritizing the memory resource requirements of the primary link interface of critical devices, significantly reducing the issue of device activation failures due to insufficient resources. Furthermore, intelligent management of boot loader configuration parameters ensures the stable use of the original allocation method when reallocation is not necessary, ensuring system compatibility and enhancing overall operational stability.

[0083] Figure 2 The overall flow chart of the memory resource allocation processing method provided in the embodiment of the present application, the execution subject of the memory resource allocation processing method is Figure 1 The server shown, such as Figure 2 As shown, the method includes:

[0084] When it is detected that the server has completed booting and entered the operating system, step S301 is executed: determining whether it is necessary to reallocate memory resources for each link interface according to the total memory resources.

[0085] If it is determined that the memory resources need to be reallocated, the device configuration information of each link interface is traversed and scanned, and step S302 is executed: determining whether the hot plug function of each link interface is enabled.

[0086] If the hot-swap function of the link interface is enabled, step S303 is executed: determining whether there is an expansion device under the link interface.

[0087] If there is an expansion device under the link interface, step S304 is executed: the link interface is allocated according to the reserved memory resources.

[0088] If there is no expansion device under the link interface, step S305 is executed: memory resources are allocated to the link interface according to preset resource parameters.

[0089] If the hot-swap function of the link interface is not enabled, step S306 is executed: determining whether there is an expansion device under the link interface.

[0090] If an expansion device exists under the link interface, step S307 is executed: the binding relationship between the link interface and the reserved memory resource is released.

[0091] S308: Update the reserved memory resources to the current remaining memory resources of the server.

[0092] S309: Determine whether the current remaining memory resources meet the memory resources required by the expansion device.

[0093] If the current remaining memory resources meet the memory resources required by the expansion device, step S310 is executed: the required memory resources are allocated to the link interface where the expansion device is located.

[0094] If the current remaining memory resources do not meet the memory resources required by the expansion device, step S311 is executed: no memory resources are allocated to the link interface, and resources of the link interface are isolated.

[0095] If no expansion device exists under the link interface, step S312 is executed: no memory resources are allocated to the link interface, and resources of the link interface are isolated.

[0096] If it is determined that the memory resource does not need to be reallocated, step S313 is executed: the parameter configuration instruction in the boot loader is deleted;

[0097] S314: Allocate memory resources to each link interface according to the original allocation method configured before entering the operating system.

[0098] In summary, during server bootup and the operating system entry phase, real-time monitoring of the match between total memory resources and the requirements of each link interface accurately determines whether memory reallocation is necessary, avoiding unnecessary resource adjustment overhead. Link interfaces are prioritized based on hot-swap functionality, prioritizing the memory resource requirements of the primary link interface of critical devices, significantly reducing the issue of device activation failures due to insufficient resources. Furthermore, intelligent management of boot loader configuration parameters ensures the stable use of the original allocation method when reallocation is not necessary, ensuring system compatibility and enhancing overall operational stability.

[0099] In another embodiment provided by the embodiment of the present application, before the server enters the operating system, a process of configuring each link interface is further included. The method includes S401-S404:

[0100] S401: After the server is powered on and enters the basic input and output system, it is determined whether each link interface needs to be allocated memory resources first according to the connection status of each link interface.

[0101] Specifically, the process of determining whether each link interface needs to be preferentially allocated memory resources based on its connection status includes steps Sg1-Sg7:

[0102] Sg1: Determine whether there is an expansion device under each link interface.

[0103] Specifically, the following steps Sh1-Sh6 may be used to determine whether an expansion device exists under each link interface:

[0104] Sh1: Get the communication protocol specifications followed by any link interface.

[0105] Sh2: Determine a device detection instruction corresponding to any link interface according to a communication protocol specification, wherein the device detection instruction includes a protocol specific field for triggering an extended device response.

[0106] Sh3: Send a device detection command to any link interface.

[0107] Sh4: If feedback data sent by any link interface is received within the preset response timeout period, protocol compliance verification is performed on the feedback data.

[0108] Sh5: If the feedback data passes the protocol compliance verification and the feedback data includes the response information corresponding to the device detection command, it is determined that an expansion device exists on any link interface.

[0109] Sh6: If no feedback data is received from any link interface within the preset response timeout period, it is determined that no expansion device exists on any link interface.

[0110] Sg2: If no expansion device exists under any link interface, determine whether any link interface needs to be connected to an expansion device.

[0111] Specifically, if it is found that no expansion device exists under a certain link interface, the system will further determine whether there is a need to connect an expansion device to the interface in the future.

[0112] Sg3: If any link interface does not need to be connected to an expansion device, it is determined that any link interface does not need to be preferentially allocated memory resources.

[0113] Specifically, if it is determined that the interface does not need to be connected to an expansion device, it is determined that there is no need to preferentially allocate memory resources.

[0114] Sg4: If any link interface needs to be connected to an expansion device, it is determined that any link interface needs to be allocated memory resources first.

[0115] Specifically, if it is determined that the interface needs to be connected to an expansion device in the future, it is determined that memory resources need to be allocated preferentially.

[0116] Sg5: If an expansion device exists under any link interface, determine whether the expansion device is the target device based on the identifier of the expansion device.

[0117] Specifically, when an expansion device is detected under a link interface, the system compares the expansion device's identifiers, such as the device ID and the manufacturer ID, with a preset target device list.

[0118] Sg6: If the expansion device is the target device, determine whether any link interface requires priority allocation of memory resources.

[0119] Specifically, if the device is a target device, it is determined that the link interface needs to be allocated memory resources first.

[0120] Sg7: If the expansion device is not the target device, it is determined that any link interface does not require priority allocation of memory resources.

[0121] Specifically, if the link interface does not belong to the target device, it is determined that the link interface does not need to be preferentially allocated with memory resources.

[0122] S402: If any link interface needs to be allocated memory resources first, determine any link interface as a first link interface.

[0123] Specifically, if any link interface is determined to require priority allocation of memory resources, the system will immediately mark the link interface and determine it as the first link interface.

[0124] S403: Configure reserved memory resources of the first link interface, and set resource reservation configuration information of the first link interface.

[0125] Exemplarily, required memory resources are reserved for the first link interface, and the hot plug function in the device configuration information of the first link interface is enabled.

[0126] S404: If any link interface does not need priority allocation of memory resources, any link interface is determined as a second link interface, and reserved memory resources for the second link interface are configured.

[0127] Exemplarily, required memory resources are reserved for the second link interface, and the hot plug function in the device configuration information of the second link interface is disabled.

[0128] In summary, by combining device connection status, expansion demand prediction, and device type identification, we can predict the resource priority of each link interface before the operating system starts. Key devices and interfaces with expansion plans are prioritized as first-link interfaces, with ample memory resources reserved for them and hot-swappable functionality enabled, ensuring immediate resource security for core business equipment. At the same time, we disable hot-swappable functionality for non-critical interfaces and appropriately control the amount of reserved resources, effectively reducing memory fragmentation and resource waste.

[0129] Figure 3 The link interface configuration process diagram provided in the embodiment of the present application is as follows: Figure 3 As shown, the method includes:

[0130] After the server is powered on and enters the basic input and output system, step S501 is executed: determining whether there is an expansion device under each link interface.

[0131] If an expansion device exists under the link interface, step S502 is executed: determining whether it is a target device according to the identifier of the expansion device.

[0132] If the expansion device is the target device, step S503 is executed: configuring reserved memory resources of the link interface where the expansion device is located.

[0133] S504: Enable the hot-swap function of the link interface where the target device is located.

[0134] If the extension device is not the target device, step S505 is executed: configuring reserved memory resources of the link interface where the extension device is located.

[0135] S506: Disable the hot-swap function of the link interface where the expansion device is located.

[0136] If no expansion device exists under the link interface, step S507 is executed: determining whether the link interface needs to be connected to an expansion device.

[0137] If the link interface needs to be connected to an expansion device, step S508 is executed: reserving memory resources for the link interface configuration and enabling the hot-swap function.

[0138] If the link interface does not need to be connected to an expansion device, step S509 is executed: no memory resources are reserved for the link interface configuration, and the hot plug function is disabled.

[0139] In summary, by combining device connection status, expansion demand prediction, and device type identification, we can predict the resource priority of each link interface before the operating system starts. Key devices and interfaces with expansion plans are prioritized as first-link interfaces, with ample memory resources reserved for them and hot-swappable functionality enabled, ensuring immediate resource security for core business equipment. At the same time, we disable hot-swappable functionality for non-critical interfaces and appropriately control the amount of reserved resources, effectively reducing memory fragmentation and resource waste.

[0140] In the embodiment provided in the present application, determining whether memory resources need to be reallocated for each link interface based on the total memory resources can also be determined by determining whether a preset policy is enabled on the server. The method includes:

[0141] S601: When detecting that the server has completed booting and entered the operating system, determining whether a preset policy is enabled to prevent reallocation of memory resources for each link interface.

[0142] Specifically, the judgment process includes Si1-Si3:

[0143] Si1: Get the configuration parameters of memory allocation control in the basic input and output system settings, where the configuration parameters of memory allocation control include a memory allocation lock flag, which is used to indicate whether to prohibit the server from reallocating memory resources of each link interface when entering the operating system.

[0144] Si2: If the memory allocation lock flag is in the on state, it is determined that the preset policy is enabled.

[0145] Si3: If the memory allocation lock flag is not enabled, it is determined that the preset policy is not enabled.

[0146] S602: If it is determined that the preset policy is enabled, memory resources are not reallocated for each link interface.

[0147] S603: If it is determined that the preset policy is not enabled, reallocate memory resources for each link interface.

[0148] In summary, when the memory allocation lock flag is turned on, that is, the preset policy is enabled, the system will maintain the original memory allocation status, avoid resource conflicts caused by reallocation, and effectively ensure the continuous operation of key businesses that require high memory configuration stability; when the flag is not turned on, the system will promptly respond to the dynamic resource requirements of each link interface, start the reallocation process, and realize the reallocation of memory resources.

[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0150] Figure 4 This is a schematic diagram of the structure of the memory resource allocation processing device provided in the embodiment of the present application. Figure 4 As shown, an embodiment of the present application further provides a memory resource allocation processing device, which includes: a resource re-allocation judgment module 401, a configuration information detection module 402, a first allocation module 403, a second allocation module 404 and a resource use module 405.

[0151] The resource reallocation judgment module 401 is used to judge whether it is necessary to reallocate memory resources for each link interface according to total memory resources when detecting that the server has completed booting and entered the operating system, wherein each link interface is used to connect each expansion device.

[0152] The configuration information detection module 402 is used to detect the resource reservation configuration information of each link interface if it is determined that memory resources need to be reallocated, wherein the resource reservation configuration information is used to indicate whether the corresponding link interface needs to prioritize the allocation of memory resources. The resource reservation configuration information is configured for each link interface before the server enters the operating system.

[0153] The first allocation module 403 is configured to allocate memory resources to each first link interface detected to which memory resources need to be allocated first according to a first preset rule.

[0154] The second allocation module 404 is configured to allocate memory resources to each second link interface detected to not require priority allocation of memory resources according to a second preset rule after completing allocation of memory resources to each first link interface.

[0155] The resource use module 405 is configured to, if it is determined that memory resources do not need to be reallocated, set parameter configuration instructions to enable the server to allocate memory resources to each link interface according to the original allocation method configured before entering the operating system.

[0156] In one possible implementation, the first allocation module 403 is specifically used to determine whether there is an expansion device under each first link interface; if there is an expansion device under any first link interface, any first link interface is allocated according to the reserved memory resources, where the reserved memory resources are configured for each first link interface before the server enters the operating system.

[0157] In a possible implementation manner, the first allocation module 403 is further configured to allocate memory resources to any first link interface according to preset resource parameters if no expansion device exists under any first link interface.

[0158] In one possible embodiment, the second allocation module 404 is specifically used to determine whether there is an expansion device under each second link interface after completing the allocation of memory resources to each first link interface; if there is an expansion device under any second link interface, the binding relationship between any second link interface and the reserved memory resources of any second link interface is released, and the reserved memory resources are updated to the current remaining memory resources of the server, where the reserved memory resources are configured for the second link interface before the server enters the operating system; based on the current remaining memory resources, memory resources are allocated to any second link interface according to the third preset rule.

[0159] In a possible implementation, the second allocation module 404 is further configured to: if no expansion device exists under any second link interface, not allocate memory resources to any second link interface, and perform resource isolation on any second link interface.

[0160] In one possible embodiment, the second allocation module 404 is also used to obtain the memory resources required by the expansion device under any second link interface; determine whether the current remaining memory resources meet the memory resources required by the expansion device; if the current remaining memory resources meet the memory resources required by the expansion device, allocate memory resources to any second link interface.

[0161] In a possible implementation, the second allocation module 404 is further configured to not allocate memory resources to any second link interface and perform resource isolation on any second link interface if currently remaining memory resources do not meet memory resources required by the expansion device.

[0162] In one possible implementation, the resource use module 405 is specifically used to obtain a configuration parameter set of the server's boot loader; determine whether the configuration parameter set includes parameter configuration instructions corresponding to the need to reallocate memory resources, where the parameter configuration instructions are used to instruct the reallocation operation of the server's memory resources; if the configuration parameter set includes parameter configuration instructions, the parameter configuration instructions are deleted so that the server allocates memory resources to each link interface according to the original allocation method configured before entering the operating system.

[0163] In one possible implementation, the configuration information detection module 402 is specifically used to traverse and scan the device configuration information of each link interface, wherein the device configuration information includes a hot-swap function; determine whether the hot-swap function of each link interface is enabled; if the hot-swap function of any link interface is enabled, determine that any link interface is a first link interface that requires priority allocation of memory resources; if the hot-swap function of any link interface is not enabled, determine that any link interface is a second link interface that does not require priority allocation of memory resources.

[0164] In one possible implementation, the resource reallocation judgment module 401 is specifically used to obtain the capacity of the total memory resources of the server and the memory resources required by each link interface; if the capacity of the total memory resources is not less than the memory resources required by each link interface, there is no need to reallocate memory resources for each link interface; if the capacity of the total memory resources is less than the memory resources required by each link interface, it is necessary to reallocate memory resources for each link interface.

[0165] In one possible embodiment, the device also includes a link interface setting module, which is used to determine whether each link interface needs to be allocated memory resources first according to the connection status of each link interface after the server is turned on and enters the basic input and output system; if any link interface needs to be allocated memory resources first, then any link interface is determined as the first link interface; the reserved memory resources of the first link interface are configured, and the resource reservation configuration information of the first link interface is set.

[0166] In a possible implementation, the interface setting module is further configured to determine any link interface as a second link interface and configure reserved memory resources for the second link interface if any link interface does not require priority allocation of memory resources.

[0167] In one possible implementation, a link interface setting module is further used to determine whether there is an expansion device under each link interface; if there is no expansion device under any link interface, then determine whether any link interface needs to access the expansion device; if any link interface does not need to access the expansion device, then determine that any link interface does not need to prioritize the allocation of memory resources; if any link interface needs to access the expansion device, then determine that any link interface needs to prioritize the allocation of memory resources.

[0168] In one possible embodiment, the link interface setting module is also used to determine whether an expansion device is a target device based on an identifier of the expansion device if an expansion device exists under any link interface; if the expansion device is a target device, it is determined that any link interface needs to be preferentially allocated memory resources; if the expansion device is not a target device, it is determined that any link interface does not need to be preferentially allocated memory resources.

[0169] In one possible embodiment, a link interface setting module is further used to obtain the communication protocol specification followed by any link interface; according to the communication protocol specification, a device detection instruction corresponding to any link interface is determined, wherein the device detection instruction includes a protocol-specific field for triggering an extended device response; a device detection instruction is sent to any link interface; if feedback data sent by any link interface is received within a preset response timeout, the feedback data is verified for protocol compliance; if the feedback data passes the protocol compliance verification and the feedback data includes response information corresponding to the device detection instruction, it is determined that an extended device exists on any link interface; if no feedback data sent by any link interface is received within the preset response timeout, it is determined that no extended device exists on any link interface.

[0170] In one possible embodiment, the device also includes a second resource redistribution judgment module, which is used to determine whether a preset policy is enabled to prevent the reallocation of memory resources for each link interface when detecting that the server has completed booting and entered the operating system; if it is determined that the preset policy is enabled, memory resources are not reallocated for each link interface; if it is determined that the preset policy is not enabled, memory resources are reallocated for each link interface.

[0171] In one possible embodiment, the second resource redistribution judgment module is also used to obtain the configuration parameters of memory allocation control in the basic input and output system settings, wherein the configuration parameters of memory allocation control include a memory allocation lock flag, and the memory allocation lock flag is used to indicate whether the server is prohibited from reallocating the memory resources of each link interface when entering the operating system; if the memory allocation lock flag is in the on state, it is determined that the preset policy is enabled; if the memory allocation lock flag is in the off state, it is determined that the preset policy is not enabled.

[0172] For the description of the features in the embodiment corresponding to the memory resource allocation processing device, reference can be made to the relevant description of the embodiment corresponding to the memory resource allocation processing method, which will not be repeated here.

[0173] Figure 5 This is a schematic diagram of the structure of the server provided in the embodiment of the present application. Figure 5 As shown, the server provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the server also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus.

[0174] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502 , so that the at least one processor 501 executes the above-mentioned embodiment of the memory resource allocation processing method.

[0175] The specific implementation process of the processor 501 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.

[0176] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.

[0177] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.

[0178] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.

[0179] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned memory resource allocation processing method embodiments when running.

[0180] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0181] An embodiment of the present application further provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned memory resource allocation processing method embodiments when executed by a processor.

[0182] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned memory resource allocation processing method embodiments.

[0183] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0184] The above is a detailed introduction to a memory resource allocation processing method, device, storage medium and product provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A memory resource allocation processing method, characterized in that: include: When detecting that the server has completed booting and entered the operating system, determining whether it is necessary to reallocate memory resources for each link interface according to the total memory resources, wherein each link interface is used to connect to each expansion device; If it is determined that memory resources need to be reallocated, detecting resource reservation configuration information of each link interface, wherein the resource reservation configuration information is used to indicate whether the corresponding link interface needs to be preferentially allocated memory resources, and the resource reservation configuration information is configured for each link interface before the server enters the operating system; For each detected first link interface to which memory resources need to be preferentially allocated, determining whether there is an expansion device under each first link interface; If an expansion device exists under any first link interface, allocating the first link interface according to the reserved memory resources, wherein the reserved memory resources are configured for each first link interface before the server enters the operating system; For each detected second link interface that does not require priority allocation of memory resources, after completing allocation of memory resources to each first link interface, memory resources are allocated to each second link interface according to a second preset rule.

2. The memory resource allocation processing method according to claim 1, characterized in that: After determining whether there is an expansion device under each first link interface, the method further includes: If no expansion device exists under any first link interface, memory resources are allocated to the first link interface according to preset resource parameters.

3. The memory resource allocation processing method according to claim 1, characterized in that: Allocating memory resources to each second link interface according to a second preset rule includes: After completing the allocation of memory resources for each of the first link interfaces, determining whether there is an expansion device under each of the second link interfaces; If an expansion device exists under any second link interface, unbinding the binding relationship between the any second link interface and the reserved memory resources of the any second link interface, and updating the reserved memory resources to the current remaining memory resources of the server, wherein the reserved memory resources are configured for the second link interface before the server enters the operating system; According to the current remaining memory resources, memory resources are allocated to any one of the second link interfaces according to a third preset rule.

4. The memory resource allocation processing method according to claim 3, characterized in that: After determining whether there is an expansion device under each second link interface, the method further includes: If no expansion device exists under any second link interface, no memory resources are allocated to any second link interface, and resources of any second link interface are isolated.

5. The memory resource allocation processing method according to claim 3, characterized in that: The allocating memory resources to any one of the second link interfaces according to the current remaining memory resources and a third preset rule includes: Acquire memory resources required by the expansion device under any of the second link interfaces; Determining whether the currently remaining memory resources meet the memory resources required by the expansion device; If the currently remaining memory resources meet the memory resources required by the expansion device, memory resources are allocated to any one of the second link interfaces.

6. The memory resource allocation processing method according to claim 5, characterized in that: After determining whether the current remaining memory resources meet the memory resources required by the expansion device, the method further includes: If the currently remaining memory resources do not meet the memory resources required by the expansion device, no memory resources are allocated to any of the second link interfaces, and resources of any of the second link interfaces are isolated.

7. The memory resource allocation processing method according to claim 1, characterized in that: After determining whether it is necessary to reallocate memory resources for each link interface based on the total memory resources, the method further includes: Obtaining a set of configuration parameters of a boot loader of the server; Determining whether the configuration parameter set includes a parameter configuration instruction corresponding to the need to reallocate memory resources, wherein the parameter configuration instruction is used to instruct a reallocation operation on the memory resources of the server; If the configuration parameter set includes the parameter configuration instruction, the parameter configuration instruction is deleted so that the server allocates memory resources to each link interface according to the original allocation method configured before entering the operating system.

8. The memory resource allocation processing method according to claim 1, characterized in that: The detecting of resource reservation configuration information of each link interface includes: Traversing and scanning device configuration information of each link interface, wherein the device configuration information includes a hot plug function; Determine whether the hot-swap function of each link interface is enabled; If the hot-swap function of any link interface is enabled, determining that the any link interface is the first link interface to which memory resources need to be preferentially allocated; If the hot-plug function of any link interface is not enabled, the any link interface is determined to be the second link interface that does not require priority allocation of memory resources.

9. The memory resource allocation processing method according to claim 1, characterized in that: The determining whether it is necessary to reallocate memory resources for each link interface according to the total memory resources includes: Obtaining the total memory resource capacity of the server and the memory resources required by each link interface; If the capacity of the total memory resources is not less than the memory resources required by each link interface, there is no need to reallocate memory resources for each link interface; If the capacity of the total memory resources is smaller than the memory resources required by each link interface, it is necessary to reallocate memory resources for each link interface.

10. The memory resource allocation processing method according to claim 1, characterized in that: Before the server enters the operating system, the server also includes: After the server is powered on and enters the basic input and output system, determining whether each link interface needs to be allocated memory resources first according to the connection status of each link interface; If any link interface needs to allocate memory resources first, determining the any link interface as the first link interface; Configure reserved memory resources of the first link interface and set resource reservation configuration information of the first link interface.

11. The memory resource allocation processing method according to claim 10, characterized in that: After determining whether each link interface needs to be allocated memory resources first, the method further includes: If any link interface does not need to be allocated memory resources in priority, the any link interface is determined as a second link interface, and reserved memory resources for the second link interface are configured.

12. The memory resource allocation processing method according to claim 10, characterized in that: The determining, based on the connection status of each link interface, whether each link interface needs to be preferentially allocated memory resources includes: Determine whether there is an expansion device under each link interface; If no expansion device exists under any link interface, determining whether any link interface needs to be connected to an expansion device; If any of the link interfaces does not need to access an expansion device, determining that any of the link interfaces does not need to be preferentially allocated memory resources; If any of the link interfaces needs to access an expansion device, it is determined that any of the link interfaces needs to be allocated memory resources with priority.

13. The memory resource allocation processing method according to claim 12, characterized in that: After determining whether there is an expansion device under each link interface, the method further includes: If an extension device exists under any link interface, determining whether the extension device is a target device according to an identifier of the extension device; If the expansion device is a target device, determining that any one of the link interfaces needs to be allocated memory resources preferentially; If the expansion device is not the target device, it is determined that any of the link interfaces does not need to be allocated memory resources preferentially.

14. The memory resource allocation processing method according to claim 12, wherein: The determining whether there is an expansion device under each link interface includes: Obtain the communication protocol specifications followed by any link interface; determining, according to the communication protocol specification, a device detection instruction corresponding to the any one of the link interfaces, wherein the device detection instruction includes a protocol specific field for triggering an extended device response; Sending the device detection instruction to any link interface; If feedback data sent by any link interface is received within a preset response timeout period, protocol compliance verification is performed on the feedback data; If the feedback data passes the protocol compliance verification and the feedback data includes response information corresponding to the device detection instruction, it is determined that an expansion device exists on any of the link interfaces; If no feedback data sent by any link interface is received within the preset response timeout period, it is determined that no extension device exists on any link interface.

15. The memory resource allocation processing method according to claim 1, wherein: Also includes: When detecting that the server has completed booting and entered the operating system, determining whether a preset policy is enabled to prevent reallocation of memory resources for each link interface; If it is determined that the preset policy is enabled, memory resources are not reallocated for the link interfaces; If it is determined that the preset policy is not enabled, memory resources are reallocated for each link interface.

16. The memory resource allocation processing method according to claim 15, characterized in that: The determining whether a preset policy is enabled to prevent reallocation of memory resources for each link interface includes: Obtaining configuration parameters for memory allocation control in basic input / output system settings, wherein the configuration parameters for memory allocation control include a memory allocation lock flag, the memory allocation lock flag being used to indicate whether to prohibit the server from reallocating memory resources of each link interface when entering the operating system; If the memory allocation lock flag is in an on state, it is determined that the preset policy is enabled; If the memory allocation lock flag is in an unenabled state, it is determined that the preset policy is not enabled.

17. A server, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the memory resource allocation processing method according to any one of claims 1 to 16 when executing the computer program.

18. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the memory resource allocation processing method according to any one of claims 1 to 16 are implemented.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the memory resource allocation processing method according to any one of claims 1 to 16 are implemented.

Citation Information

Patent Citations

  • PCIe resource allocation method and device, electronic equipment and storage medium

    CN118034917A

  • Method and device for resource allocation

    WO2015157913A1