Solid-state disk address mapping method and device and solid-state disk

Through the hot and cold prediction model and dynamic address mapping strategy, combined with CWDP and PCWD strategies, the problem of difficult to take into account both parallelism and fairness in multi-tenant scenarios is solved, and the performance stability and fairness are improved.

CN119025437AActive Publication Date: 2024-11-26HUAZHONG UNIV OF SCI & TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411046486.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-11-26
Estimated Expiration
2044-08-01

AI Technical Summary

Technical Problem

Existing solid-state drives (SSDs) cannot meet both parallelism and fairness through a single address mapping strategy, resulting in a decline in performance isolation and resource utilization in multi-tenant scenarios.

Method used

The cold and cold prediction model is used to distinguish between cold and hot data, and the address mapping strategy is dynamically adjusted according to the I/O intensity. The PCWD strategy is used to ensure fairness when high I/O intensity is used, and the unfair situation is alleviated by adjusting the relaxation time when low I/O intensity is used to alleviate unfair situations. , combine CWDP and PCWD strategies to optimize parallelism and fairness.

Benefits of technology

Improve the performance stability and fairness of SSDs in multi-tenant scenarios, maximize hardware efficiency use, reduce interference between users, and achieve performance isolation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025437A_ABST
    Figure CN119025437A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computers, and particularly discloses a solid-state disk address mapping method and device and a solid-state disk. When the request rate of the request queue is greater than a preset rate threshold, the request queue is a first request queue; predicting a cold and hot type of to-be-written data corresponding to each write request in the first request queue by adopting a cold and hot prediction model, when the data is cold data, processing the write request by adopting a first strategy, and when the data is hot data, processing the write request by adopting a second strategy; when the request rate of the request queue is not greater than the preset rate threshold value, the request queue is a second request queue, and a second strategy is adopted to process the write request in the second request queue; and determining whether unfair conditions exist among different users in combination with the request rates and the write proportions belonging to different user request queues, and if so, adjusting the relaxation time of the unfair users to reduce the unfair conditions. According to the application, the fairness can be improved on the premise of guaranteeing the performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and more specifically, to a solid state disk address mapping method, device, and solid state disk. Background Art

[0002] Solid State Disk (SSD) is widely adopted in cloud infrastructure to provide low-latency I / O services and better performance. Cloud providers aim to reduce hardware resource costs and maximize their utilization by sharing the same SSD across multiple applications. However, the diversity of user requirements and the complexity of the I / O stack in cloud storage systems make performance isolation more challenging. Interference between concurrently running workloads can cause unfairness in SSDs. Therefore, high performance and fairness should be considered as first-class design criteria for SSDs in modern data centers.

[0003] Modern SSDs achieve high performance by using multiple independent channels and chips in parallel. Exploiting the internal multi-level parallelism of hundreds of NAND flash memories is becoming a key issue in designing high-performance SSDs. There are many ways to achieve SSD parallelism. We focus on the most basic and core function of the SSD controller, namely address mapping, to consider SSD parallelism. Address mapping determines the physical layout of data by remapping logical addresses and physical addresses. In this process, the data layout inside the flash chip should be carefully determined so that different levels of parallelism can be utilized. Usually, the page allocation strategy in the address mapping writes data to the underlying flash memory according to different allocation principles. For example, the CWDP (Channel-Way-Die-Plane) strategy stripes data to each parallel unit in the order of channel, chip, wafer, and plane to maximize SSD parallelism. In contrast, the PCWD (Plane-Channel-Way-Die) strategy prioritizes allocating data to multiple planes within a single channel, so the parallelism performance is not as good as CWDP. See the data allocation methods of the CWDP strategy and PCWD strategy for details. Figure 1 As shown. Figure 1 It can be seen that the CWDP strategy has better parallel performance but poor fairness; the PCWD strategy has poor parallel performance but better fairness.

[0004] In recent years, the fairness issue has attracted widespread attention from researchers. The unfairness issue is mainly caused by the I / O interference caused by different user requests competing for SSD resources (such as the parallel units of the underlying flash memory). Existing research on solving the fairness problem in SSD devices can be divided into two categories, including I / O scheduling strategies at the software layer and performance isolation methods at the hardware layer. The software layer mainly focuses on achieving fairness in the cache or chip queue by adjusting the position of the request in the queue. The hardware layer achieves performance isolation by allocating exclusive SSD hardware resources such as channels or chips to different users. It can be seen that the hardware-oriented method can directly eliminate the unfairness caused by I / O interference between different users. The software-oriented method makes full use of the software and hardware resources of the SSD, so it is better in performance.

[0005] In fact, most of the existing research on parallelism and fairness is separate. Although significant progress has been made in the parallelism of SSDs, especially in the exploration of plane-level parallelism, a large number of studies have shown that excessive parallelism can inadvertently affect the fairness of SSDs, because parallelism tends to stripe data to the bottom layer. More specifically, if the CWDP strategy is adopted, those ultra-low latency SSDs will distribute data to independent execution units as much as possible in order to reduce the queuing time of requests. However, this will cause the cross-execution of different users to each execution unit in the SSD, exacerbating I / O interference, resulting in more serious unfairness problems, see Figure 2 As shown in (a), if the PCWD strategy is adopted, see Figure 2 As shown in (b), although the unfairness problem is reduced, the parallel performance is much worse. Figure 2 An example of the above process is shown. The key problem is that SSD cannot simultaneously meet parallelism and fairness through a single mapping strategy. Summary of the invention

[0006] In view of the defects of the prior art, the purpose of the present application is to provide a solid-state drive address mapping method, device and solid-state drive, aiming to solve the problem that the existing SSD cannot simultaneously meet parallelism and fairness through a single mapping strategy.

[0007] To achieve the above objectives, in a first aspect, the present application provides a solid state disk address mapping method, comprising:

[0008] Receive a request queue of at least one user; the request queue includes at least one write request and / or at least one read request;

[0009] When the request rate of the request queue is greater than the preset rate threshold, it is a first type of request queue; a cold and hot prediction model is used to predict the cold and hot types of the data to be written corresponding to each write request in the first type of request queue; when it is cold data, the first strategy is used to process the write request, and when it is hot data, the second strategy is used to process the write request; the first strategy is a strategy to ensure fairness, and the second strategy is a strategy to ensure parallelism;

[0010] When the request rate of the request queue is not greater than the preset rate threshold, it is a second request queue, and the second strategy is used to process the write requests in the second request queue; combining the request rates and write ratios of the two second request queues belonging to different users to determine whether there is unfairness between different users, if there is unfairness, adjust the relaxation time of the second request queue of the unfair user to alleviate the unfairness; the unfairness is that if the sub-request of the second request queue belonging to the first user is processed after the sub-request of the second request queue belonging to the second user, resulting in the relaxation time of the first user's request queue being extended, then the first user is an unfair user.

[0011] In one embodiment, the first policy is a PCWD policy, and the second policy is a CWDP policy;

[0012] The PCWD strategy stripes data to each parallel unit in the order of plane, channel, chip and wafer;

[0013] The CWDP strategy stripes data to each parallel unit in the order of channel, chip, wafer and plane.

[0014] It is understandable that the present application distinguishes between flows of different I / O intensities when the flow request enters the SSD. Under high I / O intensity, the PCWD strategy is used for cold data to ensure fairness, while hot data still uses the CWDP strategy to prioritize performance. In order to accurately distinguish between cold and hot data, the use of a trained model can ensure accurate prediction of cold and hot data and make it easy to handle mixed workloads with different access patterns. To further improve SSD fairness, the slack time of the flow is adjusted to alleviate unfairness under low I / O intensity. This method can improve fairness while ensuring performance.

[0015] It should be noted that the read performance of data written according to the PCWD policy is very poor, especially at low I / O intensity. The performance of writing to the same address again will not be affected by the address mapping policy used for the last write. It is necessary to distinguish between hot and cold data, that is, to determine whether the data will be read frequently. After the data is written to the SSD, we regard the data that will be read in the future as hot data, and the data that will not be read as cold data. We hope to use the PCWD write policy for those cold data to improve fairness, while the hot data is still written to the flash memory using the CWDP policy, so as to avoid the possible poor performance of hot data when it is read.

[0016] In one embodiment, whether there is unfairness between different users is determined by the following steps:

[0017] Calculating a request rate ratio of the second request queue of the first user to that of the second user;

[0018] Calculate the write ratio ratio of the second request queue of the first user to that of the second user;

[0019] If the request rate ratio is greater than 1 and the write ratio ratio is greater than 1, the second user is an unfair user;

[0020] If the request rate ratio is less than 1 and the write ratio ratio is less than 1, the first user is an unfair user;

[0021] If the request rate ratio is greater than 1 and the write ratio ratio is less than 1, if the product of the request rate ratio and the preset weight is greater than the inverse of the write ratio ratio, then the second user is an unfair user, otherwise the first user is an unfair user;

[0022] If the request rate ratio is less than 1 and the write ratio ratio is greater than 1, if the product of the inverse of the request rate ratio and the preset weight is greater than the write ratio ratio, the first user is an unfair user, otherwise the second user is an unfair user.

[0023] In one embodiment, the preset weight is 1.

[0024] In one embodiment, the method further comprises:

[0025] Extracting the characteristics of the request queue in different time periods; the characteristics include: average request size, request rate, write ratio, time locality of request access, and space locality of request access; the time locality is the ratio of re-access traffic to total traffic, and the space locality is the percentage of random requests to all requests;

[0026] The cold and hot prediction model is a trained decision tree model;

[0027] The decision tree model predicts the hot and cold types of data, including:

[0028] The features of the request queues in different time periods are input into the trained decision tree model to predict the hot and cold types of the data to be written corresponding to each write request in the request queue.

[0029] It should be noted that the above decision tree model is trained by a tree model trainer.

[0030] In one embodiment, the training step of the decision tree model includes:

[0031] Taking the features of the request queue training samples as input, and inputting them into the decision tree model for training; each write request in the training samples has a cold or hot label;

[0032] The performance of the decision tree model is evaluated by cross validation, and the decision tree model is trained offline.

[0033] In one embodiment, adjusting the slack time of the second request queue of the unfair user to alleviate the unfair situation includes:

[0034] The execution order of the unfair user sub-requests and the non-unfair user sub-requests is adjusted to reduce the relaxation time of the request queue corresponding to the unfair user without affecting the relaxation time of the request queue corresponding to the non-unfair user.

[0035] In a second aspect, the present application provides a solid state disk address mapping device, including:

[0036] A feature collection module, configured to receive a request queue of at least one user, wherein when a request rate of the request queue is greater than a preset rate threshold, the request queue is a first type of request queue; when a request rate of the request queue is not greater than the preset rate threshold, the request queue is a second type of request queue; the request queue includes at least one write request and / or at least one read request;

[0037] A cold / hot prediction module, used to predict the cold / hot type of the to-be-written data corresponding to each write request in the first request queue by using a cold / hot prediction model;

[0038] An address allocation module, configured to process the write request in the first request queue using a first strategy when the data to be written corresponding to the write request is cold data, and process the write request using a second strategy when the data to be written is hot data; and process the write request in the second request queue using the second strategy; the first strategy is a strategy for ensuring fairness, and the second strategy is a strategy for ensuring parallelism;

[0039] A fair scheduling module is used to determine whether there is unfairness between different users by combining the request rates and write ratios of two second request queues belonging to different users. If there is unfairness, the relaxation time of the second request queue of the unfair user is adjusted to alleviate the unfairness. The unfairness is that if a sub-request of the second request queue belonging to the first user is processed after a sub-request of the second request queue belonging to the second user, resulting in the relaxation time of the first user's request queue being extended, then the first user is an unfair user.

[0040] In one embodiment, the fair scheduling module is used to calculate the request rate ratio of the second request queue of the first user and the second user; calculate the write ratio ratio of the second request queue of the first user and the second user; if the request rate ratio is greater than 1 and the write ratio ratio is greater than 1, the second user is an unfair user; if the request rate ratio is less than 1 and the write ratio ratio is less than 1, the first user is an unfair user; if the request rate ratio is greater than 1 and the write ratio ratio is less than 1, if the product of the request rate ratio and the preset weight is greater than the inverse of the write ratio ratio, the second user is an unfair user, otherwise the first user is an unfair user; and if the request rate ratio is less than 1 and the write ratio ratio is greater than 1, if the product of the inverse of the request rate ratio and the preset weight is greater than the write ratio ratio, the first user is an unfair user, otherwise the second user is an unfair user.

[0041] In a third aspect, the present application provides a solid state disk, comprising: a solid state disk address mapping device described in the above-mentioned first aspect or any one of the embodiments of the first aspect.

[0042] It can be understood that the beneficial effects of the second or third aspect mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0043] In general, the above technical solutions conceived by the present application have at least the following beneficial effects compared with the prior art:

[0044] The present application provides a solid state disk address mapping method, device and solid state disk. The provided solution is based on the combination of two widely used existing address mapping strategies CWDP and PCWD, which can optimize the parallelism and fairness of SSD at the same time, which is very important for multi-tenant scenarios. Making full use of the existing mapping strategy can ensure the stable performance of FpH2a without making too many system modifications.

[0045] The present application provides a solid state disk address mapping method, device and solid state disk. The solid state disk address mapping scheme provided is stronger than the general scheme in terms of scalability, which is reflected in the fact that other strategies can be combined in a more fine-grained manner. Since FpH2a focuses on the optimization of parallelism and fairness, CWDP and PCWD are selected as the base mapping schemes for scheduling. Under appropriate circumstances, users can select other mapping schemes to replace the above base schemes as needed.

[0046] The present application provides a solid-state disk address mapping method, device and solid-state disk. The solid-state disk address mapping solution provided can provide fairness in multi-tenant scenarios and can give full play to the parallelism of SSDs, which involves performance improvement. This means that FpH2a can maximize the use of SSD hardware efficiency, while ensuring that different users reduce interference with each other while using SSDs, achieving the goal of performance isolation. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a schematic diagram of the data allocation method of the CWDP strategy and the PCWD strategy provided in the embodiment of the present application;

[0048] Figure 2 is a schematic diagram of I / O flows in different allocation modes within an SSD provided by an embodiment of the present application;

[0049] Figure 3 is a flow chart of a solid state disk address mapping method provided in an embodiment of the present application;

[0050] Figure 4 It is a schematic diagram of the FpH2a architecture provided in an embodiment of the present application;

[0051] Figure 5 It is a schematic diagram of a classification tree for cold and hot prediction provided in an embodiment of the present application;

[0052] Figure 6 It is a schematic diagram of alleviating unfairness by adjusting the relaxation time of unfair flows provided by an embodiment of the present application;

[0053] Figure 7 is an architectural diagram of a solid state disk address mapping device provided in an embodiment of the present application;

[0054] Figure 8 This is an architectural diagram of the solid-state drive provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0056] The term "and / or" in this article is a description of the association relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in the term "and / or" or the term "I / O" in this article means or, and the symbol "io_rate flowA / io_rate flowB "or" write_ratio flowA / write_ratio flowB The symbol “ / ” in “” represents a division sign.

[0057] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of objects. For example, the first policy and the second policy are used to distinguish different policies rather than to describe a specific order of policies; the first user and the second user are used to distinguish different users rather than to describe a specific order of users.

[0058] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0059] In the description of the embodiments of the present application, unless otherwise specified, "at least one" means one or more, for example, at least one write request means one or more write requests, etc.; at least one read request means one or more read requests, etc.

[0060] First, the technical terms involved in the embodiments of the present application are introduced.

[0061] (1)FpH2a

[0062] The solid state disk address mapping scheme provided in this application can be referred to as FpH2a.

[0063] (2) The first request queue and the second request queue

[0064] The first request queue is a request queue with high I / O intensity, and the second request queue is a request queue with low I / O intensity.

[0065] Next, the technical solutions provided in the embodiments of the present application are introduced.

[0066] In this application, the application describes the details of FpH2a, which is a fairness strategy based on hybrid address allocation for SSD scenarios shared by multiple applications. The basic idea of ​​FpH2a is to provide different address mapping schemes for various user flows, so as to strike a balance between performance and fairness. To this end, the application needs to consider the following issues. First, how to define high I / O intensity so that the PCWD strategy can be selectively used (the address mapping scheme of FpH2a uses the CWDP strategy by default). Secondly, under high-intensity I / O, which data needs to use the PCWD strategy. Because some data will be read after writing, blindly using the PCWD strategy will result in very poor performance when reading these data. Finally, how to provide fairness while ensuring performance under low-intensity I / O. In the following embodiments, the application will solve the above problems one by one and propose corresponding solutions.

[0067] Traditional SSDs optimize parallelism as their primary goal, but this comes at the cost of losing fairness. FpH2a can optimize SSD parallelism while improving SSD fairness. To achieve this goal, FpH2a distinguishes between streams of different I / O intensities when stream requests enter the SSD. Under high I / O intensity, FpH2a uses the PCWD strategy for cold data to ensure fairness, while hot data still uses the CWDP strategy to prioritize performance. To accurately distinguish between cold and hot data, FpH2a collects I / O data features that will be read after writing as a training set for training. And to achieve lightweight prediction, a decision tree model is deployed in FpH2a. The trained model can ensure accurate prediction of cold and hot data and make it easy to handle mixed workloads with different access patterns. To further improve SSD fairness, FpH2a will alleviate unfairness by adjusting the slack time of the stream under low I / O intensity. This method can improve fairness while ensuring performance.

[0068] Figure 3 is a flow chart of a solid state disk address mapping method provided in an embodiment of the present application; Figure 3 As shown, the following steps are included:

[0069] Step S101, receiving a request queue of at least one user; the request queue includes at least one write request and / or at least one read request;

[0070] Step S102: When the request rate of the request queue is greater than a preset rate threshold, it is a first type of request queue; a cold and hot prediction model is used to predict the cold and hot types of the data to be written corresponding to each write request in the first type of request queue; when it is cold data, the first strategy is used to process the write request, and when it is hot data, the second strategy is used to process the write request; the first strategy is a strategy for ensuring fairness, and the second strategy is a strategy for ensuring parallelism;

[0071] Specifically, Figure 4 The workflow FpH2a of the present application is shown, which consists of five main parts: feature collector, tree model trainer, hot and cold predictor, address allocator and fair scheduler. The feature collector continuously receives I / O requests from the host interface logic (HIL) and extracts features from the access pattern of each workload. Different types of features will be used by different modules. For example, the feature collector itself will classify the data into high and low types according to the I / O intensity. The hot and cold predictor is a trained decision tree model used to distinguish hot and cold data at high I / O intensity. The parameters of the decision tree model are obtained by training the tree model trainer module in offline mode, and this module does not affect the operation of the online module. The address allocator will select different address mapping schemes including CWDP and PCWD according to the hot and cold degree of the data to balance fairness and performance. Finally, in low I / O intensity, the fair scheduler will adjust the relaxation time according to the unfairness of the flow while ensuring performance to achieve fairness.

[0072] In an optional example, the stream I / O feature extraction provided by the present application specifically includes the following steps:

[0073] The features extracted from the streaming I / O request level are very rich. This application calculates five features related to fairness and I / O interference modeling from the request queue of each user's HIL (which can be regarded as an I / O sequence) because they have been frequently used in previous work. In particular, this application analyzes the following workload features:

[0074] 1. Average I / O size (ave_io_size∈R+): The average I / O size of all requests in the I / O sequence. R+ represents a positive real number in mathematics.

[0075] 2. I / O rate (io_rate∈R+): The number of requests in the I / O sequence, reflecting the I / O intensity of the request.

[0076] 3. Write ratio (write_ratio∈[0,1]): the ratio of write requests to all requests.

[0077] 4. Temporal locality of I / O access (rar∈[0,1]): The ratio of revisit traffic to total traffic, reflecting the locality characteristics.

[0078] 5. Spatial locality of I / O access (randomness∈[0,1]): The percentage of random requests to all I / O requests. A random request is defined as a request that exceeds a threshold (e.g., 128KiB) from the address of the current request to the address of the previous 32 requests.

[0079] It should be noted that these features are not used in every module. This application will introduce the features used by each module separately later. In addition, some features such as temporal locality and spatial locality of I / O access are only collected when the current I / O sequence belongs to high I / O intensity, because it is meaningless to calculate these features when the I / O rate is very small.

[0080] In addition to collecting features, the feature collector also distinguishes different I / O intensities based on the I / O rate. This application refers to the threshold for distinguishing high and low I / O intensities as IORate. th When the I / O rate of one of the users is greater than IORate th This application considers it as a high I / O intensity flow, otherwise it is a low I / O intensity flow. The write request in the low intensity I / O flow uses the CWDP policy by default, while the high intensity I / O flow will be trained and predicted to assign a suitable address mapping scheme.

[0081] Specifically, the implementation of hybrid address mapping provided by the present application is as follows: Although the present application has many advantages in using PCWD under high I / O intensity, one problem is that the data may be read soon. Because the read performance of data written according to the PCWD strategy is very poor, especially under low I / O intensity. The performance of writing again on the same address will not be affected by the address mapping strategy used for the last write.

[0082] In order to solve this problem, this application needs to distinguish between hot and cold data, that is, to determine whether the data will be read frequently. After the data is written to the SSD, this application regards those data that will be read in the future as hot data, and the data that will not be read as cold data. This application hopes to use the PCWD write strategy for those cold data to improve fairness, while the hot data is still written to the flash memory using the CWDP strategy, so as to avoid the possible poor performance of the hot data when it is read. In order to achieve this goal, this application trains a decision tree model offline, passes the trained parameters to the predictor, and finally assigns different address mapping schemes according to the hotness of the data.

[0083] Among them, the decision tree model is trained by a tree model trainer to predict whether I / O requests are hot or cold. The main function of the tree model trainer is to train a model that can predict whether I / O requests are hot or cold. Based on all five features calculated by the feature collector, this application explores the use of decision trees (DT) to predict the hot and cold classification of data. In addition to its high prediction accuracy, DT also has the key advantage of producing stable and explainable results. This application can discover the key features that cause the data to be accessed again by analyzing the model parameters output by DT. More importantly, the model after decision tree training only involves binary classification judgments of several parameters, which is very critical for SSDs with very limited resources.

[0084] The specific training process of the above decision tree model includes:

[0085] (1) Sample marking: For the collected training data set, the feature collector monitors the possible RAW (read-after-write) access pattern in real time. This access pattern represents the process of writing and subsequently reading the same page. Then, the tree model trainer marks the request's feature sequence of writing and reading collected by the feature collector.<ave_io_size,io_rate,write_ratio,rar,randomness> The remaining data is marked as hot data, and the rest is marked as cold data. After a period of offline collection, the tree model trainer will get a large amount of training data with hot and cold labels.

[0086] (2) Model training: The tree model trainer takes all the features described previously as input (<ave_io_size,io_rate,write_ratio,rar,randomy> ∈R 5 ), and then use cold or hot as the training label ("1" for hot, "0" for cold). This application can use 10-fold cross validation to evaluate the performance of the decision tree. The training phase of the model is offline and will not affect the performance of the SSD during normal use.

[0087] In a specific embodiment, the present application predicts the hot and cold types of the data to be written corresponding to each write request in the request queue by inputting the characteristics of the request queues in different time periods into a trained decision tree model. It is understandable that as time goes by, new requests are continuously added to the request queue, and the characteristics of the request queue will be updated accordingly. It can be seen that the characteristics of the request queues in different time periods carry the characteristics of the requests added between different time periods. Therefore, the decision tree model can be trained in combination with the characteristics of the request queues in different time periods; so that the decision tree model can realize the prediction of the hot and cold types of the data corresponding to each write request in the request queue.

[0088] Figure 5 It is a decision tree model obtained by the present application after training based on the collected training data in a workload. It contains data in different proportions, which is represented by the percentage "xx%" at the bottom of each node. It can be seen intuitively that the decision tree believes that small I / O requests (ave_io_size<17) with large I / O intensity (io_rate>=324) in the load belong to hot data (Node 2). Furthermore, for those large I / O requests under high intensity (ave_io_size>=17 and io_rate>=187), read data with stronger locality (write_ratio<0.21 and rar>=0.82) belongs to hot data (Node5). Note that there is no hot data when write_ratio>=0.21 and randomness<=0.01, which is 0%. This way of distinguishing is in line with the present application's understanding of hot data, so it is more credible.

[0089] Furthermore, based on the results obtained by the tree model trainer, the present application completes the hot and cold prediction of write I / O requests. The tree model trainer will pass the trained decision tree model parameters to the hot and cold predictor. These parameters are the thresholds used for binary classification decisions for different features. For example, for Figure 5 The trained decision tree model in , the parameters include 17 for ave_io_size, 324 and 187 for io_rate, 0.21 for write_ratio and 0.82 for rar, and 0.99 for randomness. The hot and cold predictor takes the features obtained by the feature collector as input and outputs hot and cold labels according to the parameters of the decision tree model. Therefore, the storage overhead and computational overhead of FpH2a are negligible.

[0090] It should be noted that it is not necessary to perform hot and cold prediction on the read I / O because the corresponding physical address has been determined. Therefore, the hot and cold of the read I / O will not be discussed in this application.

[0091] Step S103, when the request rate of the request queue is not greater than the preset rate threshold, it is a second request queue, and the second strategy is used to process the write requests in the second request queue; combining the request rates and write ratios of the two second request queues belonging to different users, determine whether there is unfairness between different users, and if there is unfairness, adjust the relaxation time of the second request queue of the unfair user to alleviate the unfairness; the unfairness is that if the sub-request of the second request queue belonging to the first user is processed after the sub-request of the second request queue belonging to the second user, resulting in the relaxation time of the first user's request queue being extended, then the first user is an unfair user.

[0092] Obviously, through the hot and cold predictor, this application can obtain hot and cold tags representing whether the current write I / O will be read in the future. If the current write I / O belongs to cold data, this application will use the PCWD strategy to allocate the physical address, otherwise the CWDP strategy will be used. Since cold data will not be accessed in the future, the use of PCWD can improve fairness while ensuring performance (the I / O intensity is large at this time, and the performance of PCWD and CWDP are similar). The hot data write using the CWDP strategy will give priority to performance (parallel reading) when it is read in the future.

[0093] In a specific embodiment, the present application implements fairness guarantee for requests under low I / O intensity. By analyzing the present application, unfair users in a shared SSD are identified, and fairness is achieved while ensuring the performance of other users.

[0094] In existing research, it was found that there are four main sources of interference that affect SSD fairness: I / O intensity, access mode, read-write ratio, and garbage collection. Since the access mode is not very obvious under low-intensity I / O, and this application allows each block to be used by a single user, this application ignores the impact of access mode and garbage collection on unfairness. Existing work points out that for I / O intensity and read-write ratio, high I / O intensity and high write ratio I / O flows will affect other flows, leading to unfairness. Here, this application locates unfair users by comparing the I / O intensity and read-write ratio differences of two users, flowA and flowB. The method for selecting unfair flows in this application is shown in Algorithm 1.

[0095] The fairness judgment algorithm provided in the embodiment of the present application is specifically as follows:

[0096] Step 1: Calculate the I / O rate io_rate of user A flowA The I / O rate io_rate of user B flowB I / O rate ratio; diff io_rate =io_rate flowA / io_rate flowB .

[0097] Step 2: Calculate user A’s write ratio write_ratio flowA Write ratio with user B write_ratio flowB Write ratio ratio; diff write_ratio =write_ratio flowA / write_ratio flowB .

[0098] Step 3: If the I / O rate ratio is greater than 1 and the write ratio ratio is greater than 1, user B is an unfair user;

[0099] Step 4: If the I / O rate ratio is less than 1 and the write ratio ratio is less than 1, user A is an unfair user;

[0100] Step 5: If the I / O rate ratio is greater than 1 and the write ratio ratio is less than 1, if the product of the I / O rate ratio and the preset weight α is greater than the inverse of the write ratio ratio, user B is an unfair user, otherwise user A is an unfair user;

[0101] Step 6: If the I / O rate ratio is less than 1 and the write ratio ratio is greater than 1, if the product of the inverse of the I / O rate ratio and the preset weight α is greater than the write ratio ratio, user A is an unfair user, otherwise user B is an unfair user;

[0102] Except for the above steps 3 to 6, there is no unfair situation between user A and user B.

[0103] Among them, α is an adjustable weight parameter used to eliminate the difference in unfairness between I / O intensity and read-write ratio. By default, α is set to 1, which means that I / O intensity and read-write ratio have the same impact on unfairness. The core idea of ​​the algorithm is to compare the difference between the two flows in terms of I / O intensity and read-write ratio. The greater the difference, the more prominent the unfairness problem is, thus determining the current unfair flow.

[0104] In fact, one reason for the unfairness problem is that the user's subrequest is delayed by other users, resulting in a longer slack time for the request. Therefore, the way the fair scheduler solves the fairness problem is to reduce the slack time of the request.

[0105] For example, Figure 6 The sub-requests of the two streams A and B in the above diagram are distributed by the CWDP strategy and executed on chips in different channels (currently belonging to low-intensity I / O, the CWDP strategy is used by default). Figure 6 An example of alleviating unfairness by adjusting the slack time of unfair flows, where A0, A1, and A2 are sub-requests of A; B0, B1, and B2 are sub-requests of B. Since the waiting queues in each chip are of the same type of operations, the execution time of each transaction in the same queue is the same. At this time, the completion time of the requests of flows A and B are t6 and t5 respectively, and the slack times are (t6-t1) and (t5-t1) respectively.

[0106] Assuming that the current flow B is an unfair flow relative to flow A, the fair scheduler searches forward for the request of flow A in the queue where the last executed sub-request of the request to which flow B belongs is located (that is, it searches before the t5 completion time point of the B1 sub-request in the queue of "channel 2_chip 3"). After the fair scheduler searches forward and finds the sub-request of flow A (A2), the application will evaluate whether flows A and B can be adjusted between the slack times.

[0107] Figure 6 In the present application, it can be observed that by adjusting the positions of the B1 and A2 sub-requests, the request of stream B can be executed in advance. After the adjustment, the slack time and delay of stream A are not affected, while the slack time and delay of stream B are shortened (t3-t1 and t3 respectively). Therefore, the fair scheduler can improve the performance of stream B while ensuring that the performance of stream A is not affected, thereby satisfying the fairness of streams A and B. Please note that if the current stream A is an unfair flow relative to stream B, the positions of sub-requests B0 and A1 cannot be adjusted at this time, because this will affect the performance of stream B. In this case, the fair scheduler will abandon the queue reordering, so the fair scheduler cannot always find a situation that satisfies the reduction of slack time.

[0108] Figure 7 is an architectural diagram of a solid state disk address mapping device provided in an embodiment of the present application; Figure 7 As shown, including:

[0109] The feature collection module 710 is used to receive a request queue of at least one user. When the request rate of the request queue is greater than a preset rate threshold, it is a first request queue; when the request rate of the request queue is not greater than the preset rate threshold, it is a second request queue; the request queue includes at least one write request and / or at least one read request;

[0110] A cold / hot prediction module 720 is used to predict the cold / hot type of the to-be-written data corresponding to each write request in the first request queue by using a cold / hot prediction model;

[0111] The address allocation module 730 is used to process the write request in the first request queue using a first strategy when the data to be written corresponding to the write request is cold data, and to process the write request using a second strategy when the data to be written corresponding to the write request is hot data; and to process the write request in the second request queue using the second strategy; the first strategy is a strategy for ensuring fairness, and the second strategy is a strategy for ensuring parallelism;

[0112] The fair scheduling module 740 is used to determine whether there is unfairness between different users by combining the request rates and write ratios of the two second request queues belonging to different users. If there is unfairness, the relaxation time of the second request queue of the unfair user is adjusted to alleviate the unfairness. The unfairness is that if the sub-request of the second request queue belonging to the first user is processed after the sub-request of the second request queue belonging to the second user, resulting in the relaxation time of the first user's request queue being extended, then the first user is an unfair user.

[0113] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment, and the implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.

[0114] Figure 8 is an architectural diagram of a solid state disk provided in an embodiment of the present application; Figure 8 As shown, the solid state disk includes the solid state disk address mapping device provided in the above embodiment.

[0115] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.

[0116] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0117] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.

[0118] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A solid state disk address mapping method, It is characterized in that include: Receive a request queue of at least one user; the request queue includes at least one write request and / or at least one read request; When the request rate of the request queue is greater than the preset rate threshold, it is a first type of request queue; a cold and hot prediction model is used to predict the cold and hot types of the data to be written corresponding to each write request in the first type of request queue; when it is cold data, the first strategy is used to process the write request, and when it is hot data, the second strategy is used to process the write request; the first strategy is a strategy to ensure fairness, and the second strategy is a strategy to ensure parallelism; When the request rate of the request queue is not greater than the preset rate threshold, it is a second request queue, and the second strategy is used to process the write requests in the second request queue; combining the request rates and write ratios of the two second request queues belonging to different users to determine whether there is unfairness between different users, if there is unfairness, adjust the relaxation time of the second request queue of the unfair user to alleviate the unfairness; the unfairness is that if the sub-request of the second request queue belonging to the first user is processed after the sub-request of the second request queue belonging to the second user, resulting in the relaxation time of the first user's request queue being extended, then the first user is an unfair user.

2. The method according to claim 1, It is characterized in that Determine whether there is unfairness between different users by following these steps: Calculating a request rate ratio of the second request queue of the first user to that of the second user; Calculate the write ratio ratio of the second request queue of the first user to that of the second user; If the request rate ratio is greater than 1 and the write ratio ratio is greater than 1, the second user is an unfair user; If the request rate ratio is less than 1 and the write ratio ratio is less than 1, the first user is an unfair user; If the request rate ratio is greater than 1 and the write ratio ratio is less than 1, if the product of the request rate ratio and the preset weight is greater than the inverse of the write ratio ratio, then the second user is an unfair user, otherwise the first user is an unfair user; If the request rate ratio is less than 1 and the write ratio ratio is greater than 1, if the product of the inverse of the request rate ratio and the preset weight is greater than the write ratio ratio, the first user is an unfair user, otherwise the second user is an unfair user.

3. The method according to claim 2, It is characterized in that The preset weight is 1.

4. The method according to claim 1, It is characterized in that The first strategy is the PCWD strategy, and the second strategy is the CWDP strategy; The PCWD strategy stripes data to each parallel unit in the order of plane, channel, chip and wafer; The CWDP strategy stripes data to each parallel unit in the order of channel, chip, wafer and plane.

5. The method according to claim 1, It is characterized in that Also includes: Extracting characteristics of the request queue in different time periods; The features include: average request size, request rate, write ratio, time locality of request access, and space locality of request access; the time locality is the ratio of re-access traffic to total traffic, and the space locality is the percentage of random requests to all requests; The cold and hot prediction model is a trained decision tree model; The decision tree model predicts the hot and cold types of data, including: The features of the request queues in different time periods are input into the trained decision tree model to predict the hot and cold types of the data to be written corresponding to each write request in the request queue.

6. The method according to claim 5, It is characterized in that The training steps of the decision tree model include: Taking the features of the request queue training samples as input, and inputting them into the decision tree model for training; each write request in the training samples has a cold or hot label; The performance of the decision tree model is evaluated by cross validation, and the decision tree model is trained offline.

7. The method according to claim 1, It is characterized in that The adjusting the relaxation time of the second request queue of the unfair user to alleviate the unfair situation includes: The execution order of the unfair user sub-requests and the non-unfair user sub-requests is adjusted to reduce the relaxation time of the request queue corresponding to the unfair user without affecting the relaxation time of the request queue corresponding to the non-unfair user.

8. A solid state disk address mapping device, It is characterized in that include: A feature collection module, configured to receive a request queue of at least one user, wherein when a request rate of the request queue is greater than a preset rate threshold, the request queue is a first type of request queue; when a request rate of the request queue is not greater than the preset rate threshold, the request queue is a second type of request queue; the request queue includes at least one write request and / or at least one read request; A cold / hot prediction module, used to predict the cold / hot type of the to-be-written data corresponding to each write request in the first request queue by using a cold / hot prediction model; An address allocation module, configured to process the write request in the first request queue using a first strategy when the data to be written corresponding to the write request is cold data, and process the write request using a second strategy when the data to be written is hot data; and process the write request in the second request queue using the second strategy; the first strategy is a strategy for ensuring fairness, and the second strategy is a strategy for ensuring parallelism; A fair scheduling module is used to determine whether there is unfairness between different users by combining the request rates and write ratios of two second request queues belonging to different users. If there is unfairness, the relaxation time of the second request queue of the unfair user is adjusted to alleviate the unfairness. The unfairness is that if a sub-request of the second request queue belonging to the first user is processed after a sub-request of the second request queue belonging to the second user, resulting in the relaxation time of the first user's request queue being extended, then the first user is an unfair user.

9. The device according to claim 8, It is characterized in that The fair scheduling module is used to calculate the request rate ratio of the second request queue of the first user and the second user; calculate the write ratio ratio of the second request queue of the first user and the second user; if the request rate ratio is greater than 1 and the write ratio ratio is greater than 1, the second user is an unfair user; if the request rate ratio is less than 1 and the write ratio ratio is less than 1, the first user is an unfair user; if the request rate ratio is greater than 1 and the write ratio ratio is less than 1, if the product of the request rate ratio and the preset weight is greater than the inverse of the write ratio ratio, the second user is an unfair user, otherwise the first user is an unfair user; and if the request rate ratio is less than 1 and the write ratio ratio is greater than 1, if the product of the inverse of the request rate ratio and the preset weight is greater than the write ratio ratio, the first user is an unfair user, otherwise the second user is an unfair user.

10. A solid state disk, It is characterized in that include: The solid state disk address mapping device as described in claim 8 or 9.

Citation Information

Patent Citations

  • Request processing method and device for realizing fairness of solid state disk and electronic equipment

    CN116643693A

  • Storage optimization method and device of solid state disk, computer equipment and storage medium

    CN116974491A

  • Method for adjusting SSD load, storage system, storage access method and product

    CN118244995A

  • File system operating method and devices using the same

    US20120209893A1

  • Memory apparatus and methods thereof for write amplification aware wear leveling

    US20180188980A1