Load balancing among multiple command queues in processing apparatus
By distributing completion queue entries using load balancing algorithms, the host controller optimizes the utilization of processing cores, addressing inefficiencies in existing interrupt handling mechanisms and enhancing system performance.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- QUALCOMM INC
- Filing Date
- 2024-11-15
- Publication Date
- 2026-05-21
AI Technical Summary
In modern computing systems with multiple processing cores, existing interrupt handling mechanisms like Locality Peripheral Interrupts (LPI) do not effectively balance the load among processing cores, leading to inefficient utilization and performance constraints due to uneven distribution of completion queue entries.
A host controller strategically distributes completion queue entries among multiple processing cores using algorithms such as round robin or weighted round robin to optimize load balancing, allowing for more efficient utilization of processing resources.
This approach enhances the performance and efficiency of computing systems by ensuring that completion queue entries are distributed based on core capabilities and load, thereby optimizing the processing load across all cores.
Smart Images

Figure CN2024132212_21052026_PF_FP_ABST
Abstract
Description
LOAD BALANCING AMONG MULTIPLE COMMAND QUEUES IN PROCESSING APPARATUSTECHNICAL FIELD
[0001] The present disclosure relates generally to a processing apparatus and more particularly to techniques for command queues load balancing in a processing apparatus.BACKGROUND
[0002] Modern computing systems can access a storage device using various technologies such as Universal Flash Storage (UFS) and Non-Volatile Memory Express (NVMe) for their high performance and efficiency. Both technologies leverage Message Signaled Interrupts (MSI) to notify the processor of the computing system of the completion of input / output (I / O) operations. MSI enables devices to communicate completion events as data packets over a bus rather than using separate interrupt lines, enhancing scalability and efficiency of interrupt processing. In modern computing systems, efficient interrupt handling is crucial for performance, especially in multi-core processors. Locality Peripheral Interrupts (LPI) is a mechanism that can be used for interrupt handling in a computing system using multi-core processors and hardware with multiple peripherals. LPI optimizes the handling of interrupts by considering the proximity of the interrupt source to the processing cores. LPI can minimize latency by directing interrupts to the nearest or most suitable processor cores based on locality. The system can use multiple circular queues (MCQs) to manage and organize data transfer between various system components (e.g., processing 0cores) and the data storage. MCQ is widely used for servicing high throughput I / O among multiple processing cores. MCQ can use two types of queues, for example, submission queue (SQ) and completion queue (CQ) .SUMMARY
[0003] The following presents a summary of one or more implementations in order to provide a basic understanding of such implementations. This summary is not an extensive overview of all contemplated implementations and is intended to neither identify key or critical elements of all implementations nor delineate the scope of any or all implementations. Its sole purpose is to present some concepts of one or more implementations in a form as a prelude to the more detailed description that is presented later.
[0004] Aspects of the disclosure provides various systems, apparatuses, and techniques for distributing queue entries in a processing apparatus with multiple processing cores and MCQ. In some aspects, a host controller can distribute completion queue entries among a plurality of completion queues (CQs) strategically.
[0005] One aspect of the disclosure provides a method of operating a queue at a host controller. The method includes receiving a plurality of commands from one or more submission queues (SQs) . The method further includes sending the plurality of commands received from the one or more SQs to a storage device to execute the plurality of commands. The method further includes storing a plurality of completion queue entries (CQEs) , each CQE including a response from the storage device in response to the execution of a corresponding one of the plurality of commands. The method further includes distributing the plurality of CQEs to a plurality of completion queues (CQs) , each of the plurality of CQs associated with one of a plurality of processing cores, according to a distribution algorithm for distributing the CQEs.
[0006] One aspect of the disclosure provides a processing apparatus including: a plurality of processing cores; a storage device; one or more submission queues (SQs) associated with the plurality of processing cores; a plurality of completion queues (CQs) , each of the CQs associated with one of the plurality of processing cores; a completion queue buffer; and a host controller connected to the storage device. The host controller is configured to: receive a plurality of commands from the one or more SQs; send the plurality of commands received from the one or more SQs to the storage device to execute the plurality of commands; store a plurality of completion queue entries (CQEs) at the completion queue buffer, each CQE including a response from the storage device in response to the execution of a corresponding one of the plurality of commands; and distribute the plurality of CQEs among the plurality of CQs according to a distribution algorithm for distributing the CQEs.
[0007] One aspect of the disclosure provides a processing apparatus, including: means for receiving a plurality of commands from one or more submission queues (SQs) ; means for sending the plurality of commands received from the one or more SQs to a storage device to execute the plurality of commands; means for storing a plurality of completion queue entries (CQEs) , each CQE including a response from the storage device in response to the execution of a corresponding one of the plurality of commands; and means for distributing the plurality of CQEs to a plurality of completion queues (CQs) , each of the plurality of CQs associated with one of a plurality of processing cores according to a distribution algorithm for distributing the CQEs.BRIEF DESCRIPTION OF THE DRAWINGS
[0008] FIG. 1 is a schematic block diagram illustrating a processing apparatus in accordance with some aspects of the disclosure.
[0009] FIG. 2 is a schematic diagram illustrating a host memory, a host controller, and a storage device of a processing apparatus in accordance with some aspects of the disclosure.
[0010] FIG. 3 is a diagram illustrating an exemplary process of distributing completion queue (CQ) entities among multiple processing cores in accordance with some aspects of the disclosure.
[0011] FIG. 4 is a flow chart illustrating a procedure of distributing a response stored in a CQ buffer to a CQ in accordance with some aspects of the disclosure.
[0012] FIG. 5 illustrates exemplary registers for configuring and controlling CQ load balancing capabilities of a host controller in accordance with some aspects of the disclosure.
[0013] FIG. 6 is a diagram conceptually illustrating distribution slots for use with a round robin (RR) algorithm in accordance with some aspects of the disclosure.
[0014] FIG. 7 is a diagram illustrating an exemplary CQ load balancing distribution slot configuration for use with a weighted RR algorithm in accordance with some aspects of the disclosure.
[0015] FIG. 8 is a flow chart illustrating an exemplary process of distributing CQ entries in accordance with some aspects of the disclosure.
[0016] FIG. 9 is a flow chart illustrating a method of distributing queue entities at a host controller in accordance with some aspects of the disclosure.DETAILED DESCRIPTION
[0017] The detailed description set forth below in connection with the appended drawings is intended as a description of various configurations and is not intended to represent the only configurations in which the concepts described herein may be practiced. The detailed description includes specific details for the purpose of providing a thorough understanding of various concepts. However, it will be apparent to those skilled in the art that these concepts may be practiced without these specific details. In some instances, well-known structures and components are shown in block diagram form in order to avoid obscuring such concepts.
[0018] Several aspects of the invention will now be presented with reference to various apparatus and methods. These apparatus and methods will be described in the following detailed description and illustrated in the accompanying drawings by various blocks, modules, components, circuits, steps, processes, algorithms, etc. (collectively referred to as “elements” ) . These elements may be implemented using electronic hardware, computer software, firmware, or any combination thereof. Whether such elements are implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system.
[0019] A computing system can access a data storage device using various interface technologies such as Universal Flash Storage (UFS) and Non-Volatile Memory Express (NVMe) . In some aspects, the system can use multiple circular queues (MCQs) to manage and organize data transfer between various different system components (e.g., processing cores) and the data storage. MCQ is widely used for providing high throughput input / output (I / O) among multiple processing cores and the storage device. In a system using MCQ, there are two types of queues: submission queue (SQ) and completion queue (CQ) . SQ is a specialized circular queue for which host software (SW) at the processor is the producer, and a host controller is the consumer. The host SW passes messages (SQ entries) to the controller using the SQ to indicate submission of new I / O commands to be processed. CQ is a specialized circular queue for which the host controller is the producer, and the host SW is the consumer. The host controller uses the CQ to pass messages as CQ entries to the host SW indicating completion of I / O commands. The host controller can also use the CQ to pass data retrieved from the storage device to the host SW.
[0020] Aspects of the disclosure provide various systems, apparatuses, and techniques for distributing queue entries in a processing apparatus with multiple processing cores and MCQ. In some aspects, a host controller can distribute completion queue entries among a plurality of CQs strategically, for example, based on the respective loading and / or processing capability of the processing cores. In some aspects, the host controller can distribute the CQ entries (CQEs) to the CQs among different processing cores without being limited to a specific SQ and CQ (s) binding. The host controller can distribute the CQEs across different processing cores using any suitable algorithm to optimize the load on the processing cores.
[0021] FIG. 1 is a schematic block diagram illustrating a processing apparatus 100 with multiple queues in accordance with some aspects of the disclosure. In this example, the apparatus 100 can be a computer system or a part thereof. The apparatus 100 includes a host 102 and a data storage device 104. The host 102 can include one or more processors 106 (e.g., one or more processing cores) and one or more registers 108 that can be used to perform various functions of the apparatus, including, for example, functions typically performed by portable devices like mobile devices, tablets, portable computers, wearable devices (e.g., earbuds, headphones, etc. ) , smartwatches, and other such devices. These functions can include wireless communications with other devices (e.g., smartphones, computers, etc. ) and application specific functions. The data storage device 104 can store various data in a non-volatile memory (NVM) 110. In one example, the NVM may be NAND Flash memory or the like. However, the device is not limited to using only NAND Flash and can use other types of NVM. In one example, the data storage device can be a solid state device (SSD) with NVM for storing data.
[0022] In some aspects, the host 102 and the data storage device 104 connect to each other using a wireless or wired storage interface 112, for example, a Universal Flash Storage (UFS) interface, a Non-Volatile Memory Express (NVMe) interface, or any suitable interface. The processors 106 can perform various functions (e.g., using software / application 118 stored in a host memory 120) and can communicate with a host controller 116 using a host driver 122. Using the host driver 122, the processor 106 can communicate, control, and exchange data with the host controller 116 in order to access (e.g., read data and write data) the storage device 104. In some aspects, the host controller 116 can provide a UFS host controller interface (UFSHCI) to the processors 106. The host controller 116 is responsible for managing the interface and data transfer between host software (e.g., application 118) and the storage device 104. This can include interface management, power management, and control functions. The host controller 116 (e.g., the UFSHCI) provides a set of registers that can be accessed by the processor 106 using the host driver 122. The host driver 122 can use a combination of registers and transfer request descriptors in host memory 120 (e.g., one or more random access memories) to communicate with the host controller 116. In some examples, the storage device 104 can include a memory card, an embedded bootable mass storage device, an input-output (IO) device, etc. The processors 106 and host controller 116 can access the storage device 104 using multiple submission queues 124 and completion queues 126.
[0023] In some aspects, some or all of the functions described herein can be performed by the apparatus 100 using one or more processors 106, the host controller 116, and / or the storage device 104. In some examples, the processors 106, host controller 116, and storage device 104 may each include a microprocessor, a microcontroller, an embedded controller, a logic circuit, software, firmware, ASIC, or any kind of processing device, for performing one or more of the functions described herein as being performed by the apparatus 100. In one example, the processors 106 may include multiple processing cores of the same or different types.
[0024] In some aspects, a processor can send a I / O command to a storage device using a specific SQ. Then upon the completion of the command, the host controller can inform the processor by sending a message using a specific CQ. In some examples, the CQ can be bonded to the SQ. Further, the host controller can trigger an interrupt, which belongs to the CQ, and the interrupt is routed to a processor to which the interrupt is affined to. For example, the host controller can use Message Signaled Interrupts (MSI) to notify the processor of the completion of the I / O command. In a processing system with multiple processing cores or processors, the system can use Locality Peripheral Interrupts (LPI) as a mechanism for handling the interrupts from the storage device. In some implementations, LPI does not affine or assign one MSI to multiple processors, thus there is no MSI load balancing among the processing cores. This limitation can lead to a scenario where a processing system is heavily loaded with I / Os issued from only a few processing cores, and not all cores are actively servicing I / Os completions (e.g., in MSI handler) . This scenario can constrain the performance and efficiency of the system.
[0025] Aspects of the present disclosure provide a host controller that is configured to distribute CQ messages among processing cores to optimize the utilization and / or loading of the processing cores. FIG. 2 is a block diagram conceptually illustrating a host memory 202, a host controller 204, and a storage device 206 of a processing apparatus according to some aspects. In one example, the host memory 202 may be the host memory 120 of FIG. 1, the host controller 204 may be the host controller 116, and the storage device 206 may be the storage device 104 of FIG. 1. The processing apparatus can operate multiple queues (e.g., MCQ including SQs and CQs) in the host memory 202 using multiple processing cores (e.g., core 0–core 7 shown in FIG. 2) . The processing cores may be the processors 106 of FIG. 1. Each processing core can handle one or more of the queues (SQs and / or CQs) . A processing core can send a command using its associated SQ (e.g., SQ0 through SQ7) . A response to the command originating from a given SQ can be sent using a certain CQ based on a distribution algorithm. In some aspects, the SQ for holding the command and the CQ for holding the corresponding response can be associated with the same or different processing cores. For example, a processing core can submit a command to the SQ to access (e.g., read / write data) the storage device 206, and the response from the storage device can be sent to a CQ that is managed by the same processing core or different processing core.
[0026] In some aspects, the apparatus can operate the queues SQ0–SQ7 and CQ0–CQ7 in the host memory. Each processing core can be associated with one or more SQs and / or one or more CQs. For example, SQ0 is associated with core 0, SQ1 is associated with core 1, SQ2 is associated with core 2, and SQ3 is associated with core 3. CQ0, CQ4, and SQ4 are associated with core 4. CQ1, CQ5, and SQ5 are associated with core 5. CQ2, CQ6, and SQ6 are associated with core 6. CQ3, CQ7, and SQ7 are associated with core 7.In other examples, the processing cores and the queues may have other association patterns.
[0027] In some aspects, the SQs and CQs are circular queues that can be referred to as multi-circular queues (MCQs) . Access to a SQ or CQ can be performed using a head pointer and a tail pointer, which keep track of the current content in the queue. A circular queue allows for continuous use of memory space by wrapping around when the end of the buffer is reached. The head pointer indicates the position in the queue where the next item will be read (dequeued) . The head pointer advances as items are removed from the queue. The tail pointer indicates the position in the queue where the next item can be written (enqueued) . The tail pointer advances as items are added to the queue. Queue entries are removed from the head of the queue for processing and new entries are added to the tail of the queue. In other aspects, the SQs and CQs can be different types of queues, instead of MCQ.
[0028] In some aspects, the host controller 204 includes an SQ buffer 208, a CQ buffer 210, and a CQ load balancer 212. Host controller 204 uses the SQ buffer 208 to temporarily hold the commands (SQ entries) fetched from the SQs, and uses the CQ buffer 210 to temporarily hold the responses (CQ entries) from the storage device 206 (e.g., an SSD) . In some aspects, the CQ load balancer 212 can be implemented by hardware circuitry, software, or a combination of software and hardware. The CQ load balancer 212 can enable the host controller to distribute the CQ entries strategically to the CQs. For example, the CQ load balancer uses a distribution algorithm to send the CQ entries to the CQs to balance the utilization among the CQs and / or the processing load on the processing cores. In some examples, the CQ load balancer 212 can use a round robin (RR) or a weighted round robin (WRR) algorithm as the distribution policy. In some aspects, the algorithm can assign the weights to the CQs based on processor architecture and / or processing capability of the processing cores. In one example, the host controller 204 can distribute relatively more CQ entries to the CQs on more powerful cores and relatively fewer CQ entries to CQs on less powerful cores, instead of evenly. In another example, the host controller 204 can distribute relatively more CQ entries to less utilized CQs and relatively fewer CQ entries to highly utilized CQs.
[0029] FIG. 3 is a diagram illustrating an exemplary process of distributing CQ entries among multiple processing cores according to some aspects. In one example, the host controller 204 can receive commands from SQ2, SQ3, SQ4, SQ5, and SQ7. The host controller can store the commands in the SQ buffer 208. For example, the commands can be I / O commands (e.g., read and / or write) used to access the storage device 206. In one example, the commands can be UFS or NVMe commands. The host controller sends the commands to the storage device 206 for execution (e.g., reading and / or writing data) . When the command is a read command, the desired data is retrieved from the storage device and sent to the host controller. When the command is a write command, the desired data is transferred from the host controller to be stored at the storage device.
[0030] After the command is completed, the storage device generates a response that indicates the status (e.g., success, error, etc. ) of the command. The storage device sends the response to the host controller, which can place the received response in the CQ buffer 210. The CQ buffer acts as an intermediate storage area before the responses are distributed to the specific CQ queue. The host controller can use the CQ load balancer 212 to distribute the responses from the shared CQ buffer to the appropriate CQ. This distribution can be based on various factors (e.g., command type, core affinity, priority, etc. ) to achieve load balancing among the cores that handles the CQs.
[0031] In some aspects, the CQ load balancer has the flexibility of selecting any CQ among multiple CQs to handle a response for any SQ. That is, a SQ is not bound to a specific CQ. For example, the CQ load balancer 212 can send a response (CQE) associated with a SQ (e.g., SQ0–SQ7) to any of the CQ0–CQ7, for example, based on the loading of the processing cores and / or the utilization of the CQs. In one example, the interrupts (IRQs) of CQ0 and CQ4 are handled by core 4, the IRQs of CQ1 and CQ5 are handled by core 5, the IRQs of CQ2 and CQ6 are handled by core 6, and the IRQs of CQ3 and CQ7 are handled by core 7. Once the response is sent to a specific CQ, the host controller can trigger an interrupt (e.g., message signaling interrupt) that belongs to that specific CQ so that the processing core can handle the interrupt and response. In one example, when the response is sent to CQ0 or CQ4, the host controller can trigger an interrupt to core 4. In one example, when the response is sent to CQ1 or CQ5, the host controller can trigger an interrupt to core 5. In one example, when the response is sent to CQ2 or CQ6, the host controller can trigger an interrupt to core 6. In one example, when the response is sent to CQ3 or CQ7, the host controller can trigger an interrupt to core 7.
[0032] FIG. 4 is a flow chart illustrating a procedure 400 of distributing a response stored in a CQ buffer to a CQ according to some aspects of the disclosure. For example, the CQ load balancer 212 can use the procedure 400 to distribute a CQ entry (CQE) in the CQ buffer 210 to any of the CQ0–CQ7 using a distribution algorithm. In one example, the CQ entry can be a response from the storage device 206 in response to a command from a specific SQ (e.g., one of SQ0–SQ7) .
[0033] At block 402, the CQ load balancer can retrieve a CQ entry from the CQ buffer. The CQ entry can be a response from the storage device 206. In one example, the response can be a UFS Protocol Information Unit (UPIU) which includes the status of the command execution. The CQ buffer can store multiple CQ entries corresponding to commands from one or more SQs. In one example, the CQ load balancer can retrieve the CQ entries using a first in, first out (FIFO) order. At block 404, the CQ load balancer can select a CQ based on a distribution algorithm that can distribute the CQ entries among the CQs to optimize the loading on the processing cores and / or utilization of the CQs. The CQ load balancer can use any suitable algorithm to distribute the CQ entries to the CQs. In one example, the CQ load balancer can use a round robin (RR) or a weighted round robin (WRR) algorithm as the distribution policy. For example, the host controller can distribute relatively more CQ entries to more powerful cores and relatively less CQ entries to less powerful cores. For another example, the host controller can distribute relatively more CQ entries to less utilized CQs and relatively less CQ entries to highly utilized CQs. The CQ load balancer can consider both CQ utilization and core loading to distribute the CQ entries.
[0034] FIG. 5 illustrates exemplary registers for configuring and controlling CQ load balancing capabilities of a host controller according to some aspects. The host controller can use a controller capability register 502 to indicate whether or not the host controller supports CQ load balancing as described above in relation to FIGs. 1–4. For example, the controller capability register 502 can have a bit field that can be set to a first value (e.g., bit value 1) to indicate that the host controller supports CQs load balancing; or a second value (e.g., bit value 0) to indicate that that host controller does not support CQ load balancing.
[0035] In some aspects, the host controller can determine the CQ processing capability of each CQ, for example, from a CQ configuration register 508. The CQ configuration register can have a capacity field that indicates the CQ processing capability (e.g., a value between 0 and 63) of the corresponding core. In one example, a first CQ may have a value of 5 in processing capability and a second CQ may have a value of 10 in processing capability. In this case, the second CQ has twice the processing capability of the first CQ.
[0036] In some aspects, the host controller can use a CQ load balancing control register 504 to select a CQ distribution algorithm. The CQ load balancing control register can have a first bit field that can be set to a first value to indicate that CQs load balancing is enabled, or a second value to indicate that CQs load balancing is disabled. The CQ load balancing register can have a second bit field that can be set to various values, and each of the values indicates a specific CQ distribution algorithm to be used. Table 1 below illustrates some examples CQ loading configurations using the CQ load balancing control register 504.
[0037] When the bit field has the value 0000, the host controller uses a round robin (RR) algorithm to distribute the CQ entries to the CQs in a sequential manner. In this case, the host controller can use a round robin counter to determine the current CQ to which the CQ entry should be assigned. For example, the round robin counter can start at the value 0 that indicates CQ0. Then the host controller increments the round robin counter after assigning each CQ entry. The host controller can wrap around the counter to zero after reaching the last CQ (e.g., CQ7) .
[0038] When the bit field has the value 0010, 0010, or 0011, the host controller uses a weighted RR algorithm with multiple distribution slots (32, 64, or 128 distribution slots) to distribute the CQ entries to the CQs. The distribution slots enable the host controller to define a specific weighted RR distribution sequence. More distribution slots can be assigned to a CQ that has a greater weight than another CQ. FIG. 6 is a drawing conceptually illustrating 32 distribution slots 600 for use with a RR or weighted RR algorithm. In some aspects, the distribution slots can be implemented using registers (e.g., registers 108 of FIG. 1) or host memory (e.g., host memory 120 of FIG. 1) . The distribution slots define the order in which the host controller (e.g., CQ load balancer 212 of FIG. 2) distributes CQ entries from the CQ buffer to the CQs. In some aspects, the host controller can use the CQ load balancing distribution registers 506 to configure (e.g., disable or enable) the distribution slots. For example, each CQ load balancing distribution register corresponds to one distribution slot. The host controller can set a first bit field in the CQ load balancing distribution register to a first value (e.g., 0) to disable a corresponding distribution slot or a second value (e.g., 1) to enable the distribution slot. Each CQ load balancing distribution register also has a second bit field that indicates the CQ assigned to that distribution slot based on the RR or weighted RR algorithm in use. The more slots are assigned to a specific CQ, the more weight is given to that CQ. The CQ load balancer sends more CQ entries to a CQ with a higher weight than other CQs.
[0039] When the bit field has the value 0100, the host controller uses a CQ capacity based RR algorithm to distribute the CQ entries to the CQs in a sequential manner. In this case, the CQ load balancer can distribute the CQ entities to the CQs in a round robin fashion based on CQ capacity (e.g., as indicated by the CQ configuration register 508) . A CQ with a higher CQ capacity value receives more CQEs than a CQ with a lower capacity value. For example, a first CQ with twice the CQ capacity value than a second CQ can receive twice as many CQ entities as second CQ.
[0040] FIG. 7 conceptually illustrates an exemplary CQ load balancing distribution slot configuration for use with a weighted RR algorithm according to some aspects. In this example, the host controller uses the CQ load balancing distribution registers 506 to enable 24 distribution slots (e.g., DS0 through DS23) and disables 7 distribution slots (e.g., DS24–DS31) . In other examples, the algorithm can enable more or fewer distribution slots and / or different distribution slots. In this example, the CQs are assigned to the distribution slots in a specific weighted RR fashion. Starting with DS0, CQ0, CQ1, and CQ2 are respectively assigned to DS0, DS1, and DS2. CQ 3 is assigned to DS3, DS4, and DS5. Then CQ4, CQ5, and CQ6 are respectively assigned to DS6, DS7, and DS8. CQ7 is assigned to DS9, DS10, and DS11. In this round, CQ3 and CQ7 each have more weight (3X weight) than CQ0, CQ1, CQ2, CQ4, CQ5, and CQ6. Therefore, the host controller (e.g., CQ load balancer 212 of FIG. 2) distributes more CQ entries to CQ3 and CQ7 according to this particular weighted RR algorithm. The distribution slots DS12 to DS23 have similar CQ assignment as DS0 to DS11. In this example, DS24 to DS31 are not used because they are disabled according to the CQ load balancing distribution registers 506. In other examples, the host controller can configure the distribution slots using other RR algorithms with different weights.
[0041] FIG. 8 is a flow chart illustrating an exemplary process 800 of distributing CQEs to CQs using CQ load balancing distribution registers according to some aspects. For example, the host controller 116 of FIG. 1 or any processing devices (e.g., a system on a chip (SoC) device) can perform the process 800 to distribute CQEs using the CQ load balancing distribution registers 506 of FIG. 5. In one example, the host controller can use the CQ load balancer 212 of FIG. 2 to distribute the CQEs to the CQs.
[0042] At decision block 802, the host controller can determine whether there are any CQEs stored in a buffer (e.g., CQ buffer 210 of FIG. 2) . In one example, a CQE can be a response from the storage device 206 of FIG. 2 in response to a command from a specific SQ at a processing core (e.g., core 0 through core 7 of FIG. 2) . The host controller can distribute the CQEs in the buffer to a plurality of CQs in a host memory 202 of FIG. 2. At block 804, the host controller can determine a CQ for sending the CQE using the CQ load balancing distribution registers 506 of FIG. 5. For example, the CQ load balancing distribution registers (e.g., DS0 through DS31) can indicate the next CQ based on a RR algorithm as described above in relation to FIGs. 6 and 7. For example, DS0 can indicate CQ0, DS1 can indicate CQ1, and so on. At block 806, the host controller can send the CQE to the CQ as indicated in the CQ load balancing distribution registers. In some aspects, the host controller can implement any suitable algorithms (not limited to RR) using the CQ load balancing distribution registers in order to optimize the loading among processing cores.
[0043] FIG. 9 is a flow chart illustrating a method 900 of distributing queue entities among CQs according to some aspects of the present disclosure. For example, the queue entities can be the CQEs as described above in relation to FIGs. 1–8. For example, the method 900 can be performed by the host controller 116 of FIG. 1 or host controller 204 of FIG. 2, or any processing devices (e.g., SoC) .
[0044] At 902, the host controller can receive a plurality of commands from one or more submission queues (SQs) . In some aspects, the SQ buffer 208 of FIG. 2 can provide a means to receive the plurality of commands from one or more SQs. The host controller can store the commands as SQ entries in the SQ buffer. For example, the SQs can include SQ0 through SQ7 as described above in relation to FIGs. 2 and 3. In one example, the host controller can receive the SQEs from SQ2, SQ3, SQ4, and SQ5, respectively, as shown in the example of FIG. 3.
[0045] At 904, the host controller can send the plurality of commands received from the one or more SQs to a storage device to execute the plurality of commands. For example, the commands can include read and / or write commands. In some aspects, the wireless or wired storage interface 112 of FIG. 1 can provide a means to send the commands to the storage device. For example, the storage device may be the storage device 104 of FIG. 1 or storage device 206 of FIG. 2. The write command can include the data to be stored to the storage device.
[0046] At 906, the host controller can store a plurality of CQEs. Each CQE can include a response from the storage device in response to the execution of a corresponding one of the plurality of commands or SQEs. In some aspects, the CQ buffer 210 of FIG. 2 can provide a means to store the plurality of CQEs. For example, the response can indicate the status (e.g., success or failure) of the command and / or data retrieved from the storage device.
[0047] At 908, the host controller can distribute the plurality of CQEs to a plurality of completion queues (CQs) , each of the plurality of CQs associated with one of a plurality of processing cores according to a distribution algorithm. In some aspects, the host controller can optimize the processing load of the plurality of processing cores by distributing the plurality of CQEs to the CQs. In some aspects, the CQ load balancer 212 can provide a means to distribute the plurality of CQEs to the plurality of CQs (e.g., CQ0 through CQ7 of FIG. 2) . In some examples, the distribution algorithm can be a round robin algorithm, weighted round robin algorithm, or any algorithm that can optimize the processing load between the processing cores. In one example, the host controller can send the CQEs corresponding to SQ2 to CQ0 and CQ4, send the CQEs corresponding to SQ3 to CQ1 and CQ5, send the CQEs corresponding to SQ4 to CQ2 and CQ6, and send the CQEs corresponding to SQ5 to CQ3 and CQ7.
[0048] In some aspects, the host controller can send a greater quantity of the plurality of CQEs to a first CQ than a second CQ, based on relative processing capability and / or processing load between the processing cores. In one example, the host controller can send the greater quantity of the plurality of CQEs to the first processing core that has less processing load than the second processing core. In one example, the host controller can send the greater quantity of the plurality of CQEs to the first processing core that has more processing capability than the second processing core. In one example, the host controller can send greater quantity of the plurality of CQEs to a first CQ core that has less utilization of a second CQ.
[0049] Some implementation examples are described in the following numbered clauses:
[0050] Example 1: A method of operating a queue at a host controller, the method comprising: receiving a plurality of commands from one or more submission queues (SQs) ; sending the plurality of commands received from the one or more SQs to a storage device to execute the plurality of commands; storing a plurality of completion queue entries (CQEs) , each CQE comprising a response from the storage device in response to the execution of a corresponding one of the plurality of commands; and distributing the plurality of CQEs to a plurality of completion queues (CQs) , each of the plurality of CQs associated with one of a plurality of processing cores according to a distribution algorithm.
[0051] Example 2: The method of example 1, wherein the plurality of CQs comprise: a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; and a second CQ associated with a second processing core of the plurality of processing cores, and wherein the distribution algorithm comprises: sending a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing capability between the first processing core and the second processing core.
[0052] Example 3: The method of example 2, wherein the first processing core has greater processing capability for handling the plurality of CQs than the second processing core.
[0053] Example 4: The method of example 1, wherein the plurality of CQs comprises: a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; and a second CQ associated with a second processing core of the plurality of processing cores, and wherein the distribution algorithm comprises: sending a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing load between the first processing core and the second processing core.
[0054] Example 5: The method of example 4, wherein the distribution algorithm comprises: sending the greater quantity of the plurality of CQEs to the first processing core that has less processing load than the second processing core.
[0055] Example 6: The method of example 1, 2, 3, 4, or 5, wherein the distribution algorithm comprises: distributing the plurality of CQEs to balance a processing load among the plurality of processing cores.
[0056] Example 7: The method of example 1, 2, 3, 4, or 5, wherein the plurality of commands comprise a first command and a second command, both the first command and the second command corresponding to a first SQ of the one or more SQs, wherein the plurality of CQEs comprise a first CQE corresponding to the first command and a second CQE corresponding to the second command, wherein the distribution algorithm comprises: distributing the first CQE to a first CQ of the plurality of CQs; and distributing the second CQE to a second CQ of the plurality of CQs.
[0057] Example 8: The method of example 7, wherein the plurality of processing cores comprises a first processing core and a second processing core, and wherein the first CQ is associated with the first processing core and the second CQ is associated with the second processing core.
[0058] Example 9: The method of example 1, 2, 3, 4, or 5, wherein the distribution algorithm comprises a round robin (RR) algorithm configured to distribute the plurality of CQEs among the plurality of CQs in a sequential manner.
[0059] Example 10: The method of example 9, wherein the RR algorithm comprises a weighted RR algorithm comprising a plurality of weights respectively assigned to the plurality of CQs based on at least one of processor architecture or processing capability of the plurality of processing cores.
[0060] Example 11: A processing apparatus comprising: a plurality of processing cores; a storage device; one or more submission queues (SQs) associated with the plurality of processing cores; a plurality of completion queues (CQs) , each of the plurality of CQs associated with one of the plurality of processing cores; a completion queue buffer; and a host controller connected to the storage device, the host controller configured to: receive a plurality of commands from the one or more SQs; send the plurality of commands received from the one or more SQs to the storage device to execute the plurality of commands; store a plurality of completion queue entries (CQEs) at the completion queue buffer, each CQE comprising a response from the storage device in response to the execution of a corresponding one of the plurality of commands; and distribute the plurality of CQEs among the plurality of CQs according to a distribution algorithm.
[0061] Example 12: The processing apparatus of example 11, wherein the plurality of CQs comprises: a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; and a second CQ associated with a second processing core of the plurality of processing cores, and wherein the host controller is further configured to: send a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing capability between the first processing core and the second processing core.
[0062] Example 13: The processing apparatus of example 12, wherein the first processing core has greater processing capability for handling the plurality of CQs than the second processing core.
[0063] Example 14: The processing apparatus of example 11, wherein the plurality of CQs comprise: a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; and a second CQ associated with a second processing core of the plurality of processing cores, and wherein the host controller is further configured to: send a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing load between the first processing core and the second processing core.
[0064] Example 15: The processing apparatus of example 14, wherein the host controller is further configured to: send the greater quantity of the plurality of CQEs to the first processing core that has less processing load than the second processing core.
[0065] Example 16: The processing apparatus of example 11, 12, 13, 14, or 15, wherein the host controller is further configured to: distribute the plurality of CQEs to balance a processing load among the plurality of processing cores.
[0066] Example 17: The processing apparatus of example 11, 12, 13, 14, or 15, wherein the plurality of commands comprise a first command and a second command, both the first command and the second command corresponding to a same SQ of the one or more SQs, wherein the plurality of CQEs comprise a first CQE corresponding to the first command and a second CQE corresponding to the second command, wherein the host controller is further configured to: distribute the first CQE to a first CQ of the plurality of CQs; and distribute the second CQE to a second CQ of the plurality of CQs.
[0067] Example 18: The processing apparatus of example 17, wherein the plurality of processing cores comprises a first processing core and a second processing core, and wherein the first CQ is associated with the first processing core and the second CQ is associated with the second processing core.
[0068] Example 19: The processing apparatus of example 11, 12, 13, 14, or 15, wherein the distribution algorithm comprises a round robin (RR) algorithm configured to distribute the plurality of CQEs among the plurality of CQs in a sequential manner.
[0069] Example 20: The processing apparatus of example 19, wherein the RR algorithm comprises a weighted RR algorithm comprising a plurality of weights respectively assigned to the plurality of CQs based on at least one of processor architecture or processing capability of the plurality of processing cores.
[0070] Example 21: The processing apparatus of example 11, wherein the host controller comprises: a plurality of CQ load balancing distribution registers corresponding to a plurality of distribution slots according to the distribution algorithm, each of the plurality of CQs assigned to one or more of the plurality of distribution slots; and a plurality of CQ configuration registers corresponding to the plurality of CQs, each CQ configuration register configured to indicate the CQ processing capability of a corresponding core of the plurality of processing cores.
[0071] Example 22: A processing apparatus, comprising: means for receiving a plurality of commands from one or more submission queues (SQs) ; means for sending the plurality of commands received from the one or more SQs to a storage device to execute the plurality of commands; means for storing a plurality of completion queue entries (CQEs) , each CQE comprising a response from the storage device in response to the execution of a corresponding one of the plurality of commands; and means for distributing the plurality of CQEs to a plurality of completion queues (CQs) , each of the plurality of CQs associated with one of a plurality of processing cores according to a distribution algorithm.
[0072] Example 23: The processing apparatus of example 22, wherein the plurality of CQs comprises: a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; and a second CQ associated with a second processing core of the plurality of processing cores, and wherein the distribution algorithm comprises: sending a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing capability between the first processing core and the second processing core.
[0073] Example 24: The processing apparatus of example 23, wherein the first processing core has greater processing capability for handling the plurality of CQs than the second processing core.
[0074] Example 25: The processing apparatus of example 22, wherein the plurality of CQs comprises: a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; and a second CQ associated with a second processing core of the plurality of processing cores, and wherein the distribution algorithm comprises: sending a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing load between the first processing core and the second processing core.
[0075] Example 26: The processing apparatus of example 25, wherein the distribution algorithm comprises: sending the greater quantity of the plurality of CQEs to the first processing core that has less processing load than the second processing core.
[0076] Example 27: The processing apparatus of example 22, wherein the distribution algorithm comprises: distributing the plurality of CQEs to balance a processing load among the plurality of processing cores.
[0077] Example 28: The processing apparatus of example 22, 23, 24, 25, or 26, wherein the plurality of commands comprise a first command and a second command, both the first command and the second command corresponding to a first SQ of the one or more SQs, wherein the plurality of CQEs comprise a first CQE corresponding to the first command and a second CQE corresponding to the second command, wherein the distribution algorithm comprises: distributing the first CQE to a first CQ of the plurality of CQs; and distributing the second CQE to a second CQ of the plurality of CQs.
[0078] Example 29: The processing apparatus of example 28, wherein the plurality of processing cores comprises a first processing core and a second processing core, and wherein the first CQ is associated with the first processing core and the second CQ is associated with the second processing core.
[0079] Example 30: The processing apparatus of example 22, 23, 24, 25, or 26, wherein the distribution algorithm comprises a round robin (RR) algorithm configured to distribute the plurality of CQEs among the plurality of CQs in a sequential manner.
[0080] It is understood that the specific order or hierarchy of steps in the processes disclosed is an illustration of exemplary approaches. Based upon design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged. Further, some steps may be combined or omitted. The accompanying method claims present elements of the various steps in a sample order, and are not meant to be limited to the specific order or hierarchy presented.
[0081] The previous description is provided to enable any person skilled in the art to practice the various aspects described herein. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects. Thus, the claims are not intended to be limited to the aspects shown herein, but is to be accorded the full scope consistent with the language claims, wherein reference to an element in the singular is not intended to mean “one and only one” unless specifically so stated, but rather “one or more. ” Unless specifically stated otherwise, the term “some” refers to one or more. All structural and functional equivalents to the elements of the various aspects described throughout this disclosure that are known or later come to be known to those of ordinary skill in the art are expressly incorporated herein by reference and are intended to be encompassed by the claims. Moreover, nothing disclosed herein is intended to be dedicated to the public regardless of whether such disclosure is explicitly recited in the claims. No claim element is to be construed as a means plus function unless the element is expressly recited using the phrase “means for. ”
[0082] It is understood that the specific order or hierarchy of steps in the processes disclosed is an illustration of exemplary approaches. Based upon design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged. Further, some steps may be combined or omitted. The accompanying method claims present elements of the various steps in a sample order, and are not meant to be limited to the specific order or hierarchy presented.
Claims
1.A method of operating a queue at a host controller, the method comprising:receiving a plurality of commands from one or more submission queues (SQs) ;sending the plurality of commands received from the one or more SQs to a storage device to execute the plurality of commands;storing a plurality of completion queue entries (CQEs) , each CQE comprising a response from the storage device in response to the execution of a corresponding one of the plurality of commands; anddistributing the plurality of CQEs to a plurality of completion queues (CQs) , each of the plurality of CQs associated with one of a plurality of processing cores, according to a distribution algorithm for distributing the CQEs.2.The method of claim 1,wherein the plurality of CQs comprise:a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; anda second CQ associated with a second processing core of the plurality of processing cores, andwherein the distribution algorithm comprises:sending a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing capability between the first processing core and the second processing core.3.The method of claim 2, wherein the first processing core has greater processing capability for handling the plurality of CQs than the second processing core.4.The method of claim 1,wherein the plurality of CQs comprises:a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; anda second CQ associated with a second processing core of the plurality of processing cores, andwherein the distribution algorithm comprises:sending a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing load between the first processing core and the second processing core.5.The method of claim 4, wherein the distribution algorithm comprises:sending the greater quantity of the plurality of CQEs to the first processing core that has less processing load than the second processing core.6.The method of claim 1, wherein the distribution algorithm comprises:distributing the plurality of CQEs to balance a processing load among the plurality of processing cores.7.The method of claim 1,wherein the plurality of commands comprise a first command and a second command, both the first command and the second command corresponding to a first SQ of the one or more SQs,wherein the plurality of CQEs comprise a first CQE corresponding to the first command and a second CQE corresponding to the second command,wherein the distribution algorithm comprises:distributing the first CQE to a first CQ of the plurality of CQs; anddistributing the second CQE to a second CQ of the plurality of CQs.8.The method of claim 7,wherein the plurality of processing cores comprises a first processing core and a second processing core, andwherein the first CQ is associated with the first processing core and the second CQ is associated with the second processing core.9.The method of claim 1, wherein the distribution algorithm comprises a round robin (RR) algorithm configured to distribute the plurality of CQEs among the plurality of CQs in a sequential manner.10.The method of claim 9, wherein the RR algorithm comprises a weighted RR algorithm comprising a plurality of weights respectively assigned to the plurality of CQs based on at least one of processor architecture or processing capability of the plurality of processing cores.11.A processing apparatus comprising:a plurality of processing cores;a storage device;one or more submission queues (SQs) associated with the plurality of processing cores;a plurality of completion queues (CQs) , each of the plurality of CQs associated with one of the plurality of processing cores;a completion queue buffer; anda host controller connected to the storage device, the host controller configured to:receive a plurality of commands from the one or more SQs;send the plurality of commands received from the one or more SQs to the storage device to execute the plurality of commands;store a plurality of completion queue entries (CQEs) at the completion queue buffer, each CQE comprising a response from the storage device in response to the execution of a corresponding one of the plurality of commands; anddistribute the plurality of CQEs among the plurality of CQs according to a distribution algorithm for distributing the CQEs.12.The processing apparatus of claim 11,wherein the plurality of CQs comprises:a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; anda second CQ associated with a second processing core of the plurality of processing cores, andwherein the host controller is further configured to:send a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing capability between the first processing core and the second processing core.13.The processing apparatus of claim 12, wherein the first processing core has greater processing capability for handling the plurality of CQs than the second processing core.14.The processing apparatus of claim 11,wherein the plurality of CQs comprise:a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; anda second CQ associated with a second processing core of the plurality of processing cores, andwherein the host controller is further configured to:send a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing load between the first processing core and the second processing core.15.The processing apparatus of claim 14, wherein the host controller is further configured to:send the greater quantity of the plurality of CQEs to the first processing core that has less processing load than the second processing core.16.The processing apparatus of claim 11, wherein the host controller is further configured to:distribute the plurality of CQEs to balance a processing load among the plurality of processing cores.17.The processing apparatus of claim 11,wherein the plurality of commands comprise a first command and a second command, both the first command and the second command corresponding to a same SQ of the one or more SQs,wherein the plurality of CQEs comprise a first CQE corresponding to the first command and a second CQE corresponding to the second command,wherein the host controller is further configured to:distribute the first CQE to a first CQ of the plurality of CQs; anddistribute the second CQE to a second CQ of the plurality of CQs.18.The processing apparatus of claim 17,wherein the plurality of processing cores comprises a first processing core and a second processing core, andwherein the first CQ is associated with the first processing core and the second CQ is associated with the second processing core.19.The processing apparatus of claim 11, wherein the distribution algorithm comprises a round robin (RR) algorithm configured to distribute the plurality of CQEs among the plurality of CQs in a sequential manner.20.The processing apparatus of claim 19, wherein the RR algorithm comprises a weighted RR algorithm comprising a plurality of weights respectively assigned to the plurality of CQs based on at least one of processor architecture or processing capability of the plurality of processing cores.21.The processing apparatus of claim 11, wherein the host controller comprises:a plurality of CQ load balancing distribution registers corresponding to a plurality of distribution slots according to the distribution algorithm, each of the plurality of CQs assigned to one or more of the plurality of distribution slots; anda plurality of CQ configuration registers corresponding to the plurality of CQs, each CQ configuration register configured to indicate the CQ processing capability of a corresponding core of the plurality of processing cores.22.A processing apparatus, comprising:means for receiving a plurality of commands from one or more submission queues (SQs) ;means for sending the plurality of commands received from the one or more SQs to a storage device to execute the plurality of commands;means for storing a plurality of completion queue entries (CQEs) , each CQE comprising a response from the storage device in response to the execution of a corresponding one of the plurality of commands; andmeans for distributing the plurality of CQEs to a plurality of completion queues (CQs) , each of the plurality of CQs associated with one of a plurality of processing cores according to a distribution algorithm for distributing the CQEs.23.The processing apparatus of claim 22,wherein the plurality of CQs comprises:a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; anda second CQ associated with a second processing core of the plurality of processing cores, andwherein the distribution algorithm comprises:sending a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing capability between the first processing core and the second processing core.24.The processing apparatus of claim 23, wherein the first processing core has greater processing capability for handling the plurality of CQs than the second processing core.25.The processing apparatus of claim 22,wherein the plurality of CQs comprises:a first completion queue (CQ) associated with a first processing core of the plurality of processing cores; anda second CQ associated with a second processing core of the plurality of processing cores, andwherein the distribution algorithm comprises:sending a greater quantity of the plurality of CQEs to the first CQ than the second CQ, based on relative processing load between the first processing core and the second processing core.26.The processing apparatus of claim 25, wherein the distribution algorithm comprises:sending the greater quantity of the plurality of CQEs to the first processing core that has less processing load than the second processing core.27.The processing apparatus of claim 22, wherein the distribution algorithm comprises:distributing the plurality of CQEs to balance a processing load among the plurality of processing cores.28.The processing apparatus of claim 22,wherein the plurality of commands comprise a first command and a second command, both the first command and the second command corresponding to a first SQ of the one or more SQs,wherein the plurality of CQEs comprise a first CQE corresponding to the first command and a second CQE corresponding to the second command,wherein the distribution algorithm comprises:distributing the first CQE to a first CQ of the plurality of CQs; anddistributing the second CQE to a second CQ of the plurality of CQs.29.The processing apparatus of claim 28,wherein the plurality of processing cores comprises a first processing core and a second processing core, andwherein the first CQ is associated with the first processing core and the second CQ is associated with the second processing core.30.The processing apparatus of claim 22, wherein the distribution algorithm comprises a round robin (RR) algorithm configured to distribute the plurality of CQEs among the plurality of CQs in a sequential manner.