METHOD AND SYSTEM FOR PERFORMING DYNAMIC HMB MANAGEMENT IN PCIe-BASED DEVICES
By dynamically managing the HMB memory allocation slots, the memory release delay problem caused by static HMB allocation in PCIe devices is solved, and more efficient memory usage and throughput enhancement is achieved.
Patent Information
- Application Number
- CN202410653234.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-05-30
- Filing Date
- 2024-05-24
- Publication Date
- 2024-12-03
AI Technical Summary
In PCIe-based devices, the allocation of the host memory buffer (HMB) is static, resulting in memory release delays and under-utilization, affecting event throughput enhancement.
By estimating potential memory requirements, sending requests to the host device to dynamically allocate and release memory allocation slots, and dynamic management of HMB memory is achieved using mechanisms such as asynchronous event requests (AERs) and feature commands.
Improves the dynamic allocation and release efficiency of memory, avoids memory release delay, optimizes the use of HMB, and enhances event-based throughput.
Smart Images

Figure CN119065592A_ABST
Abstract
Description
Technical Field
[0001] The disclosure relates to peripheral component interconnect express (PCIe) based devices, and more particularly, to methods and systems for performing dynamic host memory buffer (HMB) management in PCIe based devices. Background Art
[0002] A host memory buffer (HMB) is a portion of memory present in a host device that is used by a peripheral component interconnect express (PCIe) based device. In a PCIe based device, a controller of the PCIe based device uses the HMB (rather than onboard limited memory) to enhance the performance of the PCIe based device. However, in related art methods using storage protocols such as non-volatile memory express (NVMe), HMB allocation is static, meaning that the required HMB is allocated only once during the boot period of the PCIe based device and is released by the host device once the session is completed.
[0003] In addition, in the related art method, when the host device determines that the HMB should be released or when the host device needs the allocated memory to perform the operation of the host device, the release of the HMB occurs. Therefore, when the host device sends the instruction about the release to the PCIe-based device, the PCIe-based device can terminate the operation being performed using the allocated memory of the HMB and remove the data from the allocated memory of the HMB. Thereafter, the host device releases the memory of the HMB originally allocated to the PCIe-based device. This presents a challenge to the PCIe-based device, because the PCIe-based device may have to release the memory when receiving the instruction from the host device, resulting in the delay of the PCIe-based device to complete the operation or the termination of the operation caused by the lack of memory. In addition, in the related art method, when the PCIe-based device has completed its operation and no longer needs the allocated memory of the HMB, the PCIe-based device does not have any way to communicate with the host device to release the allocated memory of the HMB. This leads to a scenario where a portion of the HMB memory is retained in the PCIe-based device even if the memory is not used by the PCIe-based device until the host device sends a release request to the PCIe-based device. Therefore, in the related art system, the HMB is not optimally used, and the controller cannot use the HMB for event-based throughput enhancement without affecting the currently loaded HMB data.
[0004] The information disclosed in this Background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information constitutes the prior art already known to a person skilled in the art. Summary of the invention
[0005] According to one aspect of the disclosure, a method for performing dynamic host memory buffer (HMB) management in a peripheral component interconnect express (PCIe)-based device including a controller is provided, the method comprising: estimating potential memory requirements for one or more memory-intensive operations to be performed by the PCIe-based device; sending a first request to a host device associated with the PCIe-based device, the first request indicating the potential memory requirements of a host memory buffer (HMB) from the host device; receiving a plurality of memory allocation slots from the host device based on the first request; whenever the controller requires memory from the HMB, sending a second request to the host device to dynamically use the plurality of memory allocation slots, the second request including HMB information related to current memory requirements; and initializing memory of the HMB allocated to the PCIe-based device based on the second request to perform at least one of the one or more memory-intensive operations.
[0006] The one or more memory intensive operations may include pre-fetch processing, mode-based improvements for specific applications, background migration, flash operations, garbage collection (GC) migration, and any host memory based operations for optimized and functionalized products.
[0007] HMB information can be stored in an array data structure.
[0008] The HMB information may include: an "enabled" field, an "in use" field, an HMB size, an HMB preferred size, an HMB maximum size, an HMB minimum size, a priority for releasing memory, an approximate duration for retaining memory to perform at least one of the one or more memory intensive operations, and at least one of an HMB memory descriptor list.
[0009] The method may further include receiving the plurality of memory allocation slots sent by the host device through one of a get feature command, a get log page command, and a first command customized according to customer requirements.
[0010] The method may further include: allocating the memory of the HMB to the controller based on a second request; and releasing the memory of the HMB from the controller based on a third request, wherein the second request and the third request are transmitted through one of a set feature command and a second command customized according to customer needs.
[0011] The method may also include: sending a third request to the host device, the third request including HMB information related to dynamically releasing the memory of the HMB used to perform at least one of the one or more memory-intensive operations, wherein the third request is sent to the host device once data is actively removed from the memory of the HMB or before data is removed from the memory of the HMB.
[0012] When the third request is sent before removing the data from the memory of the HMB, receiving confirmation of removing the data from the memory of the HMB from the host device based on the third request; and removing the data from the memory of the HMB based on the confirmation from the host device.
[0013] The method may further include releasing, by the host device, the memory of the HMB based on HMB information related to the release of the memory of the HMB when the removal of the data from the memory of the HMB is completed.
[0014] According to one disclosed aspect, an apparatus for performing dynamic host memory buffer (HMB) (107) management in a peripheral component interconnect express (PCIe)-based device is provided, the apparatus comprising: a controller; and a memory, communicatively coupled to the controller and storing instructions, which, when executed by the controller, cause the controller to: estimate potential memory requirements for one or more memory intensive operations to be performed by the PCIe-based device; send a first request to a host device associated with the PCIe-based device, the first request indicating the potential memory requirements of a host memory buffer (HMB) from the host device; receive a plurality of memory allocation slots from the host device based on the first request; send a second request to the host device to dynamically use the plurality of memory allocation slots, the second request including HMB information related to current memory requirements; and initialize memory of the HMB allocated to the controller based on the second request to perform at least one of the one or more memory intensive operations.
[0015] The foregoing summary is merely illustrative and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features will become apparent by reference to the drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are included in and constitute a part of the present disclosure, illustrate exemplary embodiments and, together with the description, explain the principles of the disclosure. In the drawings, the leftmost digit of a reference number identifies the drawing in which the reference number first appears. The same reference numerals are used throughout the drawings to represent the same features and components. Example embodiments of the systems and / or methods according to the embodiments of the present subject matter and with respect to the drawings are now described by way of example only, in which:
[0017] Figure 1 illustrates an example of communication between a PCIe-based device and a host device according to a disclosed example embodiment;
[0018] Figure 2 A detailed block diagram showing a peripheral component interconnect express (PCIe) device according to an example embodiment of the disclosure;
[0019] Figure 3 A flow chart illustrating a method of performing dynamic host memory buffer (HMB) management in a peripheral component interconnect express (PCIe) based device according to a disclosed example embodiment is shown.
[0020] Figure 4A A sequence diagram illustrating an exemplary memory allocation between a Peripheral Component Interconnect Express (PCIe) based device and a host device is shown.
[0021] Figure 4B A sequence diagram illustrating an exemplary memory deallocation between a Peripheral Component Interconnect Express (PCIe) based device and a host device is shown.
[0022] Figure 5 A general computing system architecture is shown in accordance with the disclosed example embodiments.
[0023] Those skilled in the art will appreciate that any block diagrams herein represent conceptual diagrams of exemplary systems embodying the principles of the present subject matter. Similarly, it will be appreciated that any flow charts, state transition diagrams, pseudocodes, etc. represent various processes that can be substantially represented in a computer-readable medium and executed by a computer or processor, whether or not such computers or processors are explicitly shown. DETAILED DESCRIPTION
[0024] In this disclosure, the term “exemplary” is used herein to mean “serving as an example, instance, or illustration.” Any embodiment or implementation of the subject matter described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0025] Although the disclosure is susceptible to various modifications and alternative forms, the specific embodiments disclosed have been shown by way of example in the accompanying drawings and will be described in detail below. However, it should be understood that it is not intended to limit the disclosure to the specific form disclosed, but on the contrary, the disclosure will cover all modifications, equivalents and alternatives that fall within the scope of the disclosure.
[0026] The terms "include", "comprises" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a configuration, apparatus or method that includes a series of components or steps includes not only these components or steps, but may also include other components or steps not explicitly listed or inherent to these configurations or apparatus or methods. In other words, without further limitations, one or more elements in a system or device beginning with "includes..." do not exclude the presence of other elements or additional elements in the system or method.
[0027] In the following detailed description of the disclosed embodiments, reference is made to the accompanying drawings which form a part thereof, in which specific embodiments in which the disclosure may be practiced are shown by way of example. These embodiments are described in sufficient detail to enable one skilled in the art to practice the disclosure, and it will be understood that other embodiments may be utilized and changes may be made without departing from the scope of the disclosure. Therefore, the following description should not be taken in a limiting sense.
[0028] Figure 1 An example 100 of communication between a PCIe-based device and a host device is shown in accordance with an exemplary embodiment of the disclosure.
[0029] According to an example embodiment, a peripheral component interconnect express (PCIe)-based device (or referred to as, PCIe device) 101 may include a controller 103 configured to perform dynamic host memory buffer (HMB) 107 management. As an example, the PCIe-based device 101 may be a graphics adapter card, a network interface card (NIC), a storage accelerator device, a solid-state drive (SSD) expansion card, a sound card, a storage controller card, a redundant array of independent disks (RAID) controller, a video capture card, etc. According to an example embodiment, the controller 103 and / or the processor of the PCIe-based device 101 may perform dynamic HMB 107 management. According to an example embodiment, the device may be connected to a host device 105 using PCIe. As an example, the host device 105 may be a computing device (such as, a personal computer (PC)), etc.). However, the disclosure is not limited thereto, and thus according to another example embodiment, the computing device may include other electronic devices.
[0030] According to an example embodiment, the controller 103 of the PCIe-based device 101 may estimate potential memory requirements of one or more memory-intensive operations to be performed by the PCIe-based device 101. Here, the potential memory requirements may be estimated memory requirements of one or more memory-intensive operations to be performed by the PCIe-based device 101. The one or more memory-intensive operations may include, but are not limited to, at least one of pre-fetch processing, mode-based improvements for specific applications, background migration, flash memory operations, garbage collection (GC) migration, and any host memory-based operations for optimized and functionalized products. As an example, the PCIe-based device 101 may require a total of 10 gigabytes (GB) of memory to perform the one or more memory-intensive operations.
[0031] According to an example embodiment, when estimating the potential memory demand, the controller 103 may send a first request to a host device 105 associated with the PCIe-based device 101, the first request indicating the potential memory demand from a host memory buffer (HMB) 107 of the host device 105. According to an example embodiment, the PCIe-based device 101 may send the first request using an asynchronous event request (AER).
[0032] According to an example embodiment, when sending a first request to the host device 105, the controller 103 may receive a plurality of memory allocation slots from the host device 105 in response to the first request. For example, based on the first request, the controller 103 may receive a plurality of memory allocation slots from the host device 105. According to an example embodiment, the host device 105 may allocate a plurality of memory allocation slots to the controller 103 so that the controller 103 can dynamically request a host memory of a desired size for performing one or more memory-intensive operations by sending HMB information. For example, whenever one or more memory-intensive operations are performed, the controller 103 may dynamically request a host memory of a desired size. According to an example embodiment, based on the first request, the host device 105 may send a plurality of memory allocation slots to the controller 103. For example, in response to the first request, the host device 105 may send a plurality of memory allocation slots to the controller 103 through a command. According to an example embodiment, the command may include, but is not limited to, a get feature command, a get log page command, or a first command customized according to customer needs. The response to the first request may be based on the configuration of the vendors of the PCIe based device 101 and the host device 105 .
[0033] According to an example embodiment, upon receiving a plurality of memory allocation slots, the controller 103 may use the plurality of memory allocation slots to send a second request to the host device 105, the second request including HMB information related to the current memory demand. According to an example embodiment, the plurality of memory allocation slots from the host device 105 may be used dynamically by the controller when sending the second request. For example, whenever the controller 103 requests memory from the HMB 107, the controller 103 may send a second request to the host device 105 to dynamically use the plurality of memory allocation slots, the second request including HMB information related to the current memory demand. According to an example embodiment, the PCIe-based device 101 may use AER to send the second request. According to an example embodiment, the HMB information may be stored in an array data structure. The HMB information may include, but is not limited to, an "enable" field, an "in use" field, an HMB size, an HMB preferred size, an HMB maximum size, an HMB minimum size, a priority for releasing memory, an approximate duration of keeping memory to perform at least one of one or more memory-intensive operations, and at least one of an HMB memory descriptor list. According to an exemplary scenario, the PCIe-based device 101 may need a memory to perform a pre-fetch processing operation, and the controller 103 of the PCIe-based device 101 may send a second request to the host device 105. Meanwhile, if the PCIe-based device 101 may need a memory to perform background migration, the controller 103 may again send a second request to the host device 105. That is, the controller 103 may send another second request to the host device 105. Since the controller 103 may have requested the host device 105 for a memory indicating a potential memory demand, the memory allocated to perform the pre-fetch processing operation may not be affected.
[0034] According to an example embodiment, when sending the second request, the controller 103 may be configured to initialize the memory of the HMB allocated to the controller 103 in response to the second request to perform at least one of the one or more memory-intensive operations. For example, the controller 103 may initialize the memory of the HMB allocated to the controller 103 based on the second request. According to an example embodiment, in response to the second request, the memory of the HMB 107 may be allocated to the controller 103 by the host device 105 through one of the setting feature command and the second command customized according to customer needs. The response to the second request may be based on the configuration of the vendor of the PCIe-based device 101 and the host device 105. According to an example embodiment, the host device 105 may reserve memory for at least one of the one or more memory-intensive operations. When initializing the memory of the HMB 107, the controller 103 may use the memory of the HMB allocated for performing at least one of the one or more memory-intensive operations.
[0035] According to an example embodiment, upon completion of one or more memory-intensive operations, the controller 103 may send a third request to the host device 105, the third request including HMB information related to the release of the memory of the HMB 107 used to perform at least one of the one or more memory-intensive operations, wherein at least one of the one or more memory-intensive operations is dynamically performed using a plurality of memory allocation slots. According to an example embodiment, the PCIe-based device 101 may send the third request using AER. According to an example embodiment, whenever the controller 103 needs to release the memory of the HMB 107, the controller 103 may send the third request to the host device 105. Thus, the controller 103 may dynamically release the memory of the HMB 107 for use by one or more subsequent or future memory-intensive operations. According to an example embodiment, once data is actively removed from the memory of the HMB 107, the third request may be sent to the host device 105. Once the removal of data from the memory of the HMB 107 is completed, the host device 105 releases the memory of the HMB 107 based on the HMB information related to the release of the memory of the HMB 107.
[0036] In an example embodiment, before removing the data from the memory of the HMB 107, the third request may be sent to the host device 105. According to an example embodiment, the controller 103 may receive a confirmation of removing the data from the memory of the HMB 107 from the host device 105 in response to the third request. Upon receiving the confirmation from the host device 105, the controller 103 may remove the data from the memory of the HMB 107. Once the removal of the data from the memory of the HMB 107 is completed, the host device 105 releases the memory of the HMB 107 based on the HMB information related to the release of the memory of the HMB 107.
[0037] In an example embodiment, when the host device 105 needs the memory allocated to the controller 103, the host device 105 may release the memory of the HMB 107 used by the controller 103 for performing at least one of the one or more memory-intensive operations. For example, when the controller 103 is performing at least one of the one or more memory-intensive operations, the host device 105 may need the memory, and based on the need for the memory, the host device 105 may release the memory. According to an example embodiment, the host device 105 may release the memory and notify or request the controller 103 to remove the data stored in the allocated memory.
[0038] Figure 2 A detailed block diagram of a Peripheral Component Interconnect Express (PCIe) based device 101 is shown according to an example embodiment of the disclosure.
[0039] According to an example embodiment, the PCIe-based device 101 may include an I / O interface 201, a controller 103, and a memory 203. According to an example embodiment, the memory 203 may be communicatively coupled to the controller 103. The controller 103 may be configured to perform one or more functions of the PCIe-based device 101 using data 205 of the PCIe-based device 101 and one or more modules 207 to perform dynamic host memory buffer (HMB) 107 management. According to an example embodiment, the memory 203 may store data 205.
[0040] According to an example embodiment, the data 205 stored in the memory 203 may include, but is not limited to, memory requirement data 209, request data 211, memory allocation slot data 213, HMB information data 215, and other data 217. According to an example embodiment, the data 205 may be stored in the memory 203 in the form of various data structures. In addition, a data model (such as a relational data model or a hierarchical data model) may be used to organize the data 205. The other data 217 may include various temporary data and files generated by one or more modules 207.
[0041] According to an example embodiment, the memory requirement data 209 may include memory requirements for one or more memory intensive operations performed by the PCIe-based device 101. The one or more memory intensive operations may include, but are not limited to, at least one of pre-fetch processing, mode-based improvements for specific applications, background migration, flash memory operations and garbage collection (GC) migration, and any host memory-based operations for optimized / functionalized products. According to an example embodiment, the memory requirement data 209 may be sent to the host device 105 to indicate potential memory requirements for one or more memory intensive operations performed by the controller 103.
[0042] According to an example embodiment, the request data 211 may include information related to a first request, a second request, and a third request sent by the controller 103 to the host device 105. According to an example embodiment, the first request may indicate a potential memory demand of a host memory buffer (HMB) from the host device 105. According to an example embodiment, the second request may include HMB information related to current memory demand. According to an example embodiment, the third request may include HMB information related to the release of memory of the HMB used to perform at least one of the one or more memory-intensive operations. The HMB information provides knowledge about the size of the memory to be allocated to the controller 103 and the corresponding parameters during the allocation, and the size of the memory to be released and the corresponding parameters during the release. According to an example embodiment, the first request, the second request, and the third request may be sent by the PCIe-based device 101. The request data 211 may also include information related to responses received in response to the first request, the second request, and the third request. According to an example embodiment, the PCIe-based device 101 may send the first request, the second request, and the third request using an asynchronous event request (AER).
[0043] According to an example embodiment, the memory allocation slot data 213 may include information related to the memory slot allocated by the host device 105 in response to the first request from the controller 103. The host device 105 may allocate the memory slot based on potential memory requirements for one or more memory intensive operations. According to an example embodiment, the controller 103 may perform at least one of the one or more memory intensive operations using the memory allocation slot data 213 indicating information related to the memory slot allocated by the host device 105.
[0044] According to an example embodiment, the HMB information data 215 may include information related to the current memory demand of the controller 103. The HMB information data 215 may be sent to the host device 105 together with the second request. The HMB information data 215 may include, but is not limited to, at least one of an "enable" field, an "in use" field, an HMB size, an HMB preferred size, an HMB maximum size, an HMB minimum size, a priority for releasing memory, an approximate duration for retaining memory to perform at least one of one or more memory-intensive operations, and an HMB memory descriptor list. According to an example embodiment, the "enable" field may indicate whether the host device 105 has set up the memory. The "in use" field may indicate whether the memory is in use by the controller 103. The HMB size is the size of the HMB memory allocated by the host device 105. The HMB preferred size is the size of the HMB memory preferred by the host device 105. The HMB maximum size is the maximum HMB memory requested by the controller 103. The HMB minimum size is the minimum HMB memory requested by the controller 103. The priority for releasing memory is the priority based on which the host device 105 can release the HMB memory. The duration field may indicate a duration required for at least one of the one or more memory-intensive operations to be performed by the controller 103. According to an example embodiment, the controller 103 may send the HMB information data 215 whenever it requires memory allocation for each of the one or more memory-intensive operations. According to an example embodiment, the controller 103 may also send the HMB information data 215 to the host device 105 when the controller 103 releases memory for performing at least one of the memory-intensive operations.
[0045] According to an example embodiment, the data 205 may be processed by one or more modules 207 of the PCIe-based device 101. According to an example embodiment, the one or more modules 207 may be communicatively coupled to the controller 103 to perform one or more functions of the PCIe-based device 101. According to an example embodiment, the one or more modules 207 may include, but are not limited to, an estimation module 219, a transmission module 221, a reception module 223, an initialization module 225, a release module 227, and other modules 229.
[0046] As used herein, the term module may represent an application specific integrated circuit (ASIC), an electronic circuit, a hardware processor (shared, dedicated or group) and memory that executes one or more software or firmware programs, a combinational logic circuit, and / or other suitable components that provide the described functionality. In one embodiment, each of the one or more modules 207 may be configured as an independent hardware computing unit. According to an example embodiment, other modules 229 may be used to perform various miscellaneous functions for the PCIe-based device 101. It will be understood that such one or more modules 207 may be represented as a single module or a combination of different modules. According to an example embodiment, other modules 229 may include one or more other modules configured to perform other operations of the PCIe-based device alone or in collaboration with the estimation module 219, the sending module 221, the receiving module 223, the initialization module 225, and the release module 227 to perform other operations of the PCIe-based device.
[0047] According to an example embodiment, the estimation module 219 may be configured to estimate potential memory requirements of one or more memory-intensive operations to be performed by the PCIe-based device 101. The estimation module 219 estimates potential memory requirements for a boot period of the host device 105. The one or more memory-intensive operations may include, but are not limited to, at least one of pre-fetch processing, mode-based improvement of specific applications, background migration, flash operation and garbage collection (GC) migration, and any host memory-based operation for an optimized / functionalized product.
[0048] According to an example embodiment, the sending module 221 may be configured to send a first request to a host device 105 associated with a PCIe-based device 101, the first request indicating a potential memory demand of a host memory buffer (HMB) 107 from the host device 105. The sending module 221 may also be configured to send a second request to the host device 105 to dynamically use a plurality of memory allocation slots whenever the controller 103 needs memory from the HMB 107, the second request including HMB information related to the current memory demand. In addition, the sending module 221 may also be configured to send a third request to the host device 105 whenever the controller 103 needs to release memory of the HMB 107, the third request including HMB information related to the release of memory of the HMB 107 for performing at least one of one or more memory-intensive operations, wherein at least one of the one or more memory-intensive operations is dynamically performed using a plurality of memory allocation slots. Therefore, the controller 103 may dynamically release memory of the HMB 107 for use by one or more subsequent or future memory-intensive operations.
[0049] According to an example embodiment, the receiving module 223 may be configured to receive a plurality of memory allocation slots from the host device 105 in response to the first request. The receiving module 223 may also be configured to receive confirmation of removing data from the memory of the HMB 107 from the host device 105 in response to the third request.
[0050] According to an example embodiment, the initialization module 225 may be configured to initialize the memory of the HMB allocated to the controller 103 in response to the second request to perform at least one of the one or more memory-intensive operations. When initializing the memory, the controller 103 may utilize the memory to perform at least one of the one or more memory-intensive operations.
[0051] According to an example embodiment, the release module 227 may be configured to dynamically release the memory of the HMB 107 for performing at least one of the one or more memory-intensive operations using a plurality of memory allocation slots. Upon completion of at least one of the one or more memory-intensive operations, the release module 227 may be configured to remove data from the memory of the HMB 107. According to an example embodiment, the release module 227 may receive a third request, the third request including HMB information related to the release of the memory of the HMB 107 for performing at least one of the one or more memory-intensive operations. According to an example embodiment, once the data is actively removed from the memory of the HMB 107, the third request may be sent to the host device 105. In some other example embodiments, the third request may be sent to the host device 105 before the data is removed from the memory of the HMB 107. When the third request is sent to the host device 105 before the data is removed from the memory of the HMB 107, the release module 227 may receive a confirmation of removing the data from the memory of the HMB 107 from the host device 105 in response to the third request. In addition, in response to the confirmation from the host device 105, the release module 227 can remove the data from the memory of the HMB 107. Once the data is removed from the memory of the HMB 107, the release module 227 can notify the host device 105, and the host device 105 can then release the memory of the HMB 107 from which the data was removed. Once the memory of the HMB 107 is released, the host device 105 can use the memory of the HMB 107 for different allocation requests received from the controller 103 or for the operation of the host device 105.
[0052] Figure 3 A flow chart illustrating a method of performing dynamic host memory buffer (HMB) 107 management in a peripheral component interconnect express (PCIe) based device 101 according to an example embodiment of the disclosure is shown.
[0053] like Figure 3As shown in FIG. , method 300 may include using Figure 2 The peripheral component express (PCIe) based device 101 shown in FIG. 1 performs one or more blocks of a method for dynamic host memory buffer (HMB) 107 management in the PCIe based device 101. The one or more blocks may illustrate one or more operations corresponding to the method for performing dynamic HMB 107 management. The method 300 may be described in the overall context of computer executable instructions. In general, computer executable instructions may include routines, programs, objects, components, data structures, procedures, modules, and functions that perform specific functions or implement specific abstract data types.
[0054] The order in which the method 300 is described is not intended to be construed as limiting, and any number of the described method blocks may be combined in any order to implement the described method. Additionally, individual blocks may be deleted from the method without departing from the scope of the subject matter described herein. Furthermore, the described method may be implemented in any suitable hardware, software, firmware, or a combination thereof.
[0055] In operation 301, the method 300 may include estimating, by the controller 103 of the PCIe-based device 101, potential memory requirements for one or more memory-intensive operations to be performed by the PCIe-based device 101. The one or more memory-intensive operations may include, but are not limited to, at least one of pre-fetch processing, mode-based improvement of specific applications, background migration, flash operations, garbage collection (GC) migration, and any host memory-based operation for optimized and functionalized products.
[0056] In operation 303 , the method 300 may include sending, by the controller 103 , a first request to a host device 105 associated with the PCIe-based device 101 , the first request indicating a potential memory demand of a host memory buffer (HMB) 107 from the host device 105 .
[0057] In operation 305, the method 300 may include receiving, by the controller 103, a plurality of memory allocation slots from the host device 105 in response to a first request. According to an example embodiment, in response to the first request, the host device 105 may send the plurality of memory allocation slots to the controller 103 via one of a get feature command, a get log page command, and a first command customized according to customer requirements.
[0058] In operation 307, the method 300 may include sending, by the controller 103, a second request to the host device 105 to dynamically use a plurality of memory allocation slots whenever the controller 103 requires memory from the HMB 107, the second request including HMB information related to the current memory demand. According to an example embodiment, the HMB information may be stored in an array data structure. According to an example embodiment, the HMB information may include, but is not limited to, an "enabled" field, an "in use" field, an HMB size, an HMB preferred size, an HMB maximum size, an HMB minimum size, a priority for releasing memory, an approximate duration of retaining memory to perform at least one of the one or more memory intensive operations, and at least one of an HMB memory descriptor list.
[0059] In operation 309, the method 300 may include initializing, by the controller 103, in response to the second request, a memory of the HMB allocated to the controller 103 to perform at least one of the one or more memory-intensive operations. According to an example embodiment, in response to the corresponding second request and the third request, the host device 105 allocates the memory of the HMB 107 to the controller 103 and releases the memory of the HMB 107 from the controller 103 by setting one of a feature command and a second command customized according to customer needs. According to an example embodiment, whenever the controller 103 needs to release the memory of the HMB 107, the controller 103 may send a third request to the host device 105, the third request including HMB information related to the release of the memory of the HMB 107 for performing at least one of the one or more memory-intensive operations, wherein at least one of the one or more memory-intensive operations is dynamically performed using a plurality of memory allocation slots. Therefore, the controller 103 may dynamically release the memory of the HMB 107 for use by subsequent or future one or more memory-intensive operations. According to an example embodiment, once data is actively removed from the memory of the HMB 107 or before the data is removed from the memory of the HMB 107, the third request is sent to the host device 105. According to an example embodiment, when the controller 103 receives confirmation of the removal of the data from the memory of the HMB 107 from the host device 105 in response to the third request, the controller 103 removes the data from the memory of the HMB 107 in response to the confirmation from the host device 105. According to an example embodiment, upon completion of the removal of the data from the memory of the HMB 107, the host device 105 releases the memory of the HMB 107 based on the HMB information related to the release of the memory of the HMB 107.
[0060] Figure 4A A sequence diagram illustrating an exemplary memory allocation between a Peripheral Component Interconnect Express (PCIe) based device and a host device is shown.
[0061] According to an example embodiment, a controller 103 of a peripheral component interconnect express (PCIe)-based device 101 may estimate a potential memory requirement for performing one or more memory-intensive operations (S1). When estimating the memory requirement, the controller 103 may send a first request to a host device 105 associated with the PCIe-based device 101 (S2), the first request indicating a potential memory requirement of a host memory buffer (HMB) 107 from the host device 105. As an example, the controller 103 may request to allocate seven slots to perform one or more memory-intensive operations. According to an example embodiment, the PCIe-based device 101 notifies the host device 105 of the potential memory requirement. Therefore, the controller 103 may receive a plurality of memory allocation slots from the host device 105 in response to the first request (S3). As an example, a response to the first request may be one of a get feature command, a get log page command, and a first command customized according to customer requirements. When the PCIe-based device 101 may require the HMB 107 to perform at least one of the one or more memory-intensive operations, the controller 103 may dynamically send a second request to the host device 105 (S4) using a plurality of memory allocation slots whenever the controller 103 requires memory from the HMB 107, the second request including HMB information related to the current memory demand. As an example, the HMB information may include the following exemplary values based on the demand for the one or more memory-intensive operations:
[0062] (HMB ID, slot 0)
[0063] Enable: 0
[0064] In use: 0
[0065] HMB Size: 0
[0066] HMB preferred size: 64 megabytes (MB)
[0067] Maximum HMB size: 128MB
[0068] HMB 107 minimum size: 32MB
[0069] Priority for releasing memory: null
[0070] Approximate duration of retention memory: null
[0071] HMB memory descriptor list: empty
[0072] According to an example embodiment, the controller 103 may receive a response to the second request from the host device 105 (S5). As an example, the response to the second request may be one of a set feature command and a second command customized according to customer needs. For example, the HMB information received in response to the second request may include the following exemplary values:
[0073] (HMB ID, slot 0)
[0074] Enable: 1
[0075] In use: 0
[0076] HMB size: 64 megabytes (MB)
[0077] HMB preferred size: 64 megabytes (MB)
[0078] Maximum HMB size: 128MB
[0079] HMB 107 minimum size: 32MB
[0080] Priority for releasing memory: null
[0081] Approximate duration of retention memory: null
[0082] HMB Memory Descriptor List: Physical addresses of memory allocated by the host device 105
[0083] Upon receiving a response to the second request, the controller 103 may utilize the memory to perform at least one of the memory-intensive operations. According to an example embodiment, the controller 103 may initialize the memory of the HMB allocated to the controller 103 in response to the second request to perform at least one of the one or more memory-intensive operations (S6). When the memory is used by the controller 103, the in-use field in the HMB information may be changed to "1". According to an example embodiment, the controller 103 may send success to the host device 105 to indicate that the initialization is successful (S7). Whenever the controller 103 may need memory from the HMB 107 of the host device 105, the process of sending the first request may be performed until the memory is initialized.
[0084] Figure 4B A sequence diagram illustrating an exemplary memory deallocation between a Peripheral Component Interconnect Express (PCIe) based device and a host device is shown.
[0085] According to an example embodiment, upon completion of the task, the controller 103 may send a third request to the host device 105 (S8), the third request including HMB information related to the release of a memory of the HMB 107 for performing at least one of the one or more memory-intensive operations, wherein at least one of the one or more memory-intensive operations is dynamically performed using a plurality of memory allocation slots. When sending the request, the controller 103 may receive a confirmation of removing data from the memory of the HMB 107 from the host device 105 in response to the third request (S9). As an example, the response to the third request may be one of a set feature command and a second command customized according to customer needs. For example, the HMB information received in response to the third request may include the following exemplary values:
[0086] (HMB ID, slot 0)
[0087] Enable: 0
[0088] In use: 0
[0089] HMB size: 64 megabytes (MB)
[0090] HMB preferred size: 64 megabytes (MB)
[0091] Maximum HMB size: 128MB
[0092] HMB 107 minimum size: 32MB
[0093] Priority for releasing memory: null
[0094] Approximate duration of retention memory: null
[0095] HMB Memory Descriptor List: Physical addresses of memory allocated by the host device 105
[0096] According to an example embodiment, the controller 103 may remove data from the memory of the HMB 107 in response to confirmation from the host device 105 (S10). Upon completion of removing data from the memory of the HMB 107, the host device 105 releases the memory of the HMB 107 based on HMB information related to the release of the memory of the HMB 107 (S11).
[0097] Figure 5 1 is a general diagram of a system 500 to which a peripheral component interconnect express (PCIe) based device is connected according to an example embodiment of the disclosure. In an example embodiment, the system 500 may be a host device 105 explained in the context of the disclosure. According to an example embodiment, Figure 5The system 500 may be a mobile system such as a portable communication terminal (e.g., a mobile phone), a smart phone, a tablet computer (PC), a wearable device, a healthcare device, or an Internet of Things (IOT) device. However, Figure 5 The system 500 is not limited to a mobile system and may be a PC, a laptop computer, a server, a media player, or an automotive device (eg, a navigation device).
[0098] Reference Figure 5 , the system 500 may include a main processor 510, a memory (e.g., 520a and 520b), and a storage device (e.g., 530a and 530b). In addition, the system 500 may include at least one of an image capture device 541, a user input device 542, a sensor 543, a communication device 544, a display 545, a speaker 546, a power supply device 547, and a connection interface 548.
[0099] According to example embodiments, the main processor 510 may control all operations of the system 500. For example, the main processor 510 may control operations of other components included in the system 500. The main processor 510 may be implemented as a general-purpose processor, a dedicated processor, or an application processor.
[0100] The main processor 510 may include at least one CPU core 511 and a controller 512 configured to control memories 520a to 520b and / or storage devices 530a to 530b. In an example embodiment, the main processor 510 may also include an accelerator 513, which is a dedicated circuit for high-speed data operations (such as artificial intelligence (AI) data operations). The accelerator 513 may include a graphics processing unit (GPU), a neural processing unit (NPU), and / or a data processing unit (DPU), and may be implemented as a chip physically separated from other components of the main processor 510.
[0101] The memories 520a to 520b may be used as main memory devices of the system 500. Although each of the memories 520a to 520b may include a volatile memory such as a static random access memory (SRAM) and / or a dynamic RAM (DRAM), each of the memories 520a to 520b may include a nonvolatile memory such as a flash memory, a phase change RAM (PRAM), and / or a resistive RAM (RRAM). The memories 520a to 520b may be implemented in the same package as the main processor 510.
[0102] The storage devices 530a and 530b may be used as non-volatile storage devices configured to store data regardless of whether power is supplied to it, and have a larger storage size than the memories 520a to 520b. The storage devices 530a and 530b may include a storage controller (STRG CTRL) configured to store data via the control of the storage controllers 531a and 531b and NVM (non-volatile memory, such as flash memory) 532a and 532b, respectively. Although the NVMs 532a and 532b may include flash memory having a two-dimensional (2D) structure or a three-dimensional (3D) V-NAND structure, the NVM may include other types of NVMs (such as PRAM and / or RRAM).
[0103] The storage devices 530a and 530b may be physically separated from the main processor 510 and included in the system 500 or implemented in the same package as the main processor 510. In addition, the storage devices 530a and 530b may have various types of solid-state devices (SSDs) or memory cards, and may be removably combined with other components of the system 500 through an interface (such as a connection interface 548 to be described below). The storage devices 530a and 530b may be devices that apply a standard protocol (such as Universal Flash Storage (UFS), Embedded Multimedia Card (eMMC), or Non-Volatile Memory Express (NVMe)), but are not limited thereto.
[0104] The image capture device 541 may capture a still image or a moving image. The image capture device 541 may include a camera, a camcorder, and / or a webcam.
[0105] The user input device 542 may receive various types of data input by a user of the system 500 and include a touch pad, a keypad, a keyboard, a mouse, and / or a microphone.
[0106] The sensor 543 may detect various types of physical quantities that may be obtained from the outside of the system 500 and convert the detected physical quantities into electrical signals. The sensor 543 may include a temperature sensor, a pressure sensor, an illumination sensor, a position sensor, an acceleration sensor, a biosensor, and / or a gyro sensor.
[0107] The communication device 544 may send and receive signals according to various communication protocols between other devices outside the system 500. The communication device 544 may include an antenna, a transceiver, and / or a modem.
[0108] Display 545 and speaker 546 may be used as output devices configured to output visual information and auditory information, respectively, to a user of system 500 .
[0109] The power supply device 547 may appropriately convert power supplied from a battery (not shown) embedded in the system 500 and / or an external power source, and supply the converted power to each component of the system 500 .
[0110] The connection interface 548 may provide a connection between the system 500 and an external device that is connected to the system 500 and is capable of transmitting and receiving data to and from the system 500. The connection interface 548 may be implemented by using various interface schemes (such as Advanced Technology Attachment (ATA), Serial ATA (SATA), External SATA (e-SATA), Small Computer Small Interface (SCSI), Serial Attached SCSI (SAS), Peripheral Component Interconnect (PCI), PCI Express (PCIe), NVMe, IEEE 1394, Universal Serial Bus (USB) interface, Secure Digital (SD) card interface, MultiMediaCard (MMC) interface, eMMC interface, UFS interface, embedded UFS (eUFS) interface, and Compact Flash (CF) card interface).
[0111] According to an example embodiment, a method for estimating potential memory demand and sending a request indicating the potential memory demand to a host device is provided. In this way, the host device is aware of the potential memory demand during a boot period to provide a plurality of memory allocation slots that enable a controller to dynamically request a desired size of host memory for performing memory intensive operations.
[0112] According to an example embodiment, the method further comprises: whenever memory is required for performing one or more memory-intensive operations, sending a request to allocate memory using an asynchronous event request (AER). In this way, memory is dynamically allocated, and thus, even after a startup period, the controller is able to perform one or more memory-intensive operations using the dynamically allocated memory.
[0113] According to an example embodiment, the method further comprises: releasing memory of the HMB used by the controller for performing one or more memory intensive operations upon completion of the operation. In this way, the method dynamically utilizes memory by making the memory available for subsequent one or more memory intensive operations.
[0114] As described above, it should be noted that the method according to one or more disclosed embodiments can be used to overcome various technical problems associated with performing dynamic host memory buffer (HMB) management in a peripheral component interconnect express (PCIe)-based device. In other words, the method according to one or more disclosed embodiments has practical application and provides a technically improved solution to the technical problems associated with existing methods of dynamic host memory buffer (HMB) management in PCIe-based devices.
[0115] In view of the technical progress provided by the method according to one or more embodiments disclosed, because the operations of the method as described above provide the above-mentioned solutions to the technical problems existing in the related art technology, these operations are not conventional or well-known aspects in the art. In addition, because these operations provide technical solutions to technical problems, these operations obviously bring about improvements in the functions of the system itself.
[0116] Unless expressly stated otherwise, the terms "embodiment," "multiple embodiments," "one or more embodiments," "example embodiment," and "one embodiment" mean "one or more (but not all) embodiments of the invention."
[0117] Unless expressly stated otherwise, the terms "includes," "comprising," "having" and variations thereof mean "including but not limited to."
[0118] An enumerated listing of items does not imply that any or all of the items are mutually exclusive, unless expressly stated otherwise. The terms "a" and "an" mean "one or more," unless expressly stated otherwise.
[0119] The description of an embodiment with several components in communication with each other does not imply that all such components are required. Rather, various optional components are described to illustrate various possible embodiments of the invention.
[0120] When a single device or article is described herein, it will be clear that more than one device / article (whether or not they cooperate) may be used in place of a single device / article. Similarly, where more than one device / article is described herein (whether or not they cooperate), it will be clear that a single device / article may be used in place of more than one device / article, or a different number of devices / articles may be used in place of the number of devices or procedures shown. Optionally, the functions and / or features of a device may be optionally embodied by one or more other devices that are not explicitly described as having such functions / features. Thus, other embodiments of the invention need not include the device itself.
[0121] Finally, the language used in the specification is selected primarily for readability and illustrative purposes, and may not be selected to describe or limit the subject matter of the invention. Therefore, it is intended that the scope of the invention be limited not by the detailed description, but by any claims that issue based on this application. Therefore, the embodiments of the invention are intended to illustrate, but not to limit, the scope of the invention, which is set forth in the appended claims.
[0122] Although various aspects and embodiments have been disclosed herein, other aspects and embodiments will be apparent to those skilled in the art. The various aspects and embodiments disclosed herein are for illustrative purposes and are not intended to be limiting, with the true scope and spirit being indicated by the appended claims.
Claims
1. A method for performing dynamic host memory buffer management in a peripheral component express (PCI) based device including a controller, the method comprising: include: estimating potential memory requirements for one or more memory intensive operations to be performed by a peripheral component fast interconnect-based device; sending a first request to a host device associated with the PCE-based device, the first request indicating the potential memory demand from a host memory buffer of the host device; receiving a plurality of memory allocation slots from a host device based on a first request; Whenever the controller requires memory from the host memory buffer, sending a second request to the host device to dynamically use the plurality of memory allocation slots, the second request including host memory buffer information associated with the current memory demand; as well as A memory allocated to a host memory buffer of the PCE-based device is initialized based on the second request to perform at least one of the one or more memory-intensive operations.
2. The method according to claim 1, in, The one or more memory intensive operations include at least one of pre-fetch processing, mode-based improvements for specific applications, background migration, flash operations, garbage collection migration, and any host memory-based operations for optimized and functionalized products.
3. The method according to claim 1, in, Host memory buffer information is stored in an array data structure.
4. The method according to claim 3, in, The host memory buffer information includes: an "enabled" field, an "in use" field, a host memory buffer size, a host memory buffer preferred size, a host memory buffer maximum size, a host memory buffer minimum size, a priority for releasing memory, an approximate duration for retaining memory to perform at least one of the one or more memory intensive operations, and at least one of a host memory buffer memory descriptor list.
5. The method according to claim 1, further comprising: include: The plurality of memory allocation slots are received and sent by the host device through one of a get feature command, a get log page command, and a first command customized according to customer requirements.
6. The method according to any one of claims 1 to 5, further comprising: include: allocating memory of the host memory buffer to the controller based on the second request; as well as releasing memory of the host memory buffer from the controller based on a third request, The response to each of the second request and the third request is transmitted through one of a set feature command and a second command customized according to customer needs.
7. The method according to any one of claims 1 to 5, further comprising: include: sending a third request to the host device, the third request including host memory buffer information related to dynamically releasing memory of a host memory buffer used to perform at least one of the one or more memory intensive operations, Wherein, upon actively removing the data from the memory of the host memory buffer or before removing the data from the memory of the host memory buffer, the third request is sent to the host device.
8. The method according to claim 7, include: When the third request is sent before the data is removed from the memory in the host memory buffer, receiving, from the host device, confirmation of removal of the data from the memory of the host memory buffer based on the third request; as well as Data is removed from memory in a host memory buffer based on the acknowledgement from the host device.
9. The method according to claim 7, further comprising: include: Upon completion of removing the data from the memory of the host memory buffer, the memory of the host memory buffer is released by the host device based on the host memory buffer information related to the release of the memory of the host memory buffer.
10. An apparatus for performing dynamic host memory buffer management in a peripheral component express (PCE) based device, the apparatus comprising: include: Controller; as well as A memory is communicatively coupled to the controller and stores instructions that, when executed by the controller, cause the controller to: estimating potential memory requirements for one or more memory intensive operations to be performed by a peripheral component fast interconnect-based device; sending a first request to a host device associated with the PCE-based device, the first request indicating the potential memory demand from a host memory buffer of the host device; receiving a plurality of memory allocation slots from a host device based on a first request; sending a second request to the host device to dynamically use the plurality of memory allocation slots, the second request including host memory buffer information associated with a current memory demand; as well as Memory allocated to a host memory buffer of the controller is initialized based on the second request to perform at least one of the one or more memory intensive operations.
11. The device according to claim 10, in, The one or more memory intensive operations include at least one of pre-fetch processing, mode-based improvements for specific applications, background migration, flash operations, garbage collection migration, and any host memory-based operations for optimized / functionalized products.
12. The device according to claim 10, in, Host memory buffer information is stored in an array data structure.
13. The device according to claim 12, in, The host memory buffer information includes: an "enabled" field, an "in use" field, a host memory buffer size, a host memory buffer preferred size, a host memory buffer maximum size, a host memory buffer minimum size, a priority for releasing memory, an approximate duration for retaining memory to perform at least one of the one or more memory intensive operations, and at least one of a host memory buffer memory descriptor list.
14. The device according to claim 10, in, The controller is further configured to receive the plurality of memory allocation slots sent by the host device through one of a get feature command, a get log page command, and a first command customized according to customer requirements.
15. The device according to any one of claims 10 to 14, in, allocating, by the host device, memory of the host memory buffer to the controller based on the second request, and releasing, by the host device, memory of the host memory buffer from the controller based on the third request, The response to each of the second request and the third request is transmitted through one of a set feature command and a second command customized according to customer needs.
16. The device according to any one of claims 10 to 14, in, The controller is also configured to: sending a third request to the host device, the third request including host memory buffer information related to dynamically releasing memory of a host memory buffer used to perform at least one of the one or more memory intensive operations, Wherein, upon actively removing the data from the memory of the host memory buffer or before removing the data from the memory of the host memory buffer, the third request is sent to the host device.
17. The device according to claim 16, include: When the third request is sent before removing the data from the memory in the host memory buffer, the controller is configured to: receiving, from the host device, confirmation of removal of the data from the memory of the host memory buffer based on the third request; as well as Data is removed from memory in a host memory buffer based on the acknowledgement from the host device.
18. The device according to claim 16, in, Upon completion of removing the data from the memory of the host memory buffer, the memory of the host memory buffer is released by the host device based on the host memory buffer information related to the release of the memory of the host memory buffer.
