Power consumption control method based on I / O scheduling, solid-state drive controller and solid-state drive
By using an I/O scheduling-based power control method, the average power consumption of read and write requests is obtained and combined with CPU frequency and power consumption limits, enabling precise control of solid-state drive power consumption and ensuring the smoothness of the I/O scheduling process. This method is suitable for IT infrastructure management in servers and data centers.
Patent Information
- Application Number
- CN202211065623.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-09-01
AI Technical Summary
Existing solid-state drive (SSD) power consumption control methods lack clear computational logic and methods, making it impossible to achieve accurate control of SSD power consumption.
A power consumption control method based on I/O scheduling is provided. By obtaining the average power consumption of read and write requests, and combining the CPU frequency and power consumption limits of the solid-state drive, the maximum power consumption value of the solid-state drive is allocated at a preset time granularity, thereby precisely controlling the power consumption of the solid-state drive.
It enables precise control of solid-state drive power consumption, ensures the smoothness of I/O scheduling processes, has significant value in terms of electricity costs and power allocation, and is suitable for IT infrastructure management in servers and data centers.
Smart Images

Figure CN115373852B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of solid-state drive technology, specifically to a power consumption control method based on I / O scheduling, a solid-state drive controller, and a solid-state drive. Background Technology
[0002] The main components of a solid-state drive (SSD) include flash memory chips, a controller, DDR memory, a PCB, and electronic devices such as capacitors and resistors. Typically, the power consumption of components other than the flash memory chips is relatively constant and does not vary much under different operating modes; the vast majority of dynamic power consumption originates from the flash memory chips. The power consumption of the flash memory chips is directly proportional to the number of commands they need to execute, which can also be understood as being directly proportional to the overall I / O concurrency of the SSD.
[0003] Existing solid-state drive (SSD) power consumption control only has a rough approach, lacking clear and predictable calculation logic and principles, as well as specific and practical power consumption calculation processes and methods, thus failing to accurately control the power consumption of SSDs. Summary of the Invention
[0004] The embodiments described in this application mainly address the technical problem of the inability to accurately control the power consumption of solid-state drives.
[0005] To address the aforementioned technical problems, one technical solution adopted in this application is: providing a power consumption control method based on I / O scheduling, applied to a solid-state drive (SSD). The method includes: obtaining the average power consumption of read requests as a first average power consumption, and obtaining the average power consumption of write requests as a second average power consumption; obtaining the available power consumption of the SSD based on its power consumption limits; allocating a maximum power consumption value with a preset time granularity according to the CPU frequency of the SSD and the available power consumption of the SSD; and controlling the power consumption of the SSD based on the first average power consumption, the second average power consumption, and the maximum power consumption value with the preset time granularity.
[0006] Optionally, the step of obtaining the average power consumption of the read request as the first average power consumption includes: obtaining the idle current and idle voltage of the solid-state drive in an idle state; controlling the solid-state drive to run the read request with a first concurrency, and correspondingly obtaining the first operating current and first operating voltage of the solid-state drive; and calculating the first average power consumption based on the read request with the first concurrency, the first operating current, the first operating voltage, the idle voltage, and the idle current.
[0007] Optionally, calculating the first average power consumption based on the read requests, the first operating current, the first operating voltage, the idle voltage, and the idle current of the first concurrency level includes: calculating the first average power consumption according to the formula: W_Read=(U_busy1*I_busy1*1–U_idle*I_idle*1) / P_iops1, where W_Read is the first average power consumption, U_busy1 is the first operating voltage, I_busy1 is the first operating current, U_idle is the idle voltage, I_idle is the idle current, and P_iops1 is the first concurrency level, i.e., the number of read requests executed within 1 second.
[0008] Optionally, the step of obtaining the average power consumption of the write request as the second average power consumption includes: obtaining the idle current and idle voltage of the solid-state drive in an idle state; controlling the solid-state drive to run the write request with a second level of concurrency, and correspondingly obtaining the second operating current and second operating voltage of the solid-state drive; and calculating the second average power consumption based on the write request with the second level of concurrency, the second operating current, the second operating voltage, the idle voltage, and the idle current.
[0009] Optionally, calculating the second average power consumption based on the write requests, the second operating current, the second operating voltage, the idle voltage, and the idle current of the second concurrency level includes: calculating the second average power consumption according to the formula: W_Program=(U_busy2*I_busy2*1–U_idle*I_idle*1) / P_iops2, where W_Program is the second average power consumption, U_busy2 is the second operating voltage, I_busy2 is the second operating current, U_idle is the idle voltage, I_idle is the idle current, and P_iops2 is the second concurrency level, i.e., the number of write requests executed within 1 second.
[0010] Optionally, obtaining the available power consumption of the solid-state drive based on its power consumption limit 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.
[0011] Optionally, the step of allocating the maximum power consumption value with a preset time granularity based on the CPU frequency and available power consumption of the solid-state drive includes: calculating the maximum power consumption value according to the formula: W_tick = P_availble * 1 second / F_cpu, where W_tick is the maximum power consumption value with a preset time granularity, (P_availble * 1 second) is the available power consumption of the solid-state drive, and F_cpu is the CPU frequency of the solid-state drive.
[0012] Optionally, controlling the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value at the preset time granularity includes: within a preset period, obtaining the current available power consumption and the current used power consumption based on the maximum power consumption value at the preset time granularity and the current scheduling process; determining whether the current available power consumption is greater than the current used power consumption; if so, performing I / O scheduling on the I / O in the current scheduling process, and updating the current used power consumption based on the number of read request scheduling and write request scheduling in the current scheduling process, combined with the first average power consumption and the second average power consumption; if not, not performing I / O scheduling on the I / O in the current scheduling process until the current available power consumption is greater than the current used power consumption.
[0013] Optionally, controlling the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value of the preset time granularity further includes: resetting the current available power consumption and the current used power consumption at the start of the next preset cycle.
[0014] Optionally, controlling the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value at the preset time granularity includes: within a preset period, before each I / O scheduling, obtaining the current available power consumption and the current used power consumption based on the maximum power consumption value at the preset time granularity and the current scheduling process; determining whether the current available power consumption is greater than the current used power consumption; if so, performing this I / O scheduling, and updating the current used power consumption according to the I / O type of this I / O scheduling, combined with the first average power consumption or the second average power consumption, wherein the I / O type includes the read request and the write request; if not, not performing this I / O scheduling, until the current available power consumption is greater than the current used power consumption.
[0015] Optionally, controlling the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value of the preset time granularity further includes: resetting the current available power consumption and the current used power consumption at the start of the next preset cycle.
[0016] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a firmware system, the firmware system comprising: an average power consumption acquisition module, configured to acquire the average power consumption of read requests as a first average power consumption and the average power consumption of write requests as a second average power consumption; an available power consumption acquisition module, configured to acquire the available power consumption of the solid-state drive (SSD) based on the SSD's power consumption limits; a power consumption calculation module, configured to allocate a maximum power consumption value with a preset time granularity based on the SSD's CPU frequency and the SSD's available power consumption; and a power consumption control module, configured to control the SSD's power consumption based on the first average power consumption, the second average power consumption, and the maximum power consumption value with the preset time granularity.
[0017] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a solid-state drive controller, including: 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 executable by the at least one processor, and the instructions are executed by the at least one processor to cause the at least one processor to perform the power consumption control method based on I / O scheduling described above.
[0018] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of this application is to provide a solid-state drive, including: the solid-state drive controller described above, and at least one flash memory medium communicatively connected to the solid-state drive controller.
[0019] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of this application is: to provide a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to enable the solid-state drive to execute the power consumption control method based on I / O scheduling as described above.
[0020] Unlike related technologies, this application provides a power consumption control method based on I / O scheduling, a solid-state drive (SSD) controller, and a solid-state drive (SSD). The method includes: obtaining the average power consumption of read requests as a first average power consumption and the average power consumption of write requests as a second average power consumption; obtaining the available power consumption of the SSD based on its power consumption limits; allocating a maximum power consumption value with a preset time granularity according to the CPU frequency of the SSD and the available power consumption of the SSD; and controlling the power consumption of the SSD based on the first average power consumption, the second average power consumption, and the maximum power consumption value with the preset time granularity. The power consumption control method based on I / O scheduling provided in this application obtains the first average power consumption of read requests and the second average power consumption of write requests, obtains the available power consumption according to a set power consumption level, and precisely controls the power consumption of the SSD based on the first average power consumption, the second average power consumption, and the maximum power consumption value with the preset time granularity. This method is easy to implement and has significant value for electricity cost and power allocation in the management and maintenance of IT infrastructure such as servers and data centers. Furthermore, the method allocates power consumption precisely to the smallest time unit (tick), thus ensuring the smoothness of the entire I / O scheduling process and achieving stable performance. Attached Figure Description
[0021] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0022] Figure 1 This is a flowchart illustrating a power consumption control method based on I / O scheduling provided in an embodiment of this application;
[0023] Figure 2a This is a schematic flowchart of a method for obtaining a first average power consumption provided in an embodiment of this application;
[0024] Figure 2b This is a schematic flowchart of a method for obtaining a second average power consumption provided in an embodiment of this application;
[0025] Figure 3 This is a schematic flowchart of a method for obtaining the available power consumption of a solid-state drive according to an embodiment of this application;
[0026] Figure 4 This is an example diagram related to the preset period in the embodiments of this application;
[0027] Figure 5 This is a schematic diagram of a process for controlling the power consumption of a solid-state drive according to an embodiment of this application;
[0028] Figure 6 yes Figure 5 A diagram illustrating the time and power consumption involved in the process;
[0029] Figure 7a This is a schematic diagram of another process for controlling the power consumption of a solid-state drive provided in an embodiment of this application;
[0030] Figure 7b yes Figure 7a A flowchart illustrating the I / O scheduling process;
[0031] Figure 8 yes Figure 7a and 7b A diagram illustrating the time and power consumption involved in the process;
[0032] Figure 9 This is a schematic diagram of the firmware system provided in the embodiments of this application;
[0033] Figure 10 This is a schematic diagram of the solid-state drive controller provided in the embodiments of this application. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0035] It should be noted that, unless otherwise specified, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device schematic diagram or the order in the flowchart. Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit this application. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0036] Please see Figure 1 , Figure 1 This is a flowchart illustrating a power consumption control method based on I / O scheduling provided in an embodiment of this application. The method is applied to solid-state drives (SSDs) and includes:
[0037] S11. The average power consumption of the read request is taken as the first average power consumption, and the average power consumption of the write request is taken as the second average power consumption. In this embodiment, the commands that the solid-state drive / flash memory chip needs to execute are represented as I / O, which can also be written as IO. Generally speaking, the basic commands of flash memory chips in a solid-state drive include Erase, Program, and Read. During the operation of solid-state drive services, the number of Erase commands is usually very small and can be almost ignored (usually the number of flash memory pages is very large, for example, when there are 1000 pages in a block, the number of Program commands is 1000 times that of Erase commands). Therefore, it is not necessary to calculate the power consumption of Erase commands separately, and the power consumption of Program commands can be simply used as the power consumption of Erase commands. The power consumption measurement of Read commands needs to consider different IO sizes. Program commands are usually programmed according to a fixed multiplane program granularity. It should be noted that, for the convenience of explaining the embodiments of this application, the Read command is used to represent read requests and the Program command is used to represent write requests in this embodiment.
[0038] For specific details, please refer to... Figure 2a The average power consumption of obtaining the read request as the first average power consumption includes:
[0039] S111. Obtain the idle current and idle voltage of the solid-state drive (SSD) in its idle state. Typically, the idle power consumption of an SSD is stable, and the idle current I_idle and idle voltage U_idle can be directly measured when the SSD is idle.
[0040] S112. Control the solid-state drive to run read requests with a first level of concurrency, and correspondingly obtain the first operating current and first operating voltage of the solid-state drive. The first level of concurrency is set to P_iops1, and the voltage and current values of the solid-state drive in this state are measured as the first operating current I_busy1 and the first operating voltage U_busy1. It should be noted that this embodiment uses one second as the time length for example calculation, that is, the number of Read commands executed within one second is P_iops1.
[0041] S113. Calculate the first average power consumption based on the read requests of the first concurrency level, the first operating current, the first operating voltage, the idle voltage, and the idle current. Using a time length of 1 second, the dynamic power consumption within 1 second is: U_busy1*I_busy1*1 – U_idle*I_idle*1. Therefore, the average power consumption value (W_read) of a single Read command can be obtained, i.e., the first average power consumption W_read = (U_busy1*I_busy1*1 – U_idle*I_idle*1) / P_iops1, where W_read is the first average power consumption, U_busy1 is the first operating voltage, I_busy1 is the first operating current, U_idle is the idle voltage, I_idle is the idle current, and P_iops1 is the first concurrency level, i.e., the number of Read commands executed within 1 second.
[0042] Similar to the steps described above for obtaining the average power consumption of read requests as the first average power consumption, please refer to... Figure 2b The step of obtaining the average power consumption of the write request as the second average power consumption includes:
[0043] S1101. Obtain the idle current and idle voltage of the solid-state drive (SSD) in its idle state. Measure the idle current I_idle and idle voltage U_idle when the SSD is in its idle state.
[0044] S1102. Control the solid-state drive to run the write request with a second level of concurrency, and obtain the second operating current and the second operating voltage of the solid-state drive accordingly. Again, using one second as the time length, i.e., the number of Program commands executed within one second is P_iops2, the second concurrency is set to P_iops2, and the voltage and current values of the solid-state drive in this state are measured as the second operating current I_busy2 and the second operating voltage U_busy2.
[0045] S1103. Based on the write requests of the second concurrency level, the second operating current, the second operating voltage, the idle voltage, and the idle current, calculate the second average power consumption. Again, using 1 second as the time length, the dynamic power consumption within 1 second is: U_busy2*I_busy2*1 – U_idle*I_idle*1. From this, the average power consumption value (W_program) of a single Program command can be obtained, i.e., the second average power consumption W_program = (U_busy2*I_busy2*1 – U_idle*I_idle*1) / P_iops2, where W_program is the second average power consumption, U_busy2 is the second operating voltage, I_busy2 is the second operating current, U_idle is the idle voltage, I_idle is the idle current, and P_iops2 is the second concurrency level, i.e., the number of Program commands executed within 1 second.
[0046] S12. Obtain the available power consumption of the solid-state drive (SSD) based on its power consumption limits. For details, please refer to... Figure 3 The method for obtaining the available power consumption of a solid-state drive (SSD) based on its power consumption limitation includes:
[0047] S121. Obtain the idle power consumption of the solid-state drive. Generally speaking, 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.
[0048] S122. Obtain the power consumption limit of the solid-state drive. Solid-state drives typically support several power consumption levels. For example, a certain solid-state drive supports 5 levels of power consumption control. When the power consumption level is 0, no power consumption is controlled; when the power consumption levels are 1, 2, 3, 4, and 5, the corresponding power consumption control targets are 18W, 16W, 14W, 12W, and 10W (watts), respectively.
[0049] S123. Calculate the available power consumption of the solid-state drive (SSD) based on the idle power consumption and the power consumption limit. In this embodiment, the power consumption limit corresponding to the current power consumption level is denoted as P_curLevel, indicating that the SSD needs to control its power consumption to no more than P_curLevel. Therefore, the current available power consumption P_available = P_curLevel – P_idle. By controlling the I / O scheduling power consumption per unit time based on the 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 the user's current power consumption level is 3, the corresponding power consumption control target is 14W. Assuming the previously measured idle power consumption of the SSD is 6W, then the available power consumption is 8W. In this case, the SSD controls the I / O scheduling power consumption based on the 8W power consumption control target.
[0050] S13. Allocate the maximum power consumption of a preset time granularity based on the CPU frequency of the solid-state drive (SSD) and the available power consumption of the SSD. To maintain stable I / O scheduling and thus achieve stable performance, the allocation of I / O scheduling can be divided into the smallest possible time granularity. Typically, the smallest time unit within the SSD CPU is a tick. In this embodiment, one tick is used as a preset time granularity. The tick unit is related to the CPU clock frequency of the SSD. Assuming the CPU clock frequency is F_cpu, meaning the CPU has F_cpu ticks per second, and one tick lasts 1 / (F_cpu) seconds, the power consumption that can be allocated per tick can be calculated as: W_tick = P_available * 1 second / F_cpu, where W_tick is the maximum power consumption of the preset time granularity, i.e., the power consumption that can be allocated per tick, (P_available * 1 second) is the available power consumption of the SSD (1 second), and F_cpu is the CPU frequency of the SSD.
[0051] S14. Control the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value of the preset time granularity.
[0052] Please combine Figure 4 This embodiment uses a preset period T1 = 1 second as an example for illustration. It is assumed that the preset period T1 is divided into 8 scheduling processes, i.e. Figure 4 In the t1-t8 sequence, each scheduling process includes scheduling multiple I / O operations within n ticks. Figure 4 The example in the text indicates that the t1 scheduling process takes 40 ticks, during which the SSD performs n I / O scheduling operations. It's understood that the duration of each scheduling process can be different; for example, the first scheduling process might take 40 ticks, the second might take 100 ticks, and so on. The SSD consumes power during I / O scheduling. In step S11, the average power consumption of the Read command and the Program command can be obtained, namely the first average power consumption and the second average power consumption. It's understood that... Figure 4 The diagrams shown are only for the purpose of explaining the relationship between the preset period, scheduling process, and I / O scheduling quantity, and do not have any time ratio limitation function.
[0053] Please see Figure 5In the diagram, StartTick represents the initial tick; CurrentTick represents the current tick value of the SSD CPU; ElapsedTick represents the number of ticks that have passed, which can be understood as the length of time that has passed; IOSchedule represents the execution of I / O scheduling; W_tick is the maximum power consumption of the preset time granularity, that is, the power consumption that can be allocated in one tick; W_credit represents the available power consumption at the current time point, that is, the current available power consumption, and its value is equal to ElapsedTick * W_tick; W_usedCredit represents the power consumption that has been used at the current time point, that is, the current used power consumption, and the corresponding power consumption will be accumulated to the current used power consumption after the execution of I / O scheduling.
[0054] It should be noted that in the calculation logic of this embodiment, the currently available power consumption (W_credit) used for allocation increases based on the time length. The longer the time, the more I / O scheduling is allocated, i.e., W_credit = ElapsedTick * W_tick. The currently used power consumption (W_usedCredit) also increases with I / O scheduling. The more I / O scheduling, the more power consumption is consumed, and the currently used power consumption cannot exceed the currently allocated currently available power consumption. If it does, I / O scheduling will be restricted. Since the relevant variable values (including the currently available power consumption and the currently used power consumption) will become larger and larger over time, in order to avoid overflow, this method sets a preset period to periodically reset the count. This preset period is to avoid the relevant values from overflowing, and it is assumed that the control period is 1 second.
[0055] Figure 5 In the illustrated process, before initializing power-related variables, power consumption data is acquired based on steps S11-12. The first average power consumption of the Read command, the second average power consumption of the Program command, and the maximum power consumption at a preset time granularity are calculated: W_read = (U_busy1*I_busy1*1 – U_idle*I_idle*1) / P_iops1; W_program = (U_busy2*I_busy2*1 – U_idle*I_idle*1) / P_iops2; W_tick = P_available*1 seconds / F_cpu. Then, power consumption control-related variables are initialized, including StartTick, W_credit, and W_usedCredit.
[0056] The method of controlling the power consumption of the solid-state drive based on the maximum power consumption of the first average power consumption, the second average power consumption, and the preset time granularity includes:
[0057] Within a preset period T1, the current available power consumption is obtained based on the maximum power consumption value of the preset time granularity and the current scheduling process, and the current used power consumption is also obtained.
[0058] Determine whether the current available power consumption W_credit is greater than the current used power consumption W_usedCredit; if yes, perform I / O scheduling on the I / O in the current scheduling process, and update the current used power consumption W_usedCredit based on the number of Read command scheduling and Program command scheduling in the current scheduling process, combined with the first average power consumption and the second average power consumption; if no, do not perform I / O scheduling on the I / O in the current scheduling process until the current available power consumption W_credit is greater than the current used power consumption W_usedCredit.
[0059] As shown in the diagram, during I / O scheduling, in the current scheduling process, for each Read IO scheduled, the current used power W_usedCredit is increased by W_read; for each Program IO scheduled, the current used power W_usedCredit is increased by W_program. A single scheduling process can contain multiple I / O operations, meaning multiple I / O scheduling operations can be performed. W_usedCredit increases accordingly based on the number and type of I / O operations in the current scheduling process.
[0060] At the start of the next preset cycle, the current available power consumption and the current used power consumption are reset.
[0061] Please combine Figure 6 , Figure 6 Taking a preset period T1 as an example, the diagram shows the shaded area within the upper box representing the current available power consumption W_credit, and the shaded area within the lower box representing the current used power consumption W_usedCredit. The boxes indicate the preset period limit (1 second as an example). It should be noted that the two boxes corresponding to each scheduling process in the diagram represent the start time of the current scheduling process. For example, the two boxes corresponding to t1 indicate that at the start of the first scheduling, the current available power consumption is the shaded area within the upper box. Since there is no scheduled I / O at this time (within this preset period), the current used power consumption is zero.
[0062] by Figure 6For example, at the start of t1, the current available power consumption is the upper slanted shaded part, the current used power consumption is zero, W_credit > W_usedCredit. Perform I / O scheduling for the I / O in t1, and correspondingly increase the current used power consumption based on the number of Read commands and Program commands in t1. At the start of t2, the current available power consumption is the upper slanted shaded part, the current used power consumption is the lower cross-hatched shaded part, W_credit > W_usedCredit. Perform I / O scheduling for the I / O in t2, and correspondingly increase the current used power consumption based on the number of Read commands and Program commands in t1. The same applies to t3. At the start of t4, at this time W_credit < W_usedCredit, indicating that the current used power consumption has exceeded the current available power consumption currently allocated. At this time, limit the I / O scheduling, that is, suspend scheduling the I / O until, as time increases, the current available power consumption increases and is greater than the current used power consumption, and then continue with the I / O scheduling until the preset period T1 ends and enter the next preset period.
[0063] At the start of the next said preset period, reset the current available power consumption and the current used power consumption, that is Figure 5 reset the parameters in, W_usedCredit = 0, and also refresh the starting tick value, StartTick = currentTick. It can be understood that, for the convenience of calculation and illustration, 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 The controlling the power consumption of the solid state drive based on the maximum power consumption amount of the first average power consumption, the second average power consumption and the preset time granularity includes:
[0065] Within a preset period, before each I / O scheduling, obtain the current available power consumption based on the maximum power consumption amount of the preset time granularity and the current scheduling process, and obtain the current used power consumption.
[0066] Judge whether the current available power consumption W_credit is greater than the current used power consumption W_usedCredit; if so, perform this I / O scheduling, and update the current used power consumption according to the I / O type of this I / O scheduling, in combination with the first average power consumption or the second average power consumption, where the I / O type includes the Read command and the Program command; if not, do not perform this I / O scheduling until the current available power consumption W_credit is greater than the current used power consumption W_usedCredit.
[0067] At the start of the next preset period, the available I / O scheduling amount and the used I / O scheduling amount are reset.
[0068] As shown in the figure, when performing I / O scheduling, if a Read IO is scheduled, the current power consumption W_usedCredit is added to W_read; if a Program IO is scheduled, the current power consumption W_usedCredit is added to W_program. That is, the current W_usedCredit increases according to the type of I / O currently scheduled.
[0069] Please combine Figure 8 , Figure 8 Taking the execution of 7 I / O operations as an example, the shaded area within the upper box in the diagram represents the current available power consumption W_credit, and the shaded area within the lower box represents the current used power consumption W_usedCredit. The boxes are used to indicate the preset period limit (taking 1 second as an example). It should be noted that the two boxes corresponding to each I / O operation in the diagram correspond to the start time of the current I / O. For example, the two boxes corresponding to IO1-tick1 represent: the moment when IO1 enters the process, which is also the start time of tick1. The current available power consumption is the shaded area within the upper layer. Since no I / O has been scheduled at this time (the start time of this preset period), the current used power consumption in the lower layer is zero.
[0070] by Figure 8For example, when IO1 enters the process, the current available power consumption is the upper diagonal shaded part, the current used power consumption is zero, W_credit > W_usedCredit, schedule IO1, and increase the current used power consumption W_usedCredit correspondingly based on the type of IO1; when IO2 enters the process (assuming still within tick1 at this time), the current available power consumption is the upper diagonal shaded part, the current used power consumption is the lower cross-hatched part, W_credit > W_usedCredit, schedule IO2, and increase the current used power consumption W_usedCredit correspondingly based on the type of IO2. The same applies to IO3. When IO4 enters the process, assuming it enters tick2 at this time, the current available power consumption increases, and still W_credit > W_usedCredit, schedule IO4, and increase the current used power consumption W_usedCredit correspondingly based on the type of IO4. The same applies to IO5. When IO6 enters the process, assuming still within tick2 at this time, but W_credit < W_usedCredit at this time, it means that the current used power consumption has exceeded the current available power consumption allocated currently. At this time, limit the scheduling of I / O, that is, suspend the scheduling of I / O until the start of tick3, when the current available power consumption increases and is greater than the current used power consumption, and then continue to schedule IO6, and so on.
[0071] At the start of the next preset cycle, reset the current available power consumption and the current used power consumption, that is Figure 7a reset the parameters in, W_usedCredit = 0, and also refresh the starting tick value, StartTick = currentTick.
[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 and Figure 6 the corresponding method for controlling the power consumption of the solid-state drive is based on the 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 the control at the I / O level, with precise control granularity. In actual use, users can choose the appropriate control level for power consumption control according to different application environments.
[0073] The power consumption control method based on I / O scheduling provided in this application obtains the first average power consumption of the Read command and the second average power consumption of the Program command, calculates the available power consumption according to a set power consumption level, and precisely controls the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value at a preset time granularity. This method is easy to implement and has great value for electricity cost and power allocation in the management and maintenance of IT infrastructure such as servers and data centers. Furthermore, the method allocates power consumption precisely to the smallest time unit (tick), thus ensuring the smoothness of the entire I / O scheduling process and achieving stable performance.
[0074] Please see Figure 9 This 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 acquire the average power consumption of read requests as the first average power consumption and the average power consumption of write requests as the second average power consumption. Based on the idle current and idle voltage of the solid-state drive in the idle state, it performs calculations for read requests and write requests to acquire the first average power consumption of read requests and the second average power consumption of write requests, respectively.
[0076] Available power consumption acquisition module 32 can acquire the available power consumption of the solid-state drive based on the power consumption limit of the solid-state drive. By acquiring the idle power consumption and power consumption limit of the solid-state drive, the available power consumption of the solid-state drive is calculated 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 power consumption calculation module 33 can allocate a maximum power consumption value with a preset time granularity based on the CPU frequency and available power consumption of the solid-state drive (SSD). Specifically, the maximum power consumption value can be calculated according to the formula: W_tick = P_available * 1 second / F_cpu, where W_tick is the maximum power consumption value with a preset time granularity, (P_available * 1 second) is the available power consumption of the SSD, and F_cpu is the CPU frequency of the SSD.
[0078] The power consumption control module 34 can control the power consumption of the solid-state drive (SSD) based on the first average power consumption, the second average power consumption, and the maximum power consumption value at the preset time granularity. This includes controlling the SSD's power consumption at the scheduling process level or at the I / O level.
[0079] It should be noted that the aforementioned firmware system can execute the power consumption control method based on I / O scheduling provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the method. Technical details not described in detail in the firmware system embodiments can be found in the power consumption control method based on I / O scheduling provided in the embodiments of this application.
[0080] Please see Figure 10 , Figure 10 This is a schematic diagram of a solid-state drive (SSD) controller according to an embodiment of the present invention. The SSD controller 500 can be used to execute the aforementioned power consumption control method based on I / O scheduling. The SSD controller 500 includes:
[0081] The solid-state drive firmware system as described above; one or more processors 51 and memory 52, Figure 10 Take the 51 processor as an example.
[0082] The processor 51 and the memory 52 can be connected via a bus or other means. Figure 10 Taking the example of a connection between China and Israel via a bus.
[0083] The 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 power consumption control method based on I / O scheduling in the embodiments of the present invention. The processor 51 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory 52, thereby implementing the power consumption control method based on I / O scheduling in the above-described method embodiments.
[0084] The memory 52 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the firmware system, etc. Furthermore, the memory 52 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 52 may optionally include memory remotely located relative to the processor 51, and these remote memories may be connected to the firmware system via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0085] The one or more modules are stored in the memory 52. When executed by the one or more processors 51, they perform the power consumption control method based on I / O scheduling in any of the above method embodiments, for example, performing the method steps and implementation described above. Figure 9 The functionality of the modules within.
[0086] This invention also provides a solid-state drive (SSD), which is vertically divided into a plurality of sequentially numbered dies. The SSD includes the aforementioned SSD controller and at least one flash memory medium communicatively connected to the SSD controller.
[0087] The above-described product can execute the power consumption control method based on I / O scheduling provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the method. Technical details not described in detail in this embodiment can be found in the power consumption control method based on I / O scheduling provided in the embodiments of the present invention.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A power consumption control method based on I / O scheduling, applied to solid-state drives, characterized in that, The method includes: The average power consumption of read requests is the first average power consumption, and the average power consumption of write requests is the second average power consumption. Obtain the available power consumption of the solid-state drive based on its power consumption limitations; The maximum power consumption is allocated at a preset time granularity based on the CPU frequency and available power consumption of the solid-state drive (SSD), including calculating the maximum power consumption according to the formula: W_tick = P_availble * 1 second / F_cpu, where W_tick is the maximum power consumption at the preset time granularity, (P_availble * 1 second) is the available power consumption of the SSD, and F_cpu is the CPU frequency of the SSD. Controlling the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value at the preset time granularity includes: within a preset period, obtaining the current available power consumption and the current used power consumption based on the maximum power consumption value at the preset time granularity and the current scheduling process; determining whether the current available power consumption is greater than the current used power consumption; if so, performing I / O scheduling on the I / O in the current scheduling process, and updating the current used power consumption based on the number of read request scheduling and write request scheduling in the current scheduling process, combined with the first average power consumption and the second average power consumption; if not, not performing I / O scheduling on the I / O in the current scheduling process until the current available power consumption is greater than the current used power consumption.
2. The method according to claim 1, characterized in that, The average power consumption for acquiring the read request, which is the first average power consumption, includes: Obtain the idle current and idle voltage of the solid-state drive in its idle state; Control the solid-state drive to run the read requests with a first level of concurrency, and accordingly obtain the first operating current and the first operating voltage of the solid-state drive; The first average power consumption is calculated based on the read requests of the first concurrency, the first operating current, the first operating voltage, the idle voltage, and the idle current.
3. The method according to claim 2, characterized in that, The calculation of the first average power consumption based on the read requests, the first operating current, the first operating voltage, the idle voltage, and the idle current of the first concurrency includes: Calculate the first average power consumption according to the formula; The formula is: W_read = (U_busy1 * I_busy1 * 1 – U_idle * I_idle * 1) / P_iops1, where W_read is the first average power consumption, U_busy1 is the first operating voltage, I_busy1 is the first operating current, U_idle is the idle voltage, I_idle is the idle current, and P_iops1 is the first concurrency, i.e., the number of read requests executed within 1 second.
4. The method according to claim 1, characterized in that, The method of obtaining the average power consumption of the write request as the second average power consumption includes: Obtain the idle current and idle voltage of the solid-state drive in its idle state; Control the solid-state drive to run the write request with a second level of concurrency, and obtain the second operating current and the second operating voltage of the solid-state drive accordingly; The second average power consumption is calculated based on the write requests of the second concurrency, the second operating current, the second operating voltage, the idle voltage, and the idle current.
5. The method according to claim 4, characterized in that, The calculation of the second average power consumption based on the write request, the second operating current, the second operating voltage, the idle voltage, and the idle current of the second concurrency includes: Calculate the second average power consumption according to the formula; The formula is: W_program = (U_busy2 * I_busy2 * 1 – U_idle * I_idle * 1) / P_iops2, where W_program is the second average power consumption, U_busy2 is the second operating voltage, I_busy2 is the second operating current, U_idle is the idle voltage, I_idle is the idle current, and P_iops2 is the second concurrency, i.e., the number of write requests executed in 1 second.
6. The method according to claim 1, characterized in that, The method for obtaining the available power consumption of the solid-state drive based on its power consumption limitation includes: Obtain the idle power consumption of the solid-state drive; Obtain the power consumption limit of the solid-state drive; The available power consumption of the solid-state drive is calculated based on the idle power consumption and the power consumption limit.
7. The method according to any one of claims 1-6, characterized in that, The method of controlling the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value at the preset time granularity further includes: At the start of the next preset cycle, the current available power consumption and the current used power consumption are reset.
8. The method according to any one of claims 1-6, characterized in that, Another implementation of controlling the power consumption of the solid-state drive based on the maximum power consumption of the first average power consumption, the second average power consumption, and the preset time granularity includes: Within a preset period, before each I / O scheduling, the current available power consumption is obtained based on the maximum power consumption of the preset time granularity and the current scheduling process, and the current used power consumption is also obtained. Determine whether the currently available power consumption is greater than the currently used power consumption; If so, then this I / O scheduling is performed, and the current used power consumption is updated according to the I / O type of this I / O scheduling, combined with the first average power consumption or the second average power consumption, wherein the I / O type includes the read request and the write request; If not, this I / O scheduling will not be performed until the current available power consumption is greater than the current used power consumption.
9. The method according to claim 8, characterized in that, The method of controlling the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value at the preset time granularity further includes: At the start of the next preset cycle, the current available power consumption and the current used power consumption are reset.
10. A firmware system, characterized in that, The firmware system includes: The average power consumption acquisition module is used to acquire the average power consumption of read requests as the first average power consumption and the average power consumption of write requests as the second average power consumption. Available power consumption acquisition module, used to acquire the available power consumption of solid-state drive based on the power consumption limit of solid-state drive; The power consumption calculation module is used to allocate a maximum power consumption value with a preset time granularity based on the CPU frequency and available power consumption of the solid-state drive (SSD), and to calculate the maximum power consumption value according to the formula: W_tick = P_availble * 1 second / F_cpu, where W_tick is the maximum power consumption value with a preset time granularity, (P_availble * 1 second) is the available power consumption of the SSD, and F_cpu is the CPU frequency of the SSD. The power consumption control module is used to control the power consumption of the solid-state drive based on the first average power consumption, the second average power consumption, and the maximum power consumption value at the preset time granularity. It is used to: within a preset period, obtain the current available power consumption and the current used power consumption based on the maximum power consumption value at the preset time granularity and the current scheduling process; determine whether the current available power consumption is greater than the current used power consumption; if so, perform I / O scheduling on the I / O in the current scheduling process, and update the current used power consumption based on the number of read request schedulings and write request schedulings in the current scheduling process, combined with the first average power consumption and the second average power consumption; if not, do not perform I / O scheduling on the I / O in the current scheduling process until the current available power consumption is greater than the current used power consumption.
11. A solid-state drive controller, characterized in that, include: The firmware system of claim 10; At least one processor; as well as, 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, which, when executed by the at least one processor, causes the at least one processor to perform the power consumption control method based on I / O scheduling as described in any one of claims 1-9.
12. A solid-state drive, characterized in that, include: The solid-state drive controller of claim 11, and at least one flash memory medium communicatively connected to the solid-state drive controller.
Citation Information
Patent Citations
Data buffer zone implementing method for reducing hard disk power consumption
CN101221465A
Method for improving service quality of solid state disk and solid state disk
CN110362275A