A memory virtualization I / O isolation method, apparatus and medium
By associating the virtual device (VF) of the SSD with a namespace and binding a unique write channel and garbage collection channel, the I/O isolation problem in SR-IOV technology for SSDs is solved, improving the overall performance and reliability of the system.
Patent Information
- Application Number
- CN202211399760.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-09
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-11-09
AI Technical Summary
When SSDs use SR-IOV technology, they cannot achieve I/O isolation, which causes business operations of different users to interfere with each other, reducing the overall performance and reliability of the system.
By associating each virtual device (VF) with a corresponding namespace, obtaining relevant information, binding unique write channels and garbage collection channels, configuring attributes, and allocating storage resource pools, the correspondence between virtual devices (VF), namespaces, and write channels is established, thereby achieving I/O isolation.
This achieves isolation between different business functions, improves the overall performance and reliability of the system, and avoids mutual interference between business functions.
Smart Images

Figure CN115562817B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of SR-IOV technology, and in particular to an I / O isolation method, apparatus and medium for memory virtualization. Background Technology
[0002] Single Root I / O Virtualization and Sharing Specification (SR-IOV) is a technical specification defined by the PCI-SIG Association. It is a virtual channel implementation technology used to virtualize a PCIe device into multiple PCIe devices. Each virtual PCIe device has its own PCIe configuration space and provides services to upper-layer software just like a physical PCIe device.
[0003] Devices using SR-IOV consist of one physical function (PF) and multiple virtual functions (VFs). The PF possesses all the functionalities of a PCIe device and can be managed and configured like a regular PCIe device. The VF is similar to the PF, possessing all input / output (I / O) related functions. However, the VF can only manipulate data on the PCIe device and cannot perform device configuration and management.
[0004] PCIe devices using SR-IOV technology consist of multiple PFs and VFs, with multiple VFs grouped together and corresponding to one PF. Each PF has a unique configuration space, which is shared by the VFs associated with it. Each VF also has its own independent BAR (Basic Address Register) address and I / O queue. When virtual machines are mapped to each VF, each virtual machine can directly access unique hardware resources, thereby improving system performance.
[0005] Currently, Solid State Disks (SSDs) using SR-IOV technology can virtualize a single SSD device into multiple SSD devices for use by different users (e.g., virtual machines). However, current SSD devices using SR-IOV technology cannot achieve I / O isolation. When different users are using VF, their services interfere with each other, reducing the overall system performance.
[0006] Therefore, how to solve the I / O isolation problem when applying SR-IOV technology to SSDs, and how to prevent different VFs from affecting each other when performing different services, thereby improving the overall performance and reliability of the system, is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0007] The purpose of this application is to provide an I / O isolation method, device and medium for memory virtualization, to solve the I / O isolation problem when SSDs use SR-IOV technology, to avoid different VFs from affecting each other when performing different services, and to improve the overall performance and reliability of the system.
[0008] To address the aforementioned technical problems, this application provides an I / O isolation method for memory virtualization, comprising:
[0009] After associating each virtual device (VF) with a corresponding namespace at the front end, the namespace-related information sent by the front end is obtained.
[0010] Based on the namespace-related information and the pre-established write channel resources, a unique write channel is bound to each namespace;
[0011] The namespace-related information is used to configure a unique write channel attribute for each namespace;
[0012] Allocate a corresponding storage resource pool for each of the unique write channels.
[0013] Preferably, after obtaining the namespace-related information sent by the front end, the method further includes:
[0014] Each namespace is bound to a unique garbage collection channel;
[0015] Calculate the waste collection threshold corresponding to each waste collection channel based on the name space information;
[0016] Based on the waste recycling threshold corresponding to each of the waste recycling channels, a waste recycling triggering mechanism is set for each of the waste recycling channels.
[0017] Preferably, after obtaining the namespace-related information sent by the front end, the method further includes:
[0018] Each namespace is bound to a unique garbage collection channel;
[0019] Calculate the waste collection threshold corresponding to each waste collection channel based on the name space information;
[0020] A common recycling threshold is set for all the waste recycling channels based on the waste recycling threshold corresponding to each of the aforementioned waste recycling channels;
[0021] The waste recycling mechanism is triggered based on the public recycling threshold.
[0022] Preferably, after triggering the waste collection mechanism based on the public recycling threshold, the method further includes:
[0023] After determining that the garbage collection mechanism has been triggered, the garbage collection priority of each garbage collection channel is determined based on the garbage collection threshold corresponding to each garbage collection channel.
[0024] Waste is collected from each of the waste collection channels in order of priority.
[0025] Preferably, it further includes:
[0026] The remaining space in each namespace is determined based on the namespace-related information.
[0027] The ratio of garbage collection write speed to host write speed is calculated based on the remaining space in each of the aforementioned namespaces.
[0028] The speed ratio is used to set an independent flow control management mechanism for each namespace.
[0029] Preferably, it further includes:
[0030] After receiving the unbinding instruction sent by the front end;
[0031] Remove the binding relationship between each namespace and its corresponding unique write channel;
[0032] Clear the configuration attributes and storage resource pools of each unique write channel.
[0033] To address the aforementioned technical problems, this application also provides an I / O isolation device for memory virtualization, comprising:
[0034] The acquisition module is used to acquire the namespace-related information sent by the front end after the front end associates each virtual device (VF) with a one-to-one namespace.
[0035] The binding module is used to bind a unique write channel to each name space based on the name space-related information and the pre-established write channel resources;
[0036] The configuration module is used to configure attributes for the unique write channel bound to each namespace based on the namespace-related information;
[0037] The allocation module is used to allocate a corresponding storage resource pool for each of the unique write channels.
[0038] To address the aforementioned technical problems, this application also provides an I / O isolation device for memory virtualization, including a memory for storing computer programs;
[0039] A processor, used to implement the memory virtualization I / O isolation method when executing the computer program.
[0040] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the memory virtualization I / O isolation method described above.
[0041] This invention provides an I / O isolation method for memory virtualization, comprising: after associating each virtual device (VF) with a corresponding namespace at the front end, obtaining namespace-related information sent by the front end; binding a unique write channel to each namespace based on the namespace-related information and pre-established write channel resources; configuring attributes for the unique write channel bound to each namespace based on the namespace-related information; and allocating a corresponding storage resource pool for each unique write channel. Thus, the technical solution provided in this application establishes a one-to-one correspondence between the virtual device (VF), namespace, and write channel, and allocates a corresponding storage resource pool to each write channel. Therefore, when different users write data using their respective virtual devices (VF), they use their respective unique channels for business operations, avoiding mutual interference between services, achieving I / O isolation when applying SR-IOV technology, and thereby improving the overall performance of the system.
[0042] In addition, this application also provides an I / O isolation device and medium for memory virtualization, which corresponds to the above-mentioned I / O isolation method for memory virtualization and has the same effect. Attached Figure Description
[0043] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 A flowchart illustrating an I / O isolation method for memory virtualization provided in this application embodiment;
[0045] Figure 2 This is a diagram illustrating the internal structure of an SSD as provided in an embodiment of this application.
[0046] Figure 3 This is another SSD internal structure diagram provided in an embodiment of this application;
[0047] Figure 4 This is a schematic diagram illustrating a waste recycling threshold setting provided in an embodiment of this application;
[0048] Figure 5 This is a structural diagram of an I / O isolation device for memory virtualization provided in an embodiment of this application;
[0049] Figure 6 This is a structural diagram of an I / O isolation device for memory virtualization provided in another embodiment of this application. Detailed Implementation
[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0051] The core of this application is to provide an I / O isolation method, device, and medium for memory virtualization, which establishes a one-to-one correspondence between virtual device (VF), namespace, and write channel, and allocates a corresponding storage resource pool to each write channel. This ensures that when different users write data through the virtual device (VF), they can utilize their respective independent channels, achieving non-interference between services, thereby realizing I / O isolation when applying SR-IOV technology and improving system performance.
[0052] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] SR-IOV technology is a technical specification defined by the PCI-SIG Association. It is a virtual channel implementation technology used to virtualize a PCIe device into multiple PCIe devices. Each virtual PCIe device has its own PCIe configuration space and provides services to upper-layer software just like a physical PCIe device.
[0054] Devices using SR-IOV consist of one PF (Power Provider) and multiple VFs (Virtual Functions). The PF has all the functions of a PCIe device and can be managed and configured like a regular PCIe device. The VF is similar to the PF, possessing all the I / O-related functions of the device. However, the VF can only manipulate data on the PCIe device and cannot perform device configuration or management.
[0055] PCIe devices using SR-IOV technology consist of multiple PFs and VFs, with multiple VFs grouped together and corresponding to one PF. Each PF has a unique configuration space, which is shared by the VFs associated with it. Each VF also has its own independent BAR address and I / O queue. When virtual machines are mapped to each VF, each virtual machine can directly access unique hardware resources, thereby improving system performance.
[0056] Currently, SSD applications using SR-IOV technology can virtualize a single SSD device into multiple SSD devices for use by different users (e.g., virtual machines). However, current SSD devices using SR-IOV technology cannot achieve I / O isolation. When different users are using VF, their services interfere with each other, reducing the overall system performance.
[0057] To address the I / O isolation issue when applying SR-IOV technology to SSDs and prevent different Virtual Devices (VFs) from interfering with each other while performing different services, thereby improving overall system performance and reliability, this application provides an I / O isolation method for memory virtualization. This method binds Virtual Devices (VFs), namespaces, and write channels to establish a one-to-one correspondence, and binds each write channel to a corresponding storage resource pool. This ensures that when users (e.g., virtual machines) write data through a Virtual Device (VF), the services between each write channel do not interfere with each other, thus achieving I / O isolation when applying SR-IOV technology.
[0058] Figure 1 A flowchart illustrating an I / O isolation method for memory virtualization provided in this application embodiment is shown below. Figure 1 As shown, the method includes:
[0059] S10: After associating each virtual device (VF) with a one-to-one namespace at the front end, obtain the namespace-related information sent by the front end;
[0060] Figure 2 This is a diagram illustrating the internal structure of an SSD provided in an embodiment of this application. In this embodiment, the front-end (FE) divides the SSD's internal space into NAND flash memory chips based on the namespace capacity, forming independent spaces such as nand1, nand2, nand3...nandn. Figure 2 As shown, in an SSD using SR-IOV technology, one physical device (PF) corresponds to multiple virtual devices (VF), and one VF corresponds to one namespace, and one namespace corresponds to one NAND flash memory chip.
[0061] It should be noted that each VF has its own set of address and management resources, and each namespace is virtualized as an independent device. The namespaces do not affect each other, thus realizing the virtualization of one SSD into multiple SSD devices. Upper-layer users (e.g., virtual machines) can use different virtual SSD devices for business.
[0062] After the front-end associates each Virtual Device (VF) with a corresponding namespace, the FTL obtains the namespace-related information sent by the front-end. This namespace-related information includes a unique ID for each namespace, the capacity of each namespace, and the data format corresponding to each namespace. Since business operations need to be implemented based on this namespace-related information, this information needs to be persistently stored in the FTL.
[0063] S11: Bind a unique write channel to each namespace based on namespace-related information and pre-established write channel resources;
[0064] Figure 3 This is another SSD internal structure diagram provided in this application embodiment. After obtaining the relevant information of each namespace according to step S10, a unique write channel mas is bound to each namespace according to the namespace information and the pre-established write channel resources. For example... Figure 3 As shown, FTL pre-establishes a number of write channels (mas) equal to the number of namespaces. When creating a write channel (mas), its configuration information includes the data format, the number of sblks required for the namespace capacity, etc. After obtaining the namespace information, each namespace is uniquely identified by its ID, and a unique write channel (mas) is bound to it, forming a one-to-one correspondence.
[0065] During binding, binding is performed based on the namespace and write channel mas number, for example, ... Figure 3As shown, namespace1 is bound to write channel mas1. In fact, when the frontend creates namespace1, it transmits the relevant information of namespace1 to the FTL. At this time, the FTL configures the corresponding write channel mas1 for it based on the relevant information of namespace1. During configuration, write channels mas1 with corresponding numbers need to be pre-created based on the storage space required by namespace1 and the capacity of namespace1, and then namespace1 is bound to the pre-created write channel mas1. It is worth noting that this application does not limit the binding number.
[0066] S12: Configure attributes for the unique write channel bound to each namespace based on namespace-related information;
[0067] S13: Allocate a corresponding storage resource pool for each unique write channel.
[0068] Furthermore, after establishing a one-to-one correspondence between namespaces and write channels (mas), a corresponding storage resource pool (sblk pool) is allocated to each unique write channel (mas). That is, the number of storage resource pools (sblk pools) is the same as the number of write channels (mas). To ensure that each channel can perform independent business operations smoothly, it is necessary to configure attributes for the unique write channels bound to each namespace based on namespace-related information. For example, the data format specified for each write channel (mas) is set to be the same as the data format of the corresponding namespace. Through write channel configuration attributes, the system can perceive the data format and capacity information of the virtual device, enabling the use of this configuration information in different business scenarios.
[0069] It should be noted that there is no specific order between steps S12 and S13; they can be performed simultaneously or either step can be performed first. This application does not impose any restrictions on this.
[0070] Furthermore, it should be noted that the write channel mas and the storage resource pool sblk pool are subordinate to each other. In implementation, based on the namespace capacity, the write channel mas will be allocated to a corresponding storage resource pool sblk pool. The storage resource pool sblk pool includes multiple super blocks, which are storage units used to store data. The specific number of super blocks needs to be determined based on the corresponding namespace capacity and reserved storage space (OP).
[0071] Before the corresponding namespace is deleted, the super block in the storage resource pool (sblk pool) is exclusively used by the corresponding write channel (mas) to store data written by the host. When the front-end (FE) issues a write command to the FTL, the FTL finds the corresponding write channel (mas) based on the namespace ID in the command, so that the host can write data to the super block corresponding to that write channel (mas).
[0072] The I / O isolation method for memory virtualization provided in this application includes: after associating each virtual device (VF) with a corresponding namespace at the front end, obtaining namespace-related information sent by the front end; binding a unique write channel to each namespace based on the namespace-related information and pre-established write channel resources; configuring attributes for the unique write channel bound to each namespace based on the namespace-related information; and allocating a corresponding storage resource pool for each unique write channel. Therefore, the technical solution provided in this application establishes a one-to-one correspondence between the virtual device (VF), namespace, and write channel, and allocates a corresponding storage resource pool to each write channel. Thus, when different users write data using their respective virtual devices (VF), they use their respective unique channels for business operations, avoiding mutual interference between services, achieving I / O isolation when applying SR-IOV technology, and thereby improving the overall system performance.
[0073] In practice, to ensure the independence of virtual devices, data must also be independent. Therefore, in addition to I / O isolation, garbage collection (GC) must also be isolated.
[0074] In a preferred embodiment, after obtaining the namespace-related information sent by the front end, the method further includes:
[0075] Each namespace is assigned a unique garbage collection channel;
[0076] Calculate the waste collection threshold for each waste collection channel based on the namespace information;
[0077] Based on the waste recycling threshold corresponding to each waste recycling channel, a waste recycling trigger mechanism is set for each waste recycling channel.
[0078] To achieve GC isolation, each namespace needs to be uniquely bound to a garbage collection channel. After binding, since the capacity of each write channel's mass array (MAS) is different, the garbage collection threshold for each garbage collection channel is calculated based on the namespace information. Then, a garbage collection trigger mechanism is set for each garbage collection channel based on its corresponding garbage collection threshold. It should be noted that the garbage collection mechanism refers to immediately triggering garbage data collection when the high usage of the corresponding storage space in the namespace reaches the GC threshold; that is, triggering GC.
[0079] Figure 4 This is a schematic diagram illustrating a waste recycling threshold setting provided in an embodiment of this application, as shown below. Figure 4 As shown, each namespace corresponds to a GC threshold. For example, the GC threshold for namespace1 is 1. When the storage space usage of namespace1 reaches the GC threshold 1, garbage data collection is triggered.
[0080] It is worth noting that the garbage collection threshold can be the value reached by the current usage of each storage space, or the value corresponding to the remaining storage space; this application does not limit this.
[0081] The I / O isolation method for memory virtualization provided in this application binds a unique garbage collection channel to each namespace. Then, it calculates the garbage collection threshold corresponding to each garbage collection channel based on the namespace information, and sets a garbage collection triggering mechanism for each garbage collection channel based on the garbage collection threshold. Thus, each namespace corresponds to a unique garbage collection mechanism, ensuring that garbage data collection is isolated from each other, further guaranteeing the reliability of isolation between virtual devices.
[0082] Based on the above embodiments, it can be understood that an SSD disk has multiple namespaces, each with a different capacity and a different GC threshold. During the host's data writing process, when the super block is consumed, the FTL needs to check the free super blocks in the corresponding storage resource pool (sblk pool) in real time. When there are insufficient free super blocks, GC needs to be initiated.
[0083] However, if each namespace reserves a free super block corresponding to the GC threshold, then a large portion of the super blocks in the entire SSD will be reserved, resulting in a very small reserved storage space operation (OP), which in turn affects the SSD's performance. An example will be provided below for easier understanding.
[0084] For example, a 4TB SSD contains 1000 superblocks, of which 800 are in the user area and 200 are in the reserved storage space (OP). The user area refers to the storage space that is visible and directly usable by the user. If the GC threshold is set to 20 superblocks, then GC will be initiated when more than 980 superblocks on the disk are consumed.
[0085] However, when applying SR-IOV technology to SSDs, assuming eight virtual devices (VFs) are created, each with 100 superblocks in the user area and 25 superblocks in the operational area, then the eight VFs will require reserving 80 superblocks. This means that when more than 920 superblocks are used, garbage collection (GC) will need to be initiated. Compared to not using SR-IOV technology, the GC data volume increases, leading to performance degradation, which is unacceptable for SSDs that prioritize performance and lifespan.
[0086] Therefore, to improve the performance of SSDs using SR-IOV technology, as a preferred embodiment, the technical solution provided in this application binds a unique garbage collection channel to each namespace, calculates the garbage collection threshold corresponding to each garbage collection channel based on the namespace information, sets a common garbage collection threshold for all garbage collection channels based on the garbage collection threshold corresponding to each garbage collection channel, and triggers a garbage collection mechanism based on the common garbage collection threshold. It is understood that the garbage collection mechanism is the same as in the above embodiment, and will not be described in detail here. For ease of understanding, the above example will be used as a basis for explanation.
[0087] In the eight Virtual Functions (VFs), each VF has 100 superblocks in its user area and 25 superblocks in its operational area. Each VF contributes two superblocks, reserving 16 superblocks for garbage collection (GC). These 16 superblocks are shared space across all VFs. Additionally, a certain number of superblocks are virtually allocated to each namespace, corresponding to its GC threshold. Specifically, as mentioned earlier, the eight VFs will need to reserve 80 superblocks as the GC threshold, with each VF reserving 10 superblocks. After using the 16 superblocks for shared space, each VF contributes two superblocks to form the shared space. Each namespace is then virtually allocated the aforementioned 10 superblocks, meaning that 10 virtual superblocks are visible to the system for that namespace. GC is triggered when the namespace begins using these 10 superblocks.
[0088] It should be noted that the virtually allocated storage space is actually unusable space, which is a virtual space visible to the system. It is the usage rights allocated to each namespace, and the number of super blocks virtually allocated to each namespace cannot exceed the total number reserved for garbage collection.
[0089] During implementation, when one of the virtual devices (VFs) has exhausted the storage space occupied by its own user area and OP area, it means that the virtual device VF has exhausted all the callable super blocks. At this time, garbage collection (GC) is required.
[0090] The I / O isolation method for memory virtualization provided in this application avoids the overall performance degradation of the SSD caused by setting a separate garbage collection threshold for each virtual device. It binds a unique garbage collection channel to each namespace, calculates the garbage collection threshold for each channel based on namespace information, and then sets a common garbage collection threshold for all channels based on the garbage collection thresholds for each channel. Finally, it triggers the garbage collection mechanism based on this common threshold. Thus, by sharing a single garbage collection threshold, the performance of the SSD is guaranteed when SR-IOV technology is applied.
[0091] Based on the above embodiments, if multiple virtual devices (VFs) simultaneously exhaust the storage space occupied by their user area and OP area, and need to perform garbage collection (GC) at the same time, it is necessary to determine the priority of GC among the virtual devices (VFs). Therefore, as a preferred embodiment, after determining that the garbage collection mechanism is triggered, the garbage collection priority of each majority garbage collection channel is determined according to the garbage collection threshold corresponding to each garbage collection channel, and garbage is collected for each garbage collection channel in order according to the garbage collection priority.
[0092] It should be noted that the garbage collection priority is determined based on the remaining number of virtual super blocks allocated in each namespace. The fewer the remaining super blocks, the higher the priority of garbage collection for the corresponding virtual device (VF).
[0093] As is understandable, the virtual allocation of super blocks is a threshold for each namespace. When the actual usable super blocks in a namespace are exhausted, the system still has a number of virtual super blocks remaining, which triggers garbage collection (GC). For easier understanding, an example will be provided below.
[0094] The actual available space for namespace1 is 50 super blocks, and the virtual allocated super blocks are 6. That is, the GC threshold for namespace1 is 6, so the system-visible storage space for namespace1 is 6 super blocks. GC is triggered when there are 6 super blocks remaining.
[0095] The actual available space for namespace2 is 60 super blocks, and the virtual allocated super blocks are 8. That is, the GC threshold for namespace2 is 8, so the system-visible storage space for namespace2 is 8 super blocks. GC is triggered when there are 8 super blocks remaining.
[0096] If there are 5 remaining super blocks visible to the system in namespace1 and 2 remaining super blocks visible to the system in namespace2, both namespace1 and namespace2 have triggered their respective GC thresholds. However, the number of remaining super blocks in namespace2 is less than the number of remaining super blocks in namespace1. Therefore, namespace2 will be GCed first.
[0097] The I / O isolation method for memory virtualization provided in this application ensures the performance of each virtual device by performing garbage collection sequentially according to the garbage collection priority of each virtual device when multiple virtual devices need to be garbage collected.
[0098] In practical implementation, performance isolation is also crucial for I / O isolation in memory virtualization. Performance isolation refers to the stability of read and write data between different namespaces per unit time.
[0099] Performance isolation is controlled by the front end based on the namespace capacity, that is, the allocation of I / O traffic to each namespace per unit time. It is also achieved through FTL (Functional Load Tour) management of the namespace.
[0100] Performance isolation requires ensuring that garbage collection (GC) within one namespace does not affect the performance of other namespaces. Therefore, within the FTL (Functional Time Layer), independent flow control is needed for each namespace. Flow control refers to the ratio of garbage collection write speed to host write speed, thereby maintaining a stable number of free superblocks within the write channel mas and preventing system crashes due to superblock exhaustion.
[0101] Therefore, as a preferred embodiment, it further includes:
[0102] Determine the remaining space in each namespace based on the namespace information;
[0103] The ratio of garbage collection write speed to host write speed is calculated based on the remaining space in each namespace.
[0104] Set up independent flow control management mechanisms for each namespace by adjusting the speed ratio.
[0105] In practice, the ratio of the garbage collection write speed (GC write) to the host write speed (Host write) of the write channel mas is dynamic. This ratio needs to be calculated in real time based on the change in the number of free super blocks in the current write channel mas, that is, the remaining space in each name space is determined based on the name space related information.
[0106] After determining the ratio of garbage collection write speed to host write speed based on the remaining space in each namespace, an independent flow control management mechanism is set for each namespace according to the speed ratio. Due to the inherent precision of this speed ratio, and the fact that some services are not affected by the flow control module, the number of idle superblocks may deviate from the stable expectation. Therefore, a ratio coefficient can be introduced as negative feedback to change the number of host writes, thereby controlling the increase or decrease of the number of idle superblocks and automatically adjusting the number of idle superblocks to a stable level. This ratio coefficient was obtained through multiple simulation experiments.
[0107] Therefore, flow control for each namespace can be adjusted based on the number of free superblocks in the corresponding write channel mas, thereby achieving performance isolation between virtual devices. When different performance tests are performed on different virtual devices, the results do not affect each other. For example, Test 1 involves random read tests on virtual device VFs 1-32 and random write tests on VFs 33-64. Test 2 involves either all random read tests or all random write tests on VFs 1-64. Ultimately, the results of Test 1 and Test 2 are consistent.
[0108] The memory virtualization I / O isolation method provided in this application improves the I / O isolation performance of memory virtualization by performing independent flow control management on each namespace to achieve performance isolation between virtual devices.
[0109] During implementation, if an unbinding command is received from the front end, FTL will release the binding relationship between each namespace and the corresponding unique write channel, and clear the configuration attributes and storage resource pool of each unique write channel. In this way, the mapping relationship between each namespace and the write channel can be dynamically bound and unbound.
[0110] The I / O isolation method for memory virtualization provided in this application embodiment can dynamically adjust the mapping relationship between each namespace and the write channel according to the binding and unbinding instructions sent by the front end, thereby improving the diversity of memory virtualization.
[0111] In the above embodiments, the I / O isolation method for memory virtualization has been described in detail. This application also provides an embodiment corresponding to the I / O isolation device for memory virtualization. It should be noted that this application describes the embodiment of the device part from two perspectives: one is based on the functional module, and the other is based on the hardware structure.
[0112] Figure 5This is a structural diagram of an I / O isolation device for memory virtualization provided in an embodiment of this application, as shown below. Figure 5 As shown, the device includes:
[0113] The acquisition module 10 is used to acquire the name space-related information sent by the front end after the front end associates each virtual device (VF) with a one-to-one name space.
[0114] Binding module 11 is used to bind a unique write channel to each namespace based on namespace-related information and pre-established write channel resources;
[0115] Configuration module 12 is used to configure attributes for the unique write channel bound to each namespace based on namespace-related information;
[0116] The allocation module 13 is used to allocate a corresponding storage resource pool for each unique write channel.
[0117] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.
[0118] The I / O isolation device for memory virtualization provided in this application includes: after associating each virtual device (VF) with a corresponding namespace at the front end, obtaining namespace-related information sent by the front end; binding a unique write channel to each namespace based on the namespace-related information and pre-established write channel resources; configuring attributes for the unique write channel bound to each namespace based on the namespace-related information; and allocating a corresponding storage resource pool for each unique write channel. Therefore, the technical solution provided in this application establishes a one-to-one correspondence between the virtual device (VF), namespace, and write channel, and allocates a corresponding storage resource pool to each write channel. Thus, when different users write data using their respective virtual devices (VF), they use their respective unique channels for business operations, avoiding mutual interference between services, achieving I / O isolation when applying SR-IOV technology, and thereby improving the overall system performance.
[0119] Figure 6 A structural diagram of an I / O isolation device for memory virtualization provided in another embodiment of this application is shown below. Figure 6 As shown, the memory virtualization I / O isolation device includes: a memory 20 for storing computer programs;
[0120] The processor 21 is configured to implement the steps of the memory virtualization I / O isolation method as described in the above embodiments when executing a computer program.
[0121] The memory virtualization I / O isolation device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.
[0122] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0123] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the memory virtualization I / O isolation method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the relevant data involved in the memory virtualization I / O isolation method.
[0124] In some embodiments, the memory virtualization I / O isolation device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0125] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on the I / O isolation device for memory virtualization and may include more or fewer components than illustrated.
[0126] The memory virtualization I / O isolation device provided in this application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: memory virtualization I / O isolation method.
[0127] The memory virtualization I / O isolation device provided in this application establishes a one-to-one correspondence between virtual devices (VF), namespaces, and write channels, and allocates a corresponding storage resource pool to each write channel. As a result, when different users write data using their respective virtual devices (VF), they use their respective unique channels for business, avoiding mutual interference between services, realizing I / O isolation when applying SR-IOV technology, and thus improving the overall performance of the system.
[0128] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.
[0129] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0130] The foregoing has provided a detailed description of an I / O isolation method, apparatus, and medium for memory virtualization provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0131] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A memory virtualization I / O isolation method, characterized in that, include: After associating each virtual device (VF) with a corresponding namespace at the front end, the namespace-related information sent by the front end is obtained. Based on the namespace-related information and the pre-established write channel resources, a unique write channel is bound to each namespace; The namespace-related information is used to configure a unique write channel attribute for each namespace; Allocate a corresponding storage resource pool for each of the unique write channels; After obtaining the namespace-related information sent by the front end, the process also includes: Each namespace is bound to a unique garbage collection channel; Calculate the waste collection threshold corresponding to each waste collection channel based on the name space information; A common recycling threshold is set for all the waste recycling channels based on the waste recycling threshold corresponding to each of the aforementioned waste recycling channels; The waste recycling mechanism is triggered based on the public recycling threshold.
2. The I / O isolation method for memory virtualization according to claim 1, characterized in that, After triggering the garbage collection mechanism based on the public recycling threshold, the following is also included: After determining that the garbage collection mechanism has been triggered, the garbage collection priority of each garbage collection channel is determined based on the garbage collection threshold corresponding to each garbage collection channel. Waste is collected from each of the waste collection channels in order of priority.
3. The I / O isolation method for memory virtualization according to claim 1, characterized in that, Also includes: The remaining space in each namespace is determined based on the namespace-related information. The ratio of garbage collection write speed to host write speed is calculated based on the remaining space in each of the aforementioned namespaces. The speed ratio is used to set an independent flow control management mechanism for each namespace.
4. The I / O isolation method for memory virtualization according to claim 1, characterized in that, Also includes: After receiving the unbinding instruction sent by the front end; Remove the binding relationship between each namespace and its corresponding unique write channel; Clear the configuration attributes and storage resource pools of each unique write channel.
5. An I / O isolation device for memory virtualization, characterized in that, include: The acquisition module is used to acquire the namespace-related information sent by the front end after the front end associates each virtual device (VF) with a one-to-one namespace. The binding module is used to bind a unique write channel to each name space based on the name space-related information and the pre-established write channel resources; The configuration module is used to configure attributes for the unique write channel bound to each namespace based on the namespace-related information; The allocation module is used to allocate a corresponding storage resource pool for each of the unique write channels; The memory virtualization I / O isolation device is further configured to include, after obtaining the namespace-related information sent by the front end: Each namespace is bound to a unique garbage collection channel; Calculate the waste collection threshold corresponding to each waste collection channel based on the name space information; A common recycling threshold is set for all the waste recycling channels based on the waste recycling threshold corresponding to each of the aforementioned waste recycling channels; The waste recycling mechanism is triggered based on the public recycling threshold.
6. An I / O isolation device for memory virtualization, characterized in that, Includes memory used to store computer programs; A processor, configured to implement the I / O isolation method for memory virtualization as described in any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the memory virtualization I / O isolation method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Computer system and memory access device
CN107894913A
