A solid state hard disk data access method, electronic device, storage medium and program product for heterogeneous computing
By splitting data access requests and dynamically allocating them to multiple queues, and utilizing the multi-queue concurrency capability of the solid-state drive, the problem of failing to fully utilize the advantages of multiple queues in the existing technology is solved, and the data transmission performance is improved.
Patent Information
- Application Number
- CN202410693486.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-05-31
AI Technical Summary
The existing technology fails to fully utilize the multi-queue concurrency advantage supported by solid-state drives, resulting in limited file transfer performance. Especially when accessing large files, the system fails to effectively utilize the concurrency capabilities of NVMe SSDs.
By splitting the data access request into multiple I/O requests and assigning them to multiple software queues and I/O submission queues, the target queue is dynamically determined based on the busyness of the CPU core and the congestion of the queue, giving full play to the solid state The multi-queue concurrency capability of the hard disk.
It improves the data transmission performance of solid-state drives, improves the data transmission efficiency between heterogeneous acceleration devices or hosts and solid-state drives, and solves the performance bottleneck problem of single-queue services.
Smart Images

Figure CN118259840B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a solid state hard disk data access method, electronic device, storage medium and program product for heterogeneous computing. Background Art
[0002] Heterogeneous computing acceleration can make full use of the advantages of different types of processors. By assigning tasks to different processors for parallel execution, computing efficiency can be improved. With the emergence of high-performance hardware accelerators and the continuous optimization of algorithms and frameworks, the computing power and speed of the system have been rapidly improved, and its performance bottleneck has gradually shifted to I / O. Taking heterogeneous computing scenarios such as artificial intelligence and large models as an example, data loading and saving checkpoints involve a large number of I / O operations. The rapid growth of the size of the training data set and the continuous increase in the number of model parameters have further increased the tasks of the I / O system. The efficiency of data loading will replace computing power as the decisive factor in the performance of systems such as artificial intelligence and large models.
[0003] In the prior art, in order to improve the data access performance of SSDs, heterogeneous acceleration devices use PCIe Peer to Peer technology to bypass the CPU and system memory and communicate directly with SSDs. This method can not only reduce the use of system memory resources, but also effectively improve data transmission performance under the condition of large data volume transmission.
[0004] However, the existing technology has defects: the read and write requests of files are often initiated by one CPU core, and one CPU core only uses one SSD I / O queue to serve. When accessing large files, even when the NVMe SSD is relatively idle, the system does not take advantage of the concurrency of the NVMe SSD supporting multiple queues, which limits the file transfer performance. Summary of the invention
[0005] The present invention provides a solid-state hard disk data access method, electronic device, storage medium and program product for heterogeneous computing, so as to solve the defect that the prior art does not utilize the concurrency advantage of the solid-state hard disk supporting multiple queues, limits the file transfer performance, and improves the data transmission performance of the solid-state hard disk.
[0006] The present invention provides a solid state hard disk data access method for heterogeneous computing, which is used in a heterogeneous computing system. The method comprises the following steps.
[0007] After receiving the data access request, obtain the hard disk parameters in the user library;
[0008] According to the hard disk parameters and the maximum data access amount of a single I / O request, the data access request is split into multiple I / O requests, and the multiple I / O requests are placed in a software queue corresponding to a CPU core that executes the data access request;
[0009] Checking the congestion of the I / O request in the software queue corresponding to the CPU core, and determining a target I / O submission queue in the solid-state drive for receiving the I / O request, and sending the I / O request to the target I / O submission queue; wherein the solid-state drive is provided with multiple I / O submission queues;
[0010] After the solid state drive completes processing the I / O request, receiving a response result returned by the solid state drive, and returning the response result to the user;
[0011] Among them: there is a corresponding relationship between the software queue and the CPU core, and there is a corresponding relationship between the I / O submission queue and the software queue. If the I / O access of the CPU core is not busy, the target I / O submission queue includes the I / O submission queue corresponding to the CPU core that executes the data access request; if the I / O access of the CPU core is busy, the target I / O submission queue includes the I / O submission queues corresponding to other non-busy CPU cores and the I / O submission queue corresponding to the CPU core that executes the data access request; when the data access request is split into multiple I / O requests, I / O requests initiated by different CPU cores are distinguished by using I / O serial numbers in different ranges as command indicators; the number of I / O requests undertaken by each I / O submission queue is related to the busyness of the I / O access of the corresponding CPU core.
[0012] According to a solid state hard disk data access method for heterogeneous computing provided by the present invention, the heterogeneous computing system includes a software queue management unit; when receiving a data access request generated by a CPU core, obtaining hard disk parameters in the user library includes:
[0013] Upon receiving a data access request generated by the CPU core, obtaining a solid state drive read function of the user library, and obtaining the hard drive parameters including a starting logical block address, a number of logical blocks, a logical block size, and a target memory location of the solid state drive;
[0014] The data access request and the hard disk parameter are transmitted to the software queue management unit.
[0015] According to a solid state disk data access method for heterogeneous computing provided by the present invention, according to the hard disk parameters and the maximum data access amount of a single I / O request, the data access request is split into multiple I / O requests, including: splitting the data access request into multiple I / O requests according to the hard disk parameters and the maximum data access amount of a single I / O request by the software queue management unit;
[0016] After splitting the data access request into multiple I / O requests according to the hard disk parameters and the maximum data access amount of a single I / O request, the method further includes:
[0017] An I / O serial number is assigned to each I / O request by the software queue management unit, and the I / O serial number group included in the data access request is recorded; wherein the I / O serial number is a value within the I / O serial number range of the i-th software queue, and the initial value is i 65535 / M, plus 1 for each additional I / O request. If the serial number increases to 65535 / M (i+1), reset the I / O serial number to i 65535 / M, M is the total number of software queues, i∈[1,M].
[0018] According to a solid state drive data access method for heterogeneous computing provided by the present invention, before receiving a data access request, the method further includes a step of initializing the heterogeneous computing system, specifically including:
[0019] Obtain the number of CPU cores of the system, recorded as M; obtain the maximum number of I / O submission queues supported by the solid-state drive, recorded as N;
[0020] Create corresponding software queues for M CPU cores respectively, with a total of M software queues; wherein the software queues are used to receive and cache data access requests issued by the corresponding CPU cores;
[0021] Initialize and configure the solid-state drive according to the specification requirements of the solid-state drive, create N I / O submission queues and N I / O completion queues, wherein the I / O completion queues correspond to the I / O submission queues one by one, and the priorities of the queues are the same;
[0022] Set a statistics unit for each I / O submission queue to record data access requests in the last K units of time, including the data location and size of each request;
[0023] Establish a correspondence between the M software queues and the N I / O submission queues:
[0024] The serial numbers of the I / O requests issued by the software queue are divided into the following ranges: .
[0025] According to a solid state disk data access method for heterogeneous computing provided by the present invention, a corresponding relationship between M software queues and N I / O submission queues is established, including:
[0026] If M > N, the i-th CPU core corresponds to the i-th software queue, where at least two software queues correspond to one I / O submission queue;
[0027] If M = N, the i-th CPU core corresponds to the i-th software queue, and the i-th software queue corresponds to the i-th I / O submission queue;
[0028] If M < N, the i-th CPU core corresponds to the i-th software queue, where one software queue corresponds to at least two I / O submission queues.
[0029] According to a solid-state drive data access method for heterogeneous computing provided by the present invention, the heterogeneous computing system includes an I / O submission queue management unit;
[0030] After putting multiple I / O requests into the software queue corresponding to the CPU core that executes the data access request, the method further includes: notifying the I / O submission queue management unit;
[0031] View the congestion situation of the I / O requests in the software queue corresponding to this CPU core, and determine the target I / O submission queue in the solid-state drive for receiving I / O requests, and send the I / O requests to the target I / O submission queue, including:
[0032] View, through the I / O submission queue management unit, whether the I / O requests in the software queue corresponding to this CPU core are less than a predetermined threshold, where the predetermined threshold is used to identify the congestion situation of the I / O requests in the software queue;
[0033] If the number of I / O requests in this software queue is less than the predetermined threshold, determine, through the I / O submission queue management unit, the I / O submission queue corresponding to this software queue as the target I / O submission queue, and take out the I / O requests from this software queue, and send the I / O requests to the target I / O submission queue; where each software queue corresponds to at least one I / O submission queue;
[0034] If the number of I / O requests in this I / O software queue is greater than or equal to the predetermined threshold, determine, through the I / O submission queue management unit, the I / O submission queue corresponding to this software queue and at least one I / O submission queue in the solid-state drive corresponding to other software queues as the target I / O submission queue, and take out the I / O requests from this software queue, and send the I / O requests to the target I / O submission queue.
[0035] According to a solid state drive data access method for heterogeneous computing provided by the present invention, an I / O submission queue corresponding to the software queue is determined as a target I / O submission queue by an I / O submission queue management unit, and an I / O request is taken out from the software queue, and the I / O request is sent to the target I / O submission queue, including:
[0036] In the case that the I / O submission queue corresponding to the software queue is a single one, the I / O submission queue corresponding to the software queue is determined as a target I / O submission queue by the I / O submission queue management unit, and an I / O request is taken out from the software queue, the multiple I / O requests are converted into a hard disk queue according to the protocol requirements of the solid state drive, the command indicator in the hard disk queue is set as an I / O serial number, and the I / O request is sent to the target I / O submission queue;
[0037] In the case where there are multiple I / O submission queues corresponding to the software queue, the multiple I / O submission queues corresponding to the software queue are determined as target I / O submission queues through the I / O submission queue management unit, and I / O requests are taken out from the software queue, and the multiple I / O requests are converted into a hard disk queue according to the protocol requirements of the solid-state drive, the command indicator in the hard disk queue is set to the I / O serial number, and the I / O requests are sent to different target I / O submission queues in sequence.
[0038] According to a solid state drive data access method for heterogeneous computing provided by the present invention, an I / O submission queue corresponding to the software queue and at least one I / O submission queue corresponding to other software queues in the solid state drive are determined as target I / O submission queues through an I / O submission queue management unit, including:
[0039] The I / O submission queue management unit calculates the target data access volume completed by each I / O submission queue in the most recent K unit time according to the statistical unit data of each I / O submission queue;
[0040] Determine, by the I / O submission queue management unit, an I / O submission queue whose target data access volume is smaller than the target data access volume of the I / O submission queue corresponding to the software queue as a first candidate I / O submission queue from at least one I / O submission queue corresponding to other software queues;
[0041] The first candidate I / O submission queue and the I / O submission queue corresponding to the software queue are determined as the target I / O submission queue by an I / O submission queue management unit.
[0042] According to a solid state drive data access method for heterogeneous computing provided by the present invention, after determining the first candidate I / O submission queue, the method further includes:
[0043] Obtaining the load rate of each CPU core through the I / O submission queue management unit, removing the I / O submission queue corresponding to the CPU core whose CPU load rate exceeds the load threshold from the first candidate I / O submission queue, and obtaining a second candidate I / O submission queue;
[0044] The second candidate I / O submission queue and the I / O submission queue corresponding to the software queue are determined as the target I / O submission queue by the I / O submission queue management unit.
[0045] According to a solid state drive data access method for heterogeneous computing provided by the present invention, an I / O request is taken out from the software queue, and the I / O request is sent to a target I / O submission queue, including:
[0046] The I / O submission queue management unit calculates the data access volume of the target I / O submission queue in the latest P unit time respectively, and sorts the multiple target I / O submission queues according to the data access volume;
[0047] Calculate, by the I / O submission queue management unit, the number of I / O requests received by each of the target I / O submission queues based on the total number of I / O requests in the software queue and the data access volume of each of the target I / O submission queues in the most recent P unit time;
[0048] A corresponding number of I / O requests are taken out from the software queue through the I / O submission queue management unit, and the corresponding number of I / O requests are sent to the corresponding target I / O submission queues in sequence according to the order of the multiple target I / O submission queues.
[0049] According to a solid state drive data access method for heterogeneous computing provided by the present invention, the response result in the I / O completion queue includes a command indicator set as an I / O serial number, and the heterogeneous computing system includes an interrupt management unit;
[0050] After the solid state drive completes processing the I / O request, receiving a response result returned by the solid state drive, and returning the response result to the user, including:
[0051] After the solid state drive has processed the I / O request, receiving an interrupt notification response sent by the solid state drive through the CPU core;
[0052] After the CPU core receives the interrupt, the I / O completion queue is read through the interrupt management unit to obtain the command indicator corresponding to the response result, and the response result is returned to the corresponding software queue management unit according to the value of the command indicator and the I / O serial number range used by the software queue;
[0053] The software queue management unit checks the saved data access request and the I / O serial number contained therein, and after all the response results of the I / O requests corresponding to the data access request are returned, the response results are returned to the user.
[0054] According to a solid state disk data access method for heterogeneous computing provided by the present invention, the number of I / O requests received by each target I / O submission queue is calculated by the following formula:
[0055]
[0056] in, The number of IO requests that the ith I / O submission queue should receive among multiple target I / O submission queues; Ceil represents the rounding up function; Represents the maximum amount of data access in a single I / O submission queue in the last P units of time among multiple target I / O submission queues; and Respectively represent the data access volume of the j-th and i-th I / O submission queues in multiple target I / O submission queues; Indicates the number of I / O requests for the software queue.
[0057] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the solid state drive data access method for heterogeneous computing as described in any one of the above is implemented.
[0058] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the solid-state hard disk data access methods for heterogeneous computing as described above.
[0059] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the solid-state hard disk data access method for heterogeneous computing as described in any one of the above is implemented.
[0060] The solid-state hard disk data access method and device for heterogeneous computing provided by the present invention obtain hard disk parameters in a user library after receiving a data access request; generate multiple I / O requests from a single data access request according to the hard disk parameters and the maximum data access amount of a single I / O request, then check the congestion of the I / O requests in the software queue corresponding to the CPU core, and determine the target I / O submission queue for receiving the I / O request in the solid-state hard disk, send the I / O request to the target I / O submission queue, receive the response result returned by the solid-state hard disk after the solid-state hard disk processes the I / O request, and return the response result to the user, so as to give full play to the advantages of the concurrent working mechanism of multiple I / O submission queues of the solid-state hard disk, so as to improve the data transmission performance between the heterogeneous acceleration device or host and the solid-state hard disk. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0062] Figure 1 It is a schematic diagram of the structure of the heterogeneous computing system provided by the present invention.
[0063] Figure 2 This is one of the flow charts of the solid state drive data access method for heterogeneous computing provided by the present invention.
[0064] Figure 3 This is the second flow chart of the solid state drive data access method for heterogeneous computing provided by the present invention.
[0065] Figure 4 This is the third flow chart of the solid state drive data access method for heterogeneous computing provided by the present invention.
[0066] Figure 5 It is a schematic diagram of sending multiple I / O requests to different target I / O submission queues in sequence in turn provided by the present invention.
[0067] Figure 6 This is the fourth flow chart of the solid state drive data access method for heterogeneous computing provided by the present invention.
[0068] Figure 7 This is the fifth flow chart of the solid state drive data access method for heterogeneous computing provided by the present invention.
[0069] Figure 8 This is the sixth flow chart of the solid state drive data access method for heterogeneous computing provided by the present invention.
[0070] Fig. 9 This is the seventh flow chart of the solid state drive data access method for heterogeneous computing provided by the present invention.
[0071] Fig.10 It is a structural schematic diagram of a solid state disk data access device for heterogeneous computing provided by the present invention.
[0072] Fig.11 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] Parallel computing on heterogeneous computing systems is usually called heterogeneous computing. Heterogeneous computing is a special form of parallel and distributed computing, which uses a group of independent computers interconnected by a high-speed network to complete computing tasks. It can coordinate the use of machines with different performance and structure to meet different computing needs, and enable code (or code segments) to be executed in a way that maximizes overall performance.
[0075] Aiming at the data access performance problem of solid-state drives in heterogeneous computing, the present invention proposes a solid-state drive data access method for heterogeneous computing. The method first obtains the maximum number of I / O submission queues and the maximum number of I / O completion queues supported by the target solid-state drive, as well as the maximum data access volume of a single I / O command; the data access request is composed of multiple I / O requests, and they are allocated to different I / O submission queues based on the busyness of the work queue, giving full play to the advantages of the solid-state drive NVMe multi-queue concurrent working mechanism to improve the data transmission performance between the heterogeneous acceleration device or host and the solid-state drive NVMe.
[0076] The solid state disk data access method of the present invention is applied to heterogeneous computing systems, see Figure 1 ,The heterogeneous computing system includes a user library, a software queue management unit, an I / O submission queue management unit, and an interrupt management unit.
[0077] The user library is used to provide an access interface to the user, so as to provide the parameters of the solid state drive to the software queue management unit.
[0078] The software queue management unit is used for receiving a single request and splitting the single request into multiple I / O requests.
[0079] The I / O submission queue management unit is responsible for coordinating the work scheduling of different I / O submission queues: based on the busyness of the I / O submission queue, determining the I / O submission queue to which the I / O request is to be assigned, and assigning the I / O request to the corresponding I / O submission queue.
[0080] The interrupt management unit is used to receive the response result of the solid state drive and return it to the software queue management unit and the user library.
[0081] In addition, it also includes an access volume statistics unit for recording the data access status of each work queue.
[0082] Combine the following Figure 2-Figure 9 The present invention describes a solid state hard disk data access method for heterogeneous computing.
[0083] Figure 2 This is one of the flow charts of the solid state drive data access method for heterogeneous computing provided by the present invention, such as Figure 2 As shown, the method includes the following steps 201 to 204.
[0084] Step 201: upon receiving a data access request, obtaining hard disk parameters in the user library.
[0085] In the present invention, the CPU includes multiple CPU cores, each CPU core has a corresponding software queue, and each data access request is initiated by one of the CPU cores.
[0086] Specifically, step 201 includes: when receiving a data access request generated by the CPU core, obtaining the solid-state hard disk read function nvme_read() function of the user library, obtaining the hard disk parameters including the starting logical block address, number of logical blocks, logical block size and target memory location of the solid-state hard disk, and then passing the hard disk parameters and the data access request to the software queue management unit.
[0087] The hard disk parameters may be used to segment data access requests in subsequent steps.
[0088] Step 202: Generate multiple I / O requests from the data access request according to the hard disk parameters and the maximum data access amount of a single I / O request, and put the multiple I / O requests into a software queue corresponding to the CPU core that executes the data access request.
[0089] Step 202 specifically includes: splitting the data access request into multiple I / O requests according to the hard disk parameters and the maximum data access amount of a single I / O request through the software queue management unit, placing the multiple I / O requests into the software queue corresponding to the CPU core, and notifying the I / O submission queue management unit.
[0090] In the present invention, a single data access request cannot be sent directly to the solid state drive, but needs to be split into multiple I / O requests, and then the multiple I / O requests are sent to the solid state drive respectively, and the solid state drive receives the response results generated according to each I / O request. Each I / O request corresponds to a maximum data access amount, and the response result of the solid state drive to each I / O request does not exceed the maximum data access amount.
[0091] After the multiple I / O requests are placed in the software queue, the software queue management unit sends a notification to the I / O submission queue management unit, so that the I / O submission queue management unit executes the step of sending the I / O requests to the target I / O submission queue.
[0092] Step 203, check the congestion of the I / O request in the software queue corresponding to the CPU core, and determine the target I / O submission queue in the solid-state drive for receiving the I / O request, and send the I / O request to the target I / O submission queue; wherein, the solid-state drive is provided with multiple I / O submission queues.
[0093] In the present invention, the solid-state drive uses NAND flash as the storage medium, and has the characteristics of high transmission rate, high reliability, small size, low power consumption, etc. The solid-state drive NVMe based on the PCIe protocol makes full use of the high bandwidth and scalability of PCIe. The NVMe protocol stipulates that command transmission uses a queue mechanism. Each command queue contains a send queue and a completion queue. Multiple send queues can share a completion queue. A maximum of 65535 command queues are supported, and a single command queue supports a maximum of 64K instructions, so as to release the full potential of the solid-state drive and greatly improve the data transmission bandwidth and instruction parallel processing capabilities.
[0094] Specifically, each software queue corresponds to at least one I / O submission queue. For example, CPU core 1 corresponds to software queue 1, and software queue 1 corresponds to I / O submission queues 1 and 2; CPU core 2 corresponds to software queue 2, and software queue 2 corresponds to I / O submission queue 3; CPU core 3 corresponds to software queue 3, and software queue 3 corresponds to I / O submission queues 4, 5, and 6. If the number of I / O requests of the software queue corresponding to the current CPU core is moderate, the I / O request submission work is performed through the I / O submission queue corresponding to the software queue corresponding to the current CPU core; if the number of I / O requests of the software queue corresponding to the current CPU core is too large, it is necessary to obtain the I / O submission queues corresponding to the software queues corresponding to other CPU cores to complete the I / O request submission work.
[0095] Step 203 includes: checking through the I / O submission queue management unit whether the I / O requests in the software queue corresponding to the CPU core are less than a predetermined threshold, wherein the predetermined threshold is used to identify the congestion of the I / O requests in the software queue; if the number of the I / O requests in the software queue is less than the predetermined threshold, determining the I / O submission queue corresponding to the software queue as the target I / O submission queue through the I / O submission queue management unit, taking out the I / O requests from the software queue, and sending the I / O requests to the target I / O submission queue; if the number of the I / O requests in the I / O software queue is greater than or equal to the predetermined threshold, determining the I / O submission queue corresponding to the software queue and at least one I / O submission queue corresponding to other software queues in the solid-state drive as the target I / O submission queue through the I / O submission queue management unit, taking out the I / O requests from the software queue, and sending the I / O requests to the target I / O submission queue.
[0096] Through step 203, the I / O request can be sent to the solid-state drive via the I / O submission queue. The work queue can be allocated to different I / O submission queues based on their busyness, giving full play to the advantages of the concurrent working mechanism of multiple I / O submission queues of the solid-state drive to improve the data transmission performance between the heterogeneous acceleration device and the solid-state drive.
[0097] Step 204: After the solid state drive completes processing the I / O request, a response result returned by the solid state drive is received, and the response result is returned to the user.
[0098] In this step 204, after the solid state drive has processed the I / O request, the interrupt management unit receives the response result returned by the solid state drive, and returns the response result to the user through the software queue management unit.
[0099] Among them, the interrupt management unit is responsible for receiving the response result of the solid state drive, and submitting the response result returned by the solid state drive to the software queue management unit in a timely manner.
[0100] In the present invention, the software queue management unit does not submit the response result corresponding to a single I / O request to the user library upon receiving it, but checks whether the returned response result is the response result corresponding to all I / O requests split from the current data access request, and submits the response result to the user library after determining that the response results of all I / O requests have been returned.
[0101] Among them: there is a corresponding relationship between the software queue and the CPU core, and there is a corresponding relationship between the I / O submission queue and the software queue. If the I / O access of the CPU core is not busy, the target I / O submission queue includes the I / O submission queue corresponding to the CPU core that executes the data access request; if the I / O access of the CPU core is busy, the target I / O submission queue includes the I / O submission queues corresponding to other non-busy CPU cores and the I / O submission queue corresponding to the CPU core that executes the data access request; when the data access request is split into multiple I / O requests, I / O requests initiated by different CPU cores are distinguished by using I / O serial numbers in different ranges as command indicators; the number of I / O requests undertaken by each I / O submission queue is related to the busyness of the I / O access of the corresponding CPU core.
[0102] The solid-state hard disk data access method for heterogeneous computing provided by the present invention obtains hard disk parameters in a user library after receiving a data access request; generates multiple I / O requests from a single data access request according to the hard disk parameters and the maximum data access amount of a single I / O request, then checks the congestion of the I / O requests in the software queue corresponding to the CPU core through an I / O submission queue management unit, determines a target I / O submission queue in the solid-state hard disk for receiving the I / O request, sends the I / O request to the target I / O submission queue, receives a response result returned by the solid-state hard disk after the solid-state hard disk processes the I / O request, and returns the response result to the user, so as to give full play to the advantages of the concurrent working mechanism of multiple I / O submission queues of the solid-state hard disk, so as to improve the data transmission performance between the heterogeneous acceleration device or the host and the solid-state hard disk.
[0103] Furthermore, before receiving the data access request generated by the CPU core, the method further includes the step of initializing the heterogeneous computing system, see Figure 3 , specifically including steps 301~306.
[0104] 301. Obtain the number of CPU cores of the system, recorded as M; obtain the maximum number of I / O submission queues supported by the solid state drive, recorded as N.
[0105] 302. Create corresponding software queues for each of the M CPU cores, for a total of M software queues; wherein, the software queues are used to receive and cache data access requests sent by the corresponding CPU cores.
[0106] 303. Initialize and configure the solid-state drive according to the specifications of the solid-state drive, and create N I / O submission queues and N I / O completion queues, wherein, the I / O completion queues and the I / O submission queues correspond one by one, and the priorities of each queue are the same. The software queues receive and cache data access requests sent by their respective CPU cores.
[0107] 304. Set a statistical unit for each I / O submission queue to record data access requests within the last K unit time periods, including the data location and data size of each request.
[0108] 305. Establish the corresponding relationship between the M software queues and the N I / O submission queues.
[0109] Specifically, step 305 includes the following steps S31 to S33.
[0110] S31. If M > N, then the i-th CPU core corresponds to the i-th software queue, where at least two software queues correspond to one I / O submission queue.
[0111] The corresponding relationship can follow that the i-th software queue corresponds to the i%N-th I / O submission queue. For example, if M is 5 and N is 4, then the 1st software queue corresponds to the 1st I / O submission queue, the 2nd software queue corresponds to the 2nd I / O submission queue, the 3rd software queue corresponds to the 3rd I / O submission queue, the 4th software queue corresponds to the 4th I / O submission queue, and the 5th software queue corresponds to the 1st I / O submission queue.
[0112] S32. If M = N, then the i-th CPU core corresponds to the i-th software queue, and the i-th software queue corresponds to the i-th I / O submission queue.
[0113] S33. If M < N, then the i-th CPU core corresponds to the i-th software queue, where one software queue corresponds to at least two I / O submission queues.
[0114] The corresponding relationship can follow that the i-th I / O submission queue corresponds to the i%N-th software queue. For example, if M is 4 and N is 5, then the 1st software queue corresponds to the 1st I / O submission queue, the 2nd software queue corresponds to the 2nd I / O submission queue, the 3rd software queue corresponds to the 3rd I / O submission queue, the 4th software queue corresponds to the 4th I / O submission queue, and the 1st software queue corresponds to the 5th I / O submission queue.
[0115] 306. Divide the serial numbers of the I / O requests issued by the software queue, wherein the serial number range used by the i-th software queue is .
[0116] Through steps 301 to 306, the heterogeneous computing system is initialized to prepare for subsequent data access to the solid state drive by the heterogeneous computing system.
[0117] Optionally, after step 202, the method further comprises: assigning an I / O serial number to each I / O request through a software queue management unit, and recording the I / O serial number group included in the data access request; wherein the I / O serial number is a value within the I / O serial number range of the i-th software queue, and the initial value is i 65535 / M, plus 1 for each additional I / O request. If the serial number increases to 65535 / M (i+1), reset the I / O serial number to i 65535 / M, M is the total number of software queues, i∈[1,M].
[0118] An I / O serial number is generated to identify the I / O request.
[0119] Further, see Figure 4 In the case where the number of I / O requests in the software queue is less than a predetermined threshold, in step 203, the I / O submission queue corresponding to the software queue is determined as the target I / O submission queue, and the I / O request is taken out from the software queue, and the I / O request is sent to the target I / O submission queue, including steps 401 and 402.
[0120] 401. In the case that the I / O submission queue corresponding to the software queue is a single one, the I / O submission queue corresponding to the software queue is determined as a target I / O submission queue by an I / O submission queue management unit, and I / O requests are taken out from the software queue, the multiple I / O requests are converted into a hard disk queue according to the protocol requirements of the solid state drive, the command indicator in the hard disk queue is set as the I / O serial number, and the I / O request is sent to the target I / O submission queue.
[0121] Among them, the hard disk queue can be obtained by converting multiple I / O requests according to the NVMe protocol of the solid-state drive.
[0122] 402. When there are multiple I / O submission queues corresponding to the software queue, the multiple I / O submission queues corresponding to the software queue are determined as target I / O submission queues through the I / O submission queue management unit, and I / O requests are taken out from the software queue, and the multiple I / O requests are converted into a hard disk queue according to the protocol requirements of the solid state drive, and the command indicator in the hard disk queue is set to an I / O serial number, and the I / O requests are sent to different target I / O submission queues in sequence.
[0123] Specifically, see Figure 5 , Figure 5 The schematic diagram shows that multiple I / O requests are sent to different target I / O submission queues in sequence. For example, if there are 2 I / O submission queues corresponding to the software queue and n I / O requests, the 1st to k-1st I / O requests are sent to the target I / O submission queue 1, and the kth I / O request is sent to the target I / O submission queue 2.
[0124] Specifically, if the number of I / O requests in the I / O software queue is greater than or equal to a predetermined threshold, it is necessary to occupy the I / O submission queue corresponding to other I / O software queues. Figure 6 In step 203, the I / O submission queue corresponding to the software queue and at least one I / O submission queue corresponding to other software queues in the solid state drive are determined as target I / O submission queues through the I / O submission queue management unit, including steps 601, 602 and 603.
[0125] 601. The I / O submission queue management unit calculates the target data access volume completed by each I / O submission queue in the latest K unit time according to the statistical unit data of each I / O submission queue.
[0126] 602. Determine, through the I / O submission queue management unit, an I / O submission queue having a target data access volume smaller than a target data access volume of an I / O submission queue corresponding to the software queue as a first candidate I / O submission queue from at least one I / O submission queue corresponding to other software queues.
[0127] 603. Determine, by an I / O submission queue management unit, the first candidate I / O submission queue and the I / O submission queue corresponding to the software queue as the target I / O submission queue.
[0128] For example, if there are 5 I / O software queues, the current I / O software queue is queue 1, and the other I / O software queues are queues 2 to 5. If the number of I / O requests in I / O software queue 1 is greater than or equal to the predetermined threshold, the target data access volume completed in the last K unit time of I / O software queues 1 to 5 is calculated respectively. If the target data access volume of I / O software queues 2 and 3 is less than the target data access volume of the I / O submission queue corresponding to software queue 1, the I / O submission queues corresponding to I / O software queues 1, 2, and 3 are determined as the target I / O submission queues.
[0129] Furthermore, in another method, after the first candidate I / O submission queue is determined, the first candidate I / O submission queue may be further screened according to the CPU load rate. Figure 7 , the method also includes steps 701~702.
[0130] 701. Obtain the load rate of each CPU core through an I / O submission queue management unit, remove the I / O submission queue corresponding to the CPU core whose CPU load rate exceeds the load threshold from the first candidate I / O submission queue, and obtain a second candidate I / O submission queue.
[0131] 702. Determine, by an I / O submission queue management unit, the second candidate I / O submission queue and the I / O submission queue corresponding to the software queue as the target I / O submission queue.
[0132] Continuing with the above example, the load rate of each CPU core 1 to 5 is obtained through the I / O submission queue management unit. If the load rate of CPU cores 2, 4, and 5 exceeds the load threshold, the first candidate I / O submission queue includes the I / O submission queue corresponding to software queue 2 corresponding to CPU core 2 and the I / O submission queue corresponding to software queue 3 corresponding to CPU core 3. Then the I / O submission queue corresponding to software queue 2 is removed from the first candidate I / O submission queue, and the I / O submission queue corresponding to software queue 3 is used as the second candidate I / O submission queue. Finally, the I / O submission queues corresponding to software queues 1 and 3 are determined as the target I / O submission queues.
[0133] Further, see Figure 8 In step 203, the I / O request is taken out from the software queue and the I / O request is sent to the target I / O submission queue, including the following steps 801, 802 and 803.
[0134] 801. Calculate, by an I / O submission queue management unit, the data access volume of the target I / O submission queue in the most recent P unit time, and sort the multiple target I / O submission queues according to the data access volume.
[0135] 802. Calculate, by the I / O submission queue management unit, the number of I / O requests received by each of the target I / O submission queues based on the total number of I / O requests in the software queue and the amount of data access by each of the target I / O submission queues in the last P unit time.
[0136] Specifically, the number of I / O requests received by each target I / O submission queue is calculated by the following formula (1):
[0137] (1)
[0138] in, The number of IO requests that the ith I / O submission queue should receive among multiple target I / O submission queues; Ceil represents the rounding up function; Represents the maximum amount of data access in a single I / O submission queue in the last P units of time among multiple target I / O submission queues; and Respectively represent the data access volume of the j-th and i-th I / O submission queues in multiple target I / O submission queues; Indicates the number of I / O requests for the software queue.
[0139] After calculating the number of I / O requests received by each target I / O submission queue, it is necessary to further correct the number of I / O requests of each I / O submission queue to ensure that the sum of the number of I / O requests of each I / O submission queue is equal to the number of I / O requests corresponding to the software queue.
[0140] If after calculation, the sum of the number of I / O requests corresponding to each I / O submission queue is greater than the number of I / O requests corresponding to the software queue, the number of I / O requests corresponding to each I / O submission queue can be reduced in proportion according to the ratio of the sum of the number of I / O requests corresponding to each I / O submission queue to the number of I / O requests corresponding to the software queue.
[0141] In another way, the difference between the sum of the number of I / O requests corresponding to each I / O submission queue and the number of I / O requests corresponding to the software queue can also be calculated, and the number of I / O requests corresponding to one or N I / O submission queues with a higher number of I / O requests can be reduced according to the difference to reduce the data pressure of these I / O submission queues.
[0142] 803. Take out a corresponding number of I / O requests from the software queue through the I / O submission queue management unit, and send the corresponding number of I / O requests to the corresponding target I / O submission queues in sequence according to the order of the multiple target I / O submission queues.
[0143] Through steps 801 to 803, the allocation of I / O requests in the target I / O submission queue is achieved.
[0144] Further, after the solid state drive processes the I / O request, the interrupt management unit receives a response result returned by the solid state drive, and returns the response result to the user through the software queue management unit, see Fig. 9 , specifically including the following steps 901~903.
[0145] 901. After the solid state drive completes processing an I / O request, an interrupt notification response sent by the solid state drive is received through a CPU core.
[0146] 902. After the CPU core receives an interrupt, the I / O completion queue is read through the interrupt management unit to obtain the command indicator corresponding to the response result, and the response result is returned to the corresponding software queue management unit according to the value of the command indicator and the I / O serial number range used by the software queue.
[0147] The response result in the I / O completion queue includes a command indicator commandidentifier set as the I / O serial number.
[0148] In addition, the access volume statistics unit records the I / O request completion status in the corresponding I / O submission queue management unit.
[0149] 903. Check the saved data access request and the I / O serial number contained therein through the software queue management unit, and after all the response results of the I / O requests corresponding to the data access request are returned, return the response results to the user.
[0150] In the present invention, the software queue management unit checks in sequence whether the response result corresponding to each I / O request is returned by the I / O serial number. If there are 10 I / O requests, but 9 response results are received, the software queue management unit will wait for the response result corresponding to the last I / O request to be returned, and then return the response results to the user.
[0151] The solid state drive data access device for heterogeneous computing provided by the present invention is described below. The solid state drive data access device for heterogeneous computing described below and the solid state drive data access method for heterogeneous computing described above can be referenced to each other.
[0152] The present invention provides a solid state hard disk data access device for heterogeneous computing, see Fig.10, used for heterogeneous computing systems to access solid-state hard disk data, the device includes: including: a parameter transmission module 1001, a request generation module 1002, a request submission module 1003 and a response submission module 1004.
[0153] The parameter transmission module 1001 is used to obtain the hard disk parameters in the user library after receiving the data access request;
[0154] The request generation module 1002 is used to split the data access request into multiple I / O requests according to the hard disk parameters and the maximum data access amount of a single I / O request, and put the multiple I / O requests into a software queue corresponding to the CPU core that executes the data access request;
[0155] The request submission module 1003 is used to check the congestion of the I / O request in the software queue corresponding to the CPU core, determine the target I / O submission queue in the solid state drive for receiving the I / O request, and send the I / O request to the target I / O submission queue; wherein the solid state drive is provided with multiple I / O submission queues;
[0156] A response submission module 1004 is used to receive a response result returned by the solid state drive after the solid state drive processes the I / O request, and return the response result to the user;
[0157] Among them: there is a corresponding relationship between the software queue and the CPU core, and there is a corresponding relationship between the I / O submission queue and the software queue. If the I / O access of the CPU core is not busy, the target I / O submission queue includes the I / O submission queue corresponding to the CPU core that executes the data access request; if the I / O access of the CPU core is busy, the target I / O submission queue includes the I / O submission queues corresponding to other non-busy CPU cores and the I / O submission queue corresponding to the CPU core that executes the data access request; when the data access request is split into multiple I / O requests, I / O requests initiated by different CPU cores are distinguished by using I / O serial numbers in different ranges as command indicators; the number of I / O requests undertaken by each I / O submission queue is related to the busyness of the I / O access of the corresponding CPU core.
[0158] Optionally, the heterogeneous computing system includes a software queue management unit;
[0159] The parameter passing module 1001 is specifically used to: upon receiving a data access request generated by the CPU core, obtain the solid-state hard disk read function of the user library, and obtain the hard disk parameters including the starting logical block address, number of logical blocks, logical block size and target memory location of the solid-state hard disk; and pass the data access request and the hard disk parameters to the software queue management unit.
[0160] Optionally, the request generation module 1002 is specifically configured to: split the data access request into multiple I / O requests according to the hard disk parameters and the maximum data access amount of a single I / O request through the software queue management unit;
[0161] The device also includes a serial number generating module, which is used to allocate an I / O serial number to each I / O request after the data access request is split into multiple I / O requests by the software queue management unit according to the hard disk parameters and the maximum data access amount of a single I / O request, and record the I / O serial number group included in the data access request; wherein the I / O serial number is a value within the I / O serial number range of the i-th software queue, and the initial value is i 65535 / M, plus 1 for each additional I / O request. If the serial number increases to 65535 / M (i+1), reset the I / O serial number to i 65535 / M, M is the total number of software queues, i∈[1,M].
[0162] Optionally, the device further includes an initialization module, configured to:
[0163] Obtain the number of CPU cores of the system, recorded as M; obtain the maximum number of I / O submission queues supported by the solid-state drive, recorded as N;
[0164] Create corresponding software queues for M CPU cores respectively, with a total of M software queues; wherein the software queues are used to receive and cache data access requests issued by the corresponding CPU cores;
[0165] Initialize and configure the solid-state drive according to the specification requirements of the solid-state drive, create N I / O submission queues and N I / O completion queues, wherein the I / O completion queues correspond to the I / O submission queues one by one, and the priorities of the queues are the same;
[0166] Set a statistics unit for each I / O submission queue to record data access requests in the last K units of time, including the data location and size of each request;
[0167] Establishing a correspondence between the M software queues and the N I / O submission queues;
[0168] The I / O serial numbers of the I / O requests issued by the software queue are divided into the following ranges: .
[0169] Optionally, an initialization module is specifically used to:
[0170] If M > N, the i-th CPU core corresponds to the i-th software queue, where at least two software queues correspond to one I / O submission queue;
[0171] If M = N, the i-th CPU core corresponds to the i-th software queue, and the i-th software queue corresponds to the i-th I / O submission queue;
[0172] If M < N, the i-th CPU core corresponds to the i-th software queue, where one software queue corresponds to at least two I / O submission queues.
[0173] Optionally, the heterogeneous computing system includes an I / O submission queue management unit;
[0174] The request generation module 1002 is specifically configured to: after putting multiple I / O requests into the software queue corresponding to the CPU core that executes the data access request, notify the I / O submission queue management unit;
[0175] The request submission module 1003 is specifically configured to:
[0176] Check, through the I / O submission queue management unit, whether the I / O requests in the software queue corresponding to this CPU core are less than a predetermined threshold, where the predetermined threshold is used to identify the congestion situation of the I / O requests in the software queue;
[0177] If the number of the I / O requests in this software queue is less than the predetermined threshold, determine, through the I / O submission queue management unit, the I / O submission queue corresponding to this software queue as the target I / O submission queue, and take out the I / O requests from this software queue, and send the I / O requests to the target I / O submission queue; where each software queue corresponds to at least one I / O submission queue;
[0178] If the number of the I / O requests in this I / O software queue is greater than or equal to the predetermined threshold, determine, through the I / O submission queue management unit, the I / O submission queue corresponding to this software queue and at least one I / O submission queue corresponding to other software queues in the solid-state drive as the target I / O submission queue, and take out the I / O requests from this software queue, and send the I / O requests to the target I / O submission queue.
[0179] Optionally, the request submission module 1003 is specifically configured to:
[0180] In the case that the I / O submission queue corresponding to the software queue is a single one, the I / O submission queue corresponding to the software queue is determined as a target I / O submission queue by the I / O submission queue management unit, and an I / O request is taken out from the software queue, the multiple I / O requests are converted into a hard disk queue according to the protocol requirements of the solid state drive, the command indicator in the hard disk queue is set as an I / O serial number, and the I / O request is sent to the target I / O submission queue;
[0181] In the case where there are multiple I / O submission queues corresponding to the software queue, the multiple I / O submission queues corresponding to the software queue are determined as target I / O submission queues through the I / O submission queue management unit, and I / O requests are taken out from the software queue, and the multiple I / O requests are converted into a hard disk queue according to the protocol requirements of the solid-state drive, the command indicator in the hard disk queue is set to the I / O serial number, and the I / O requests are sent to different target I / O submission queues in sequence.
[0182] Optionally, the request submission module 1003 is specifically configured to:
[0183] The I / O submission queue management unit calculates the target data access volume completed by each I / O submission queue in the most recent K unit time according to the statistical unit data of each I / O submission queue;
[0184] Determine, by the I / O submission queue management unit, an I / O submission queue whose target data access volume is smaller than the target data access volume of the I / O submission queue corresponding to the software queue as a first candidate I / O submission queue from at least one I / O submission queue corresponding to other software queues;
[0185] The first candidate I / O submission queue and the I / O submission queue corresponding to the software queue are determined as the target I / O submission queue by an I / O submission queue management unit.
[0186] Optionally, the device further comprises: a candidate submission queue determination module, configured to, after determining the first candidate I / O submission queue, obtain the load rate of each CPU core through the I / O submission queue management unit, remove the I / O submission queue corresponding to the CPU core whose CPU load rate exceeds the load threshold from the first candidate I / O submission queue, and obtain the second candidate I / O submission queue;
[0187] The second candidate I / O submission queue and the I / O submission queue corresponding to the software queue are determined as the target I / O submission queue by the I / O submission queue management unit.
[0188] Optionally, the request submission module 1003 is specifically configured to:
[0189] The I / O submission queue management unit calculates the data access volume of the target I / O submission queue in the latest P unit time respectively, and sorts the multiple target I / O submission queues according to the data access volume;
[0190] Calculate, by the I / O submission queue management unit, the number of I / O requests received by each of the target I / O submission queues based on the total number of I / O requests in the software queue and the data access volume of each of the target I / O submission queues in the most recent P unit time;
[0191] A corresponding number of I / O requests are taken out from the software queue through the I / O submission queue management unit, and the corresponding number of I / O requests are sent to the corresponding target I / O submission queues in sequence according to the order of the multiple target I / O submission queues.
[0192] Optionally, the heterogeneous computing system includes an interrupt management unit;
[0193] The response submission module 1004 is specifically used for:
[0194] After the solid state drive has processed the I / O request, receiving an interrupt notification response sent by the solid state drive through the CPU core;
[0195] After the CPU core receives an interrupt, the I / O completion queue is read through the interrupt management unit to obtain the command indicator corresponding to the response result, and the response result is returned to the corresponding software queue management unit according to the value of the command indicator and the I / O serial number range used by the software queue; the I / O request completion status is recorded in the corresponding I / O submission queue management unit through the access volume statistics unit.
[0196] The software queue management unit checks the saved data access request and the I / O serial number contained therein, and after all the response results of the I / O requests corresponding to the data access request are returned, the response results are returned to the user library.
[0197] The solid-state hard disk data access device for heterogeneous computing provided by the present invention obtains hard disk parameters in a user library after receiving a data access request; generates multiple I / O requests from a single data access request according to the hard disk parameters and the maximum data access amount of a single I / O request, and then checks the congestion of the I / O requests in the software queue corresponding to the CPU core through an I / O submission queue management unit, and determines the target I / O submission queue in the solid-state hard disk for receiving the I / O request, sends the I / O request to the target I / O submission queue, receives a response result returned by the solid-state hard disk after the solid-state hard disk processes the I / O request, and submits the response result to the user library, so as to give full play to the advantages of the concurrent working mechanism of multiple I / O submission queues of the solid-state hard disk, so as to improve the data transmission performance between the heterogeneous acceleration device or host and the solid-state hard disk.
[0198] Fig.11 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.11 As shown, the electronic device may include: a processor (processor) 1110, a communication interface (Communications Interface) 1120, a memory (memory) 1130 and a communication bus 1140, wherein the processor 1110, the communication interface 1120, and the memory 1130 communicate with each other through the communication bus 1140. The processor 1110 can obtain the logic instructions in the memory 1130 to execute the solid-state hard disk data access method for heterogeneous computing, the method comprising: upon receiving a data access request, obtaining the hard disk parameters in the user library; generating multiple I / O requests from the data access request according to the hard disk parameters and the maximum data access amount of a single I / O request, and placing the multiple I / O requests into the software queue corresponding to the CPU core; checking the congestion of the I / O requests in the software queue corresponding to the CPU core, and determining the target I / O submission queue for receiving the I / O requests in the solid-state hard disk, and sending the I / O request to the target I / O submission queue; wherein, the solid-state hard disk is provided with multiple I / O submission queues; after the solid-state hard disk processes the I / O request, receiving the response result returned by the solid-state hard disk, and returning the response result to the user.
[0199] In addition, the logic instructions in the above-mentioned memory 1130 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0200] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the solid-state hard disk data access method for heterogeneous computing provided by the above methods, the method including: when receiving a data access request, obtaining hard disk parameters in the user library; generating multiple I / O requests from the data access request according to the hard disk parameters and the maximum data access amount of a single I / O request, and placing the multiple I / O requests into the software queue corresponding to the CPU core; checking the congestion of the I / O requests in the software queue corresponding to the CPU core, and determining the target I / O submission queue for receiving the I / O request in the solid-state hard disk, and sending the I / O request to the target I / O submission queue; wherein, multiple I / O submission queues are set in the solid-state hard disk; after the solid-state hard disk processes the I / O request, receiving a response result returned by the solid-state hard disk, and returning the response result to the user.
[0201] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the solid-state hard disk data access method for heterogeneous computing provided by the above-mentioned methods, the method comprising: upon receiving a data access request, obtaining hard disk parameters in the user library; generating multiple I / O requests from the data access request according to the hard disk parameters and the maximum data access amount of a single I / O request, and placing the multiple I / O requests into a software queue corresponding to the CPU core; checking the congestion of the I / O requests in the software queue corresponding to the CPU core, and determining a target I / O submission queue in the solid-state hard disk for receiving I / O requests, and sending the I / O request to the target I / O submission queue; wherein, multiple I / O submission queues are provided in the solid-state hard disk; after the solid-state hard disk processes the I / O request, receiving a response result returned by the solid-state hard disk, and returning the response result to the user.
[0202] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0203] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A solid state drive data access method for heterogeneous computing, characterized in that: Used for a heterogeneous computing system to access solid state drive data, the method comprises: After receiving the data access request, obtain the hard disk parameters in the user library; According to the hard disk parameters and the maximum data access amount of a single I / O request, the data access request is split into multiple I / O requests, and the multiple I / O requests are placed in a software queue corresponding to a CPU core that executes the data access request; Checking the congestion of the I / O request in the software queue corresponding to the CPU core, and determining a target I / O submission queue in the solid-state drive for receiving the I / O request, and sending the I / O request to the target I / O submission queue; wherein the solid-state drive is provided with multiple I / O submission queues; After the solid state drive completes processing the I / O request, receiving a response result returned by the solid state drive, and returning the response result to the user; Among them: there is a corresponding relationship between the software queue and the CPU core, and there is a corresponding relationship between the I / O submission queue and the software queue. If the I / O access of the CPU core is not busy, the target I / O submission queue includes the I / O submission queue corresponding to the CPU core that executes the data access request; if the I / O access of the CPU core is busy, the target I / O submission queue includes the I / O submission queues corresponding to other non-busy CPU cores and the I / O submission queue corresponding to the CPU core that executes the data access request; when the data access request is split into multiple I / O requests, I / O requests initiated by different CPU cores are distinguished by using I / O serial numbers in different ranges as command indicators; the number of I / O requests undertaken by each I / O submission queue is related to the busyness of the I / O access of the corresponding CPU core.
2. The solid state drive data access method for heterogeneous computing according to claim 1, characterized in that: The heterogeneous computing system includes a software queue management unit; When receiving a data access request, obtaining hard disk parameters in the user library includes: When a data access request is received, a solid state drive read function of the user library is obtained to obtain the hard disk parameters including a starting logical block address, a number of logical blocks, a logical block size, and a target memory location of the solid state drive; The data access request and the hard disk parameter are transmitted to the software queue management unit.
3. The solid state drive data access method for heterogeneous computing according to claim 2, characterized in that: According to the hard disk parameters and the maximum data access amount of a single I / O request, the data access request is split into multiple I / O requests, including: Splitting the data access request into multiple I / O requests according to the hard disk parameters and the maximum data access amount of a single I / O request by the software queue management unit; After splitting the data access request into multiple I / O requests according to the hard disk parameters and the maximum data access amount of a single I / O request, the method further includes: An I / O serial number is assigned to each I / O request by the software queue management unit, and the I / O serial number group included in the data access request is recorded; wherein the I / O serial number is a value within the I / O serial number range of the i-th software queue, and the initial value is i 65535 / M, plus 1 for each additional I / O request. If the serial number increases to 65535 / M (i+1), reset the I / O serial number to i 65535 / M, M is the total number of software queues, i∈[1,M].
4. The solid state drive data access method for heterogeneous computing according to claim 2, characterized in that: Before receiving the data access request, the method further includes an initialization step, specifically including: Obtain the number of CPU cores of the system, recorded as M; obtain the maximum number of I / O submission queues supported by the solid-state drive, recorded as N; Create corresponding software queues for M CPU cores respectively, with a total of M software queues; wherein the software queues are used to receive and cache data access requests issued by the corresponding CPU cores; Initialize and configure the solid-state drive according to the specifications of the solid-state drive, creating N I / O submission queues and N I / O completion queues, where the I / O completion queues and I / O submission queues correspond one-to-one, and the priorities of each queue are the same; Set up a statistical unit for each I / O submission queue to record data access requests within the last K unit time periods, including the data location and data size of each request; Establish the correspondence between M software queues and N I / O submission queues; The serial numbers of the I / O requests issued by the software queue are divided into the following ranges: .
5. The solid state drive data access method for heterogeneous computing according to claim 4, characterized in that: Establish the correspondence between M software queues and N I / O submission queues, including: If M > N, the i-th CPU core corresponds to the i-th software queue, where at least two software queues correspond to one I / O submission queue; If M = N, the i-th CPU core corresponds to the i-th software queue, and the i-th software queue corresponds to the i-th I / O submission queue; If M < N, the i-th CPU core corresponds to the i-th software queue, where one software queue corresponds to at least two I / O submission queues.
6. The solid state drive data access method for heterogeneous computing according to claim 4, characterized in that: The heterogeneous computing system includes an I / O submission queue management unit; After placing multiple I / O requests into the software queue corresponding to the CPU core that executes the data access request, the method further includes: notifying the I / O submission queue management unit; Check the congestion situation of the I / O requests in the software queue corresponding to the CPU core, and determine the target I / O submission queue in the solid-state drive for receiving I / O requests, and send the I / O requests to the target I / O submission queue, including: Check through the I / O submission queue management unit whether the I / O requests in the software queue corresponding to the CPU core are less than a predetermined threshold, where the predetermined threshold is used to identify the congestion situation of the I / O requests in the software queue; If the number of I / O requests in the software queue is less than the predetermined threshold, determine, through the I / O submission queue management unit, the I / O submission queue corresponding to the software queue as the target I / O submission queue, and take out the I / O requests from the software queue and send the I / O requests to the target I / O submission queue; where each software queue corresponds to at least one I / O submission queue; If the number of I / O requests in the I / O software queue is greater than or equal to the predetermined threshold, determine, through the I / O submission queue management unit, the I / O submission queue corresponding to the software queue and at least one I / O submission queue in the solid-state drive corresponding to other software queues as the target I / O submission queue, and take out the I / O requests from the software queue and send the I / O requests to the target I / O submission queue.
7. The solid state disk data access method for heterogeneous computing according to claim 6, characterized in that: Determine, through the I / O submission queue management unit, the I / O submission queue corresponding to the software queue as the target I / O submission queue, and take out the I / O requests from the software queue and send the I / O requests to the target I / O submission queue, including: In the case that the I / O submission queue corresponding to the software queue is a single one, the I / O submission queue corresponding to the software queue is determined as a target I / O submission queue by the I / O submission queue management unit, and an I / O request is taken out from the software queue, the multiple I / O requests are converted into a hard disk queue according to the protocol requirements of the solid state drive, the command indicator in the hard disk queue is set as an I / O serial number, and the I / O request is sent to the target I / O submission queue; In the case where there are multiple I / O submission queues corresponding to the software queue, the multiple I / O submission queues corresponding to the software queue are determined as target I / O submission queues through the I / O submission queue management unit, and I / O requests are taken out from the software queue, and the multiple I / O requests are converted into a hard disk queue according to the protocol requirements of the solid-state drive, the command indicator in the hard disk queue is set to the I / O serial number, and the I / O requests are sent to different target I / O submission queues in sequence.
8. The solid state drive data access method for heterogeneous computing according to claim 6, characterized in that: Determining, by an I / O submission queue management unit, an I / O submission queue corresponding to the software queue and at least one I / O submission queue corresponding to other software queues in the solid state drive as a target I / O submission queue, including: The I / O submission queue management unit calculates the target data access volume completed by each I / O submission queue in the most recent K unit time according to the statistical unit data of each I / O submission queue; Determine, by the I / O submission queue management unit, an I / O submission queue whose target data access volume is smaller than the target data access volume of the I / O submission queue corresponding to the software queue as a first candidate I / O submission queue from at least one I / O submission queue corresponding to other software queues; The first candidate I / O submission queue and the I / O submission queue corresponding to the software queue are determined as the target I / O submission queue by an I / O submission queue management unit.
9. The solid state disk data access method for heterogeneous computing according to claim 8, characterized in that: After determining the first candidate I / O submission queue, the method further includes: Obtaining the load rate of each CPU core through the I / O submission queue management unit, removing the I / O submission queue corresponding to the CPU core whose CPU load rate exceeds the load threshold from the first candidate I / O submission queue, and obtaining a second candidate I / O submission queue; The second candidate I / O submission queue and the I / O submission queue corresponding to the software queue are determined as the target I / O submission queue by the I / O submission queue management unit.
10. The solid state disk data access method for heterogeneous computing according to claim 6, characterized in that: Taking out the I / O request from the software queue and sending the I / O request to the target I / O submission queue includes: The I / O submission queue management unit calculates the data access volume of the target I / O submission queue in the latest P unit time respectively, and sorts the multiple target I / O submission queues according to the data access volume; Calculate, by the I / O submission queue management unit, the number of I / O requests received by each of the target I / O submission queues based on the total number of I / O requests in the software queue and the data access volume of each of the target I / O submission queues in the most recent P unit time; A corresponding number of I / O requests are taken out from the software queue through the I / O submission queue management unit, and the corresponding number of I / O requests are sent to the corresponding target I / O submission queues in sequence according to the order of the multiple target I / O submission queues.
11. The solid state disk data access method for heterogeneous computing according to claim 7, characterized in that: The response result in the I / O completion queue includes a command indicator set as an I / O serial number, and the heterogeneous computing system includes an interrupt management unit; After the solid state drive completes processing the I / O request, receiving a response result returned by the solid state drive, and returning the response result to the user, specifically includes: After the solid state drive has processed the I / O request, receiving an interrupt notification response sent by the solid state drive through the CPU core; After the CPU core receives the interrupt, the I / O completion queue is read through the interrupt management unit to obtain the command indicator corresponding to the response result, and the response result is returned to the corresponding software queue management unit according to the value of the command indicator and the I / O serial number range used by the software queue; The software queue management unit checks the saved data access request and the I / O serial number contained therein, and after all the response results of the I / O requests corresponding to the data access request are returned, the response results are returned to the user.
12. The solid state disk data access method for heterogeneous computing according to claim 10, characterized in that: The number of I / O requests received by each of the target I / O submission queues is calculated using the following formula: ; in, The number of IO requests that the ith I / O submission queue should receive among multiple target I / O submission queues; Ceil represents the rounding up function; Represents the maximum amount of data access in a single I / O submission queue in the last P units of time among multiple target I / O submission queues; and Respectively represent the data access volume of the j-th and i-th I / O submission queues in multiple target I / O submission queues; Indicates the number of I / O requests for the software queue.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the solid-state hard disk data access method for heterogeneous computing as described in any one of claims 1 to 12 is implemented.
14. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the solid-state hard disk data access method for heterogeneous computing as described in any one of claims 1 to 12 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the solid-state hard disk data access method for heterogeneous computing as described in any one of claims 1 to 12 is implemented.
