System management memory allocation method, program operation method, system and product
By monitoring the number of processors and cores in real time when the server is turned on and dynamically allocating SMRAM memory, the problems of insufficient memory and waste of resources caused by static allocation of traditional BIOS memory management are solved, and the normal operation of SDU services and system performance are improved.
Patent Information
- Application Number
- CN202411487479.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-10-23
AI Technical Summary
Traditional BIOS memory management adopts a static allocation strategy, resulting in insufficient memory when the system is high load, while memory resources cannot be fully utilized at low load, which cannot meet users' flexible adjustment of memory size in different application scenarios. At the same time, the memory pages that can be allocated in the SMRAM area are insufficient, which affects the implementation of SDU technology.
By monitoring the number of physical processors and cores in real time during the server startup process, calculating the total number of cores, and determining the core interval and the target capacity of the system management memory that needs to be configured based on the total number of cores, dynamically allocating SMRAM memory to meet the operation needs of SDU services.
It realizes flexible and automated SMRAM memory allocation for servers with different hardware configurations, avoiding waste caused by excessive memory allocation or failure to operate normally due to excessive SDU services, and improving the system's memory resource utilization efficiency and overall performance.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and in particular to a system management memory allocation method, a program running method, a system and a product. Background Art
[0002] In the server field, memory management is very important. With the continuous development of computer technology and the increasing complexity and diversification of its applications, the functions of BIOS (Basic Output Input System), as a key part of computer startup and hardware initialization, are constantly expanding and optimizing, and the system's demand for memory resources is also increasing. Traditional BIOS memory management methods often adopt static allocation strategies, and the configuration of memory size is often relatively fixed, that is, a fixed memory size is allocated according to the preset value when the system starts. The method of allocating a fixed memory size is more likely to lead to insufficient memory when the system is highly loaded, and memory resources are not fully utilized when the system is underloaded, which cannot meet the user's flexible adjustment needs for memory size in different application scenarios.
[0003] In addition, with the innovation of new BIOS technologies, SDU (SMM Driver Update) technology has been introduced in recent years. This technology can update BIOS area modules in real time under the system through the SMM (System Management Mode) service resident in the BIOS. SDU technology uses the SMRAM (System Management RAM) area to implement module access, which makes the allocable area in SMRAM tight. On this basis, the number of allocable memory pages in the SMRAM area is directly related to the implementation of SDU technology.
[0004] In a server, the more physical processors and cores a single processor has, the more memory pages it occupies in the system management mode. If the allocatable memory pages in the SMRAM area are insufficient to support the operation of the SDU, a failure will occur. Therefore, how to achieve flexible memory allocation to meet the normal operation of the SDU is a problem that needs to be solved. Summary of the invention
[0005] In view of this, the present application aims to propose a system management memory allocation method, program running method, system and product to achieve flexible allocation of memory space under system management mode and ensure the correct operation of driver updates under system management mode.
[0006] To achieve the above purpose, the technical solution of this application is as follows:
[0007] A first aspect of an embodiment of the present application provides a system management memory allocation method, the method comprising:
[0008] Start the basic input and output system, initialize the system management mode environment and configure the system management mode service;
[0009] Get the number of physical processors on the server and the number of cores carried by each physical processor, and calculate the total number of cores;
[0010] Determine a corresponding core interval based on the total number of cores, and determine a first target capacity of a system management memory to be configured based on the core interval;
[0011] Based on the first target capacity, a system management memory is allocated for driver update in the system management mode.
[0012] Optionally, the system management memory allocation method further includes:
[0013] After allocating system management memory, run the operating system;
[0014] The driver update service is run in the system management mode in the operating system to update the basic input and output system area module of the server; the basic input and output system area module is a part of the program in the basic input and output system firmware.
[0015] Optionally, determining a corresponding core interval based on the total number of cores, and determining a first target capacity of a system management memory to be configured based on the core interval includes:
[0016] comparing the total number of cores to a first threshold;
[0017] When the total number of cores is less than or equal to the first threshold, determining the corresponding core interval as a first interval;
[0018] Based on the first interval, a first target capacity of the system management memory to be configured is determined as the first capacity.
[0019] Optionally, determining a corresponding core interval based on the total number of cores, and determining a first target capacity of a system management memory to be configured based on the core interval further includes:
[0020] When the total number of cores is greater than the first threshold, comparing the total number of cores with a second threshold; the second threshold is greater than the first threshold;
[0021] When the total number of cores is less than or equal to the second threshold, determining the corresponding core interval as the second interval; based on the second interval, determining that the first target capacity of the system management memory to be configured is the second capacity; the second capacity is greater than the first capacity;
[0022] When the total number of cores is greater than the second threshold, the corresponding core interval is determined to be a third interval; based on the third interval, a first target capacity of the system management memory to be configured is determined to be a third capacity; and the third capacity is greater than the second capacity.
[0023] Optionally, allocating system management memory based on the first target capacity includes:
[0024] Acquire current free memory pages, and allocate a corresponding number of free memory pages based on the first target capacity;
[0025] After allocating the free memory page, detecting whether there is a memory page conflict between the currently allocated free memory page and the memory page occupied by the hardware device of the server;
[0026] If there is a memory page conflict, the memory pages occupied by the hardware device of the server are set as reserved memory, and the free memory pages are reallocated.
[0027] Optionally, after determining the first target capacity of the system management memory to be configured, the method further includes:
[0028] Check whether there is a pre-set expansion configuration;
[0029] If there is a pre-set capacity expansion configuration, read the capacity expansion configuration to obtain the second target capacity;
[0030] Based on the first target capacity and the second target capacity, a system management memory is allocated.
[0031] Optionally, the system management memory allocation method further includes:
[0032] Displaying optional expansion configurations on a basic input / output system settings interface; the expansion configurations include: expandable capacity options;
[0033] When the expansion configuration is changed, a basic input and output system restart operation is performed.
[0034] Optionally, after allocating the system management memory, the method further includes: before entering the operating system, displaying the current real-time operating status information of the system management memory and the memory usage information on the user interface.
[0035] According to a second aspect of an embodiment of the present application, a program running method is provided, including:
[0036] Execute the method provided in the first aspect of the embodiment of the present application, allocate system management memory, and run the operating system;
[0037] After entering the operating system, running the target application; the target application occupies the system management memory when running;
[0038] When insufficient memory occurs during the operation of the target application, obtaining the system management memory capacity that needs to be expanded for the target application;
[0039] Restart the server to enter the basic input and output system setting interface, and set the expansion configuration in the basic input and output system setting interface according to the system management memory capacity that needs to be expanded;
[0040] After setting the expansion configuration, restart the server and execute the method provided in the first aspect of the embodiment of the present application to allocate system management memory;
[0041] After allocating system management memory, run the operating system;
[0042] After entering the operating system, the target application is re-run.
[0043] According to a third aspect of an embodiment of the present application, a server is provided, including:
[0044] A multi-way physical processor, wherein the physical processor is a single-core or multi-core processor;
[0045] The server is used to execute the method provided in the first aspect of the embodiment of the present application to allocate system management memory.
[0046] Optionally, the server further includes:
[0047] The update module is used to run the driver update service in the system management mode after entering the operating system to update the basic input and output system area module of the server; the basic input and output system area module is a part of the program in the basic input and output system firmware.
[0048] According to a fourth aspect of an embodiment of the present application, a processing system is provided, including:
[0049] The server provided in the third aspect of the embodiment of the present application is used to allocate system management memory and run an operating system; after entering the operating system, run a target application; the target application occupies the system management memory when running;
[0050] The fault handling module is used to perform the following steps:
[0051] When insufficient memory occurs during the operation of the target application, obtaining the system management memory capacity that needs to be expanded for the target application;
[0052] Controlling the server to restart and enter a basic input and output system setting interface, and setting a capacity expansion configuration in the basic input and output system setting interface;
[0053] After setting the expansion configuration, control restarting the server and execute the method provided in the first aspect of the embodiment of the present application to allocate system management memory.
[0054] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the method provided in the first aspect or the second aspect of the embodiment of the present application are implemented.
[0055] According to the sixth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method provided in the first aspect or the second aspect of the embodiments of the present application are implemented.
[0056] According to the seventh aspect of the embodiments of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the method provided in the first aspect or the second aspect of the embodiments of the present application are implemented.
[0057] By using the system management memory allocation method provided by the present application, when starting the BIOS, the number of physical processors of the server and the number of cores of each processor are obtained, the total number of cores of the server is calculated, and the core interval is determined according to the scale of the total number of cores of the server. Further, the system management memory capacity that needs to be allocated for the SDU service is determined based on the core interval, and SMRAM memory is allocated based on the memory capacity.
[0058] The method determines the SMRAM memory capacity actually allocated to the server by real-time monitoring the number of physical processors and cores in the server during the server startup process, thereby realizing flexible and automatic SMRAM memory allocation for servers with different hardware configurations, avoiding memory waste caused by excessive memory allocation, or SDU failure to operate normally after startup caused by excessive memory allocation, thereby enabling the system to use memory resources more efficiently and improving the overall system performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. 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 paying any creative labor.
[0060] Figure 1 is a flowchart of a system management memory allocation method proposed in an embodiment of the present application;
[0061] Figure 2 is a flowchart of allocating system management memory in one embodiment of the present application;
[0062] Figure 3 is a flowchart of a program running method proposed in an embodiment of the present application;
[0063] Figure 4 It is a schematic diagram of the architecture of a server in an embodiment of the present application;
[0064] Figure 5 is a schematic diagram of a fault handling system in one embodiment of the present application;
[0065] Figure 6 It is a schematic diagram of an electronic device proposed in an embodiment of the present application. DETAILED DESCRIPTION
[0066] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0067] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0068] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0069] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects as detailed in the present application.
[0070] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.
[0071] The traditional SMRAM memory allocation method is to allocate a fixed size of memory capacity. However, as the number of physical processors and the number of processor cores increase, the memory required to execute SDU services also increases, and insufficient memory may occur, causing the SDU service to fail to operate normally. For example, on a two-way processor server or a four-way processor server, when updating the BIOS area module through SDU technology, less than 600 memory pages are usually required, and the fixed allocation of 128M SMRAM capacity can meet the needs. However, for the case of a large number of cores, including a 48-core processor server, the number of memory pages required by the server reaches 1,300 memory pages. At this time, the fixed allocation of 128M SMRAM memory space is not enough to support the normal operation of the SDU, and a failure will occur. For engineers, blindly expanding SMRAM memory may lead to potential memory risks and system insecurity. For example, allocating too much SMRAM memory to meet the operation of the SDU may cause some applications to run out of memory during operation.
[0072] Therefore, the SMRAM memory allocation method provided by this application flexibly allocates memory capacity that matches the number of cores according to the number of processing cores in the server, thereby reducing memory risks on the basis of meeting the operating requirements of the SDU. This solution can be applied to server platforms of various architectures to achieve adaptive allocation of SMRAM memory based on the actual configuration of the server to meet the needs of the normal operation of the server SDU.
[0073] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0074] Figure 1 1 is a flow chart of a system management memory allocation method proposed in an embodiment of the present application. Figure 1 As shown, the method includes:
[0075] S1: Start the basic input and output system, initialize the system management mode environment and configure the system management mode service;
[0076] S2: Obtain the number of physical processors on the server and the number of cores carried by each physical processor, and calculate the total number of cores;
[0077] S3: determining a corresponding core interval based on the total number of cores, and determining a first target capacity of a system management memory to be configured based on the core interval;
[0078] S4: Based on the first target capacity, allocating system management memory for driver update in system management mode.
[0079] In this embodiment, during the server startup process, the BIOS is first run. After entering the BIOS, the SMM environment is initialized and the SMM service is configured. During the BIOS POST (Power On Self Test), the memory usage is collected in real time, the number of physical processors of the current server and the number of cores of each physical processor are detected, and then the total number of cores in the current server is calculated:
[0080] Total core count = the sum of the core counts of all physical processors.
[0081] Further, according to the current total number of cores of the server, the corresponding core interval is determined, and then the SMRAM memory capacity (ie, the first target capacity) to be allocated for the SDU service is determined. Based on the first target capacity, the SMRAM memory is allocated to complete the allocation of the system management memory.
[0082] This application determines the total number of cores in the current server in real time during the server startup process, thereby allocating a matching SMRAM memory capacity to the server to meet the normal operation of the SDU service after the server is powered on. This method can be used to automatically match servers with different hardware configurations and allocate SMRAM memory of appropriate capacity. The automated memory adjustment process reduces the need for manual intervention and reduces the maintenance cost and time cost of the system. By reasonably allocating SMRAM memory capacity, it is possible to avoid memory waste caused by excessive memory allocation, or the inability of the SDU to operate normally after startup due to too small memory allocation, so that the system can use memory resources more efficiently and improve the overall system performance. This method can significantly improve the computer's ability to flexibly adjust SMRAM memory allocation, thereby meeting performance requirements in specific application scenarios.
[0083] As an implementation manner of the present application, the system management memory allocation method further includes:
[0084] After allocating system management memory, run the operating system;
[0085] The driver update service is run in the system management mode in the operating system to update the basic input and output system area module of the server; the basic input and output system area module is a part of the program in the basic input and output system firmware.
[0086] In one embodiment, after the system management memory is allocated, the system enters the operating system. In the operating system, the SDU is executed through the SMM service, so as to update some area modules in the BIOS firmware and check the verification operation results.
[0087] As an implementation manner of the present application, determining a corresponding core interval based on the total number of cores, and determining a first target capacity of a system management memory to be configured based on the core interval includes:
[0088] comparing the total number of cores to a first threshold;
[0089] When the total number of cores is less than or equal to the first threshold, determining the corresponding core interval as a first interval;
[0090] Based on the first interval, a first target capacity of the system management memory to be configured is determined as the first capacity.
[0091] In one embodiment, based on the total number of cores of the current server, the interval in which the total number of cores is located is determined. Specifically, the total number of cores is compared with a first threshold value, and if the total number of cores is less than or equal to the first threshold value, it is determined that the total number of cores is in the first interval. In this embodiment, a plurality of intervals of the number of cores are pre-divided based on the threshold value, and the corresponding memory capacity to be allocated is matched to each interval. When the total number of cores of the server is less than or equal to the first threshold value, it is determined that the current interval is within the range of the first interval. Further, the first capacity matching the first interval is determined to be the first target capacity allocated to the server, that is, the SMRAM memory capacity used as the SDU running the server.
[0092] In actual applications, the first threshold and the first target capacity can be customized according to actual application needs. In this embodiment, the first threshold can be set to 256, and the first target capacity can be set to 128M. That is, when the total number of cores of the server does not exceed 256, 128M of SMRAM memory capacity is allocated to the SDU.
[0093] As an implementation manner of the present application, determining a corresponding core interval based on the total number of cores, and determining a first target capacity of a system management memory to be configured based on the core interval further includes:
[0094] When the total number of cores is greater than the first threshold, comparing the total number of cores with a second threshold; the second threshold is greater than the first threshold;
[0095] When the total number of cores is less than or equal to the second threshold, determining the corresponding core interval as the second interval; based on the second interval, determining that the first target capacity of the system management memory to be configured is the second capacity; the second capacity is greater than the first capacity;
[0096] When the total number of cores is greater than the second threshold, the corresponding core interval is determined to be a third interval; based on the third interval, a first target capacity of the system management memory to be configured is determined to be a third capacity; and the third capacity is greater than the second capacity.
[0097] In one embodiment, if the total number of cores of the current server is greater than the first threshold, the total number of cores is further compared with the second threshold. If the total number of cores is less than or equal to the second threshold, it is determined that the total number of cores of the server is within the range of the second interval. Further, the second capacity matching the second interval is determined to be the first target capacity allocated to the server, that is, the SMRAM memory capacity used for the server to run the SDU.
[0098] If the total number of cores is greater than the second threshold, it is determined that the total number of cores of the server is within the range of the third interval. Further, a third capacity matching the third interval is determined as the first target capacity allocated to the server, that is, the SMRAM memory capacity used for running the SDU of the server.
[0099] In actual applications, the second threshold, the second capacity, and the third capacity can all be customized according to actual application needs. Optionally, the second threshold is set to 512, and the second capacity is set to 256M. That is, when the total number of cores of the server exceeds 256 and does not exceed 512, 256M of SMRAM memory capacity is allocated to the SDU. The third capacity is set to 512M, that is, when the total number of cores of the server exceeds 512, 512M of SMRAM memory capacity is allocated to the SDU.
[0100] In this embodiment, the total number of cores of the server is first compared with the minimum threshold (i.e., the first threshold). When the total number of cores is less than the first threshold, the memory capacity to be allocated is directly determined, thereby saving system resources. When the total number of cores of the server exceeds the first threshold, the total number of cores is further compared with a second threshold that is larger than the first threshold, thereby determining the range interval in which it is located.
[0101] As an implementation manner of the present application, allocating system management memory based on the first target capacity includes:
[0102] Acquire current free memory pages, and allocate a corresponding number of free memory pages based on the first target capacity;
[0103] After allocating the free memory page, detecting whether there is a memory page conflict between the currently allocated free memory page and the memory page occupied by the hardware device of the server;
[0104] If there is a memory page conflict, the memory pages occupied by the hardware device of the server are set as reserved memory, and the free memory pages are reallocated.
[0105] In one embodiment, after determining the first target capacity of the SMRAM memory to be allocated, the free memory pages in the memory are obtained, so as to allocate a corresponding number of free memory pages according to the first target capacity. After each adjustment of the memory page, it is necessary to detect whether the memory page currently allocated for the SDU service conflicts with the memory page allocated for other hardware devices in the server. If a conflict occurs, it is necessary to set the memory page allocated by the system for other hardware devices (for example: PCIE card, network card, video card, etc.) to Reserve mode (i.e., retain memory), and then re-detect the allocable free memory pages, and reallocate the free memory pages for the SDU service. Avoid memory conflicts that cause the service to fail to operate normally after startup.
[0106] In this embodiment, when allocating SMRAM memory for SDU services, it is detected in real time whether there is overlap with the addresses (memory pages) occupied by other devices, so that the area position is readjusted, avoiding potential system security risks and instability, and also achieving compatibility with other devices and system configurations.
[0107] As an implementation manner of the present application, after determining the first target capacity of the system management memory to be configured, the method further includes:
[0108] Check whether there is a pre-set expansion configuration;
[0109] If there is a pre-set capacity expansion configuration, read the capacity expansion configuration to obtain the second target capacity;
[0110] Based on the first target capacity and the second target capacity, a system management memory is allocated.
[0111] In one embodiment, in addition to allocating memory to the SDU, SMRAM memory can also be allocated to some specified applications that run after booting. The memory of the application is allocated by means of expansion configuration. In the BIOS stage, after determining the first target capacity to be configured, check whether there is a pre-set expansion configuration in the BIOS. If there is an expansion configuration, read the expansion configuration and obtain the second target capacity to be expanded. Based on the first target capacity and the second target capacity, determine the total capacity to be allocated:
[0112] Total capacity = first target capacity + second target capacity.
[0113] In this embodiment, the user can pre-set the expansion configuration according to the SMRAM memory capacity required by the specified application. When the server is powered on and enters the POST stage, the total number of cores of the server is first obtained by real-time detection, and then the corresponding first target capacity is automatically matched according to the total number of cores, and memory is allocated to the SDU service based on the first target capacity. In addition, it is detected whether there is a pre-set expansion configuration. If so, the expansion configuration is read and the second target capacity is obtained therefrom, and memory is allocated to the application based on the second target capacity. That is, in this embodiment, the total capacity of the SMRAM memory allocated in the BIOS stage is determined based on the first target capacity and the second target capacity.
[0114] In this embodiment, for certain applications that need to use SMRAM memory, memory is allocated by pre-setting the expansion configuration, so that memory expansion can be implemented on the basis of allocating memory for SDU services in the BIOS stage, so that the normal operation of SDU services and specified applications can be met after the boot is completed.
[0115] As an implementation manner of the present application, the system management memory allocation method further includes:
[0116] Displaying optional expansion configurations on a basic input / output system settings interface; the expansion configurations include: expandable capacity options;
[0117] When the expansion configuration is changed, a basic input and output system restart operation is performed.
[0118] In one embodiment, the optional expansion configuration is displayed on the BIOS setup interface, including at least one expandable capacity option. The user can generate the expansion configuration by presetting the expansion memory capacity in the BIOS setup interface and submitting it for saving. In the case where the expansion configuration changes, the BIOS executes a restart and reads the pre-set expansion configuration after the next startup to obtain the second target capacity therein.
[0119] It is worth noting that since setting the SMRAM memory too large can easily cause memory waste, when setting the expansion configuration, it is necessary to ensure that the total capacity determined based on the first target capacity and the second target capacity usually does not exceed the capacity threshold. In one embodiment, when displaying the optional expansion configuration in the BIOS setup interface, the expandable capacity options can be screened according to the capacity threshold and the first target capacity, and the optional options that meet the capacity threshold conditions are marked and displayed as recommended expanded memory capacity for the user to choose.
[0120] For example, in the BIOS setup interface, there are three capacity options: 32M, 64M, and 128M. When the capacity threshold is 560M, if the first target capacity is 512M, the 32M capacity option is marked as a recommended option for display; if the first target capacity is 128M, the 32M, 64M, and 128M capacity options are all marked as recommended options. By marking the capacity options that meet the capacity threshold conditions as recommended options and displaying them in the BIOS setup interface, users can give priority to recommended options when making choices, avoiding memory waste and improving overall system performance.
[0121] As an implementation mode of the present application, after allocating the system management memory, it also includes: before entering the operating system, the current system management memory real-time operating status information and memory usage information are displayed on the user interface.
[0122] In one embodiment, in order to facilitate the user to understand the adjustment process of the system memory, after the memory configuration is completed, the real-time operation status of the system management memory and the memory usage are also displayed on the user interaction interface for the user to view. This facilitates the user to intuitively understand the memory allocation, including: the address, size and area attributes of the current SMRAM and other information.
[0123] Figure 2 1 is a flowchart of allocating system management memory in one embodiment of the present application. Figure 2As shown, after booting and entering the BIOS, the system management mode (SMM) environment is first initialized, and then the system management mode (SMM) service is configured. The number of physical processors in the current server and the number of cores of each physical processor are detected, and the total number of cores of the current server is calculated. According to the total number of cores, the first target capacity to be allocated is determined. Whether there is a pre-set expansion configuration is detected. If not, the memory is directly allocated based on the first target capacity. If it exists, the expansion configuration is read to obtain the second target capacity to be expanded. The total capacity is obtained based on the first target capacity and the second target capacity, and the system management memory (SMRAM) is allocated. After the memory is allocated, it is detected whether there is a conflict with the memory page occupied by the hardware configuration in the server (overlap occurs). If there is an overlap, the memory page occupied by the hardware configuration is set as reserved memory, and then the free page is re-allocated based on the total capacity. After the memory allocation is completed, before running the operating system, the real-time operating status and memory usage of the system management memory are displayed on the user interface for users to view. After running into the operating system, the SDU or the specified application can be run normally.
[0124] Based on the same inventive concept, an embodiment of the present application provides a program running method, including:
[0125] Execute the system management memory allocation method described in the above embodiment, allocate system management memory, and run the operating system;
[0126] After entering the operating system, running the target application; the target application occupies the system management memory when running;
[0127] When insufficient memory occurs during the operation of the target application, obtaining the system management memory capacity that needs to be expanded for the target application;
[0128] Restart the server to enter the basic input and output system setting interface, and set the expansion configuration in the basic input and output system setting interface according to the system management memory capacity that needs to be expanded;
[0129] After setting the expansion configuration, restart the server, and execute the system management memory allocation method as described in the above embodiment to allocate the system management memory;
[0130] After allocating system management memory, run the operating system;
[0131] After entering the operating system, the target application is re-run.
[0132] In this embodiment, after the system is powered on, the target application that needs to use SMRAM memory is run. In practical applications, the target application can be part of the developer tool program (for example, debug program). Since the application can only run in the operating system, it is impossible to determine whether the currently allocated memory capacity meets the normal operation of the target application in the BIOS stage of the server startup. Therefore, in the BIOS stage, the corresponding memory is first allocated to the SDU service through the above-mentioned system management memory allocation method. After entering the operating system, the target application is run. If insufficient memory occurs during the operation of the target application, the memory capacity required by the program will be prompted by a fault error. Then, the capacity expansion is performed according to the memory capacity required by the program. Specifically, the server is restarted to enter the BIOS. In the BIOS setting interface, according to the SMRAM memory capacity that the program needs to expand, the corresponding capacity option is selected, and the expansion configuration is generated and saved. Then, the server is restarted again to realize the memory required by the SDU service and the allocation of the expanded memory. After the memory allocation is completed, the operating system is entered and the target application is re-run to realize the normal operation of the target application.
[0133] Figure 3 1 is a flowchart of a program running method proposed in an embodiment of the present application. Figure 3 As shown in the figure, when the target application in the operating system has insufficient running memory, the system management memory capacity that needs to be expanded for the program is obtained. The server is restarted, and when entering the BIOS stage, the capacity option is set in the BIOS setup interface, the expansion configuration is generated and saved, and then the memory expansion is completed by restarting the server again to solve the problem of insufficient running memory for the target application.
[0134] Based on the same inventive concept, an embodiment of the present application provides a server. The server includes:
[0135] A multi-way physical processor, wherein the physical processor is a single-core or multi-core processor;
[0136] The server is used to execute the system management memory allocation method described in the above embodiment to allocate system management memory.
[0137] In this embodiment, the server may be a server of a different architecture, with a multi-way physical processor, wherein each processor may be a single-core processor or a multi-core processor. Figure 4 Schematic diagram of the server architecture in an embodiment of the present application. Figure 4As shown, the server 101 includes an operating system (OS), a multi-way physical processor (single-core or multi-core CPU), a memory, a basic input-output system (BIOS), and a baseboard management controller (BMC). Among them, the multi-way physical processors communicate directly with the operating system, the memory, and the basic input-output system respectively, and the basic input-output system also communicates directly with the baseboard management controller. When the server is turned on, the BIOS is first started, the SMM environment is initialized, and the SMM service is configured to obtain the number of physical processors and the number of cores carried by each physical processor, and the total number of cores is calculated; the first target capacity of the SMRAM memory to be configured is determined according to the total number of cores, and then the SMRAM memory is allocated based on the first target capacity for running the SDU service under the OS when the server is turned on.
[0138] Optionally, the server further comprises: an update module, which is used to run a driver update service in a system management mode after entering the operating system to update a basic input / output system area module of the server; the basic input / output system area module is a part of the program in the basic input / output system firmware.
[0139] Based on the same inventive concept, an embodiment of the present application provides a processing system, including:
[0140] The server as described in the above embodiment is used to allocate system management memory and run the operating system; after entering the operating system, the target application is run; the target application occupies the system management memory when running;
[0141] The fault handling module is used to perform the following steps:
[0142] When insufficient memory occurs during the operation of the target application, obtaining the system management memory capacity that needs to be expanded for the target application;
[0143] Controlling the server to restart and enter a basic input and output system setting interface, and setting a capacity expansion configuration in the basic input and output system setting interface;
[0144] After setting the expansion configuration, the server is controlled to be restarted, and the system management memory allocation method described in the above embodiment is executed to allocate the system management memory.
[0145] Figure 5 Schematic diagram of a fault handling system in one embodiment of the present application. Figure 5As shown, the processing system includes the server 101 provided in the above embodiment, and a fault processing module 102. The fault processing module 102 is used to obtain the system management memory capacity that the target application needs to expand when insufficient memory occurs when the target application is running, and when the server is restarted, control to enter the BIOS setting interface, and generate an expansion configuration according to the system management memory capacity that the target application needs to expand. After the expansion configuration is generated, control to restart the server to implement the expansion of the system management memory to ensure that the target application can run normally.
[0146] Based on the same inventive concept, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the system management memory allocation method or the steps in the program running method as described in any of the above embodiments of the present application.
[0147] Based on the same inventive concept, an embodiment of the present application provides a readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the system management memory allocation method or the steps in the program running method as described in any of the above embodiments of the present application.
[0148] Based on the same inventive concept, an embodiment of the present application provides an electronic device. Figure 6 Schematic diagram of an electronic device according to an embodiment of the present application. Figure 6 As shown, the electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the system management memory allocation method or the steps in the program running method as described in any of the above embodiments of the present application.
[0149] Based on the same inventive concept, an embodiment of the present application provides a system management memory allocation device, the device comprising:
[0150] A preprocessing module configured to start a basic input and output system, initialize a system management mode environment and configure a system management mode service;
[0151] A real-time detection module is configured to obtain the number of physical processors of the server and the number of cores carried by each physical processor;
[0152] The calculation module is configured to calculate the total number of cores based on the number of physical processors and the number of cores carried by each physical processor; determine the corresponding core interval based on the total number of cores, and determine the first target capacity of the system management memory to be configured based on the core interval;
[0153] The memory allocation module is configured to allocate system management memory based on the first target capacity for driver update in the system management mode.
[0154] As an implementation manner of the present application, the system management memory allocation device further includes a firmware update module configured to perform the following steps:
[0155] After allocating system management memory, run the operating system;
[0156] The driver update service is run in the system management mode in the operating system to update the basic input and output system area module of the server; the basic input and output system area module is a part of the program in the basic input and output system firmware.
[0157] As an implementation manner of the present application, the computing module is configured to determine a corresponding core interval based on the total number of cores, and determine a first target capacity of a system management memory to be configured based on the core interval, specifically including:
[0158] comparing the total number of cores to a first threshold;
[0159] When the total number of cores is less than or equal to the first threshold, determining the corresponding core interval as a first interval;
[0160] Based on the first interval, a first target capacity of the system management memory to be configured is determined as the first capacity.
[0161] As an implementation manner of the present application, the computing module is configured to determine a corresponding core interval based on the total number of cores, and determine a first target capacity of a system management memory to be configured based on the core interval, and further includes:
[0162] When the total number of cores is greater than the first threshold, comparing the total number of cores with a second threshold; the second threshold is greater than the first threshold;
[0163] When the total number of cores is less than or equal to the second threshold, determining the corresponding core interval as the second interval; based on the second interval, determining that the first target capacity of the system management memory to be configured is the second capacity; the second capacity is greater than the first capacity;
[0164] When the total number of cores is greater than the second threshold, the corresponding core interval is determined to be a third interval; based on the third interval, a first target capacity of the system management memory to be configured is determined to be a third capacity; and the third capacity is greater than the second capacity.
[0165] As an implementation manner of the present application, the memory allocation module is configured to allocate system management memory based on the first target capacity, specifically including:
[0166] Acquire current free memory pages, and allocate a corresponding number of free memory pages based on the first target capacity;
[0167] After allocating the free memory page, detecting whether there is a memory page conflict between the currently allocated free memory page and the memory page occupied by the hardware device of the server;
[0168] If there is a memory page conflict, the memory pages occupied by the hardware device of the server are set as reserved memory, and the free memory pages are reallocated.
[0169] As an implementation manner of the present application, the computing module is further configured to perform the following steps:
[0170] After determining a first target capacity of the system management memory to be configured, detecting whether there is a pre-set capacity expansion configuration;
[0171] If there is a pre-set capacity expansion configuration, read the capacity expansion configuration to obtain the second target capacity;
[0172] Based on the first target capacity and the second target capacity, a system management memory is allocated.
[0173] As an implementation manner of the present application, the system management memory allocation device further includes:
[0174] The interactive interface is configured to display optional expansion configurations on a basic input / output system setting interface; the expansion configurations include: expandable capacity options;
[0175] The preprocessing module is further configured to execute a basic input and output system restart operation when the expansion configuration changes.
[0176] As an implementation mode of the present application, the interactive interface is also configured to display the current real-time operating status information and memory usage information of the system management memory after allocating the system management memory and before entering the operating system.
[0177] Regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0178] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
[0179] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and components involved are not necessarily required by the present application.
[0180] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0181] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0182] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0184] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the present application is interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0185] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0186] The system management memory allocation method, program running method, system and product provided by the present application are introduced in detail above. Specific examples are used in this article 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 of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A system management memory allocation method, characterized in that: include: Start the basic input and output system during the server startup process, initialize the system management mode environment and configure the system management mode service; Get the number of physical processors on the server and the number of cores carried by each physical processor, and calculate the total number of cores; Determine a corresponding core interval based on the total number of cores, and determine a first target capacity of a system management memory to be configured based on the core interval; Based on the first target capacity, a system management memory is allocated for running a driver update service in a system management mode after the server is powered on; wherein, based on the first target capacity, the system management memory is allocated, including: obtaining current free memory pages, and allocating a corresponding number of free memory pages based on the first target capacity; after allocating the free memory pages, detecting whether there is a memory page conflict between the currently allocated free memory pages and the memory pages occupied by the hardware devices of the server; if there is a memory page conflict, setting the memory pages occupied by the hardware devices of the server as reserved memory, and reallocating the free memory pages; Check whether there is a pre-set expansion configuration; If there is a pre-set capacity expansion configuration, read the capacity expansion configuration to obtain the second target capacity; Based on the first target capacity and the second target capacity, a system management memory is allocated.
2. The system management memory allocation method according to claim 1, characterized in that: Also includes: After allocating system management memory, run the operating system; Running a driver update service in a system management mode in the operating system to update a basic input and output system area module of the server; The basic input and output system area module is a part of the program in the basic input and output system firmware.
3. The system management memory allocation method according to claim 1, characterized in that: Determining a corresponding core interval based on the total number of cores, and determining a first target capacity of a system management memory to be configured based on the core interval, including: comparing the total number of cores to a first threshold; When the total number of cores is less than or equal to the first threshold, determining the corresponding core interval as a first interval; Based on the first interval, a first target capacity of the system management memory to be configured is determined as the first capacity.
4. The system management memory allocation method according to claim 3, characterized in that: Determining a corresponding core interval based on the total number of cores, and determining a first target capacity of a system management memory to be configured based on the core interval, further comprising: When the total number of cores is greater than the first threshold, comparing the total number of cores with a second threshold; the second threshold is greater than the first threshold; When the total number of cores is less than or equal to the second threshold, determining the corresponding core interval as the second interval; based on the second interval, determining that the first target capacity of the system management memory to be configured is the second capacity; the second capacity is greater than the first capacity; When the total number of cores is greater than the second threshold, the corresponding core interval is determined to be a third interval; based on the third interval, a first target capacity of the system management memory to be configured is determined to be a third capacity; and the third capacity is greater than the second capacity.
5. The system management memory allocation method according to claim 1, characterized in that: Also includes: Display optional expansion configuration in the basic input and output system settings interface; The expansion configuration includes: expandable capacity options; When the expansion configuration is changed, a basic input and output system restart operation is performed.
6. The system management memory allocation method according to claim 1, characterized in that: After allocating the system management memory, the method further includes: before entering the operating system, displaying the current real-time operating status information and memory usage information of the system management memory on the user interface.
7. A program running method, characterized in that: include: Execute the method according to any one of claims 1 to 6, allocate system management memory, and run the operating system; After entering the operating system, running the target application; the target application occupies the system management memory when running; When insufficient memory occurs during the operation of the target application, obtaining the system management memory capacity that needs to be expanded for the target application; Restart the server to enter the basic input and output system setting interface, and set the expansion configuration in the basic input and output system setting interface according to the system management memory capacity that needs to be expanded; After setting the expansion configuration, restart the server and reallocate the system management memory; After allocating system management memory, run the operating system; After entering the operating system, the target application is re-run.
8. A server, characterized in that: include: A multi-way physical processor, wherein the physical processor is a single-core or multi-core processor; The server is used to execute the method according to any one of claims 1 to 6 to allocate system management memory.
9. The server according to claim 8, characterized in that: Also includes: An update module, for running a driver update service in a system management mode after entering the operating system, to update a basic input and output system area module of the server; The basic input and output system area module is a part of the program in the basic input and output system firmware.
10. A processing system, characterized in that: include: The server according to claim 8 or 9, used for allocating system management memory and running an operating system; After entering the operating system, running the target application; the target application occupies the system management memory when running; The fault handling module is used to perform the following steps: When insufficient memory occurs during the operation of the target application, obtaining the system management memory capacity that needs to be expanded for the target application; Controlling the server to restart and enter a basic input and output system setting interface, and setting a capacity expansion configuration in the basic input and output system setting interface; After setting the expansion configuration, the server is controlled to be restarted, and the method as claimed in claim 6 or 7 is executed to allocate system management memory.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps in the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Memory allocation method and device, electronic equipment and storage medium
CN114327862A