A CPU operating state control method, device, equipment and medium
By obtaining and controlling the running status and quantity attribute values of the core physical units of the CPU, precise control of multiple CPUs is achieved, which solves the problem that existing technology cannot accurately control the running status of the CPU without changing the startup image, ensuring that the server Stable operation in overclocked state.
Patent Information
- Application Number
- CN202210770034.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-06-30
AI Technical Summary
Existing technology cannot accurately control the running status of each CPU of multiple CPUs without changing the server system startup image. Especially when overclocking and load balancing are required, it is impossible to achieve physical control of each CPU core. Precise disabling or enabling of units.
By obtaining the CPU's core physical unit running status attribute value and core physical unit running quantity attribute value, add the CPU's core physical unit running status attribute and running quantity attribute, and control the CPU's running status based on these attribute values, including disabling or Enable core physical units to achieve precise control of each CPU.
Without changing the system startup image, it can accurately control the operating status of each CPU in a server system with multiple CPUs, so that the server can run stably and be overclocked to meet the special needs of the actual production environment.
Smart Images

Figure CN115114027B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a CPU operating state control method, device, equipment and medium. Background Art
[0002] At present, there are two ways to change the state of a physical unit in a server system: replacing the system startup image and not replacing the system startup image. The method of replacing the system startup image is relatively simple. It directly modifies the source code of the host loading stage, compiles it into a firmware file after the source code modification is completed, and then refreshes it to the server; however, in an actual production environment, the customer cannot change the state of a physical unit by modifying the source code, so generally a special tool is used to modify the data of a certain part (Section) of the firmware file, and then restarts the system to achieve the purpose of changing the running state of the physical unit without replacing the system startup image. The specific principle is as follows: when the server starts the image system, each physical unit (target) has one or more attributes, each attribute has a default attribute value, and all attributes and attribute values of each physical unit constitute an attribute library (HBD Section). When the hardware is initialized after the server is powered on, the startup image file consists of multiple Sections, and the data stored in each Section is different and the purpose is also different. There is also another temporary partial file (ATTR_TMP Section) in the boot image file for temporarily storing physical unit attributes and attribute values; during the system startup process, the data in the ATTR_TMP Section will be read in the initialization phase of the server hardware, and it will be determined whether the data in the ATTR_TMP Section is consistent with the data in the HBD Section. If they are inconsistent, the data in the ATTR_TMP Section will be obtained to overwrite the attribute values of the physical units in the current system, otherwise, no overwriting will be done. Therefore, the attribute value of a physical unit can be modified in the system through special tools, that is, directly modify the data in ATTR_TMPSection, restart the system, and if the ATTR_TMP Section data is detected to have changed during the startup process, the attribute value of the corresponding physical unit in the system will be overwritten, thereby achieving the purpose of changing the operating status of the physical unit without changing the system boot image.
[0003] For servers with openpower processors, under normal circumstances, a server generally includes two CPUs. For most production needs, as long as the CPU can work normally, it can meet the actual production needs. However, there are always some special requirements in the actual production environment, for example, the server machine needs to be in an overclocked state; and for a CPU including 24 core physical units (COREs), some COREs need to be disabled to achieve the purpose of overclocking. At the same time, load balancing needs to be considered in the overclocking situation. At this time, it is necessary to be able to accurately control the operating state of each CORE of the CPU to evenly reduce the number of running COREs, so that the server machine is in a state where it can run stably and overclock.
[0004] Regarding the configuration of the CPU's operating status, the prior art only provides the CORE running number attribute (FIELD_CORE_OVERRIDE) of the logical unit (Node). The CORE running number attribute of the logical unit belongs to the Node and can only be used to control the maximum number of running COREs under a Node. The logical unit Node is a higher-level logical unit than the CPU, and a Node may include multiple CPUs. In an actual production environment, it is rarely used to control the maximum number of running COREs under a Node. For a server system including multiple CPUs, in an actual production environment, it is more necessary to accurately control the maximum number of running COREs under each CPU, or to achieve accurate control of disabling or starting the 24 COREs under each CPU, and this configuration cannot be completed under the prior art. Summary of the invention
[0005] In order to overcome the above technical defects, the purpose of the present invention is to provide a CPU operation state control method, device, equipment and medium, the method is applied to a server system, the server system includes several CPUs, the CPU includes several core physical units, the method includes: obtaining the core physical unit operation state attribute value and the core physical unit operation quantity attribute value of the CPU; controlling the operation state of the CPU according to the core physical unit operation state attribute value and the core physical unit operation quantity attribute value of the CPU. The technical solution of the present invention can accurately control the operation state of each CPU in a server system including multiple CPUs without changing the server system startup image, and in an actual production environment, enable the server to be in a state where it can run stably and overclock, and meet special production needs.
[0006] The specific technical solutions provided by the embodiments of the present invention are as follows:
[0007] In a first aspect, a method for controlling a CPU operating state is provided, the method being applied to a server system, the server system comprising a plurality of CPUs, the CPU comprising a plurality of core physical units, the method comprising:
[0008] Obtaining a core physical unit operation state attribute value and a core physical unit operation quantity attribute value of the CPU;
[0009] The operating state of the CPU is controlled according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU.
[0010] Furthermore, before obtaining the core physical unit operation state attribute value and the core physical unit operation quantity attribute value of the CPU, the method further includes:
[0011] Adding a core physical unit operation state attribute and a core physical unit operation quantity attribute of the CPU to the CPU;
[0012] The initial attribute value of the running state of the core physical unit of the CPU is set to a first threshold, and the initial attribute value of the running number of the core physical units of the CPU is set to a second threshold.
[0013] Further, controlling the operating state of the CPU according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU includes:
[0014] Controlling the operating state of each core physical unit of the CPU according to the core physical unit operating state attribute value of the CPU;
[0015] The running number of the core physical units of the CPU is controlled according to the running number attribute value of the core physical units of the CPU.
[0016] Further, controlling the operating state of each core physical unit of the CPU according to the core physical unit operating state attribute value of the CPU includes:
[0017] Determine whether the core physical unit operation state attribute value of the CPU is consistent with the first threshold;
[0018] If yes, the process ends; if no, the core physical unit operation status attribute value of the CPU is parsed according to the bit value;
[0019] The bitwise analysis of the core physical unit operation status attribute value of the CPU includes:
[0020] Determine whether a current bit value of the core physical unit operation status attribute value of the CPU is a third threshold;
[0021] If so, the core physical unit corresponding to the current bit value of the core physical unit running status attribute value of the CPU is disabled; if not, the state of the core physical unit corresponding to the current bit value of the core physical unit running status attribute value of the CPU is maintained.
[0022] Further, after parsing the core physical unit operation status attribute value of the CPU by bit value, it includes:
[0023] Determine whether the current bit value of the core physical unit operation status attribute value of the CPU is the last bit;
[0024] If yes, determine whether there are any remaining CPUs in the server system; if no, analyze the next bit value of the current bit value of the core physical unit running status attribute value of the CPU in sequence;
[0025] The determining whether there are any remaining CPUs in the server system includes:
[0026] Determine whether there is any remaining CPU in the server system;
[0027] If so, obtain the core physical unit operating status attribute value of the remaining CPU, and control the operating status of each core physical unit of the remaining CPU according to the core physical unit operating status attribute value of the remaining CPU; if not, end the process.
[0028] Further, controlling the running number of the core physical units of the CPU according to the running number attribute value of the core physical units of the CPU includes:
[0029] Determining whether the core physical unit running quantity attribute value of the CPU has changed;
[0030] The judging whether the core physical unit running quantity attribute value of the CPU changes includes:
[0031] Determine whether the core physical unit running quantity attribute value of the CPU is consistent with the second threshold;
[0032] If so, the running number of core physical units of the CPU is maintained; if not, some core physical units of the CPU are disabled according to the attribute value of the running number of core physical units of the CPU.
[0033] Further, after determining whether the core physical unit running quantity attribute value of the CPU has changed, the method further comprises:
[0034] Determine whether there is any remaining CPU in the server system;
[0035] If so, obtain the core physical unit running quantity attribute value of the remaining CPU, and control the running quantity of the core physical units of the remaining CPU according to the core physical unit running quantity attribute value of the remaining CPU; if not, end the process.
[0036] In a second aspect, a CPU operation state control device is provided, the device comprising:
[0037] An acquisition module, used to acquire a core physical unit operation state attribute value and a core physical unit operation quantity attribute value of the CPU;
[0038] The control module is used to control the operating state of the CPU according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU.
[0039] According to a third aspect, a computer device is provided, the device comprising:
[0040] A memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the CPU operating state control method as described in any one of the first aspects.
[0041] In a fourth aspect, a computer storage medium is provided, the medium comprising:
[0042] A computer program is stored thereon, and when the computer program is executed by the memory, the steps of any of the CPU operating state control methods described in the first aspect are implemented.
[0043] Compared with the prior art, the method described in the technical solution provided in the embodiment of the present invention is applied to a server system, wherein the server system includes several CPUs, and the CPU includes several core physical units, and the method includes: obtaining the core physical unit operation state attribute value and the core physical unit operation quantity attribute value of the CPU; and controlling the operation state of the CPU according to the core physical unit operation state attribute value and the core physical unit operation quantity attribute value of the CPU. The technical solution of the present invention can accurately control the operation state of each CPU in a server system including multiple CPUs without changing the server system startup image, and in an actual production environment, enable the server to be in a state where it can run stably and overclock, and meet special production needs.
[0044] The technical solution provided by the embodiment of the present invention can achieve precise control over the operating status of each core physical unit under the CPU and the operating number of the core physical units in a server system including multiple CPUs, so that the server can be in a state of stable operation and overclocking. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 A first flow chart of a CPU operating state control method provided in Embodiment 1 of the present invention;
[0047] Figure 2 A flowchart of the existing control CPU operating state provided in the first embodiment of the present invention;
[0048] Figure 3 A second flow chart of the CPU operating state control method provided in the second embodiment of the present invention;
[0049] Figure 4 A specific flow chart of the CPU operating state control method provided in Embodiment 2 of the present invention;
[0050] Figure 5 A structural diagram of a CPU operating state control device provided in Embodiment 3 of the present invention;
[0051] Figure 6 The exemplary system provided for the fifth embodiment of the present invention can be used to implement the various embodiments described in this application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0053] It should be noted that, unless the context clearly requires otherwise, words such as “include”, “including” and similar words throughout the specification and claims should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is “including but not limited to”.
[0054] Furthermore, in the description of the present invention, unless otherwise specified, “plurality” means two or more.
[0055] Embodiment 1
[0056] The embodiment of the present invention provides a method for controlling the CPU operation state. Figure 1 As shown, the method is applied to a server system, the server system includes several CPUs, the CPU includes several core physical units, and the method includes:
[0057] Obtaining a core physical unit operation state attribute value and a core physical unit operation quantity attribute value of the CPU;
[0058] The operating state of the CPU is controlled according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU.
[0059] Specifically, in the prior art, during operation, the server system can only control the maximum number of running core physical units CORE under the logical unit Node through the CORE running number attribute (FIELD_CORE_OVERRIDE) of the logical unit. Figure 2 As shown, it is a flow chart of the existing control of CPU running status: obtaining the CORE running number attribute value of the logical unit, judging whether the current value of the CORE running number attribute value of the logical unit is 0, if so, maintaining the number value of the core physical unit CORE of the logical unit, and the core physical unit CORE of the logical unit runs normally; if not, disabling some COREs according to the CORE running number attribute value of the logical unit, so as to achieve the purpose of controlling the CPU running status.
[0060] An embodiment of the present invention provides a CPU running state control method, which is mainly used in an actual production environment to add a core physical unit running state attribute and a core physical unit running number attribute to a CPU through an overlay tool (attributeOverride) without changing a system startup image, and control the running state of each core physical unit of the CPU according to the core physical unit running state attribute value of the CPU; control the running number of the core physical units of the CPU according to the core physical unit running number attribute value of the CPU. Through these two attributes, the running state of each CPU is controlled, thereby meeting the demand for precise control of the running state of each CPU of a multi-CPU server system in an actual production environment.
[0061] Among them, the core physical unit operating status attribute (CPU_CORE_NUMBER_CONTROL) of the CPU (central processing unit) is an attribute of the CPU (Proc), which is used to accurately control the operating status of each CORE of the CPU. During the operation of the server system, it will obtain the core physical unit operating status attribute value of the CPU, and change the operating status of each CORE under the CPU according to the core physical unit operating status attribute value of the CPU, thereby ultimately achieving the purpose of controlling the operating status of each CORE of the CPU.
[0062] The core physical unit running number attribute (CORE_NUMBER_CONTROL) of the CPU is also an attribute of the CPU, which is used to control the maximum number of core physical units CORE running under the current CPU. The server system controls the running number of core physical units of the CPU according to the core physical unit running number attribute value of the CPU, so as to achieve the purpose of controlling the maximum number of COREs running under the CPU.
[0063] The CORE running quantity attribute (FIELD_CORE_OVERRIDE) of the logical unit is an attribute of the logical unit Node, which is used to control the maximum number of running core physical units CORE under the Node. It can be understood that the CORE running quantity attribute of the logical unit is a parameter of the logical unit Node. During the operation of the server system, it will obtain the CORE running quantity attribute value of the logical unit and change the operating state of the CPU according to the CORE running quantity attribute value of the logical unit.
[0064] The attributes may be understood as parameters. During the startup of the server system, the state of the entire server system is controlled by reading and setting the values of the attributes.
[0065] The CPU and Proc are both central processing units, and the CORE is the core part of the CPU, which is the CPU core and the core physical unit on the CPU chip. For the server openpower, the CPU generally includes 24 core physical units.
[0066] The Node is a logic unit one level higher than the CPU under the server openpower architecture, and the Node includes multiple CPUs.
[0067] The technical solution provided by the embodiment of the present invention is applied to a server system. The technical solution of the present invention can accurately control the operating status of each CPU in a server system including multiple CPUs without changing the server system startup image. In an actual production environment, the server can be in a state where it can run stably and overclock, thereby meeting special production needs.
[0068] Embodiment 2
[0069] The embodiment of the present invention provides a method for controlling the CPU operation state. Figure 3 As shown, the method is applied to a server system, the server system includes several CPUs, the CPU includes several core physical units, and the method includes:
[0070] Step S01, adding a core physical unit operation state attribute and a core physical unit operation quantity attribute of the CPU to the CPU;
[0071] The initial attribute value of the running state of the core physical unit of the CPU is set to a first threshold, and the initial attribute value of the running number of the core physical units of the CPU is set to a second threshold.
[0072] Specifically, a core physical unit operation state attribute and a core physical unit operation quantity attribute of the CPU are added to the CPU, and initial values are given to the core physical unit operation state attribute and the core physical unit operation quantity attribute of the CPU respectively.
[0073] The first threshold here is a 32-bit value converted from a hexadecimal value to a binary value, wherein the first 8 bits are invalid bits, the last 24 bits are valid bits, and each bit value of the last 24 bits corresponds to each CORE of the CPU.
[0074] For example, the 32-bit value is 00000000111111111111111111111111111, the first 8 bits are 0, which are invalid bits; the last 24 bits are 1 by default; and the hexadecimal value is 0x00FFFFFF.
[0075] The second threshold is 16 or 8 by default.
[0076] Step S02, obtaining a core physical unit operation state attribute value and a core physical unit operation quantity attribute value of the CPU.
[0077] Specifically, during the boot process, the server system obtains the core physical unit running state attribute value and the core physical unit running quantity attribute value of the CPU in the Hostboot stage of booting the image initialization.
[0078] The Hostboot stage is the host loading stage of the server system firmware, which mainly completes the hardware initialization process under the system. The boot image is to initialize the hardware after the server is powered on, and then guide the operating system to start the firmware.
[0079] Step S03: controlling the operating state of the CPU according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU.
[0080] Step S03 also includes:
[0081] Step S031 : controlling the operating state of each core physical unit of the CPU according to the core physical unit operating state attribute value of the CPU.
[0082] Step S031 also includes:
[0083] Step S0311, determining whether the core physical unit operation state attribute value of the CPU is consistent with the first threshold;
[0084] If yes, the process ends; if no, the core physical unit operation status attribute value of the CPU is parsed according to the bit value;
[0085] The bitwise analysis of the core physical unit operation status attribute value of the CPU includes:
[0086] Determine whether a current bit value of the core physical unit operation status attribute value of the CPU is a third threshold;
[0087] If so, the core physical unit corresponding to the current bit value of the core physical unit running status attribute value of the CPU is disabled; if not, the state of the core physical unit corresponding to the current bit value of the core physical unit running status attribute value of the CPU is maintained.
[0088] Specifically, after obtaining the core physical unit operating status attribute value of the CPU, it will be determined whether the attribute value has changed. If the core physical unit operating status attribute value of the CPU has not changed, the process will be terminated directly, otherwise a more fine-grained judgment will be performed, that is, the core physical unit operating status attribute value of the first CPU will be parsed according to the bit value.
[0089] Determine whether the core physical unit operating status attribute value of the first CPU is consistent with the first threshold value. If the core physical unit operating status attribute value of the first CPU has changed, parse and judge each bit value of the core physical unit operating status attribute value of the first CPU, and change the operating status of the CORE corresponding to each bit value according to the judgment result of each bit value, so as to finally achieve the purpose of accurately controlling the operating status of each CORE of the CPU.
[0090] Here, the third threshold is 0. If the current bit value of the core physical unit operating status attribute value of the first CPU is 0, the core physical unit corresponding to the current bit value of the core physical unit operating status attribute value of the first CPU is disabled; if the current bit value of the core physical unit operating status attribute value of the first CPU is 1, the state of the core physical unit corresponding to the current bit value of the core physical unit operating status attribute value of the first CPU is maintained.
[0091] Step S0312, determining whether the current bit value of the core physical unit operation status attribute value of the CPU is the last bit;
[0092] If yes, determine whether there are any remaining CPUs in the server system; if no, analyze the next bit value of the current bit value of the core physical unit running status attribute value of the CPU in sequence;
[0093] The determining whether there are any remaining CPUs in the server system includes:
[0094] Determine whether there is any remaining CPU in the server system;
[0095] If so, obtain the core physical unit operating status attribute value of the remaining CPU, and control the operating status of each core physical unit of the remaining CPU according to the core physical unit operating status attribute value of the remaining CPU; if not, end the process.
[0096] Specifically, determining whether the current bit value of the core physical unit operation status attribute value of the CPU is the last bit;
[0097] If so, determine whether there are any remaining CPUs in the server system; if not, move one bit backward according to the bit value and parse the next bit value of the current bit value of the core physical unit running status attribute value of the CPU in turn.
[0098] The determining whether there are any remaining CPUs in the server system includes:
[0099] Determining whether the first CPU is the last CPU in the server system;
[0100] If yes, the process ends; if no, the core physical unit running state attribute value of the next CPU is obtained, and the running state of each core physical unit of the next CPU is controlled according to the core physical unit running state attribute value of the next CPU.
[0101] Step S032: Control the running number of the core physical units of the CPU according to the running number attribute value of the core physical units of the CPU.
[0102] Step S032 also includes:
[0103] Step S0321, determining whether the core physical unit running quantity attribute value of the CPU has changed;
[0104] The judging whether the core physical unit running quantity attribute value of the CPU changes includes:
[0105] Determine whether the core physical unit running quantity attribute value of the CPU is consistent with the second threshold;
[0106] If so, the running number of core physical units of the CPU is maintained; if not, some core physical units of the CPU are disabled according to the attribute value of the running number of core physical units of the CPU.
[0107] Specifically, after obtaining the core physical unit running number attribute value (CORE_NUMBER_CONTROL) of the first CPU, it is determined whether the attribute value has changed. If the core physical unit running number attribute value of the CPU has changed, some core physical units of the CPU are disabled according to the core physical unit running number attribute value of the CPU, and the maximum running number of COREs of the CPU is controlled.
[0108] Step S0322, determining whether there are any remaining CPUs in the server system;
[0109] If so, obtain the core physical unit running quantity attribute value of the remaining CPU, and control the running quantity of the core physical units of the remaining CPU according to the core physical unit running quantity attribute value of the remaining CPU; if not, end the process.
[0110] Specifically, determining whether the CPU is the last CPU in the server system;
[0111] If so, the process ends; if not, the core physical unit running quantity attribute value of the next CPU is obtained, and the maximum running quantity of the core physical units of the next CPU is controlled according to the core physical unit running quantity attribute value of the next CPU.
[0112] like Figure 4 The figure shows a specific flow chart of the CPU running state control method. The present invention adds the core physical unit running state attribute and the core physical unit running number attribute of the CPU to the CPU, controls the running state of each core physical unit of the CPU according to the core physical unit running state attribute value of the CPU, and controls the running number of the core physical units of the CPU according to the core physical unit running number attribute value of the CPU. It mainly includes: adding the core physical unit running state attribute and the core physical unit running number attribute of the CPU to the CPU; in the process of starting up the server, obtaining the core physical unit running state attribute value and the core physical unit running number attribute value of the CPU, and setting the initial attribute value of the core physical unit running state of the CPU to a first threshold value, and setting the initial attribute value of the core physical unit running number of the CPU to a second threshold value; judging whether the core physical unit running state attribute value of the CPU is consistent with the first threshold value; judging whether the core physical unit running number attribute value of the CPU is consistent with the second threshold value, if they are consistent, the running state of the CPU is not modified; otherwise, according to the updated core physical unit running state attribute value and the core physical unit running number attribute value of the CPU, the running state of the CPU is modified. The modification of the running state of the CPU includes:
[0113] Controlling the operating state of each core physical unit of the CPU according to the core physical unit operating state attribute value of the CPU;
[0114] The running number of the core physical units of the CPU is controlled according to the running number attribute value of the core physical units of the CPU; through the above two steps, the running state of each CPU of the server system currently including multiple CPUs is finally controlled.
[0115] The method for controlling the CPU operating state provided in the embodiment of the present invention may be improved and optimized without departing from the technical solution of the present invention, and these improvements and optimizations should also be regarded as within the protection scope of the present invention.
[0116] The embodiment of the present invention provides a method for controlling the running state of a CPU. The technical solution provided in the embodiment of the present invention is applied to a server system, wherein the server system includes several CPUs, and the CPU includes several core physical units. The method includes: obtaining the core physical unit running state attribute value and the core physical unit running quantity attribute value of the CPU; and controlling the running state of the CPU according to the core physical unit running state attribute value and the core physical unit running quantity attribute value of the CPU. The technical solution of the present invention can accurately control the running state of each CPU in a server system including multiple CPUs without changing the server system startup image. In an actual production environment, the server can be in a state where it can run stably and overclock, thereby meeting special production requirements.
[0117] Embodiment 3
[0118] The present invention provides a CPU operation state control device, such as Figure 5 As shown, the device includes a pre-processing module, an acquisition module, and a control module.
[0119] In this embodiment, the pre-processing module is used to add a core physical unit operation state attribute and a core physical unit operation quantity attribute of the CPU to the CPU;
[0120] and setting the initial attribute value of the core physical unit operation state of the CPU to a first threshold, and setting the initial attribute value of the core physical unit operation quantity of the CPU to a second threshold;
[0121] The acquisition module is used to obtain the core physical unit operation state attribute value and the core physical unit operation quantity attribute value of the CPU;
[0122] The control module is used to control the operating state of the CPU according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU.
[0123] Further, the control module is used to control the running state of each core physical unit of the CPU according to the running state attribute value of the core physical unit of the CPU;
[0124] The running number of the core physical units of the CPU is controlled according to the running number attribute value of the core physical units of the CPU.
[0125] Furthermore, the control module is further configured to determine whether the core physical unit operation state attribute value of the CPU is consistent with the first threshold value;
[0126] If yes, the process ends; if no, the core physical unit operation status attribute value of the CPU is parsed according to the bit value;
[0127] The bitwise analysis of the core physical unit operation status attribute value of the CPU includes:
[0128] Determine whether a current bit value of the core physical unit operation status attribute value of the CPU is a third threshold;
[0129] If so, the core physical unit corresponding to the current bit value of the core physical unit running status attribute value of the CPU is disabled; if not, the state of the core physical unit corresponding to the current bit value of the core physical unit running status attribute value of the CPU is maintained.
[0130] Furthermore, the control module is also used to determine whether the current bit value of the core physical unit operation status attribute value of the CPU is the last bit;
[0131] If yes, determine whether there are any remaining CPUs in the server system; if no, analyze the next bit value of the current bit value of the core physical unit running status attribute value of the CPU in sequence;
[0132] The determining whether there are any remaining CPUs in the server system includes:
[0133] Determine whether there is any remaining CPU in the server system;
[0134] If so, obtain the core physical unit operating status attribute value of the remaining CPU, and control the operating status of each core physical unit of the remaining CPU according to the core physical unit operating status attribute value of the remaining CPU; if not, end the process.
[0135] Further, the control module is used to determine whether the core physical unit running quantity attribute value of the CPU has changed;
[0136] The judging whether the core physical unit running quantity attribute value of the CPU changes includes:
[0137] Determine whether the core physical unit running quantity attribute value of the CPU is consistent with the second threshold;
[0138] If so, the running number of core physical units of the CPU is maintained; if not, some core physical units of the CPU are disabled according to the attribute value of the running number of core physical units of the CPU.
[0139] Furthermore, the control module is also used to determine whether there are any remaining CPUs in the server system;
[0140] If so, obtain the core physical unit running quantity attribute value of the remaining CPU, and control the running quantity of the core physical units of the remaining CPU according to the core physical unit running quantity attribute value of the remaining CPU; if not, end the process.
[0141] The technical solution provided by the embodiment of the present invention has the following beneficial effects:
[0142] The technical solution provided by the embodiment of the present invention can achieve precise control over the operating status of each core physical unit under the CPU and the operating number of the core physical units in a server system including multiple CPUs, so that the server can be in a state of stable operation and overclocking.
[0143] Embodiment 4
[0144] The present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following method for controlling the CPU operating state can be executed:
[0145] Obtaining a core physical unit operation state attribute value and a core physical unit operation quantity attribute value of the CPU;
[0146] The operating state of the CPU is controlled according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU.
[0147] The technical solution provided by the embodiment of the present invention has the following beneficial effects:
[0148] The technical solution provided by the embodiment of the present invention can accurately control the operating status of each CPU in a server system including multiple CPUs without changing the server system startup image. In an actual production environment, the server can be in a state where it can run stably and overclock, thereby meeting special production needs.
[0149] Embodiment 5
[0150] The present invention provides a computer storage medium, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0151] Obtaining a core physical unit operation state attribute value and a core physical unit operation quantity attribute value of the CPU;
[0152] The operating state of the CPU is controlled according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU.
[0153] Furthermore, before obtaining the core physical unit operation state attribute value and the core physical unit operation quantity attribute value of the CPU, the method further includes:
[0154] Adding a core physical unit operation state attribute and a core physical unit operation quantity attribute of the CPU to the CPU;
[0155] The initial attribute value of the running state of the core physical unit of the CPU is set to a first threshold, and the initial attribute value of the running number of the core physical units of the CPU is set to a second threshold.
[0156] Further, controlling the operating state of the CPU according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU includes:
[0157] Controlling the operating state of each core physical unit of the CPU according to the core physical unit operating state attribute value of the CPU;
[0158] The running number of the core physical units of the CPU is controlled according to the running number attribute value of the core physical units of the CPU.
[0159] Further, controlling the operating state of each core physical unit of the CPU according to the core physical unit operating state attribute value of the CPU includes:
[0160] Determine whether the core physical unit operation state attribute value of the CPU is consistent with the first threshold;
[0161] If yes, the process ends; if no, the core physical unit operation status attribute value of the CPU is parsed according to the bit value;
[0162] The bitwise analysis of the core physical unit operation status attribute value of the CPU includes:
[0163] Determine whether a current bit value of the core physical unit operation status attribute value of the CPU is a third threshold;
[0164] If so, the core physical unit corresponding to the current bit value of the core physical unit running status attribute value of the CPU is disabled; if not, the state of the core physical unit corresponding to the current bit value of the core physical unit running status attribute value of the CPU is maintained.
[0165] Further, after parsing the core physical unit operation status attribute value of the CPU by bit value, it includes:
[0166] Determine whether the current bit value of the core physical unit operation status attribute value of the CPU is the last bit;
[0167] If yes, determine whether there are any remaining CPUs in the server system; if no, analyze the next bit value of the current bit value of the core physical unit running status attribute value of the CPU in sequence;
[0168] The determining whether there are any remaining CPUs in the server system includes:
[0169] Determine whether there is any remaining CPU in the server system;
[0170] If so, obtain the core physical unit operating status attribute value of the remaining CPU, and control the operating status of each core physical unit of the remaining CPU according to the core physical unit operating status attribute value of the remaining CPU; if not, end the process.
[0171] Further, controlling the running number of the core physical units of the CPU according to the running number attribute value of the core physical units of the CPU includes:
[0172] Determining whether the core physical unit running quantity attribute value of the CPU has changed;
[0173] The judging whether the core physical unit running quantity attribute value of the CPU changes includes:
[0174] Determine whether the core physical unit running quantity attribute value of the CPU is consistent with the second threshold;
[0175] If so, the running number of core physical units of the CPU is maintained; if not, some core physical units of the CPU are disabled according to the attribute value of the running number of core physical units of the CPU.
[0176] Further, after determining whether the core physical unit running quantity attribute value of the CPU has changed, the method further comprises:
[0177] Determine whether there is any remaining CPU in the server system;
[0178] If so, obtain the core physical unit running quantity attribute value of the remaining CPU, and control the running quantity of the core physical units of the remaining CPU according to the core physical unit running quantity attribute value of the remaining CPU; if not, end the process.
[0179] Figure 6 An exemplary system provided for Embodiment 5 of the present invention that can be used to implement various embodiments described in this application;
[0180] like Figure 6As shown, in some embodiments, the system can be used as any of the above-mentioned devices for CPU operation state control in each of the embodiments. In some embodiments, the system may include one or more computer-readable media (e.g., system memory or NVM / storage device) having results and one or more processors (e.g., (one or more) processors) coupled to the one or more computer-readable media and configured to execute the results to implement the module to perform the actions described in this application.
[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by computer programs and related hardware. The above-mentioned computer programs can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0182] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0183] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A CPU operation state control method, It is characterized in that The method is applied to a server system, the server system includes a plurality of CPUs, the CPU includes a plurality of core physical units, and the method includes: Adding a core physical unit running state attribute and a core physical unit running quantity attribute to the CPU; setting an initial attribute value of the core physical unit running state of the CPU to a first threshold, and setting an initial attribute value of the core physical unit running quantity of the CPU to a second threshold; Obtaining a core physical unit operation state attribute value and a core physical unit operation quantity attribute value of the CPU; Controlling the running state of the CPU according to the core physical unit running state attribute value and the core physical unit running quantity attribute value of the CPU, specifically comprising: controlling the running state of each core physical unit of the CPU according to the core physical unit running state attribute value of the CPU; controlling the running quantity of the core physical units of the CPU according to the core physical unit running quantity attribute value of the CPU; Among them, the controlling the running state of each core physical unit of the CPU according to the running state attribute value of the core physical unit of the CPU includes: judging whether the running state attribute value of the core physical unit of the CPU is consistent with the first threshold value; if so, ending the process; if not, parsing the running state attribute value of the core physical unit of the CPU according to the bit value; the parsing of the running state attribute value of the core physical unit of the CPU according to the bit value includes: judging whether the current bit value of the running state attribute value of the core physical unit of the CPU is a third threshold value; if so, disabling the core physical unit corresponding to the current bit value of the running state attribute value of the core physical unit of the CPU; if not, maintaining the state of the core physical unit corresponding to the current bit value of the running state attribute value of the core physical unit of the CPU; Among them, the controlling the running number of core physical units of the CPU according to the core physical unit running number attribute value of the CPU includes: judging whether the core physical unit running number attribute value of the CPU has changed; the judging whether the core physical unit running number attribute value of the CPU has changed includes: judging whether the core physical unit running number attribute value of the CPU is consistent with the second threshold; if so, maintaining the running number of core physical units of the CPU; if not, disabling some core physical units of the CPU according to the core physical unit running number attribute value of the CPU.
2. The CPU operation state control method according to claim 1, It is characterized in that After the bitwise value is parsed for the core physical unit running state attribute value of the CPU, the method includes: Determine whether the current bit value of the core physical unit operation status attribute value of the CPU is the last bit; If yes, determine whether there are any remaining CPUs in the server system; if no, analyze the next bit value of the current bit value of the core physical unit running status attribute value of the CPU in sequence; The determining whether there are any remaining CPUs in the server system includes: Determine whether there is any remaining CPU in the server system; If so, obtain the core physical unit operating status attribute value of the remaining CPU, and control the operating status of each core physical unit of the remaining CPU according to the core physical unit operating status attribute value of the remaining CPU; if not, end the process.
3. The CPU operation state control method according to claim 1, It is characterized in that After determining whether the core physical unit running quantity attribute value of the CPU has changed, the method further comprises: Determine whether there is any remaining CPU in the server system; If so, obtain the core physical unit running quantity attribute value of the remaining CPU, and control the running quantity of the core physical units of the remaining CPU according to the core physical unit running quantity attribute value of the remaining CPU; if not, end the process.
4. A CPU operation state control device based on the method according to any one of claims 1 to 3, It is characterized in that The device comprises: An acquisition module, used to acquire a core physical unit operation state attribute value and a core physical unit operation quantity attribute value of the CPU; The control module is used to control the operating state of the CPU according to the core physical unit operating state attribute value and the core physical unit operating quantity attribute value of the CPU.
5. A computer device comprising a memory, a processor and a computer program stored in the memory, It is characterized in that The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 3.
6. A computer storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a memory, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Central processing unit control method and mobile terminal
CN106293908A
Multi-core processor control method and device, electronic equipment and storage medium
CN110764605A
