Solid-state hard disk power consumption control method, solid-state hard disk controller, and solid-state hard disk
By obtaining the average power consumption and available power consumption of a single I/O and combining it with the maximum I/O scheduling amount at a preset time granularity, the accuracy problem of SSD power consumption control is solved, and precise control of SSD power consumption and smooth I/O scheduling are achieved. It is suitable for IT infrastructure management of servers and data centers.
Patent Information
- Application Number
- CN202211065153.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-09-01
AI Technical Summary
Existing methods for controlling the power consumption of solid-state drives lack clear calculation logic and methods, and are unable to accurately control the power consumption of solid-state drives.
By obtaining the average power consumption of a single I/O, the available power consumption is calculated based on the power consumption limit of the solid-state drive, and the power consumption of the solid-state drive is controlled according to the maximum value of the I/O scheduling amount at a preset time granularity. The power consumption data provided by the power management chip of the solid-state drive itself is used for precise control.
It achieves precise control of solid-state drive power consumption, ensures the smoothness of I/O scheduling, reduces electricity bills and power distribution management costs, and is of great value to IT infrastructure management of servers and data centers.
Smart Images

Figure CN115373851B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of solid-state hard disks, and in particular to a solid-state hard disk power consumption control method, a solid-state hard disk controller, and a solid-state hard disk. Background Art
[0002] The main components of a solid-state drive include flash memory chips, a controller, DDR memory, a printed circuit board (PCB), and electronic devices such as capacitors and resistors. The power consumption of components other than the flash memory chips is generally relatively constant, with little variation between different operating modes. The flash memory chips contribute the vast majority of dynamic power consumption. Flash memory chip power consumption is proportional to the number of commands they need to execute, or in other words, to the overall I / O concurrency of the SSD.
[0003] Existing SSD power consumption control only has rough ideas, without clear and deducible calculation logic and principles, nor specific and practical power consumption calculation processes and methods, and cannot accurately control the power consumption of SSDs. Summary of the Invention
[0004] The embodiments of the present application mainly solve the technical problem of being unable to accurately control the power consumption of solid-state drives.
[0005] In order to solve the above technical problems, a technical solution adopted in the embodiment of the present application is: to provide a solid-state hard disk power consumption control method, applied to the solid-state hard disk, including: obtaining the average power consumption of a single I / O; obtaining the available power consumption of the solid-state hard disk based on the power consumption limit of the solid-state hard disk; calculating the maximum value of the I / O scheduling amount of a preset time granularity based on the average power consumption and the available power consumption; and controlling the power consumption of the solid-state hard disk based on the maximum value of the I / O scheduling amount of the preset time granularity.
[0006] Optionally, obtaining the average power consumption of a single I / O includes: obtaining the idle power consumption and running power consumption of the solid-state drive; obtaining the I / O scheduling amount per unit time; and calculating the average power consumption of a single I / O based on the idle power consumption, the running power consumption and the I / O scheduling amount per unit time.
[0007] Optionally, the calculating the average power consumption of a single I / O based on the idle power consumption, the running power consumption and the I / O scheduling amount per unit time includes: calculating the average power consumption of the single I / O according to the formula; the formula is: W_io = (P_busy-P_idle)*T0 / N_io, where W_io is the average power consumption of a single I / O, P_busy is the running power consumption, P_idle is the idle power consumption, T0 is unit time, and N_io is the I / O scheduling amount per unit time.
[0008] Optionally, obtaining the available power consumption of the solid-state drive based on the power consumption limit of the solid-state drive includes: obtaining the idle power consumption of the solid-state drive; obtaining the power consumption limit of the solid-state drive; and calculating the available power consumption of the solid-state drive based on the idle power consumption and the power consumption limit.
[0009] Optionally, the calculation of the maximum I / O scheduling amount within the preset period based on the average power consumption and the available power consumption includes: calculating the maximum I / O scheduling amount within the preset period according to the formula; the formula is N_io=P_available*T1 / W_io, wherein N_io is the maximum I / O scheduling amount within the preset period, P_available is the available power consumption of the solid state drive, T1 is the preset period, and W_io is the average power consumption of the single I / O; calculating the maximum I / O scheduling amount at the preset time granularity according to the formula; the formula is IO_tick=N_io / T1*1 second / F_cpu, wherein IO_tick is the maximum I / O scheduling amount at the preset time granularity, (N_io / T1) is the maximum I / O scheduling amount per unit time, F_cpu is the CPU frequency of the solid state drive, and (1 second / F_cpu) is the time of a preset time granularity.
[0010] Optionally, the controlling of the power consumption of the solid-state drive based on the maximum value of the I / O scheduling amount at the preset time granularity includes: obtaining the current available I / O scheduling amount and the current used I / O scheduling amount based on the maximum value of the I / O scheduling amount at the preset time granularity and the current scheduling process within a preset period; judging whether the available I / O scheduling amount is greater than the used I / O scheduling amount; if so, performing I / O scheduling on the I / O in the current scheduling process, and increasing the used I / O scheduling amount accordingly based on the number of I / O scheduling in the current scheduling process; if not, not performing I / O scheduling on the I / O in the current scheduling process until the available I / O scheduling amount is greater than the used I / O scheduling amount.
[0011] Optionally, controlling the power consumption of the solid-state drive based on the maximum value of the I / O scheduling amount further includes: resetting the available I / O scheduling amount and the used I / O scheduling amount at the beginning of the next preset cycle.
[0012] Optionally, the controlling of the power consumption of the solid-state drive based on the maximum value of the I / O scheduling amount at the preset time granularity includes: within a preset period, before each I / O scheduling, obtaining the current available I / O scheduling amount based on the maximum value of the I / O scheduling amount at the preset time granularity and the current scheduling process, and obtaining the current used I / O scheduling amount; judging whether the available I / O scheduling amount is greater than the used I / O scheduling amount; if so, performing this I / O scheduling and recording the used I / O scheduling amount plus one; if not, not performing this I / O scheduling until the available I / O scheduling amount is greater than the used I / O scheduling amount.
[0013] Optionally, controlling the power consumption of the solid-state drive based on the maximum value of the I / O scheduling amount further includes: resetting the available I / O scheduling amount and the used I / O scheduling amount at the beginning of the next preset cycle.
[0014] In order to solve the above technical problems, another technical solution adopted in the embodiment of the present application is: providing a firmware system, the firmware system including: an average power consumption acquisition module, used to obtain the average power consumption of a single I / O; an available power consumption acquisition module, used to obtain the available power consumption of the solid-state drive based on the power consumption limit of the solid-state drive; an I / O scheduling amount calculation module, used to calculate the maximum I / O scheduling amount of a preset time granularity based on the average power consumption and the available power consumption; and a power consumption control module, used to control the power consumption of the solid-state drive based on the maximum I / O scheduling amount of the preset time granularity.
[0015] To solve the above technical problems, another technical solution adopted in the embodiment of the present application is: providing a solid-state hard disk controller, comprising: the firmware system described above; at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the solid-state hard disk power consumption control method described above.
[0016] To solve the above technical problems, another technical solution adopted in the embodiment of the present application is: providing a solid state drive, including: the solid state drive controller mentioned above, and at least one flash memory medium communicatively connected to the solid state drive controller.
[0017] In order to solve the above technical problems, another technical solution adopted in the embodiment of the present application is: providing a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the solid-state hard disk to execute the solid-state hard disk power consumption control method as described above.
[0018] Different from the related art, the present application provides a solid-state drive power consumption control method, a solid-state drive controller, and a solid-state drive, the method comprising: obtaining the average power consumption of a single I / O; obtaining the available power consumption of the solid-state drive based on the power consumption limit of the solid-state drive; calculating the maximum value of the I / O scheduling amount at a preset time granularity based on the average power consumption and the available power consumption; and controlling the power consumption of the solid-state drive based on the maximum value of the I / O scheduling amount at the preset time granularity. The embodiment of the present application provides a specific power consumption calculation method, which obtains the average power consumption of a single I / O, obtains the available power consumption according to the set power consumption level, calculates and controls the I / O scheduling amount per unit time based on the available power consumption, thereby accurately controlling the power consumption of the solid-state drive. In addition, the control process only relies on the power consumption data provided by the power management chip and other hardware of the solid-state drive itself, without any additional components, and is easy to implement. It has great value for electricity costs and power allocation in the management and maintenance of IT infrastructure such as servers and data centers. In addition, the embodiment of the present application controls the power consumption based on the time granularity, and the power consumption allocation is accurate to the smallest time unit tick, which can ensure the stability of the entire I / O and achieve a stable performance curve. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] One or more embodiments are exemplarily illustrated by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0020] Figure 1 This is a flow chart of a method for controlling power consumption of a solid-state drive provided in an embodiment of the present application;
[0021] Figure 2 This is a flow chart of a method for obtaining average I / O power consumption provided by an embodiment of the present application;
[0022] Figure 3 This is a flow chart of a method for obtaining the available power consumption of a solid-state drive provided in an embodiment of the present application;
[0023] Figure 4 This is an example diagram related to the preset period in the embodiment of the present application;
[0024] Figure 5 This is a schematic diagram of a process for controlling the power consumption of a solid-state drive provided in an embodiment of the present application;
[0025] Figure 6 yes Figure 5 Schematic diagram of the corresponding time and power consumption in the process;
[0026] Figure 7aThis is another flowchart of controlling the power consumption of a solid-state drive provided by an embodiment of the present application;
[0027] Figure 7b yes Figure 7a Flow diagram of I / O scheduling in ;
[0028] Figure 8 yes Figure 7a and 7b Schematic diagram of the corresponding time and power consumption in the process;
[0029] Figure 9 This is a schematic diagram of the structure of the firmware system provided in an embodiment of the present application;
[0030] Figure 10 Schematic diagram of the structure of the solid-state drive controller provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0032] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device schematic or the flow chart. Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not used to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more related listed items.
[0033] See also Figure 1 , Figure 1 1 is a flow chart of a method for controlling power consumption of a solid-state drive provided in an embodiment of the present application. The method is applied to a solid-state drive and includes:
[0034] S11. Get the average power consumption of a single I / O. In the embodiment of the present application, the commands that the solid-state drive / flash memory chip needs to execute are expressed as I / O, which can also be written as IO, including commands such as Erase, Program and Read. Generally speaking, the power consumption of a solid-state drive generally includes idle power consumption and dynamic power consumption. Idle power consumption refers to the power consumption when the solid-state drive does not have any business running, and dynamic power consumption refers to the incremental power consumption generated by the solid-state drive running the business. The power consumption of the solid-state drive can be calculated by the voltage and current of the solid-state drive. Usually, the power consumption of the solid-state drive is power (P) = voltage (U) * current (I). The solid-state drive can obtain real-time voltage and current values through the power management chip, or it can be measured by tools such as a multimeter. In addition, if there is current fluctuation, multiple sampling can be performed, and then a relatively accurate power consumption can be calculated by filtering algorithms and other methods.
[0035] Please combine Figure 2 , obtaining the average power consumption of a single I / O includes:
[0036] S111. Obtain the idle power consumption and operating power consumption of the solid-state drive. Generally, the idle power consumption of a solid-state drive is stable. In this embodiment, the idle power consumption is represented as P_idle. When the solid-state drive is running, the operating power consumption of the solid-state drive can be calculated by the power management chip. In this embodiment, the operating power consumption is represented as P_busy.
[0037] S112: Obtain the I / O scheduling amount per unit time. The solid-state drive can obtain the I / O scheduling amount during the solid-state drive operation through the background firmware. In this embodiment, the I / O scheduling amount per unit time T0 is recorded as N_io.
[0038] S113 : Calculate the average power consumption of a single I / O based on the idle power consumption, the running power consumption, and the I / O scheduling amount per unit time.
[0039] Specifically, the average power consumption of a single I / O can be calculated using the following formula:
[0040] W_io = (P_busy - P_idle) * T0 / N_io, where W_io is the average power consumption of a single I / O, P_busy is the operating power consumption, P_idle is the idle power consumption, T0 is the unit time (usually 1 second), and N_io is the I / O scheduling amount in the unit time.
[0041] S12, based on the power consumption limit of the solid state drive, obtain the available power consumption of the solid state drive. Figure 3 The obtaining of the available power consumption of the solid state drive based on the power consumption limit of the solid state drive includes:
[0042] S121: Obtain the idle power consumption of the solid state drive. Generally, the idle power consumption of a solid state drive is stable and can be calculated from the voltage and current of the solid state drive. In this embodiment, the idle power consumption is represented as P_idle.
[0043] S122. Obtain the power consumption limit of the solid-state drive. A solid-state drive typically supports several power consumption levels. For example, a solid-state drive supports five levels of power consumption control. When power consumption level 0 is level 0, power consumption is not controlled. When power consumption levels 1, 2, 3, 4, and 5 are level 1, 2, 3, 4, and 5, the corresponding power consumption control targets are 18W, 16W, 14W, 12W, and 10W (watts), respectively.
[0044] S123. Calculate the available power consumption of the solid-state drive based on the idle power consumption and the power consumption limit. In the embodiment of the present application, the power consumption limit corresponding to the current power consumption level is recorded as P_curLevel, indicating that the solid-state drive needs to control the power consumption to a level not exceeding P_curLevel. Therefore, the current available power consumption P_available = P_curLevel–P_idle can be obtained. By controlling the I / O scheduling amount per unit time based on this available power consumption, the expected power consumption control target can be obtained. Taking the power consumption control level in the above example as an example, assuming that the power consumption level currently set by the user is 3, the corresponding power consumption control target is 14w. Assuming that the idle power consumption of the solid-state drive is measured in advance to be 6w, the available power consumption is 8w. At this time, the solid-state drive controls the I / O scheduling amount based on the power consumption control target of 8w.
[0045] S13, calculating the maximum value of the I / O scheduling amount of the preset time granularity according to the average power consumption and the available power consumption. Specifically, the step S13 includes:
[0046] S131. Calculate the maximum I / O scheduling amount within a preset period according to the formula. In this embodiment, the preset period is represented as T1, usually in seconds. Within the preset period T1, the corresponding maximum I / O scheduling amount can be calculated according to the following formula:
[0047] N_io=P_available*T1 / W_io, where N_io is the maximum I / O scheduling amount within the preset period, P_available is the available power consumption of the solid-state drive, T1 is the preset period, and W_io is the average power consumption of the single I / O.
[0048] S132. Calculate the maximum value of the I / O scheduling amount at the preset time granularity according to the formula. In order to maintain the smoothness of the I / O scheduling and thus achieve stable performance, the allocation of the I / O scheduling amount can be divided into as small a time granularity as possible. Usually, the minimum time unit inside the SSD CPU is a tick. In the embodiment of the present application, one tick is used as a preset time granularity. The tick unit is related to the main frequency of the SSD CPU. Assuming that the CPU clock frequency is F_cpu, that is, the CPU has F_cpu ticks per second, and the time of a tick is 1 / (F_cpu) seconds, the maximum value of the I / O scheduling amount at the preset time granularity (i.e., one tick) can be calculated as: IO_tick = N_io / T1*1 second / F_cpu, where IO_tick is the maximum value of the I / O scheduling amount at the preset time granularity, (N_io / T1) is the maximum value of the I / O scheduling amount per unit time, F_cpu is the CPU frequency of the SSD, and (1 second / F_cpu) is the time of a preset time granularity.
[0049] S14. Control the power consumption of the solid-state drive based on the maximum value of the I / O scheduling amount at the preset time granularity.
[0050] Please combine Figure 4 In this embodiment, the preset period T1 = 1 second is used as an example for explanation. It is assumed that the preset period T1 is divided into 8 scheduling processes, namely Figure 4 In t1-t8, each scheduling process includes scheduling multiple I / Os within n ticks. Figure 4 The example in the figure shows that the t1 scheduling process takes 40 ticks, and the solid-state drive executes n I / O schedulings during these 40 ticks. It is understandable that the time taken for each scheduling process may be different, for example, the first scheduling process takes 40 ticks, the second scheduling process takes 100 ticks, etc. The solid-state drive consumes power when executing I / O scheduling. In step S11, the average power consumption of a single I / O can be obtained. It is understandable that Figure 4 The diagram is only used to facilitate explanation of the relationship between the preset cycle, scheduling process, and I / O scheduling, and does not have any limiting effect.
[0051] See also Figure 5In the figure, StartTick represents the starting tick; CurrentTick represents the current tick value of the SSD CPU; ElapsedTick represents the number of elapsed ticks, which can be understood as the length of time that has passed; IO_tick represents the I / O scheduling amount within a single tick; IO_credit represents the available I / O scheduling amount at the current time point; IOSchedule represents the execution of I / O scheduling; IO_usedCredit represents the used I / O scheduling amount at the current time point, that is, the I / O scheduling amount that has been used. This variable increases by 1 after each I / O is scheduled.
[0052] It should be noted that in the calculation logic of this embodiment, the available I / O scheduling amount (IO_Credit) used for allocation increases based on the length of time. The longer the time, the more I / O scheduling amount is allocated, that is, IO_credit = IO_tick * ElapsedTick. The used I / O scheduling amount (IO_usedCredit) also increases with I / O scheduling. The more I / O scheduling, the more scheduling amount consumed. The used I / O scheduling amount cannot exceed the currently allocated available I / O scheduling amount. If it exceeds, I / O scheduling will be restricted. Because the values of related variables (including available I / O scheduling amount and used I / O scheduling amount) will increase over time, to avoid overflow, this method sets a preset period to periodically reset the count. This preset period is to prevent overflow of related values. Assume that the control period is 1 second.
[0053] Figure 5 In the process shown, before initializing power-related variables, the average power consumption of a single I / O and the amount of I / O scheduling per unit time are calculated based on the power consumption obtained by the power management chip in the background: W_io = (P_busy – P_idle) * T0 / N_io; N_io = P_available * T1 / W_io; IO_tick = N_io / T1 * 1 second / F_cpu. Then, power-control-related variables are initialized, including StartTick, IO_usedCredit, and IO_tick.
[0054] The controlling the power consumption of the solid state drive based on the maximum value of the I / O scheduling amount at the preset time granularity includes:
[0055] In a preset period T1, the currently available I / O scheduling amount is obtained based on the maximum value of the I / O scheduling amount of the preset time granularity and the current scheduling process, and the currently used I / O scheduling amount is obtained.
[0056] Determine whether the available I / O scheduling amount IO_Credit is greater than the used I / O scheduling amount IO_usedCredit; if so, perform I / O scheduling on the IO in the current scheduling process (tn), and increase the used I / O scheduling amount accordingly based on the number of I / O scheduling in the current scheduling process; if not, do not perform I / O scheduling on the I / O in the current scheduling process until the available I / O scheduling amount is greater than the used I / O scheduling amount.
[0057] As can be seen from the figure, when performing I / O scheduling, IO_usedCredit increases by one each time an I / O schedule is executed in the current scheduling process. A scheduling process can include multiple I / Os, that is, multiple I / O schedules can be executed. In this case, IO_usedCredit increases accordingly based on the number of I / O schedules in the current scheduling process.
[0058] At the beginning of the next preset period, the available I / O scheduling amount and the used I / O scheduling amount are reset.
[0059] When there is no power consumption measurement data initially, IO_tick can be set to the maximum value of an integer variable to ensure that I / O scheduling is not restricted and wait for the background power consumption related firmware to update the latest IO_tick.
[0060] Please combine Figure 6 , Figure 6 In this example, a preset period T1 in which seven scheduling processes (t1-t7) are executed, the upper block in the figure shows the currently available I / O scheduling capacity, the lower block in the figure shows the currently used I / O scheduling capacity, and the box in the figure shows the maximum I / O scheduling capacity. It should be noted that the two blocks corresponding to each scheduling process in the figure correspond to the current scheduling process moment. For example, the two blocks corresponding to t1 indicate that at the start of t1, the available I / O scheduling capacity is the upper block in the upper block. Since no I / O has been scheduled (within the preset period) at this time (the start of the preset period), the lower block in the used I / O scheduling capacity is zero.
[0061] by Figure 6For example, at the start of t1, the available I / O scheduling amount is the upper slanted shaded part, the used I / O scheduling amount is zero, IO_Credit > IO_usedCredit, perform I / O scheduling on the I / O in t1, and correspondingly increase the used I / O scheduling amount based on the number of I / O scheduling in t1; at the start of t2, the available I / O scheduling amount is the upper slanted shaded part, the used I / O scheduling amount is the lower cross-hatched shaded part, IO_Credit > IO_usedCredit, perform I / O scheduling on the I / O in t2, and correspondingly increase the used I / O scheduling amount based on the number of I / O scheduling in t2. The same applies to t3. At the start of t4, at this time IO_Credit < IO_usedCredit, indicating that the used I / O scheduling amount has exceeded the currently allocated available I / O scheduling amount. At this time, limit the I / O scheduling, that is, suspend scheduling I / O until, as time increases, the available I / O scheduling amount increases and is greater than the used I / O scheduling amount, and then continue with I / O scheduling until the end of the preset period T1 and enter the next preset period.
[0062] At the start of the next said preset period, reset the available I / O scheduling amount and the used I / O scheduling amount, that is Figure 5 Reset the parameters in, IO_usedCredit = 0, and also refresh the starting tick value, StartTick = currentTick, and save N_io = IO_usedCredit. Since the I / O model is different in different service scenarios, the corresponding I / O average power consumption value will also be different. By saving N_io = IO_usedCredit, the I / O average power consumption amount can be corrected regularly, and the above steps S11 - S13 are re-executed to cope with the I / O model in different service scenarios.
[0063] It can be understood that, for the convenience of calculation and explanation, in this embodiment, T1 = 1 second is used as an example for illustration. In some other cases, the preset period T1 can be set to a suitable time according to the actual situation.
[0064] In some other embodiments, please refer to Figure 7a and 7b where the control of the power consumption of the solid-state drive by the maximum value of the I / O scheduling amount based on the preset time granularity includes:
[0065] Within a preset period, before each I / O scheduling, obtain the current available I / O scheduling amount based on the maximum value of the I / O scheduling amount based on the preset time granularity and the current scheduling process, and obtain the current used I / O scheduling amount.
[0066] Determine whether the available I / O scheduling amount IO_Credit is greater than the used I / O scheduling amount IO_usedCredit; if so, perform this I / O scheduling and record the used I / O scheduling amount plus one; if not, do not perform this I / O scheduling until the available I / O scheduling amount is greater than the used I / O scheduling amount.
[0067] At the beginning of the next preset period, the available I / O scheduling amount and the used I / O scheduling amount are reset.
[0068] Similarly, when there is no power consumption measurement data initially, IO_tick can be set to the maximum value of an integer variable to ensure that I / O scheduling is not restricted and wait for the background power consumption related firmware to update the latest IO_tick.
[0069] Please combine Figure 8 , Figure 8 Taking the execution of 7 I / O operations as an example, the upper block in the figure shows the currently available I / O scheduling capacity, and the lower block in the figure shows the currently used I / O scheduling capacity. The blocks represent the maximum I / O scheduling capacity within the preset period (taking 1 second as an example). It should be noted that the two blocks corresponding to each I / O in the figure correspond to the current I / O start time. For example, the two blocks corresponding to IO1-tick1 represent the moment when IO1 enters the process, which is also the moment when tick1 starts. The available I / O scheduling capacity is the upper block in the diagonal shaded area. Since no IO has been scheduled (within the preset period) at this time (the start time of the preset period), the lower used I / O scheduling capacity is zero.
[0070] by Figure 8For example, when IO1 enters the process, the available I / O scheduling amount is the upper slanted shaded part, the used I / O scheduling amount is zero, IO_Credit > IO_usedCredit, schedule IO1, and record the used I / O scheduling amount plus one; when IO2 enters the process (assuming still within tick1 at this time), the available I / O scheduling amount is the upper slanted shaded part, the used I / O scheduling amount is the lower cross-hatched shaded part, IO_Credit > IO_usedCredit, schedule IO2, and record the used I / O scheduling amount plus one, and the same applies to IO3. When IO4 enters the process, assume that tick2 is entered at this time, the available I / O scheduling amount increases, and still IO_Credit > IO_usedCredit, schedule IO4, and record the used I / O scheduling amount plus one, and the same applies to IO5. When IO6 enters the process, assume that still within tick2 at this time, and IO_Credit < IO_usedCredit, which means that the used I / O scheduling amount has exceeded the currently allocated available I / O scheduling amount. At this time, limit the scheduling of I / O, that is, suspend scheduling I / O until tick3 starts, when the available I / O scheduling amount increases and is greater than the used I / O scheduling amount, then continue to schedule IO6, and so on.
[0071] At the start of the next preset cycle, reset the available I / O scheduling amount and the used I / O scheduling amount, that is Figure 7a reset the parameters in, IO_usedCredit = 0, and also refresh the starting tick value, StartTick = currentTick, and save N_io = IO_usedCredit. Similarly, due to different IO models in different service scenarios, the corresponding I / O average power consumption values will also vary. By saving N_io = IO_usedCredit, the I / O average power consumption amount can be corrected regularly, and the above steps S11 - S13 are re-executed to handle different IO models in different service scenarios.
[0072] As described above Figure 5 and Figure 6 the corresponding method for controlling the power consumption of the solid-state drive is different, Figure 5-Figure 6 the corresponding method for controlling the power consumption of the solid-state drive is based on control at the scheduling process level, with high execution efficiency; while Figure 7a 、 7b and Figure 8 the corresponding method for controlling the power consumption of the solid-state drive is based on control at the I / O level, with precise control granularity. In actual use, users can select the appropriate control level for power consumption control according to different application environments.
[0073] The solid-state drive power consumption control method provided in this application obtains the average power consumption of a single I / O, obtains the available power consumption based on the set power consumption level, and calculates and controls the I / O scheduling amount per unit time based on the available power consumption, thereby accurately controlling the power consumption of the solid-state drive. In addition, during the control process, only the power consumption data provided by the hardware such as the power management chip of the solid-state drive itself is needed, and no additional components are required, which is easy to implement. It is of great value for electricity costs and power allocation in the management and maintenance of IT infrastructure such as servers and data centers. In addition, the method accurately allocates power consumption to the smallest time unit tick, thereby ensuring the stability of the entire I / O and thus achieving stable performance.
[0074] See also Figure 9 The embodiment of the present application provides a firmware system 300 for a solid-state drive controller, the firmware system 300 including:
[0075] The average power consumption acquisition module 31 can obtain the average power consumption of a single IO by obtaining the idle power consumption, operating power consumption and I / O scheduling amount per unit time of the solid-state drive, and calculating the average power consumption of a single IO according to the formula W_io = (P_busy-P_idle)*T0 / N_io, where W_io is the average power consumption of a single IO, P_busy is the operating power consumption, P_idle is the idle power consumption, T0 is the unit time (usually 1 second), and N_io is the I / O scheduling amount per unit time.
[0076] The available power consumption acquisition module 32 can obtain the available power consumption of the solid-state drive based on the power consumption limit of the solid-state drive, by obtaining the idle power consumption and power consumption limit of the solid-state drive, and calculating the available power consumption of the solid-state drive according to P_available = P_curLevel - P_idle, where P_available is the available power consumption, P_curLevel is the power consumption limit, and P_idle is the idle power consumption.
[0077] The I / O scheduling amount calculation module 33 can calculate the maximum I / O scheduling amount within a preset period based on the average power consumption and the available power consumption. Within the preset period T1, the corresponding maximum I / O scheduling amount can be calculated according to the formula N_io = P_available * T1 / W_io, where N_io is the maximum I / O scheduling amount within the preset period, P_available is the available power consumption of the solid-state drive, T1 is the preset period, and W_io is the average power consumption of the single I / O.
[0078] The power consumption control module 34 can control the power consumption of the solid-state drive based on the maximum I / O scheduling amount within the preset period, including controlling the power consumption of the solid-state drive based on the scheduling process level or the I / O level.
[0079] It should be noted that the aforementioned firmware system can execute the SSD power consumption control method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the firmware system embodiments, please refer to the SSD power consumption control method provided in the embodiments of this application.
[0080] See also Figure 10 , Figure 10 : is a schematic diagram of the structure of a solid-state drive controller provided by an embodiment of the present invention. The solid-state drive controller 500 can be used to execute the above-mentioned power consumption control method based on I / O scheduling. The solid-state drive controller 500 includes:
[0081] The solid state drive firmware system as described above; one or more processors 51 and memory 52, Figure 10 A processor 51 is taken as an example.
[0082] The processor 51 and the memory 52 may be connected via a bus or other means. Figure 10 The bus connection is taken as an example.
[0083] Memory 52, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs, and modules, such as the program instructions / modules corresponding to the solid-state drive power consumption control method in the embodiment of the present invention. Processor 51 executes the non-volatile software programs, instructions, and modules stored in memory 52 to execute various server functional applications and data processing, thereby implementing the solid-state drive power consumption control method in the above-mentioned method embodiment.
[0084] The memory 52 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the firmware system, etc. In addition, the memory 52 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 52 may optionally include a memory remotely located relative to the processor 51, and these remote memories may be connected to the firmware system via a network. Examples of the aforementioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0085] The one or more modules are stored in the memory 52, and when executed by the one or more processors 51, the solid-state hard disk power consumption control method in any of the above method embodiments is executed, for example, the method steps and implementation steps described above are executed. Figure 9 The functions of the modules in .
[0086] An embodiment of the present invention further provides a solid-state drive, which is longitudinally divided into multiple sequentially numbered dies. The solid-state drive includes the above-mentioned solid-state drive controller and at least one flash memory medium communicatively connected to the solid-state drive controller.
[0087] The above-mentioned product can execute the solid-state hard disk power consumption control method provided by the embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in this embodiment, please refer to the solid-state hard disk power consumption control method provided by the embodiment of the present invention.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Based on the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the present application as described above. For the sake of simplicity, they are not provided in detail. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for controlling power consumption of a solid-state hard disk, applied to a solid-state hard disk, characterized in that: include: Get the average power consumption of a single I / O; Obtaining available power consumption of the solid-state drive based on a power consumption limit of the solid-state drive; Calculate the maximum value of the I / O scheduling amount of the preset time granularity according to the average power consumption and the available power consumption; Controlling the power consumption of the solid-state drive based on the maximum value of the I / O scheduling amount at the preset time granularity; Obtaining the average power consumption of a single I / O includes: Obtaining the idle power consumption and operating power consumption of the solid state drive; Get the I / O scheduling amount per unit time; Calculate the average power consumption of the single I / O according to a formula; The formula is: W_io = (P_busy – P_idle) * T0 / N_io, where W_io is the average power consumption of a single I / O, P_busy is the operating power consumption, P_idle is the idle power consumption, T0 is the unit time, and N_io is the I / O scheduling amount in the unit time.
2. The method according to claim 1, characterized in that The obtaining of the available power consumption of the solid state drive based on the power consumption limit of the solid state drive includes: Obtaining the idle power consumption of the solid state drive; Obtaining the power consumption limit of the solid state drive; The available power consumption of the solid state drive is calculated according to the idle power consumption and the power consumption limit.
3. The method according to claim 1, characterized in that Calculating the maximum value of the I / O scheduling amount of the preset time granularity according to the average power consumption and the available power consumption includes: Calculate the maximum I / O scheduling amount within the preset period according to the formula; The formula is N_io = P_available * T1 / W_io, where N_io is the maximum I / O scheduling amount within the preset period, P_available is the available power consumption of the solid-state drive, T1 is the preset period, and W_io is the average power consumption of the single I / O; Calculate the maximum I / O scheduling amount at the preset time granularity according to the formula; The formula is IO_tick = N_io / T 1 * 1 second / F_cpu, where IO_tick is the maximum I / O scheduling amount at a preset time granularity, (N_io / T 1) is the maximum I / O scheduling amount per unit time, F_cpu is the CPU frequency of the solid-state drive, and (1 second / F_cpu) is the time of a preset time granularity.
4. The method according to any one of claims 1 to 3, characterized in that The controlling the power consumption of the solid state drive based on the maximum value of the I / O scheduling amount at the preset time granularity includes: Within a preset period, obtaining the currently available I / O scheduling amount based on the maximum value of the I / O scheduling amount of the preset time granularity and the current scheduling process, and obtaining the currently used I / O scheduling amount; Determining whether the available I / O scheduling amount is greater than the used I / O scheduling amount; If so, perform I / O scheduling on the I / O in the current scheduling process, and increase the used I / O scheduling amount accordingly based on the I / O scheduling quantity in the current scheduling process; If not, I / O scheduling is not performed on the I / O in the current scheduling process until the available I / O scheduling amount is greater than the used I / O scheduling amount.
5. The method according to claim 4, characterized in that The controlling the power consumption of the solid-state drive based on the maximum I / O scheduling amount further includes: At the beginning of the next preset period, the available I / O scheduling amount and the used I / O scheduling amount are reset.
6. The method according to any one of claims 1 to 3, characterized in that The controlling the power consumption of the solid state drive based on the maximum value of the I / O scheduling amount at the preset time granularity includes: Within a preset period, before each I / O scheduling is performed, the currently available I / O scheduling amount is obtained based on the maximum value of the I / O scheduling amount at the preset time granularity and the current scheduling process, and the currently used I / O scheduling amount is obtained; Determining whether the available I / O scheduling amount is greater than the used I / O scheduling amount; If yes, perform the I / O scheduling and record the used I / O scheduling amount plus one; If not, the I / O scheduling is not performed until the available I / O scheduling amount is greater than the used I / O scheduling amount.
7. The method according to claim 6, characterized in that The controlling the power consumption of the solid-state drive based on the maximum I / O scheduling amount further includes: At the beginning of the next preset period, the available I / O scheduling amount and the used I / O scheduling amount are reset.
8. A firmware system, characterized in that: The firmware system includes: Average power consumption acquisition module, used to obtain the average power consumption of a single I / O; An available power consumption acquisition module, configured to acquire the available power consumption of the solid state drive based on the power consumption limit of the solid state drive; An I / O scheduling amount calculation module, configured to calculate a maximum I / O scheduling amount of a preset time granularity based on the average power consumption and the available power consumption; a power consumption control module, configured to control the power consumption of the solid-state drive based on a maximum value of the I / O scheduling amount at the preset time granularity; The average power consumption acquisition module is specifically used for: Obtaining the idle power consumption and operating power consumption of the solid state drive; Get the I / O scheduling amount per unit time; Calculate the average power consumption of the single I / O according to a formula; The formula is: W_io = (P_busy – P_idle) * T0 / N_io, where W_io is the average power consumption of a single I / O, P_busy is the operating power consumption, P_idle is the idle power consumption, T0 is the unit time, and N_io is the I / O scheduling amount in the unit time.
9. A solid state hard disk controller, characterized in that: include: The firmware system according to claim 8; at least one processor, and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the solid-state hard disk power consumption control method according to any one of claims 1 to 7.
10. A solid state hard disk, characterized in that: include: The solid-state drive controller of claim 9, and at least one flash memory medium communicatively connected to the solid-state drive controller.
Citation Information
Patent Citations
Power consumption control method and device for arithmetic device, chip, equipment and medium
CN114879832A
Storage apparatus and estimating method of power consumption for storage apparatus
US20090316541A1