CN106227675B - A kind of method and device that space distribution is matched with brush - Google Patents

A kind of method and device that space distribution is matched with brush Download PDF

Info

Publication number
CN106227675B
CN106227675B CN201610571559.9A CN201610571559A CN106227675B CN 106227675 B CN106227675 B CN 106227675B CN 201610571559 A CN201610571559 A CN 201610571559A CN 106227675 B CN106227675 B CN 106227675B
Authority
CN
China
Prior art keywords
logical block
queue
priority
brush
distribution
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.)
Active
Application number
CN201610571559.9A
Other languages
Chinese (zh)
Other versions
CN106227675A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610571559.9A priority Critical patent/CN106227675B/en
Publication of CN106227675A publication Critical patent/CN106227675A/en
Priority to PCT/CN2017/079347 priority patent/WO2018014591A1/en
Application granted granted Critical
Publication of CN106227675B publication Critical patent/CN106227675B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0815Cache consistency protocols
    • G06F12/0817Cache consistency protocols using directory methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses the method and devices that a kind of distribution of space and brush match, and enable to the space of file system to distribute and match with the brush of Cache, to promote the write performance of file system.The method comprise the steps that receiving write IO request;The size of IO is write according to write IO request determination;At least one logical block to match according to the distribution of preset logical block distribution queue with the size for writing IO;The data of the I/O request are write in cache Cache according to the information of at least one logical block;Brush is carried out to the data in each logical block at least one described logical block according to preset logical block brush queue.

Description

A kind of method and device that space distribution is matched with brush
Technical field
The present invention relates to the method and devices that computer field more particularly to a kind of distribution of space and brush match.
Background technique
File system is the system of a kind of storage and organizing user data, and file system provides simply and easily for user Data access.File system is made using the abstract concept of file and catalogue instead of the data block concept of the storage mediums such as disk It obtains user not having to be concerned about the storage position of data on a storage medium, only accesses its number by way of access catalogue or file According to.The file system maintenance layout of user data on a storage medium has managed point of file data on a storage medium Cloth and position.With the growth of file system life cycle, file data can constantly be increased, deleted, modified, be searched, Unreasonable space allocation policy will lead to that the free area fragmentation on storage medium is increasingly severe, and disk space obtains It is utilized less than effective, and file data can also become more discrete, thus influences the data access performance of file system.
Currently, current mainstream file system is generally using redirection (full name in English: Redirection On when writing Write, english abbreviation: ROW) technology, to realize that data are written in any position, so that random decimal is according to input and output, (English is complete Claim: Input/Output, english abbreviation: IO) it big IO full marks item can be aggregated into writes, improve the data access of file system Energy.Most important technology is space distribution technique in ROW technology, is responsible for generally in file system by a space distribution module The distribution and release in space, space distribution module is distributed in the way of preferentially using partial data logical block, in file system Cache (Cache) module brush operation according to sequence or least recently used (full name in English: Least Recently Used, english abbreviation: LRU) algorithm progress brush.
The space distribution module of existing file system by preferentially using distributing in the way of partial data logical block, with Machine cover write field scape under, generate largely with disk after, often can not find the logical block for the full marks item that gathers together enough, write performance caused to be disliked Change.Also, existing file system space distribution and Cache be isolation, between each other there is no cooperation, cause respectively by When going to execute according to strategy itself, can generate it is a large amount of repeat to write IO, that is, increase the number of brush, further reduced Write performance.
Summary of the invention
The embodiment of the invention provides methods and criterion that a kind of distribution of space and brush match, enable to file system The space distribution of system and the brush of Cache match, to promote the write performance of file system.
In view of this, first aspect present invention provides a kind of method that space distribution is matched with brush, this method packet It includes: receiving write IO request;The size of IO is write according to write IO request determination;According to preset logical block distribution queue point With at least one logical block to match with the size for writing IO;According to the information of at least one logical block by the IO The data of request are write in cache Cache;According to preset logical block brush queue at least one described logical block Each logical block in data carry out brush.Wherein, the information of at least one logical block includes but is not limited to storage pool Mark, the mark of Raid, the size of logical block.As it can be seen that matched by the space distribution of file system and the brush of Cache Method reduces the number of brush, improves the write performance of file system.
In some possible implementations, if the preset logical block distribution queue includes the logic of the first priority The logical block distribution queue of block distribution queue, the logical block distribution queue of the second priority and third priority, it is described according to At least one logical block that preset logical block distribution queue distribution matches with the size for writing IO includes: excellent according to first The logical block distribution queue of the logical block distribution queue of first grade, the logical block distribution queue of the second priority and third priority Order-assigned and at least one logical block for matching of the size for writing IO.Wherein, the logical block distribution of the first priority It may include the logical block of the first priority distribution in queue, may include second in the logical block distribution queue of the second priority The logical block of priority distribution may include the logic of third priority distribution in the logical block distribution queue of third priority Block, can be according to following allocation rule: first from the logical block distribution queue logical tiles of the first priority, if first is preferential Logical block in the logical block distribution queue of grade distributes or there is no logical blocks then to distribute from the logical block of the second priority Logical tiles in queue, if the logical block in the logical block distribution queue of the second priority distributes or there is no logics Block then logical tiles from the logical block distribution queue of third priority.
It is the logical block distribution queue according to from the first priority, second excellent in other possible implementations The order-assigned of the logical block distribution queue of the logical block distribution queue and third priority of first grade and the size for writing IO After at least one logical block to match further include: if the logical block that the logical block distribution queue of second priority is distributed And there are remaining spaces in the logical block of the logical block distribution queue distribution of the third priority, then with remaining space Logical block be moved in the logical block distribution queue of first priority, and will be moved into the logic of first priority The data in the logical block with remaining space in block distribution queue are set as the data of delay brush.
In other possible implementations, the logical block in the logical block distribution queue of first priority is portion The logical block or segment space is released out and there are partial datas in the Cache that point space is assigned away Logical block, the logical block in the logical block distribution queue of second priority are complete logical block, the third priority Logical block distribution queue in logical block in the Cache there is no data and not be complete logical block.
It is the logical block distribution queue according to the first priority, second preferential in other possible implementations The order-assigned of the logical block distribution queue of the logical block distribution queue and third priority of grade and the size phase for writing IO It include: to judge the water level of the Cache whether under pre-determined threshold before at least one matched logical block;If described The water level of Cache then distributes from the logical block distribution queue of the third priority under pre-determined threshold and writes IO with described Size the logical block that matches of the first preset percentage;The logical block distribution queue according to the first priority, second The order-assigned of the logical block distribution queue of the logical block distribution queue and third priority of priority writes the big of IO with described Small at least one logical block to match includes: logical block distribution queue, the logic of the second priority according to the first priority The order-assigned of the logical block distribution queue of block distribution queue and third priority and the second of the size for writing IO are preset The logical block that percentage matches;Wherein, the sum of first preset percentage and the second preset percentage are 1.As it can be seen that selecting When selecting logical block distribution, the water level or pressure condition of Cache are considered, it, can be according to when the pressure of Cache is small Certain ratio, such as 2:8, the first preset percentage is 20% at this time, and the second preset percentage is 80%, first preferential from third Logical tiles in the logical block distribution queue of grade, to prevent the logical block distribution queue of third priority too long, to work as When the pressure of Cache is big, there are the logical block distribution queue of enough first priority and the logical block point of the second priority It is used with queue for writing IO.
In other possible implementations, the preset logical block brush queue includes the logic of the first priority The logical block brush queue of the queue of block brush, the logical block brush queue of the second priority and third priority, it is described according to Preset logical block brush queue in each logical block at least one described logical block data carry out brush include: by According to the queue of logical block brush, the logical block brush queue of the second priority and the logical block of third priority of the first priority Brush queue carries out brush to the data in each logical block at least one described logical block.As it can be seen that choosing logical block When carrying out brush, preferentially chosen from the logical block brush queue of the first priority, if the logical block brush of the first priority Disk queue is sky, then chooses from the logical block brush queue of the second priority, otherwise from the logical block brush team of third priority Column selection takes.
In other possible implementations, the logical block brush queue of first priority is complete logical block Queue, the logical block brush queue of second priority are incomplete logical block queue, the logic of the third priority The queue of block brush is to postpone the logical block queue of brush.
Second aspect of the present invention provides a kind of device that space distribution is matched with brush, which includes:
Receiving module, for receiving write IO request;
Determining module, for writing the size of IO according to write IO request determination;
First distribution module, for what is matched according to the distribution of preset logical block distribution queue with the size for writing IO At least one logical block;
The data of the I/O request are write high speed for the information according at least one logical block and delayed by writing module It deposits in Cache;
Brush module, for according to preset logical block brush queue to each logic at least one described logical block Data in block carry out brush.
In some possible implementations, if the preset logical block distribution queue includes the logic of the first priority The logical block distribution queue of block distribution queue, the logical block distribution queue of the second priority and third priority, described first Distribution module, specifically for logical block distribution queue, the second priority according to the first priority logical block distribution queue with And at least one logical block that the order-assigned of the logical block distribution queue of third priority and the size for writing IO match.
In other possible implementations, described device further include: processing module, if being used for second priority Logical block distribution queue distribution logical block and the third priority logical block distribution queue distribution logical block in There are remaining spaces, then the logical block with remaining space are moved in the logical block distribution queue of first priority, And it will be moved into the data in the logical block with remaining space in the logical block distribution queue of first priority It is set as the data of delay brush.
In other possible implementations, the logical block in the logical block distribution queue of first priority is portion The logical block or segment space is released out and there are partial datas in the Cache that point space is assigned away Logical block, the logical block in the logical block distribution queue of second priority are complete logical block, the third priority Logical block distribution queue in logical block in the Cache there is no data and not be complete logical block.
In other possible implementations, described device further include: judgment module, for judging the Cache's Whether water level is under pre-determined threshold;Second distribution module, if the water level for the Cache under pre-determined threshold, from The logic to match with the preset percentage of the size for writing IO is distributed in the logical block distribution queue of the third priority Block;First distribution module, specifically for the logical block of logical block distribution queue, the second priority according to the first priority The order-assigned of the logical block distribution queue of distribution queue and third priority and the second of the size for writing IO preset hundred Divide the logical block than matching;Wherein, the sum of first preset percentage and the second preset percentage are 1.
In other possible implementations, the preset logical block brush queue includes the logic of the first priority The logical block brush queue of the queue of block brush, the logical block brush queue of the second priority and third priority, the brush Module, specifically for according to the logical block brush queue of the first priority, the logical block brush queue of the second priority and The logical block brush queue of three priority carries out brush to the data in each logical block at least one described logical block.
In other possible implementations, the logical block brush queue of first priority is complete logical block Queue, the logical block brush queue of second priority are incomplete logical block queue, the logic of the third priority The queue of block brush is to postpone the logical block queue of brush.
As can be seen from the above technical solutions, the embodiment of the present invention has the advantage that the space point by file system With the mode that the brush with Cache matches, reduce the number of brush, improves the write performance of file system.
Detailed description of the invention
Fig. 1 is method one embodiment schematic diagram that space distribution and brush match in the embodiment of the present invention;
Fig. 2 is method another embodiment schematic diagram that space distribution and brush match in the embodiment of the present invention;
Fig. 3 is the logic of the first priority distribution in the embodiment of the present invention in the logical block distribution queue of the first priority One schematic diagram of block;
Fig. 4 is the logic of the first priority distribution in the embodiment of the present invention in the logical block distribution queue of the first priority Another schematic diagram of block;
Fig. 5 is the logic of the second priority distribution in the embodiment of the present invention in the logical block distribution queue of the second priority One schematic diagram of block;
Fig. 6 is the logic of the third priority distribution in the embodiment of the present invention in the logical block distribution queue of third priority One schematic diagram of block;
Fig. 7 is a kind of allocation flow schematic diagram of specific logical block in the embodiment of the present invention;
Fig. 8 is the schematic diagram of the logical block brush queue in the embodiment of the present invention with priority;
Fig. 9 is device one embodiment schematic diagram that space distribution and brush match in the embodiment of the present invention;
Figure 10 is device another embodiment schematic diagram that space distribution and brush match in the embodiment of the present invention;
Figure 11 is device another embodiment schematic diagram that space distribution and brush match in the embodiment of the present invention.
Specific embodiment
The embodiment of the invention provides methods and criterion that a kind of distribution of space and brush match, enable to file system The space distribution of system and the brush of Cache match, to promote the write performance of file system.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those skilled in the art's every other implementation obtained without creative efforts Example, shall fall within the protection scope of the present invention.
Description and claims of this specification and term " first ", " second ", " third ", " in above-mentioned attached drawing The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage The data that solution uses in this way are interchangeable under appropriate circumstances, so that the embodiments described herein can be in addition to illustrating herein Or the sequence other than the content of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that Cover it is non-exclusive include, for example, containing the process, method, system, product or equipment of a series of steps or units need not limit In step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produce The other step or units of product or equipment inherently.
First some concepts that the embodiment of the present invention may relate to simply are introduced below.
ROW type file system: i.e. using the file system for redirecting mode when writing, specially newly it ought be written or modify and write When access customer data, new data will not override original legacy data, but number is written in new allocation space on a storage medium According to having the characteristics that high reliability, high scalability.
Cache: storage system perhaps computer system memory source for accelerate to storage system or department of computer science The access of system, including reading and write.Especially for IO is write, by returning to host after writing memory, to accelerate host Writing rate.Under normal circumstances, storage system or computer system can all configure a large amount of Cache as cache.
Brush: after write back data is into Cache, writing IO and return immediately, and the dirty data in Cache passes through brush technology It is changed into the process of clean data after brushing on persistent storage medium.
Independent redundancy hard disk array (full name in English: Redundant Arrays of Independent Disks, English Abbreviation: RAID);One Raid group is formed by muti-piece hard disk, a slitting can be generally made of the segment space of multiple hard disks, A stripe unit in middle slitting is used as saving and verifying data.
Storage pool: by multiple hard disks according to the persistent storage space of the Raid larger capacity formed.
Logical block: generally as unit of 1M, the space that storage pool is provided is divided into multiple logical blocks, then to patrol Collecting block is that unit is supplied to file system as space batch operation.
The release of the space ROW: assuming that at the T1 moment, ROW file has write into the data of the size of 128K, corresponding logic Space is 256K-384K;T2 moment, user have write into the data of the size of 128K to ROW file again, which can be written to Another logical space, such as 384K-512K, the logical space of 256K-384K originally need to discharge.
The method that space distribution and brush match in the embodiment of the present invention is described below.
Referring to Fig. 1, method one embodiment that space distribution and brush match in the embodiment of the present invention includes:
101, write IO request is received;
In the present embodiment, when user needs that data are written, the write IO request of user's input is received.
102, the size for writing IO is determined according to write IO request;
In the present embodiment, after receiving write IO request, the size for writing IO is determined according to write IO request.
103, at least one logical block that the size of IO matches is distributed and write according to preset logical block distribution queue;
In the present embodiment, preset logical block distribution queue may include multiple logical block distribution teams with priority It arranges, the number of the logical block in each logical block distribution queue can be one, or it is multiple, it can not also include logic Block is not construed as limiting herein.
104, the data of I/O request are write in cache Cache according to the information of at least one logical block;
In the present embodiment, the information of at least one logical block include but is not limited to the mark of storage pool (full name in English: Identity, english abbreviation: ID), the size of the ID of Raid, logical block.
105, according to preset logical block brush queue to the data in each logical block at least one logical block into Row brush.
In the present embodiment, preset logical block brush queue may include multiple logical block brush teams with priority It arranges, it can not also include logic that the number of the logical block in each logical block brush queue can be for one or multiple Block is not construed as limiting herein.
In the present embodiment, in such a way that the brush of the distribution of the space of file system and Cache matches, reduce brush Number, improve the write performance of file system.
Below by specific embodiment in the present invention space distribution and the method that matches of brush be described, ask Referring to Fig.2, another embodiment that space distribution and brush match in the embodiment of the present invention includes:
201, write IO request is received;
In the present embodiment, when user needs that data are written, the write IO request of user's input is received.
202, the size for writing IO is determined according to write IO request;
In the present embodiment, after receiving write IO request, the size for writing IO is determined according to write IO request.
203, according to the logical block distribution queue of the first priority, the logical block distribution queue of the second priority and third At least one logical block that the order-assigned of the logical block distribution queue of priority and the size for writing IO match;
It include the logical block of the first priority distribution in the present embodiment, in the logical block distribution queue of the first priority, the The logical block of one priority distribution includes two kinds of logical blocks, two kinds of logical blocks as shown in Figure 3 and Figure 4, and the logical block in Fig. 3 is Segment space is assigned away, but there remains the unallocated logical block gone out of segment space, and the logical block in Fig. 3 is assigned 64K is removed, then remaining 960K is the logical block of the first priority distribution;Logical block in Fig. 4 is released out for segment space And there are the logical block of partial data in Cache, the 896K in logical block in Fig. 4 is in Cache, but front 128K It has been be released that, then front 128K is the logical block of the first priority distribution.It is wrapped in the logical block distribution queue of second priority The logical block of the second priority distribution, logical block as shown in Figure 5 are included, the logical block in Fig. 5 is complete logical block, such as from The newly assigned logic block space of storage pool, or the complete logical block released.The logical block of third priority distributes team Column include the logical block of third priority distribution, and logical block as shown in FIG. 6, there is no numbers in Cache for the logical block in Fig. 6 According to and be not complete logical block, the 128K in Fig. 6 is the logical block of third priority distribution.
As it can be seen that logical block distribution queue of the logical block tissue of the first priority distribution to the first priority, second is preferential Logical block distribution queue of the logical block tissue of grade distribution to the second priority, the logical block tissue of third priority distribution to the The logical block distribution queue of three priority;According to following allocation rule: first being distributed from the logical block distribution queue of the first priority Logical block, from second if the logical block in the logical block distribution queue of the first priority distributes or logical block is not present Logical tiles in the logical block distribution queue of priority, if the logical block point in the logical block distribution queue of the second priority With complete or there is no logical block then logical tiles from the logical block distribution queue of third priority.Optionally, in this hair In bright some embodiments, before step 203, can also include:
Judge the water level of Cache whether under pre-determined threshold;
If the water level of Cache under pre-determined threshold, is distributed and is write from the logical block distribution queue of third priority The logical block that the first preset percentage of size of IO matches;
At this point, the logical block distribution queue according to the first priority, the logical block distribution queue of the second priority with And at least one logical block that the order-assigned of the logical block distribution queue of third priority matches with the size for writing IO is specific Are as follows:
It is preferential according to the logical block distribution queue of the first priority, the logical block distribution queue of the second priority and third The logical block that the order-assigned of the logical block distribution queue of grade and the second preset percentage of the size for writing IO match;
Wherein, the sum of the first preset percentage and the second preset percentage are 1.
As it can be seen that the water level or pressure condition of Cache are considered, when the pressure of Cache when selecting logical block distribution , can according to a certain percentage when small, such as 2:8, the first preset percentage is 20% at this time, and the second preset percentage is 80%, the first logical tiles from the logical block distribution queue of third priority, to prevent the logical block of third priority from distributing Queue is too long, thus when the pressure of Cache is big, there is the logical block distribution queue of enough first priority and second excellent The logical block distribution queue of first grade is used for writing IO.
Optionally, in some embodiments of the invention, further includes:
If the logical block that the logical block distribution queue of the second priority is distributed and the logical block of third priority distribute team There are remaining spaces in the logical block of column distribution, then the logical block with remaining space are moved to the logical block of the first priority In distribution queue, and it will be moved into the number in the logical block with remaining space in the logical block distribution queue of the first priority According to the data for being set as delay brush.Under conditions of combining above-mentioned allocation rule, a kind of allocation flow of specific logical block Figure may refer to Fig. 7.
204, the data of I/O request are write in cache Cache according to the information of at least one logical block;
In the present embodiment, the information of at least one logical block includes but is not limited to the ID of storage pool, the ID of Raid, logic The size of block.
205, according to the logical block brush queue of the first priority, the queue of logical block brush and third of the second priority The logical block brush queue of priority carries out brush to the data in each logical block at least one logical block.
In the present embodiment, the logical block brush queue of the first priority is complete logical block queue, the second priority Logical block brush queue is incomplete logical block queue, and the logical block brush queue of third priority is to postpone the logic of brush Block queue.A kind of logical block brush queue of specific first priority, the logical block brush queue of the second priority, third are excellent The logical block brush queue of first grade may refer to Fig. 8, under the dotted line frame in the logical block brush queue of the third priority in Fig. 8 The logic block space to be allocated such as logical block space representation.It is preferentially excellent from first when choosing logical block progress brush The logical block brush queue of first grade is chosen, if the logical block brush queue of the first priority is sky, from the second priority Logical block brush queue is chosen, and otherwise chooses from the logical block brush queue of third priority.
In the present embodiment, in such a way that the brush of the distribution of the space of file system and Cache matches, reduce brush Number, improve the write performance of file system.
The device that the space distribution being described below in the embodiment of the present invention and brush match, referring to Fig. 9, the present invention is real Applying device one embodiment that space distribution and brush match in example includes:
Receiving module 301, for receiving write IO request;
Determining module 302, for writing the size of IO according to write IO request determination;
First distribution module 303, for according to the distribution of preset logical block distribution queue and the size phase for writing IO At least one logical block matched;
Writing module 304, for the data of the I/O request to be write height according to the information of at least one logical block In speed caching Cache;
Brush module 305, for according to preset logical block brush queue to each of at least one described logical block Data in logical block carry out brush.
In the present embodiment, in such a way that the brush of the distribution of the space of file system and Cache matches, reduce brush Number, improve the write performance of file system.
Optionally, in some embodiments of the invention, if the preset logical block distribution queue includes first preferential Logical block distribution queue, the logical block distribution queue of the logical block distribution queue of the second priority and third priority of grade, First distribution module 303, specifically for the logical block of logical block distribution queue, the second priority according to the first priority The order-assigned of the logical block distribution queue of distribution queue and third priority and the size for writing IO match at least One logical block.
Further, referring to Fig. 10, described device further include: processing module 401, if for second priority It is deposited in the logical block of the logical block distribution queue distribution of the logical block and third priority of logical block distribution queue distribution In remaining space, then the logical block with remaining space is moved in the logical block distribution queue of first priority, and The data that will be moved into the logical block with remaining space in the logical block distribution queue of first priority are set It is set to the data of delay brush.
Wherein, the logical block in the logical block distribution queue of first priority is patrolled for what segment space was assigned away It collects block or segment space is released out and there are the logical block of partial data, second priority in the Cache Logical block distribution queue in logical block be complete logical block, patrolling in the logical block distribution queue of the third priority Block is collected data are not present in the Cache and are not complete logical block.
Described device further include: judgment module 402, for judging the water level of the Cache whether under pre-determined threshold; Second distribution module 403, if the water level for the Cache under pre-determined threshold, from the logic of the third priority The logical block to match with the preset percentage of the size for writing IO is distributed in block distribution queue;
First distribution module 303, specifically for logical block distribution queue, the second priority according to the first priority Logical block distribution queue and third priority logical block distribution queue order-assigned and the size for writing IO the The logical block that two preset percentages match;
The preset logical block brush queue includes that the logical block brush queue of the first priority, the second priority are patrolled The queue of block brush and the logical block brush queue of third priority are collected, the brush module is specifically used for preferential according to first The queue of logical block brush, the logical block brush queue of the second priority and the logical block brush queue pair of third priority of grade Data in each logical block at least one described logical block carry out brush.
Wherein, the sum of first preset percentage and the second preset percentage are 1.
The preset logical block brush queue includes that the logical block brush queue of the first priority, the second priority are patrolled The queue of block brush and the logical block brush queue of third priority are collected, the brush module 305 is specifically used for excellent according to first The logical block brush queue of first grade, the logical block brush queue of the second priority and the logical block brush queue of third priority Brush is carried out to the data in each logical block at least one described logical block.
The logical block brush queue of first priority is complete logical block queue, the logic of second priority Block brush queue is incomplete logical block queue, and the logical block brush queue of the third priority is to postpone the logic of brush Block queue.
Above from the angle of modular functionality entity in the embodiment of the present invention space distribution and the dress that matches of brush Set and be described, below from the angle of hardware handles in the embodiment of the present invention space distribution and the device that matches of brush Be described, please refer to Figure 11, the device that the distribution of space in the embodiment of the present invention and brush match include: receiver 501, Processor 502 and memory 503.
The present embodiments relate to space distribution and the device that matches of brush can have than it is illustrated in fig. 10 more More or less component, can combine two or more components, or can have different components and configure or set up, each Component can be in hardware, software or the hardware and software including one or more signal processings and/or specific integrated circuit Combination realize.
The receiver 501 is for performing the following operations:
Receive write IO request.
The processor 502 is for performing the following operations:
The size of IO is write according to write IO request determination;According to preset logical block distribution queue distribution with it is described Write at least one logical block that the size of IO matches.
The memory 503 is for performing the following operations:
The data of the I/O request are write in cache Cache according to the information of at least one logical block.
The processor 502 is also used to perform the following operations:
According to preset logical block brush queue to the data in each logical block at least one described logical block into Row brush.
Optionally, if the preset logical block distribution queue includes the logical block distribution queue of the first priority, second The logical block distribution queue of priority and the logical block distribution queue of third priority, the processor 502 are specifically used for holding The following operation of row: according to the logical block distribution queue of the first priority, the logical block distribution queue of the second priority and third At least one logical block that the order-assigned of the logical block distribution queue of priority and the size for writing IO match.
Optionally, the processor 502 is also used to perform the following operations: if the logical block of second priority distributes team There are remaining spaces in the logical block that the logical block distribution queue of the logical block and the third priority that arrange distribution is distributed, then Logical block with remaining space is moved in the logical block distribution queue of first priority, and will be moved into described The data in the logical block with remaining space in the logical block distribution queue of one priority are set as delay brush Data.
Optionally, whether the processor 502 is also used to perform the following operations: judging the water level of the Cache default Under thresholding;If the water level of the Cache is under pre-determined threshold, from the logical block distribution queue of the third priority The logical block that the preset percentage of distribution and the size for writing IO matches;At this point, the processor 502 is specifically used for executing Following operation: excellent according to the logical block distribution queue of the first priority, the logical block distribution queue of the second priority and third The logical block that the order-assigned of the logical block distribution queue of first grade and the second preset percentage of the size for writing IO match; Wherein, the sum of first preset percentage and the second preset percentage are 1.
Optionally, the processor 502 is specifically used for performing the following operations: the preset logical block brush queue includes The queue of logical block brush, the logical block brush queue of the second priority and the logical block brush of third priority of first priority Disk queue, it is preferential according to the logical block brush queue of the first priority, the logical block brush queue of the second priority and third The logical block brush queue of grade carries out brush to the data in each logical block at least one described logical block.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey The medium of sequence code.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.

Claims (14)

1. a kind of method that space distribution and brush match characterized by comprising
Receive write IO request;
The size of IO is write according to write IO request determination;
At least one logical block to match according to the distribution of preset logical block distribution queue with the size for writing IO;
The data of the I/O request are write in cache Cache according to the information of at least one logical block;
The data in each logical block at least one described logical block are brushed according to preset logical block brush queue Disk.
2. the method according to claim 1, wherein if the preset logical block distribution queue includes first excellent The logical block of the logical block distribution queue of first grade, the logical block distribution queue of the second priority and third priority distributes team Column, described at least one logical block packet to match according to the distribution of preset logical block distribution queue with the size for writing IO It includes:
According to the logical block distribution queue of the first priority, the logical block distribution queue of the second priority and third priority At least one logical block that the order-assigned of logical block distribution queue and the size for writing IO match.
3. according to the method described in claim 2, it is characterized in that, described distribute team according to from the logical block of the first priority The order-assigned of the logical block distribution queue of column, the logical block distribution queue of the second priority and third priority is write with described After at least one logical block that the size of IO matches further include:
If the logical block of logical block and the third priority that the logical block distribution queue of second priority is distributed point There are remaining spaces in logical block with queue assignment, then the logical block with remaining space are moved to first priority Logical block distribution queue in, and will be moved into the logical block distribution queue of first priority it is described have it is remaining empty Between logical block in data be set as delay brush data.
4. according to the method described in claim 3, it is characterized in that, patrolling in the logical block distribution queue of first priority Collecting block is the logical block or segment space is released out and there are portions in the Cache that segment space is assigned away The logical block of divided data, the logical block in the logical block distribution queue of second priority are complete logical block, described the Logical block in the logical block distribution queue of three priority there is no data and is not complete logical block in the Cache.
5. according to method described in claim 2 to 4 any one, which is characterized in that the logic according to the first priority The order-assigned of the logical block distribution queue of block distribution queue, the logical block distribution queue of the second priority and third priority Include: before at least one logical block to match with the size for writing IO
Judge the water level of the Cache whether under pre-determined threshold;
If the water level of the Cache under pre-determined threshold, is distributed from the logical block distribution queue of the third priority The logical block to match with the first preset percentage of the size for writing IO;
It is described preferential according to the logical block distribution queue of the first priority, the logical block distribution queue of the second priority and third At least one logical block for matching with the size for writing IO of order-assigned of the logical block distribution queue of grade includes:
According to the logical block distribution queue of the first priority, the logical block distribution queue of the second priority and third priority The logical block that the order-assigned of logical block distribution queue and the second preset percentage of the size for writing IO match;
Wherein, the sum of first preset percentage and the second preset percentage are 1.
6. the method according to claim 1, wherein the preset logical block brush queue includes first preferential The queue of logical block brush, the logical block brush queue of the second priority and the logical block brush queue of third priority of grade, It is described that the data in each logical block at least one described logical block are brushed according to preset logical block brush queue Disk includes:
According to the logical block brush queue of the first priority, the logical block brush queue of the second priority and third priority The queue of logical block brush carries out brush to the data in each logical block at least one described logical block.
7. according to the method described in claim 6, it is characterized in that, the logical block brush queue of first priority is complete Logical block queue, the logical block brush queue of second priority is incomplete logical block queue, and the third is preferential The logical block brush queue of grade is to postpone the logical block queue of brush.
8. the device that a kind of space distribution and brush match characterized by comprising
Receiving module, for receiving write IO request;
Determining module, for writing the size of IO according to write IO request determination;
First distribution module, for matching at least according to the distribution of preset logical block distribution queue with the size for writing IO One logical block;
Writing module, for the data of the I/O request to be write cache according to the information of at least one logical block In Cache;
Brush module, for according to preset logical block brush queue in each logical block at least one described logical block Data carry out brush.
9. device according to claim 8, which is characterized in that if the preset logical block distribution queue includes first excellent The logical block of the logical block distribution queue of first grade, the logical block distribution queue of the second priority and third priority distributes team Column, first distribution module, specifically for the logical block of logical block distribution queue, the second priority according to the first priority The order-assigned of the logical block distribution queue of distribution queue and third priority and the size for writing IO match at least One logical block.
10. device according to claim 9, which is characterized in that described device further include: processing module, if for described The logical block of the logical block distribution queue distribution of second priority and the logical block distribution queue distribution of the third priority Logical block in there are remaining spaces, then the logical block with remaining space is moved to the logical block point of first priority With in queue, and it will be moved into the logical block with remaining space in the logical block distribution queue of first priority In data be set as delay brush data.
11. device according to claim 10, which is characterized in that in the logical block distribution queue of first priority Logical block is that the logical block that segment space is assigned away or segment space are released out and exist in the Cache The logical block of partial data, the logical block in the logical block distribution queue of second priority is complete logical block, described Logical block in the logical block distribution queue of third priority there is no data and is not complete logic in the Cache Block.
12. according to device described in claim 9 to 11 any one, which is characterized in that described device further include: judge mould Block, for judging the water level of the Cache whether under pre-determined threshold;Second distribution module, if the water for the Cache The with the size for writing IO is distributed in position under pre-determined threshold, then from the logical block distribution queue of the third priority The logical block that one preset percentage matches;
First distribution module, specifically for the logic of logical block distribution queue, the second priority according to the first priority The order-assigned of the logical block distribution queue of block distribution queue and third priority and the second of the size for writing IO are preset The logical block that percentage matches;
Wherein, the sum of first preset percentage and the second preset percentage are 1.
13. device according to claim 8, which is characterized in that the preset logical block brush queue includes first excellent The logical block brush team of the logical block brush queue of first grade, the logical block brush queue of the second priority and third priority Column, the brush module, specifically for the logical block brush of the queue of logical block brush, the second priority according to the first priority Queue and the logical block brush queue of third priority are to the data in each logical block at least one described logical block Carry out brush.
14. device according to claim 13, which is characterized in that the logical block brush queue of first priority has been The logical block brush queue of whole logical block queue, second priority is incomplete logical block queue, and the third is excellent The logical block brush queue of first grade is to postpone the logical block queue of brush.
CN201610571559.9A 2016-07-19 2016-07-19 A kind of method and device that space distribution is matched with brush Active CN106227675B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610571559.9A CN106227675B (en) 2016-07-19 2016-07-19 A kind of method and device that space distribution is matched with brush
PCT/CN2017/079347 WO2018014591A1 (en) 2016-07-19 2017-04-01 Space allocation and disk flushing matching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610571559.9A CN106227675B (en) 2016-07-19 2016-07-19 A kind of method and device that space distribution is matched with brush

Publications (2)

Publication Number Publication Date
CN106227675A CN106227675A (en) 2016-12-14
CN106227675B true CN106227675B (en) 2019-05-24

Family

ID=57531760

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610571559.9A Active CN106227675B (en) 2016-07-19 2016-07-19 A kind of method and device that space distribution is matched with brush

Country Status (2)

Country Link
CN (1) CN106227675B (en)
WO (1) WO2018014591A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106227675B (en) * 2016-07-19 2019-05-24 华为技术有限公司 A kind of method and device that space distribution is matched with brush

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101482838A (en) * 2009-02-06 2009-07-15 杭州华三通信技术有限公司 Data write-in method and apparatus based on copy-on-write
CN103577349A (en) * 2013-11-06 2014-02-12 华为技术有限公司 Method and device for selecting data from cache to write dirty data into hard disk
CN104461936A (en) * 2014-11-28 2015-03-25 华为技术有限公司 Cached data disk brushing method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7194589B2 (en) * 2003-08-22 2007-03-20 Oracle International Corporation Reducing disk IO by full-cache write-merging
CN105095112B (en) * 2015-07-20 2019-01-11 华为技术有限公司 Control caching brush method, apparatus and non-volatile computer readable storage medium storing program for executing
CN106227675B (en) * 2016-07-19 2019-05-24 华为技术有限公司 A kind of method and device that space distribution is matched with brush

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101482838A (en) * 2009-02-06 2009-07-15 杭州华三通信技术有限公司 Data write-in method and apparatus based on copy-on-write
CN103577349A (en) * 2013-11-06 2014-02-12 华为技术有限公司 Method and device for selecting data from cache to write dirty data into hard disk
CN104461936A (en) * 2014-11-28 2015-03-25 华为技术有限公司 Cached data disk brushing method and device

Also Published As

Publication number Publication date
CN106227675A (en) 2016-12-14
WO2018014591A1 (en) 2018-01-25

Similar Documents

Publication Publication Date Title
CN105573660B (en) Method and apparatus for improving the performance of sub-clustering disk array
CN104461390B (en) Write data into the method and device of imbricate magnetic recording SMR hard disks
CN103797470B (en) Storage system
CN104636080B (en) Storage system and the method for it
CN103608782B (en) Selective data storage in LSB page face and the MSB page
CN103995855B (en) The method and apparatus of data storage
US20080016121A1 (en) Method, an apparatus and a system for managing a snapshot storage pool
CN102985909B (en) Object for good lattice provides the method and apparatus of the high scalability network storage
CN109947363B (en) Data caching method of distributed storage system
CN106708751A (en) Storage device including multi-partitions for multimode operations, and operation method thereof
CN109117084A (en) Logic block storage is dynamically readjusted into size
JP2017091545A (en) Multimode storage management apparatus, multimode storage apparatus, and selective underlying exposure (sue) mapping operation method therefor
CN102449607A (en) Storage system provided with a plurality of flash packages
CN106708423A (en) Multimode storage management system
CN103384877A (en) Storage system comprising flash memory, and storage control method
CN106462510A (en) Multiprocessor system with independent direct access to bulk solid state memory resources
CN104317742A (en) Thin provisioning method for optimizing space management
CN103761053A (en) Data and method for data processing
CN107506145B (en) Physical storage scheduling method and cloud host creation method
CN107357680A (en) Data processing equipment and the method for data processing
CN106063226B (en) Data processing method, device and equipment
CN107515728A (en) Play the data managing method and device of concurrent characteristic inside flash memory device
CN105739930B (en) A kind of storage architecture and its initial method and date storage method and managing device
CN108205473A (en) Internal memory processing method and device, computer installation and computer readable storage medium
CN108319430A (en) Handle the method and device of I/O Request

Legal Events

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