Method and device for adjusting opening and closing states of processor core
By setting the address bits in the BIOS firmware carrier and using the I2C/SPI interface to adjust the processor core status, the problem of high power consumption and complex adjustment of domestic processors is solved, and flexible adjustment and energy saving effects are achieved.
Patent Information
- Application Number
- CN202410880654.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-25
AI Technical Summary
Domestic processors have high power consumption under the same computing power, and existing technology makes it difficult to flexibly adjust the opening and closing status of the processor core, making the operation complex and time-consuming.
By setting multiple address bits in the BIOS firmware carrier to indicate the opening and closing status of the processor core, and using the I2C bus and SPI interface, the user can input the opening and closing status adjustment target, generate decoded data and write it into the corresponding address bits to enable processing The server adjusts core state on reboot.
It realizes flexible adjustment of the processor core status, reduces operation complexity and time cost, can be completed without returning to the factory, and effectively reduces power consumption and noise pollution.
Smart Images

Figure CN118838652A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a method and device for adjusting the on / off state of a processor core. Background Art
[0002] Domestic processors are relatively backward in technology compared to foreign processors. Under the same computing power, the power consumption is relatively high. Domestic processors are composed of multiple cores. When the server motherboard leaves the factory, all the cores of the processor are already set to the on state. If the user needs to adjust the on and off state of the core, they need to contact the manufacturer, and the manufacturer will re-customize a special version of the BIOS program and re-write it. Not only is the operation complicated and time-consuming, but the flexibility is poor. Summary of the invention
[0003] The present invention provides a method and device for adjusting the on / off state of a processor core. The technical solution is as follows:
[0004] In one aspect, a method for adjusting a processor core on / off state is provided, the method comprising:
[0005] Obtaining the on / off state adjustment target input by the user for the processor core;
[0006] Determine the decoded data according to the on / off state adjustment target and the set decoding rule; the decoded data is a multi-bit value, the number of bits of the decoded data is equal to the total number of processor cores, and the multi-bit value corresponds one-to-one to the multiple cores of the processor; the value in the decoded data is used to indicate whether the corresponding core is on or off;
[0007] The value of each bit of the decoded data is written into the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, so that the processor adjusts the opening and closing state of the corresponding core according to the value of the address bit in the BIOS firmware carrier during the server restart process.
[0008] In a possible implementation, the mainboard of the server includes a processor, a complex programmable logic device (CPLD) and a BIOS firmware carrier; the processor is connected to the BIOS firmware carrier via a serial peripheral SPI interface, the BIOS firmware carrier is connected to the CPLD via an SPI interface, and the processor is connected to the CPLD via an I2C bus;
[0009] The method of obtaining the on / off state adjustment target input by the user for the processor core comprises: the processor receives the on / off state adjustment target input by the user for the processor core, and writes the on / off state adjustment target into a designated register of the CPLD by using the I2C tool by calling an I2C tool in the operating system, so that the CPLD, when determining that new data is written into the designated register, executes the method of determining the decoded data according to the on / off state adjustment target and the set decoding rule.
[0010] In a possible implementation, the server includes a dual-path processor, and the two processors correspond to two BIOS firmware carriers one by one;
[0011] The processor connected to the CPLD via the I2C bus is a main processor, and the acquisition of the on / off state adjustment target input by the user for the processor core is performed by the main processor;
[0012] The number of the designated registers is two, and the two designated registers correspond to the two processors one-to-one.
[0013] In a possible implementation, the on / off state adjustment target is the number of cores turned on;
[0014] The step of adjusting the target according to the opening and closing state and setting the decoding rule to determine the decoding data includes:
[0015] Randomly determine a plurality of target cores equal to the enabled number from the plurality of cores of the processor;
[0016] Determining a target address bit of the target core;
[0017] The number of bits corresponding to the target address bits in the decoded data is decoded into a value indicating opening, and the other number of bits in the decoded data is decoded into a value indicating closing, so as to obtain decoded data.
[0018] In a possible implementation, after writing the value of each bit of the decoded data into the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, the method further includes:
[0019] Read the data on the address bit corresponding to the processor core in the BIOS firmware carrier, compare the read data with the decoded data, and if the data are consistent, determine that the writing is successful, and set the write mark position at the preset position to the write success state.
[0020] In a possible implementation, the method further includes:
[0021] When the set time is reached after the on / off state adjustment target input by the user for the processor core is obtained, the state of the write flag is read, and the user is prompted through a pop-up window on the display screen according to the state of the write flag.
[0022] In a possible implementation, the method further includes:
[0023] If the state of the write flag is a write success state, after prompting the user through a pop-up window on a display screen according to the state of the write flag, the state of the write flag is updated to a default state.
[0024] On the other hand, a device for adjusting the on / off state of a processor core is provided, the device comprising:
[0025] An acquisition unit, used for acquiring an on / off state adjustment target input by a user for a processor core;
[0026] a determination unit, configured to determine decoded data according to the on / off state adjustment target and the set decoding rule; the decoded data is a multi-bit value, the number of bits of the decoded data is equal to the total number of processor cores, and the multi-bit value corresponds one-to-one to the multiple cores of the processor; the value in the decoded data is used to indicate whether the corresponding core is on or off;
[0027] The writing unit is used to write the value of each bit of the decoded data into the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, so that the processor adjusts the opening and closing state of the corresponding core according to the value of the address bit in the BIOS firmware carrier during the server restart process.
[0028] On the other hand, a computer device is provided, which includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of the above-mentioned method for adjusting the on / off state of the processor core.
[0029] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned method for adjusting the on / off state of the processor core are implemented.
[0030] On the other hand, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the above-mentioned method for adjusting the on / off state of a processor core are implemented.
[0031] The technical solution provided by the present invention can at least bring the following beneficial effects:
[0032] Since some of the multiple address bits in the BIOS firmware carrier are used to indicate the on / off state of the processor core through the numerical value on the address bit, an input interface can be provided on the display screen at the operating system level, and the user can use the input interface to input the on / off state adjustment target for the processor core, thereby determining the decoded data using the on / off state adjustment target and setting the decoding rules, and the numerical value in the decoded data is used to indicate whether the corresponding core is on or off, and the numerical value on each bit of the decoded data is written to the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, and during the server restart process, the processor can adjust the on / off state of the corresponding core according to the numerical value on the address bit in the BIOS firmware carrier, thereby realizing flexible adjustment of the on / off state of the processor core. With this solution, the user can flexibly adjust the on / off state of the processor core according to the workload of the server, which is not only simple to operate, but can also be achieved without returning to the factory, reducing time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 It is a flow chart of a method for adjusting the on / off state of a processor core provided by an embodiment of the present invention;
[0035] Figure 2 This is a schematic diagram of the structure of a server mainboard provided by an embodiment of the present invention;
[0036] Figure 3 It is a schematic diagram of an operation interface for adjusting the on / off state of a processor core provided by an embodiment of the present invention;
[0037] Figure 4 The present invention is a structural diagram of a processor core on / off state adjustment device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in 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.
[0039] As mentioned above, in the related art, if the on / off state of the processor core needs to be adjusted, a special version of the BIOS program needs to be re-customized according to the scenario and re-written to achieve it.
[0040] Based on the above problems, the inventive concept of the present invention is to find out the part of address bits in the multiple address bits in the BIOS firmware carrier that are used to indicate the on and off status of the processor core through the numerical values on the address bits, and adjust the on and off status of the core by modifying the numerical values of this part of address bits in the BIOS firmware carrier.
[0041] The specific implementation of the above concept is described below.
[0042] Please refer to Figure 1 , an embodiment of the present invention provides a method for adjusting the on / off state of a processor core, the method comprising:
[0043] Step 100, obtaining an on / off state adjustment target input by a user for a processor core;
[0044] Step 102, determining decoded data according to the on / off state adjustment target and the set decoding rule; the decoded data is a multi-bit value, the number of bits of the decoded data is equal to the total number of processor cores, and the multi-bit value corresponds one-to-one to the multiple cores of the processor; the value in the decoded data is used to indicate whether the corresponding core is on or off;
[0045] Step 104, write the value of each bit of the decoded data into the address bit of the corresponding core in the BIOS firmware carrier of the processor, so that the processor adjusts the on / off state of the corresponding core according to the value of the address bit in the BIOS firmware carrier during the server restart process.
[0046] In the embodiment of the present invention, since some of the multiple address bits in the BIOS firmware carrier are used to indicate the on / off state of the processor core through the numerical value on the address bit, an input interface can be provided on the display screen at the operating system level, and the user can use the input interface to input the on / off state adjustment target for the processor core, thereby the on / off state adjustment target and the setting decoding rules can be used to determine the decoded data, the numerical value in the decoded data is used to indicate the opening or closing of the corresponding core, and the numerical value on each bit of the decoded data is written to the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, and during the server restart process, the processor can adjust the on / off state of the corresponding core according to the numerical value on the address bit in the BIOS firmware carrier, thereby realizing the flexible adjustment of the on / off state of the processor core. In this solution, the user can flexibly adjust the on / off state of the processor core according to the recent server workload, which is not only simple to operate, but also can be achieved without returning to the factory, reducing the time cost.
[0047] Described below Figure 1 How the various steps are performed.
[0048] First, with respect to step 100 , an on / off state adjustment target input by a user for a processor core is obtained.
[0049] The processor in the server is a multi-core design. When shipped from the factory, all cores of the processor are turned on. The more cores that are turned on, the faster the processing speed. However, as long as the core is turned on, even if the core is not performing computing work, the core that is turned on still consumes a certain amount of power. Since the workload of the server is different at different stages, when the workload is light, it is actually not necessary to turn on all cores at the same time. When the computing requirements are met, turning off some cores in the processor can effectively reduce power consumption and fan noise, and improve both energy saving and noise pollution.
[0050] Considering that users can determine the workload of the server in the future stage based on task scheduling, users can automatically adjust the on and off status of the processor core according to demand.
[0051] In the embodiment of the present invention, in order to enable the user to automatically adjust the on / off state of the processor core, the input of the on / off state adjustment target can be implemented through human-computer interaction. Specifically, at the operating system level, an operation interface can be provided on the display screen, and the operation interface includes an input interface, and the user can manually input the on / off state adjustment target through the input interface in the operation interface.
[0052] In the embodiment of the present invention, the open / close state adjustment target can be embodied in at least two forms:
[0053] The first embodiment is: the opening and closing state adjustment target is the number of core openings;
[0054] In the first embodiment, the user inputs the number of cores to be enabled for the processor. Assuming that in the embodiment of the present invention, the number of cores of the processor is 64, the number of cores to be enabled that the user can input is no more than 64, for example, 14.
[0055] The second embodiment is that the on / off state adjustment target is to turn on a number of designated cores and turn off other cores.
[0056] In the second embodiment, the user specifies a number of cores to be turned on and the other cores to be turned off. For example, if the number of cores of a processor is 64, in a specific implementation, the 64 cores of the processor can be displayed in the operation interface, and each core has a state selection button for the on state and the off state, and each core state selection button can only select one state, that is, the on state or the off state. The user selects the corresponding state for each core of the processor, so as to specify a number of cores to be turned on and the other cores to be turned off.
[0057] In this way, by providing an operation interface on a display screen and providing an input interface in the operation interface, the on / off state adjustment target input by the user for the processor core can be obtained.
[0058] In the embodiment of the present invention, the method for adjusting the on / off state of the processor core is applied to domestic servers, please refer to Figure 2 The motherboard of the domestic server includes a processor, a complex programmable logic device CPLD and a BIOS firmware carrier; the processor is connected to the BIOS firmware carrier through a serial peripheral SPI interface, the BIOS firmware carrier is connected to the CPLD through an SPI interface, and the processor is connected to the CPLD through an I2C bus; in one embodiment, the processor is a Shenwei processor.
[0059] In one implementation of the present invention, the method for adjusting the on / off state of the processor core is completely executed by the processor, that is, steps 100 to 104 are all executed by the processor.
[0060] In another implementation of the present invention, the method for adjusting the on / off state of the processor core is jointly executed by the processor and the CPLD. Then, in step 100, obtaining the on / off state adjustment target input by the user for the processor core may specifically include: the processor receives the on / off state adjustment target input by the user for the processor core, and writes the on / off state adjustment target into the designated register of the CPLD by calling the i2c tool in the operating system, so that the CPLD executes step 102 when determining that new data is written into the designated register. In this implementation, step 100 is executed by the processor, and steps 102 and 104 are executed by the CPLD.
[0061] Compared with the execution of step 102 and step 104 by the processor, the advantage of executing them by CPLD is that the processor manufacturer will not fully disclose some of its internal information to the system manufacturer and users, and it is very difficult to directly call the internal resources of the processor. CPLD is completely programmed by the system manufacturer, and its resource scheduling will be simpler.
[0062] Further, in the embodiment of the present invention, the server may include a dual-channel processor, and the two processors correspond to two BIOS firmware carriers one by one. Figure 2 ;
[0063] The processor connected to the CPLD via the I2C bus is a main processor, and the acquisition of the on / off state adjustment target input by the user for the processor core is performed by the main processor;
[0064] Then, the number of designated registers is two, and the two designated registers correspond one-to-one to the two processors.
[0065] Take a dual-channel processor as an example, and the on / off state adjustment target is implemented in the first form, and the processor and CPLD jointly execute this method, then, two registers (register and register 2) are pre-configured in the CPLD, the addresses of the two registers are 0x11 and 0x12 respectively, each register can include 256 bits, the two registers correspond to the two processors one by one, and the registers are used to store the on / off state adjustment targets of the corresponding processors. Users can input the number of cores turned on through the operation interface provided by the processor core on / off state adjustment tool. For example, the number of cores turned on for processor 1 and processor 2 is 14, please refer to Figure 3 , which is a schematic diagram of the operation interface. After receiving the number of cores to be enabled input by the user, the main processor can call the I2C tool to write 0x14 to register 1 and register 2 in the CPLD through the I2C bus. 0x14 is used to indicate that the processor has 14 cores enabled.
[0066] Then, step 102 and step 104 are described simultaneously.
[0067] In order to achieve flexible configuration of the on / off state of the processor core, it is necessary to determine the address bits used to indicate the on / off state of the processor core and what numerical values are used on the address bits to characterize the on / off state and the off / on state. In an embodiment of the present invention, the data used to indicate the on / off state of the processor core is located on multiple address bits of the BIOS firmware carrier, and the multiple address bits correspond one-to-one to the multiple cores of the processor. Among them, the multiple address bits can be known, for example, when designing, the manufacturer specifies the data on these address bits to indicate the on / off state of the processor core. For the Shenwei processor, it is assumed that these address bits are "000***00 to 00***1F", and each address bit indicates the on / off state of the corresponding core through 4 bytes of data. Assuming that the address bit indicates that the core is closed by the numerical value 0, and the numerical value f or the numerical value 1 indicates that the core is open, then the on / off state adjustment of the corresponding core can be achieved by modifying the numerical value on the corresponding address bit.
[0068] It can be understood that the decoded data is data including multi-bit values, the number of bits of the decoded data is equal to the total number of processor cores, and the multi-bit values correspond one-to-one to the multiple cores of the processor; the values in the decoded data are used to indicate whether the corresponding core is turned on or off.
[0069] In one embodiment of the present invention, when the on / off state adjustment target is implemented using the first embodiment described above, then this step 102 may include: randomly determining a plurality of target cores equal to the number of on-states from a plurality of cores of the processor; determining the target address bits of the target cores; decoding the number of bits in the decoded data corresponding to the target address bits into a value indicating on-state, and decoding the other number of bits in the decoded data into a value indicating off-state, to obtain decoded data.
[0070] In another embodiment of the present invention, when the opening and closing state adjustment target is implemented using the second embodiment described above, then this step 102 may include: determining a number of designated cores input by the user indicating opening; determining designated address bits of the designated cores, decoding the bits corresponding to the designated address bits in the decoded data into a value indicating opening, and decoding the other bits in the decoded data into a value indicating closing, to obtain decoded data.
[0071] Taking the case where a processor has 14 cores enabled as an example, assuming that the cores to be enabled are the 1st to 14th cores, the decoded data may be: ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 00. It can be seen that the decoded data includes a total of 64 bits of value, the values of the 1st to 14th bits are all f, indicating that the 1st to 14th cores are enabled, and the values of the 15th to 64th bits in the decoded data are all 0, indicating that the 15th to 64th cores are disabled.
[0072] After obtaining the decoded data, the value of each bit of the decoded data is written into the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor. After writing, the server can be restarted. During the restart process, the processor will read the value of the corresponding address bit in the corresponding BIOS firmware carrier, and turn on the core indicated by the value according to the indication of the value, and turn off the core indicated by the value, thereby completing the adjustment of the core opening and closing status.
[0073] It should be noted that if the server includes a dual-channel processor, it is necessary to determine corresponding decoding data for the on / off state adjustment targets in the two registers, and write the obtained two decoding data into the BIOS firmware carrier connected to the corresponding processor.
[0074] In order to verify whether the decoded data is successfully written to the corresponding address bit in the BIOS firmware carrier, in an embodiment of the present invention, after writing the numerical value of each bit of the decoded data to the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, the data at the address bit corresponding to the processor core in the BIOS firmware carrier can be read, and the read data is compared with the decoded data. If the data is consistent, it is determined that the writing is successful, and the write flag position at the preset position is set to the write success status.
[0075] Among them, the write flag has a default state, which can be a write failure state or another default state. Assume that the write success state is represented by "1", the write failure state is represented by "0", and the default state is represented by the write failure state, that is, the write flag is 0 in the default state. If the comparison result is that the data is consistent, indicating that the write is successful, the value on the write flag can be modified to 1. If the comparison result is that the data is inconsistent, indicating that the write is unsuccessful, the value on the write flag can be left unchanged, and this is the default state. When the write flag is set to the write success state, the restart function can be triggered to restart the server.
[0076] In one embodiment of the present invention, the user can be prompted whether the writing is successful to inform the user of the current writing status. Then, when the set time is reached after the user obtains the on and off state adjustment target input by the processor core, the state of the write flag is read, and the user is prompted through a pop-up window on the display screen according to the state of the write flag.
[0077] Under normal circumstances, the set time is sufficient to complete a write and verification operation, for example, the set time is 3 seconds. When the set time is reached, no matter the write flag is in a write success state or a write failure state, the state of the write flag (write success state or write failure state) can be prompted to the user through a pop-up window on the display screen.
[0078] Furthermore, if the writing is successful this time, in order to be able to use the write flag to verify whether the decoded data is written successfully next time, after prompting the user through a pop-up window on the display screen based on the status of the write flag, the status of the write flag is updated to the default status, so that the default status can be modified after the next write is successful.
[0079] Furthermore, if the writing is successful, the user is prompted by a pop-up window on the display screen and the state of the write flag is updated to the default state, and then the user can be prompted whether to restart the server. Specifically, the server can be restarted manually or automatically. For example, the user is prompted to automatically restart the server after a period of time (such as 30 seconds), or the user directly determines the current time to enter the server restart.
[0080] During the server restart process, the processor will read the value at the corresponding address bit of the BIOS firmware carrier to determine the server configuration information and turn on / off the corresponding core according to the value.
[0081] In the embodiment of the present invention, through testing, when 14 cores in the processor are turned on, the processor power consumption is 150W, when all 64 cores are turned on, the processor power consumption is 300W, and the fan speed is reduced from 9000 rpm to 5500 rpm, and the noise is reduced from 90 decibels to 65 decibels. It can be seen that by reducing the number of cores turned on, the processor power consumption can be reduced, and the fan speed and noise can be reduced.
[0082] Please refer to Figure 4 , an embodiment of the present invention provides a device for adjusting the on / off state of a processor core, the device comprising:
[0083] An acquisition unit 400 is used to acquire an on / off state adjustment target input by a user for a processor core;
[0084] A determination unit 402 is used to determine decoded data according to the on / off state adjustment target and the set decoding rule; the decoded data is a multi-bit value, the number of bits of the decoded data is equal to the total number of processor cores, and the multi-bit value corresponds to the multiple cores of the processor one by one; the value in the decoded data is used to indicate whether the corresponding core is turned on or off;
[0085] The writing unit 404 is used to write the value of each bit of the decoded data into the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, so that the processor adjusts the opening and closing state of the corresponding core according to the value of the address bit in the BIOS firmware carrier during the server restart process.
[0086] In one embodiment of the present invention, the mainboard of the server includes a processor, a complex programmable logic device CPLD and a BIOS firmware carrier; the processor is connected to the BIOS firmware carrier via a serial peripheral SPI interface, the BIOS firmware carrier is connected to the CPLD via an SPI interface, and the processor is connected to the CPLD via an I2C bus;
[0087] The acquisition unit is located in a processor, and the determination unit and the writing unit are both located in a CPLD;
[0088] The processor utilizes the acquisition unit to receive the on / off state adjustment target input by the user for the processor core, and writes the on / off state adjustment target into the designated register of the CPLD by using the I2C tool by calling the I2C tool in the operating system, so that the CPLD utilizes the determination unit to execute the decoding data determined according to the on / off state adjustment target and the set decoding rules when determining that new data is written into the designated register.
[0089] In one embodiment of the present invention, the server includes a dual-path processor, and the two processors correspond to two BIOS firmware carriers one by one;
[0090] The processor connected to the CPLD via the I2C bus is a main processor, and the acquisition of the on / off state adjustment target input by the user for the processor core is performed by the main processor;
[0091] The number of the designated registers is two, and the two designated registers correspond to the two processors one-to-one.
[0092] In one embodiment of the present invention, the on / off state adjustment target is the number of cores turned on;
[0093] The determination unit is specifically used to: randomly determine a plurality of target cores equal to the number of cores to be turned on from a plurality of cores of the processor; determine the target address bits of the target cores; decode the number of bits in the decoded data corresponding to the target address bits into a value indicating turning on, and decode the other number of bits in the decoded data into a value indicating turning off, to obtain decoded data.
[0094] In one embodiment of the present invention, the processor core on / off state adjustment device may further include:
[0095] A reading unit is used to read the data on the address bit corresponding to the processor core in the BIOS firmware carrier after writing the numerical value on each bit of the decoded data into the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, and compare the read data with the decoded data. If the data are consistent, it is determined that the writing is successful, and the write mark position at the preset position is in the write success state.
[0096] In one embodiment of the present invention, the processor core on / off state adjustment device may further include:
[0097] The prompting unit is used to read the state of the write flag bit when the set time is reached after the on / off state adjustment target input by the user for the processor core is obtained, and prompt the user through a pop-up window on the display screen according to the state of the write flag bit.
[0098] In one embodiment of the present invention, the processor core on / off state adjustment device may further include:
[0099] The updating unit is used for, when determining that the state of the write flag is a write success state, updating the state of the write flag to a default state after prompting the user through a pop-up window on a display screen according to the state of the write flag.
[0100] It should be noted that: the processor core on-off state adjustment device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the processor core on-off state adjustment device provided in the above embodiment and the processor core on-off state adjustment method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0101] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the processor core on / off state adjustment method provided in the above-mentioned method embodiments.
[0102] An embodiment of the present application also provides a computer device, which includes a processor, a CPLD and a memory, wherein the CPLD and the memory store at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set stored in the memory is loaded and executed by the processor, and the CPLD executes at least one instruction, at least one program, a code set or an instruction set stored in itself, so that the processor and the CPLD cooperate to implement the processor core on-off state adjustment method provided by the above-mentioned method embodiments.
[0103] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set can be loaded and executed by a processor to implement the processor core on-off state adjustment method provided in the above-mentioned method embodiments.
[0104] An embodiment of the present application also provides a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes any of the processor core on / off state adjustment methods described in the above embodiments.
[0105] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0106] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0107] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth 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 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 device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0108] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for adjusting the on / off state of a processor core, characterized in that: The method comprises: Obtaining the on / off state adjustment target input by the user for the processor core; Determine the decoded data according to the on / off state adjustment target and the set decoding rule; the decoded data is a multi-bit value, the number of bits of the decoded data is equal to the total number of processor cores, and the multi-bit value corresponds one-to-one to the multiple cores of the processor; the value in the decoded data is used to indicate whether the corresponding core is on or off; The value of each bit of the decoded data is written into the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, so that the processor adjusts the opening and closing state of the corresponding core according to the value of the address bit in the BIOS firmware carrier during the server restart process.
2. The method according to claim 1, characterized in that The mainboard of the server includes a processor, a complex programmable logic device CPLD and a BIOS firmware carrier; the processor is connected to the BIOS firmware carrier via a serial peripheral SPI interface, the BIOS firmware carrier is connected to the CPLD via an SPI interface, and the processor is connected to the CPLD via an I2C bus; The method of obtaining the on / off state adjustment target input by the user for the processor core comprises: the processor receives the on / off state adjustment target input by the user for the processor core, and writes the on / off state adjustment target into a designated register of the CPLD by using the I2C tool by calling an I2C tool in the operating system, so that the CPLD, when determining that new data is written into the designated register, executes the method of determining the decoded data according to the on / off state adjustment target and the set decoding rule.
3. The method according to claim 2, characterized in that The server includes a dual-channel processor, and the two processors correspond to two BIOS firmware carriers one by one; The processor connected to the CPLD via the I2C bus is a main processor, and the acquisition of the on / off state adjustment target input by the user for the processor core is performed by the main processor; The number of the designated registers is two, and the two designated registers correspond to the two processors one-to-one.
4. The method according to claim 1, characterized in that: The on / off state adjustment target is the number of cores that are on; The step of adjusting the target according to the opening and closing state and setting the decoding rule to determine the decoding data includes: Randomly determine a plurality of target cores equal to the enabled number from the plurality of cores of the processor; Determining a target address bit of the target core; The number of bits corresponding to the target address bits in the decoded data is decoded into a value indicating opening, and the other number of bits in the decoded data is decoded into a value indicating closing, so as to obtain decoded data.
5. The method according to claim 1, characterized in that After writing the value of each bit of the decoded data into the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, the method further includes: Read the data on the address bit corresponding to the processor core in the BIOS firmware carrier, compare the read data with the decoded data, and if the data are consistent, determine that the writing is successful, and set the write mark position at the preset position to the write success state.
6. The method according to claim 5, characterized in that Also includes: When the set time is reached after the on / off state adjustment target input by the user for the processor core is obtained, the state of the write flag is read, and the user is prompted through a pop-up window on the display screen according to the state of the write flag.
7. The method according to claim 6, characterized in that Also includes: If the state of the write flag is a write success state, after prompting the user through a pop-up window on a display screen according to the state of the write flag, the state of the write flag is updated to a default state.
8. A processor core on / off state adjustment device, characterized in that: The device comprises: An acquisition unit, used for acquiring an on / off state adjustment target input by a user for a processor core; a determination unit, configured to determine decoded data according to the on / off state adjustment target and the set decoding rule; the decoded data is a multi-bit value, the number of bits of the decoded data is equal to the total number of processor cores, and the multi-bit value corresponds one-to-one to the multiple cores of the processor; the value in the decoded data is used to indicate whether the corresponding core is on or off; The writing unit is used to write the value of each bit of the decoded data into the address bit of the corresponding core in the BIOS firmware carrier corresponding to the processor, so that the processor adjusts the opening and closing state of the corresponding core according to the value of the address bit in the BIOS firmware carrier during the server restart process.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of any one of the methods described in claims 1-7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.
