CN115048056A - Solid state disk buffer area management method based on page replacement cost - Google Patents

Solid state disk buffer area management method based on page replacement cost Download PDF

Info

Publication number
CN115048056A
CN115048056A CN202210695096.2A CN202210695096A CN115048056A CN 115048056 A CN115048056 A CN 115048056A CN 202210695096 A CN202210695096 A CN 202210695096A CN 115048056 A CN115048056 A CN 115048056A
Authority
CN
China
Prior art keywords
page
linked list
victim
clean
dirty
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210695096.2A
Other languages
Chinese (zh)
Other versions
CN115048056B (en
Inventor
刘靖宇
颜钰莹
曹兴旺
范小芹
李娟�
武优西
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hebei University of Technology
Original Assignee
Hebei University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hebei University of Technology filed Critical Hebei University of Technology
Priority to CN202210695096.2A priority Critical patent/CN115048056B/en
Publication of CN115048056A publication Critical patent/CN115048056A/en
Application granted granted Critical
Publication of CN115048056B publication Critical patent/CN115048056B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention relates to a solid state disk buffer area management method based on page replacement cost, which divides a buffer area of a solid state disk into a working area and a victim area, wherein the working area maintains a clean page linked list and a mixed page linked list, and the victim area maintains a victim page linked list; the clean page linked list is used to store clean pages that have not been modified, the mixed page linked list is used to store dirty pages that have been modified, and the victim page linked list is used to store victim candidate pages that are waiting to be accessed again or evicted from the buffer. In order to improve the hit rate of the buffer, the migration cost and the replacement cost of the page are respectively calculated, and the page with low replacement cost is selected for eviction, so that the condition that the clean page is always replaced preferentially by the existing buffer management method, the clean page is just entered into the buffer and is evicted from the buffer as the page of a victim, the frequently accessed page is kept in the buffer, meanwhile, the write-back operation frequency of the dirty flash memory page is reduced, and the overall performance of the solid state disk is improved.

Description

Solid state disk buffer area management method based on page replacement cost
Technical Field
The invention belongs to the technical field of performance optimization design of solid state disks, and particularly relates to a solid state disk buffer area management method based on page replacement cost.
Background
In order to deal with the fast access of massive unstructured data, the commonly used storage media have been developed from the earliest tapes, optical disks, etc. to mechanical disks (HDDs), and then to flash memory based Solid State Disks (SSDs) which are now commonly used. The flash memory has no mechanical characteristics of a traditional physical disk, so that the solid state disk has the advantages of nonvolatility, high shock resistance, low power consumption, small volume and the like, and the market share of the solid state disk is continuously increased.
With the continuous improvement of the capacity and performance of the solid state disk, the excellent characteristics of the solid state disk gradually make up for the performance gap between a Central Processing Unit (CPU) and an Input/Output (Input/Output), but the solid state disk also has problems, which seriously hinders the performance improvement of the solid state disk. On one hand, the solid state disk cannot perform data updating at the original position, so that newly written data must be stored in an idle position where data is not written, when the idle position does not exist, the flash memory block where invalid data is located must be erased, otherwise, the new data cannot be written into the flash memory. On the other hand, the physical characteristics of the flash memory require that the read and write operations are performed in page units and the erase operation is performed in block units, the three basic operations are different in time consumption, the flash memory is limited by the erase times, when the erase times of the flash memory block exceed a threshold, the probability of generating a bad block is increased sharply, and when a bad block is generated, data cannot be written into the bad block or written data can generate errors.
The traditional solid state disk buffer management method mainly aims at reducing the writing back of dirty pages to a flash memory, when the buffer has no free space and needs to perform page eviction operation, clean pages are preferentially evicted from the buffer, and the hit rate of the buffer is reduced.
Disclosure of Invention
Aiming at the defects of the prior art, the technical problem to be solved by the invention is to provide a solid state disk buffer area management method based on page replacement cost. The method fully utilizes the characteristic that data access has time locality, and the frequently accessed pages are reserved in the buffer area, so that the hit rate of the buffer area is improved, the write-back operation times of dirty flash memory pages are reduced, and the overall performance of the solid state disk is improved.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a solid state disk buffer area management method based on page replacement cost is characterized in that the method divides a buffer area of a solid state disk into a working area and a victim area, the working area maintains a clean page chain table and a mixed page chain table, the victim area maintains a victim page chain table, and the three page chain tables are managed by using the least recent principle; the clean page linked list is used for storing unmodified clean pages, the mixed page linked list is used for storing modified dirty pages, and the victim page linked list is used for storing victim candidate pages waiting to be accessed again or driven out of the buffer area;
when an access request comes, judging whether a target page of the access request is located in a buffer area, if so, judging whether the target page is located in a working area, if so, executing S1, otherwise, executing S2; if the target page is not located in the buffer, executing S3;
s1, if the access request is a write request, migrating the target page to the MRU end of the mixed page linked list; if the access request is a read request, when the target page is a clean page, storing the target page at an MRU end of a clean page linked list, and when the target page is a dirty page, migrating the target page to an MRU end of a mixed page linked list; finally, returning the target page to the upper application;
s2, judging whether the working area has free space, if so, and if the access request is a write request, transferring the target page to the MRU end of the mixed page linked list maintained in the working area; when the access request is a read request and the target page is a clean page, storing the target page at an MRU end of a clean page linked list in a working area, and when the target page is a dirty page, migrating the target page to an MRU end of a mixed page linked list in the working area; finally, returning the target page to the upper application;
if the working area has no free space, respectively calculating the migration cost of a clean page at the LRU end of the clean page linked list and the migration cost of a dirty page at the LRU end of the mixed page linked list by using the formula (1) and the formula (2), and migrating the page with low migration cost to the MRU end of the victim page linked list in the victim area, wherein the working area obtains the free space at the moment, and if the target page is the clean page, inserting the target page into the MRU end of the clean page linked list in the working area; if the target page is a dirty page, inserting the target page into an MRU end of a mixed page linked list in a working area; finally, returning the target page to the upper application;
Figure BDA0003701991730000021
Figure BDA0003701991730000022
in the formula, M c 、M m Representing migration costs of clean and dirty pages, respectively, C r 、C w 、C e Respectively representing the costs of a read operation, a write operation and an erase operation, k representing a scaling factor, P representing the total number of flash memory pages, P d Indicating the number of dirty flash memory pages, T c 、T d Respectively representing the time interval of last accessed page distance of the clean page linked list and the mixed page linked list LRU end;
s3, if the target page is not located in the buffer area, judging whether the buffer area has free space, if yes, reading the target page from the flash memory into the buffer area, and when the access request is a write request, transferring the target page to the MRU end of the mixed page linked list maintained in the working area; when the access request is a read request and the target page is a clean page, storing the target page at an MRU end of a clean page linked list in a working area, and when the target page is a dirty page, transferring the target page to the MRU end of a mixed page linked list in the working area; finally, returning the target page to the upper application;
if the buffer area has no free space, scanning a victim page linked list, calculating the replacement cost of each victim candidate page in the victim page linked list according to the formula (3) and the formula (4), selecting the victim candidate page with the minimum replacement cost as the victim page, and expelling the victim page into a flash memory, wherein the working area obtains the free space at the moment, and when the access request is a write request, storing a target page at an MRU end of a mixed page linked list maintained in the working area; when the access request is a read request and the target page is a clean page, storing the target page at the MRU end of the clean page linked list in the working area, and when the target page is a dirty page, storing the target page at the MRU end of the mixed page linked list in the working area; finally, returning the target page to the upper application;
Figure BDA0003701991730000023
Figure BDA0003701991730000024
where RC (i) represents the replacement cost of victim candidate page i, AUI represents the average access time interval of victim candidate pages,
Figure BDA0003701991730000025
respectively representing the times of the jth and jth-1 visits of the victim candidate page i,
Figure BDA0003701991730000026
representing the time when victim candidate page i was accessed for the first time and n representing the total number of accesses.
Further, the method also comprises the following steps:
respectively calculating the access frequency of each flash memory page in the buffer area and a threshold value for distinguishing cold dirty pages from hot dirty pages according to the formulas (5) and (6);
Figure BDA0003701991730000031
Figure BDA0003701991730000032
where VF (p) represents the access frequency, count, of the flash page p p Representing the number of accesses to the flash page p, current _ time representing the current time of the system, visit _ time p Indicating the time at which the flash memory page p enters the buffer,
Figure BDA0003701991730000033
a threshold value for distinguishing cold dirty pages from hot dirty pages is indicated;
the method comprises the steps that dirty flash memory pages with access frequency higher than a threshold value are called hot dirty flash memory pages, dirty flash memory pages with access frequency lower than the threshold value are called cold dirty flash memory pages, and the hot dirty flash memory pages and the cold dirty flash memory pages are respectively stored in corresponding physical blocks and written back to the flash memory in cluster units; the clean flash page is directly discarded and no longer written back to flash.
Compared with the prior art, the invention has the beneficial effects that:
1. in order to improve the hit rate of the buffer, the invention provides a concept of migration cost. If the work area has no free space, calculating the migration cost of a clean page at the LRU (Least Recently Used) end of the clean page linked list and the migration cost of a dirty page at the LRU end of the mixed page linked list, and selecting a page with low migration cost for migration. The existing cache region management method mainly preferentially drives the clean page out of the buffer region, but preferentially replaces the clean page always, does not consider the access frequency of the clean page, so that the clean page is used as a victim page to be driven out of the buffer region just after entering the buffer region, the hit rate of the buffer region is reduced, and the dirty page which is not accessed for a long time occupies the space of the buffer region, so that the space waste is caused.
2. Reducing the cost of writing dirty pages back to flash. The number of dirty flash memory pages contained in the page and the access frequency of the page are comprehensively considered, the page replacement cost is used as an index, the candidate page of the victim with the minimum replacement cost is selected as the page of the victim, and the page of the victim is driven out of the buffer area, so that the energy consumption is not too high.
3. In order to reduce the operation frequency of writing the flash memory page back to the flash memory and ensure that the flash memory page obtains spatial locality on data access, a page recombination mode is provided, the page to be written back to the flash memory is divided into small flash memory pages, the small flash memory pages are divided into a cold dirty page group and a hot dirty page group by taking a cluster as a unit according to the frequency of accessing the flash memory pages and are respectively written into corresponding physical blocks, a plurality of flash memory pages are written back at one time, the dispersion degree of the pages in the flash memory is reduced, the data layout of the flash memory is optimized, clean pages are directly discarded and are not written back into the flash memory, the redundant operation of writing unmodified pages back to the flash memory is reduced, the frequency and the cost of garbage recovery in the flash memory are reduced, the flash memory pages have spatial locality on data access, the probability that the flash memory pages in one physical block become invalid pages at the same time is increased, and the data migration in the garbage recovery process is reduced, and preparation is made for garbage recovery and wear leveling, so that the overall performance of the flash memory storage system is improved. The space of the buffer area is fully utilized, so that the read-write operation of the data is performed in the buffer area as much as possible, the frequency of writing the data back to the flash memory is reduced, and frequent data updating and page erasing in the flash memory are avoided.
Drawings
FIG. 1 is a layout diagram of a buffer structure according to the present invention;
FIG. 2 is a flow chart of the present invention;
FIG. 3 is a schematic diagram of page splitting according to the present invention;
FIG. 4(a) is a schematic view showing a page state of a work area in example 1;
FIG. 4(b) is a schematic diagram of the page state after the target page is migrated in embodiment 1.
Detailed Description
The technical solutions of the present invention are described in detail below with reference to the drawings and the detailed description, but the scope of the present invention is not limited thereto.
The invention provides a solid state disk buffer management method (a method for short, see fig. 1-3) based on page replacement cost, as shown in fig. 1, the method divides the buffer of a solid state disk into a working area and a victim area, the working area maintains two page linked lists, namely a clean page linked list and a mixed page linked list, and the victim area maintains one victim page linked list; the victim page linked list is used for storing victim candidate pages, and the victim candidate pages are pages waiting to be accessed again or ejected from the buffer area; the three page linked lists are managed by using the least recent principle;
setting a system access time visit _ time, the initial value of which is set to 0; recording the page access time of a buffer area, wherein each page in the buffer area is provided with an access time, namely page access time page _ time, and recording the page access time page _ time once every time the page is accessed to obtain the latest page access time; when an I/O (read-write) request arrives, adding 1 to the value of the system access time visit _ time when accessing one buffer page, assigning the value of the current system access time visit _ time to the access time of the accessed page, and recording the access time of the current accessed page;
the method specifically comprises the following steps:
firstly, when an access request comes, judging whether a target page of the access request is located in a buffer area, if so, judging whether the target page is located in a working area, if so, executing S1, otherwise, executing S2; if the target page is not located in the buffer, executing S3;
s1, if the target page is located in the working area of the buffer area, according to the page state and the request type, migrating the target page to the MRU (Most Recently Used) end of the corresponding linked list, and returning the target page to the upper application; if the access request is a write request, migrating the target page to an MRU end of the mixed page linked list; if the access request is a read request, when the target page is a clean page, storing the target page at an MRU end of a clean page linked list, and when the target page is a dirty page, migrating the target page to an MRU end of a mixed page linked list;
s2, if the target page is located in the victim area of the buffer area, judging whether the working area has free space; if yes, migrating the target page to an MRU end of a corresponding linked list in the working area according to the page state and the request type, and returning the target page to the upper application; if the access request is a write request, migrating the target page to an MRU end of a mixed page linked list maintained in a working area; if the access request is a read request, when the target page is a clean page, storing the target page at an MRU end of a clean page linked list in a working area, and when the target page is a dirty page, transferring the target page to the MRU end of a mixed page linked list in the working area;
if the working area has no free space, respectively calculating the migration cost of a clean page at an LRU (Least Recently Used) end of a clean page linked list and the migration cost of a dirty page at the LRU end of a mixed page linked list through a formula (1) and a formula (2), migrating the page with low migration cost to an MRU end of the page linked list of a victim in the victim area, obtaining the free space in the working area at the moment, and if the target page is a clean page, inserting the target page of the access request into the MRU end of the clean page linked list in the working area; if the target page is a dirty page, inserting the target page into an MRU end of a mixed page linked list in a working area;
Figure BDA0003701991730000051
Figure BDA0003701991730000052
in the formula, M c 、M m Representing migration costs of clean and dirty pages, respectively, C r 、C w 、C e Respectively representing the costs of a read operation, a write operation and an erase operation, k representing a scaling factor, P representing the total number of flash memory pages, P d Indicating the number of dirty flash memory pages, T c 、T d Respectively representing the time interval of last accessed page distance of the clean page linked list and the mixed page linked list LRU end;
in general, the migration cost of a dirty page is greater than that of a clean page; when the migration cost of the dirty page is less than that of the clean page, the migration cost indicates that the time of the dirty page from the last access is long enough, and the dirty page which is not accessed for a long time is migrated to a victim area to wait for being accessed again or being ejected from a buffer area;
s3, if the target page is not located in the buffer area, namely the target page is located in the flash memory, judging whether the buffer area has free space, if so, reading the target page into the buffer area from the flash memory, then migrating the target page to the MRU end of the corresponding linked list according to the page state and the request type, and returning the target page to the upper application; if the access request is a write request, migrating the target page to an MRU end of a mixed page linked list maintained in a working area; if the access request is a read request, when the target page is a clean page, storing the target page at an MRU end of a clean page linked list in a working area, and when the target page is a dirty page, transferring the target page to the MRU end of a mixed page linked list in the working area;
if the buffer area has no free space, scanning a victim page linked list, calculating the replacement cost of each victim candidate page in the victim page linked list according to the formula (3) and the formula (4), selecting the victim candidate page with the minimum replacement cost as the victim page, and expelling the victim page into a flash memory, wherein the working area obtains the free space at the moment, and when the access request is a write request, storing a target page at an MRU end of a mixed page linked list maintained in the working area; when the access request is a read request and the target page is a clean page, storing the target page at the MRU end of the clean page linked list in the working area, and when the target page is a dirty page, storing the target page at the MRU end of the mixed page linked list in the working area;
Figure BDA0003701991730000053
Figure BDA0003701991730000054
where RC (i) represents the replacement cost of victim candidate page i, AUI represents the average access time interval of victim candidate pages,
Figure BDA0003701991730000055
respectively representing the times of the jth and jth-1 visits of the victim candidate page i,
Figure BDA0003701991730000056
representing the time when the victim candidate page i is accessed for the first time, and n representing the total number of times of accessing;
the minimum replacement cost shows that the average access time interval of the page is longer, and the probability of being accessed again in a short time is low; in addition, the proportion of the dirty flash memory pages contained in the buffer area is not large, and the energy consumption is not too large when the dirty flash memory pages are expelled into the flash memory.
Secondly, assuming that the size of a memory page (a page located in the buffer) is 4KB, the size of a flash memory page (a page located in the flash memory) is 512B, and one memory page can be divided into 8 flash memory pages; the flash pages with data unmodified are called clean flash pages, and the flash pages with data modified are called dirty flash pages, see fig. 3; respectively calculating the access frequency of each flash memory page in the buffer area and a threshold value for distinguishing a cold dirty flash memory page from a hot dirty flash memory page according to the formulas (5) and (6);
Figure BDA0003701991730000061
Figure BDA0003701991730000062
where VF (p) represents the access frequency, count, of the flash page p p Representing the number of accesses to the flash page p, current _ time representing the current time of the system, visit _ time p Indicating the time that the flash memory page p enters the buffer,
Figure BDA0003701991730000063
a threshold value for distinguishing cold dirty pages from hot dirty pages is indicated;
the method comprises the steps that dirty flash memory pages with access frequency higher than a threshold value are called hot dirty flash memory pages, dirty flash memory pages with access frequency lower than the threshold value are called cold dirty flash memory pages, and the hot dirty flash memory pages and the cold dirty flash memory pages are respectively stored in corresponding physical blocks and written back to the flash memory in cluster units; the clean flash page is directly discarded and no longer written back to flash.
Example 1
In this embodiment, an actual access request is taken as an example to describe a solid state disk buffer management method based on page replacement cost, as shown in fig. 4(a), when an upper layer application sends a write request, and a target page P3 is located in a clean page chain table of a working area, data in a target page P3 is modified, so that the target page P3 is migrated to an MRU end of a mixed page chain table, as shown in fig. 4(b), and the target page P3 is returned to the upper layer application to complete the access request.
When an upper-layer application sends a read request, the target page P9 is not located in the buffer area, and no free space exists in the buffer area, the victim page linked list is scanned, the replacement cost of each victim candidate page in the victim page linked list is respectively calculated according to the above formulas (3) and (4), the victim candidate page with the minimum replacement cost is selected as the victim page, and the victim page is evicted to the flash memory; the calculation process of the replacement cost of the victim candidate page is as follows:
firstly, the number P of dirty flash memory pages is determined by the page state identification bit of the flash memory pages d Further obtain the proportion of dirty flash page
Figure BDA0003701991730000064
Then, according to the time and the times of the victim candidate page being accessed, calculating the average access time interval AUI of the victim candidate page;
finally, calculating a replacement cost RC (i) according to the proportion of the dirty flash memory pages and the average access time interval of candidate pages of the victim;
after a victim page is evicted into a flash memory, a victim area in a buffer area obtains a free space, migration costs of a clean page located at an LRU end of a clean page chain table and a dirty page located at an LRU end of a mixed page chain table in a working area are respectively calculated through formulas (1) and (2), a page with low migration cost is migrated to an MRU end of the victim page chain table in the victim area, if a target page P9 is a clean page, the target page P9 is inserted into the MRU end of the clean page chain table, if a target page P9 is a dirty page, the target page P9 is inserted into the MRU end of the mixed page chain table, and finally, the target page P9 is returned to an upper application layer to complete an access request.
The invention is applicable to the prior art where nothing is said.

Claims (2)

1. A solid state disk buffer area management method based on page replacement cost is characterized in that the method divides a buffer area of a solid state disk into a working area and a victim area, the working area maintains a clean page chain table and a mixed page chain table, the victim area maintains a victim page chain table, and the three page chain tables are managed by using the least recent principle; the clean page linked list is used for storing unmodified clean pages, the mixed page linked list is used for storing modified dirty pages, and the victim page linked list is used for storing victim candidate pages waiting to be accessed again or driven out of the buffer area;
when an access request comes, judging whether a target page of the access request is located in a buffer area, if so, judging whether the target page is located in a working area, if so, executing S1, otherwise, executing S2; if the target page is not located in the buffer, executing S3;
s1, if the access request is a write request, migrating the target page to the MRU end of the mixed page linked list; if the access request is a read request, when the target page is a clean page, storing the target page at an MRU end of a clean page linked list, and when the target page is a dirty page, migrating the target page to an MRU end of a mixed page linked list; finally, returning the target page to the upper application;
s2, judging whether the working area has free space, if so, and if the access request is a write request, transferring the target page to the MRU end of the mixed page linked list maintained in the working area; when the access request is a read request and the target page is a clean page, storing the target page at an MRU end of a clean page linked list in a working area, and when the target page is a dirty page, transferring the target page to the MRU end of a mixed page linked list in the working area; finally, returning the target page to the upper application;
if the working area has no free space, respectively calculating the migration cost of a clean page at the LRU end of the clean page linked list and the migration cost of a dirty page at the LRU end of the mixed page linked list by using the formula (1) and the formula (2), and migrating the page with low migration cost to the MRU end of the victim page linked list in the victim area, wherein the working area obtains the free space at the moment, and if the target page is the clean page, inserting the target page into the MRU end of the clean page linked list in the working area; if the target page is a dirty page, inserting the target page into an MRU end of a mixed page linked list in a working area; finally, returning the target page to the upper application;
Figure FDA0003701991720000011
Figure FDA0003701991720000012
in the formula, M c 、M m Representing migration costs of clean and dirty pages, respectively, C r 、C w 、C e Respectively representing the costs of a read operation, a write operation and an erase operation,k denotes a scaling factor, P denotes the total number of flash memory pages, P d Indicating the number of dirty flash memory pages, T c 、T d Respectively representing the time interval of last accessed page distance of the clean page linked list and the mixed page linked list LRU end;
s3, if the target page is not located in the buffer area, judging whether the buffer area has free space, if yes, reading the target page from the flash memory into the buffer area, and when the access request is a write request, transferring the target page to the MRU end of the mixed page linked list maintained in the working area; when the access request is a read request and the target page is a clean page, storing the target page at an MRU end of a clean page linked list in a working area, and when the target page is a dirty page, transferring the target page to the MRU end of a mixed page linked list in the working area; finally, returning the target page to the upper application;
if the buffer area has no free space, scanning a victim page linked list, calculating the replacement cost of each victim candidate page in the victim page linked list according to the formula (3) and the formula (4), selecting the victim candidate page with the minimum replacement cost as the victim page, and expelling the victim page into a flash memory, wherein the working area obtains the free space at the moment, and when the access request is a write request, storing a target page at an MRU end of a mixed page linked list maintained in the working area; when the access request is a read request and the target page is a clean page, storing the target page at the MRU end of the clean page linked list in the working area, and when the target page is a dirty page, storing the target page at the MRU end of the mixed page linked list in the working area; finally, returning the target page to the upper application;
Figure FDA0003701991720000021
Figure FDA0003701991720000022
where RC (i) represents the replacement of victim candidate page iIn other words, AUI represents the average access time interval of the victim candidate page,
Figure FDA0003701991720000023
respectively representing the times of the jth and jth-1 visits of the victim candidate page i,
Figure FDA0003701991720000024
representing the time when victim candidate page i was accessed for the first time and n representing the total number of accesses.
2. The method for managing the buffer area of the solid state disk based on the page replacement cost as claimed in claim 1, further comprising:
respectively calculating the access frequency of each flash memory page in the buffer area and a threshold value for distinguishing cold dirty pages from hot dirty pages according to the formulas (5) and (6);
Figure FDA0003701991720000025
Figure FDA0003701991720000026
where VF (p) denotes the access frequency, count, of the flash memory page p p Representing the number of accesses to the flash page p, current _ time representing the current time of the system, visit _ time p Indicating the time at which the flash memory page p enters the buffer,
Figure FDA0003701991720000027
a threshold value representing a distinction between cold and hot dirty pages;
the method comprises the steps that dirty flash memory pages with access frequency higher than a threshold value are called hot dirty flash memory pages, dirty flash memory pages with access frequency lower than the threshold value are called cold dirty flash memory pages, and the hot dirty flash memory pages and the cold dirty flash memory pages are respectively stored in corresponding physical blocks and written back to the flash memory in cluster units; the clean flash page is directly discarded and no longer written back to flash.
CN202210695096.2A 2022-06-20 2022-06-20 Solid state disk buffer area management method based on page replacement cost Active CN115048056B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210695096.2A CN115048056B (en) 2022-06-20 2022-06-20 Solid state disk buffer area management method based on page replacement cost

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210695096.2A CN115048056B (en) 2022-06-20 2022-06-20 Solid state disk buffer area management method based on page replacement cost

Publications (2)

Publication Number Publication Date
CN115048056A true CN115048056A (en) 2022-09-13
CN115048056B CN115048056B (en) 2024-07-16

Family

ID=83163346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210695096.2A Active CN115048056B (en) 2022-06-20 2022-06-20 Solid state disk buffer area management method based on page replacement cost

Country Status (1)

Country Link
CN (1) CN115048056B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136121A (en) * 2013-03-25 2013-06-05 中国人民解放军国防科学技术大学 Cache management method for solid-state disc
US20190155730A1 (en) * 2017-11-20 2019-05-23 Fujitsu Limited Storage control apparatus and computer-readable storage medium storing program
CN110413537A (en) * 2019-07-25 2019-11-05 杭州电子科技大学 A kind of flash translation layer (FTL) and conversion method towards hybrid solid-state hard disk
CN110888600A (en) * 2019-11-13 2020-03-17 西安交通大学 Buffer area management method for NAND flash memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136121A (en) * 2013-03-25 2013-06-05 中国人民解放军国防科学技术大学 Cache management method for solid-state disc
US20190155730A1 (en) * 2017-11-20 2019-05-23 Fujitsu Limited Storage control apparatus and computer-readable storage medium storing program
CN110413537A (en) * 2019-07-25 2019-11-05 杭州电子科技大学 A kind of flash translation layer (FTL) and conversion method towards hybrid solid-state hard disk
CN110888600A (en) * 2019-11-13 2020-03-17 西安交通大学 Buffer area management method for NAND flash memory

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李中单;严华;: "基于数据访问计数的NAND闪存缓存管理算法", 微电子学与计算机, no. 05, 5 May 2020 (2020-05-05) *

Also Published As

Publication number Publication date
CN115048056B (en) 2024-07-16

Similar Documents

Publication Publication Date Title
US11579773B2 (en) Memory system and method of controlling memory system
CN103136121B (en) Cache management method for solid-state disc
US7203815B2 (en) Multi-level page cache for enhanced file system performance via read ahead
CN102012867B (en) Data storage system
US9378131B2 (en) Non-volatile storage addressing using multiple tables
US7568068B2 (en) Disk drive with cache having volatile and nonvolatile memory
CN105930282B (en) A kind of data cache method for NAND FLASH
CN104166634A (en) Management method of mapping table caches in solid-state disk system
JP6711121B2 (en) Information processing apparatus, cache memory control method, and cache memory control program
CN102981963A (en) Implementation method for flash translation layer of solid-state disc
CN110888600B (en) Buffer area management method for NAND flash memory
CN110968269A (en) SCM and SSD-based key value storage system and read-write request processing method
CN109446117A (en) A kind of solid state hard disk page grade flash translation layer (FTL) design method
CN109783019B (en) Intelligent data storage management method and device
CN111722797A (en) SSD and HA-SMR hybrid storage system oriented data management method, storage medium and device
US20240020014A1 (en) Method for Writing Data to Solid-State Drive
CN115203079A (en) Method for writing data into solid state disk
CN105138277A (en) Cache management method for solid-state disc array
JP2013222434A (en) Cache control device, cache control method, and program therefor
CN115048056B (en) Solid state disk buffer area management method based on page replacement cost
CN115344201A (en) Data storage method, data query method and device
KR101353967B1 (en) Data process method for reading/writing data in non-volatile memory cache having ring structure
US10579541B2 (en) Control device, storage system and method
KR101373613B1 (en) Hybrid storage device including non-volatile memory cache having ring structure
Hao et al. On the Design of SMR HDD Block Device Driver

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant