WO2017107015A1 - Procédé d'attribution d'espace de stockage, et dispositif de stockage - Google Patents

Procédé d'attribution d'espace de stockage, et dispositif de stockage Download PDF

Info

Publication number
WO2017107015A1
WO2017107015A1 PCT/CN2015/098108 CN2015098108W WO2017107015A1 WO 2017107015 A1 WO2017107015 A1 WO 2017107015A1 CN 2015098108 W CN2015098108 W CN 2015098108W WO 2017107015 A1 WO2017107015 A1 WO 2017107015A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage space
granularity
allocation granularity
space
size
Prior art date
Application number
PCT/CN2015/098108
Other languages
English (en)
Chinese (zh)
Inventor
张鹏
叶茂
张国彬
程卓
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201580056639.4A priority Critical patent/CN107533435B/zh
Priority to PCT/CN2015/098108 priority patent/WO2017107015A1/fr
Publication of WO2017107015A1 publication Critical patent/WO2017107015A1/fr

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

Definitions

  • the present invention relates to the field of storage, and in particular, to a storage space allocation method and a storage device.
  • the granularity at which the storage device allocates storage space for data write requests is fixed. That is, for different data sizes of data to be written carried in the data write request, the storage device allocates a storage space of size kQ to the data write request in units of a fixed storage space size Q, where k is a positive integer. Because, in the same storage architecture, the amount of data per write varies little, so the allocation granularity is much larger than the data size of a certain write, resulting in wasted storage space, or much smaller than a certain write.
  • the data size causes a problem of excessive amount of metadata for describing the storage attributes of the data.
  • SAN Storage Area Network
  • NAS Network Attached Storage
  • SANs are mostly “overwrite writes”, and the amount of data written per write is usually large, which is suitable for large-granular space allocation; NAS is mostly “new write”, and the amount of data written per write is usually small. Suitable for small-grained space allocation.
  • the first aspect provides a storage space allocation method, which is applied to a storage device, and includes: preset N different allocation granularities for a storage space of the storage device, where the allocation granularity is used as a unit for allocating the storage space. And each allocation granularity has an allocatable storage space, wherein N is a positive integer greater than 1; the method comprises: the storage device receiving a data write request, the data write request including data to be written; a size of the write data and the predetermined allocation granularity, selecting an allocation granularity of the allocated storage space for the data write request from the N different allocation granularities; and using the selected allocation granularity as The data write request allocates storage space.
  • the storage device can select a different data size for the data write request of different data sizes, and allocate a storage space to the data write request, so that the amount of data written by the storage device varies greatly each time.
  • the storage device can allocate storage space with the allocation granularity closest to the size of each data write, thereby avoiding the problem of waste of storage space or excessive amount of metadata caused by a single allocation granularity.
  • the allocating a storage space for the data write request by using the selected allocation granularity comprises: comparing a size of the data to be written M a size L 1 of the unallocated storage space in the allocatable storage space of the selected allocation granularity; determining that L 1 is not less than M, and allocating a size of kQ n to the data write request from the unallocated storage space a storage space, where k is a positive integer not less than 1, and Q n is the selected distribution granularity, M ⁇ kQ n ⁇ min ⁇ L 1 , M+Q n ⁇ .
  • the above implementation is an example in which the storage device allocates a storage space for the data write request with the selected allocation granularity.
  • the allocating a storage space for the data write request by using the selected allocation granularity comprises: comparing a size of the data to be written a size L 1 of unallocated storage space in the allocatable storage space with the selected allocation granularity; determining that L 1 is less than M, determining the unallocated storage space size L 1 and the allocatable storage of the selected allocation granularity
  • the sum of the reclaimed storage space sizes L 2 in the space is not less than M
  • the reclaimed storage space refers to the storage space that has been allocated in the allocatable space of the selected allocation granularity, and the data written therein has been wiped a storage space after the partition
  • a storage space of size kQ n is allocated for the data write request from the unallocated storage space and the recovered storage space, where M ⁇ kQ n ⁇ min ⁇ L 1 +L 2 , M+Q n ⁇ .
  • the foregoing implementation manner is another example in which the storage device allocates a storage space for the data write request by using the selected allocation granularity.
  • the storage device may allocate the unallocated storage space of the selected allocated granularity to the data.
  • the write request increases the utilization of the allocatable storage space of the selected allocation granularity.
  • the third possible implementation manner of the first aspect further comprising: comparing a size M of the data to be written and the selecting The size L 1 of the unallocated storage space in the allotable storage space of the allocation granularity; when L 1 is less than M, the allocation granularity adjacent to the selected allocation granularity is identified, and the allocatable storage from the adjacent allocated granularity is identified unallocated storage space can be increased allocates storage for the selected particle size distribution, wherein the particle size distribution of the adjacent Q n-1 is greater than the selected particle size distribution Q n. In this way, the storage device can be allocated with different allocation granularities for the same storage space, which increases the flexibility of storage space utilization.
  • the storage device consolidates the small
  • the method further includes: determining that there is no consecutive address of size Q n-1 in the recovered storage space When the space is determined, the sum of the unallocated storage space size L 1 and the reclaimed storage space size L 2 in the allotable storage space of the selected allocation granularity is not less than the M; the reclaimed storage space refers to a storage space in which the data written in the allocated storage space of the selected allocation granularity has been erased; the data write request is from the unallocated storage space and the recycled storage space A storage space of size kQ n is allocated, where M ⁇ kQ n ⁇ min ⁇ L 1 + L 2 , M+Q n ⁇ .
  • the unallocated storage in the allocable storage space from the adjacent allocation granularity Adding an allocatable storage space for the selected allocation granularity in the space, comprising: comparing a sum of the assignable storage space of the selected allocation granularity with the adjacent allocated granularity and a preset for the selected allocated granularity Allocating a storage space quota; determining that the sum of the allotable storage space of the selected allocation granularity and the adjacent allocation granularity is not greater than a preset allocation of storage space quota for the selected allocation granularity, from the adjacent allocation An allocatable storage space is allocated for the selected allocation granularity in the unallocated storage space of the granular allocatable storage space.
  • a second aspect provides a storage device, where a storage space of the storage device is pre-configured with N different allocation granularities, where the allocation granularity is used as a unit for allocating the storage space, and each allocated granularity has an allotable storage space.
  • N is a positive integer greater than 1;
  • the storage device includes: a receiving unit, configured to receive a data write request, the data write request includes data to be written, and a determining unit configured to use the data to be written And a predetermined allocation granularity, selecting an allocation granularity of the allocated storage space for the data write request from the N different allocation granularities; and an allocating unit, configured to use the selected allocation granularity
  • the data write request allocates storage space.
  • the allocating unit is configured to: compare a size M of the data to be written with an allocatable storage space of the selected allocation granularity The size L 1 of the unallocated storage space; when it is determined that L 1 is not less than M, a storage space of size kQ n is allocated for the data write request from the unallocated storage space, where k is a positive integer not less than 1.
  • Q n is the assigned granularity of the selection, M ⁇ kQ n ⁇ min ⁇ L 1 , M+Q n ⁇ .
  • the allocating unit is configured to: compare a size M of the data to be written with an allocatable storage space of the selected allocation granularity The size L 1 of the unallocated storage space; when it is determined that L 1 is less than M, the sum of the unallocated storage space size L 1 and the reclaimed storage space size L 2 in the allotable storage space of the selected allocation granularity is not less than M; the reclaimed storage space refers to a storage space that has been allocated in the allocatable space of the selected allocation granularity, and a storage space in which data written therein has been erased; from the unallocated storage space And storing, in the recovered storage space, a storage space of size kQ n for the data write request, where M ⁇ kQ n ⁇ min ⁇ L 1 +L 2 , M+Q n ⁇ .
  • the allocating unit is configured to: compare a size M of the data to be written with an allocatable storage space of the selected allocation granularity The size L 1 of the unallocated storage space; when it is determined that L 1 is smaller than M, the allocation granularity adjacent to the selected allocation granularity is identified, and the unallocated storage space of the distributable storage space of the adjacent allocated granularity is said selected particle size distribution may be allocated to allocate storage space, wherein the particle size distribution of the adjacent Q n-1 is greater than the selected particle size distribution Q n.
  • the fourth possible implementation manner of the second aspect further comprising: a releasing unit, configured to: compare the adjacent allocation granularity Allocating a storage space size with a first threshold; determining whether the size of the unallocated storage space of the adjacent allocation granularity is smaller than the first threshold, and detecting whether the selected storage space of the allocated storage space of the allocated storage space is There is at least one contiguous address space of size Q n-1 ; determining that at least one contiguous address space of size Q n-1 exists in the recovered storage space, releasing the at least one contiguous address space to the neighbor Allocating storage space of the granularity; the allocation unit is specifically configured to: select from the unallocated storage space of the adjacent allocation granularity including the at least one consecutive address space of size Qn -1 The allocation granularity allocation allocates storage space.
  • the allocating unit is further configured to compare a sum of the allotable storage space of the selected allocation granularity with the adjacent allocation granularity and a preset granularity for the selected allocation granularity The allocatable storage space quota; determining that the sum of the allocable storage space of the selected allocation granularity and the adjacent allocation granularity is not greater than the preset allocatable storage space quota for the selected allocation granularity, from the neighboring The unallocated storage space of the allocatable storage space of the allocated granularity allocates an allocatable storage space for the selected allocation granularity.
  • a storage device including: a processor, a memory, a memory, a communication interface, and a communication bus, wherein the processor, the memory, the memory, and the communication interface are completed by the communication bus Communication with each other;
  • the memory includes a storage space for storing data;
  • the memory is for storing program code, the program code is N different distribution granularities pre-set by the storage space in the memory, An allocation granularity as a unit for allocating the storage space, and each allocation granularity has an allocatable storage space, wherein N is a positive integer greater than 1;
  • the processor executes the program code in the memory to cause the The processor performs the method of the first aspect, or any of the possible implementations of the first aspect above.
  • the method further includes: comparing a size of the unallocated storage space in the allotable storage space of the selected allocation granularity with a second threshold; when the selected allocated granularity is not allocated in the storage space When the size of the allocated storage space is smaller than the second threshold, the unallocated storage space in the allotable storage space of the allocation granularity adjacent to the selected allocation granularity increases the allocateable storage space for the selected allocated granularity, The adjacent distribution granularity Q n-1 is greater than the selected distribution granularity Q n .
  • the allocable storage space may be increased for the allocated granularity from the unallocated storage space larger than the allocation granularity adjacent to the allocated granularity. , to ensure that each allocation granularity has enough allocateable storage space.
  • the method further includes: detecting, at a preset time, the reclaimed storage space of the allocated storage space of the selected allocation granularity, whether there is at least one consecutive address of size Q n-1 Space; determining that at least one contiguous address space of size Q n-1 is released to the selected allocation granularity when there is at least one contiguous address space of size Q n-1 in the recovered storage space particle size distribution may be adjacent to allocate storage space adjacent to the particle size distribution Q n-1 is greater than the selected particle size distribution Q n.
  • the storage device can sequentially release the reclaimed storage space of each allocated granularity, thereby sequentially integrating the small-sized storage space into a larger granular storage space with consecutive addresses, thereby reducing storage fragmentation.
  • FIG. 1 is a schematic flowchart of a method for allocating a storage space according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an allocatable storage space with different allocation granularities in a storage space according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a method for allocating storage space by using a selected allocation granularity as a data write request according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart of a method for increasing an allocatable storage space for an allocation granularity Q n from an allocatable storage space of an allocation granularity Q n-1 according to an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of another allocatable storage space with different allocation granularities in a storage space according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a storage device according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of another storage device according to an embodiment of the present invention.
  • the following embodiments are applied to a storage device, which may be a storage array, a solid state hard disk, a tiled magnetic recording hard disk, or the like.
  • a storage device receives a data write request sent by another device, it is The data write request allocates a storage space to store data to be written in the data write request.
  • An embodiment of the present invention provides a method for allocating a storage space, where the method is applied to a storage device, where a storage space of the storage device is pre-configured with N different allocation granularities, and the allocation granularity is used as a unit for allocating the storage space. And each allocation granularity has an allocatable storage space, and the allotable storage space of each allocation granularity may be preset, or may be set when the data write request allocated by the allocation granularity is received for the first time. . Where N is a positive integer greater than one. As shown in Figure 1, the method includes:
  • the storage device receives a data write request, where the data write request includes data to be written.
  • the storage device may be an external storage device connected to the server, or may be a storage server connected to the client.
  • the data write request may be that the storage device receives from a server or client connected thereto.
  • the storage device selects an allocation granularity of the allocated storage space for the data write request from the N different allocation granularities according to the size of the to-be-written data and the preset allocation granularity.
  • the value indicates that the N different allocation granularities of the storage space may be preset by the user according to the actual amount of data written to the storage device each time. For example, if the storage device combines both SAN and NAS storage architectures, if the SAN storage architecture writes data in the range of 60M (megabytes) to 64M, the SAN storage architecture writes data each time. The amount is in the range of 10KB (kilobytes) to 64KB, and the two allocation granularities of 64M and 64KB can be preset for the storage space.
  • the storage device can calculate a difference between the size of the data to be written and each of the allocated granularities, and select an allocation granularity with a minimum absolute value of the difference from the data size. For example, if two allocation granularities of 64M (megabytes) and 64 kilobytes (kilobytes) are preset for the storage space, in this case, the storage device receives a data write request with a size of 10 KB to be carried with the data to be written.
  • the storage device may select an allocation granularity of 64 KB as an allocation granularity for allocating storage space to the data write request; the storage device is received and carried
  • the size of the data to be written is 60M
  • the data write request is due to The 64M allocation granularity is closest to the size of the data to be written. Therefore, the storage device can select a 64M allocation granularity as the allocation granularity of allocating storage space to the data write request.
  • the policy of the storage device selecting the allocation granularity of the storage space for the data write request may be set according to actual requirements. For example, if the two allocation granularities of the storage space are 50M and 30M, at this time, for the data to be written with a data size of 60M, according to the implementation described above, the distribution granularity closest to the data size is 50M, but If the storage device selects a 50M allocation granularity to allocate storage space for the data to be written, it needs to allocate two 50M storage spaces to store 60M of data, which will result in wasted 40M storage space.
  • the storage device can select a distribution granularity of 30M to allocate storage space for the data to be written, and two storage spaces of 30M size store 60M of data, thereby avoiding waste of storage space. That is, for the distribution granularity Q n and Q n-1 , if the absolute value of the difference between k n Q n and the size M of the data to be written is greater than k n-1 Q n-1 and to be written The absolute value of the difference between the sizes M of the data, then the selection granularity Q n is the allocation granularity of allocating the storage space to the data write request, and vice versa, selecting Q n-1 to allocate the storage space to the data write request.
  • the allocation granularity where k n is the number of storage spaces of size Q n allocated by the storage device for the data to be written, and k n-1 is the size allocated by the storage device for the data to be written is Q n-1
  • the preset allocation granularity is 64M and 64KB, and the size of the data to be written is 32M
  • the storage device selects 64 KB of the allocation granularity of 32M to be written to the data allocation storage space, it needs to be allocated. 500 64KB of storage space, resulting in fragmentation of storage and excessive metadata. If the storage device selects a 64M allocation granularity of 32M to be written to the data allocation storage space, 32M storage space is wasted.
  • the preset condition may be that the difference between the size of the storage space allocated for the data write request and the size of the data to be written cannot exceed 1M.
  • the storage device can select a 64 KB allocation granularity of 32 M to be written according to the preset condition; if the storage fragmentation degree is required to be the lowest in the specific implementation process, the preset condition is: for the same For the data write request, the storage space allocated by the storage device of the same granularity cannot exceed two. Therefore, the storage device can select a 64M allocation storage space to be written with a storage granularity of 32M according to the preset condition.
  • the value indicates that, in order to avoid the case where the size of the data to be written is different from the preset granularity of each of the foregoing, the N allocation granularities in the preset storage space in the embodiment of the present invention. At the same time, the difference between the adjacent two distribution granularities can be reduced.
  • the storage device allocates a storage space for the data write request by using the selected allocation granularity.
  • the selected allocation granularity corresponds to an allocation queue
  • the storage device may divide the unallocated storage space of the selected allocated granularity into a plurality of storage subspaces, wherein the size of each storage subspace is equal to the selected one.
  • the size of the granularity Q n is allocated and the address of the storage subspace is added to the allocation queue. In this way, when the storage device allocates storage space to the data write request, the storage device can directly allocate from the allocation queue, and does not need to temporarily divide the unallocated storage space of the selected allocation granularity, thereby improving the allocation efficiency.
  • the storage space described in this document may be a logical unit number (LUN).
  • LUN logical unit number
  • a LUN can usually be accessed by only one host.
  • the embodiment of the present invention may preset N allocation granularities for each LUN.
  • the method for the storage device to allocate the storage space to the data write request may refer to the foregoing steps S101 to S103, and details are not described herein again.
  • the storage device can select a different data size for the data write request of different data sizes, and allocate storage space to the data write request, thereby avoiding waste of storage space or excessive amount of metadata caused by a single allocation granularity. problem.
  • the allocateable storage space of each allocation granularity is from the unallocated storage space of the allotable storage space of the allocated granularity adjacent to the allocated granularity.
  • Allocating, and the adjacent allocation granularity is greater than the allocation granularity, and when the allocatable storage space of the allocated granularity is allocated, the distributable storage space adjacent to the allocation granularity and larger than the allocated granularity of the allocated granularity may be allocated.
  • the storage space is allocated for the allocation granularity in the unallocated storage space. As shown in FIG.
  • Q n may then allocate the memory space allocated from unallocated storage space of the Q n-1, said Q n-1 may allocate memory from the unallocated space in Q n-2 storage space allocation, when the n-Q may be allocated after the allocation of storage space, storage space can be allocated can be allocated from the n-Q Q unallocated storage space of n-1.
  • the allocatable storage space of the Q n-2 may be a storage space corresponding to one LUN, or may be a partial storage space in a LUN, if Q n
  • the allocatable storage space of the -2 is a part of the storage space of the LUN
  • the allocatable storage space of the Q n-2 is allocated, the storage may be allocated for the Q n-2 from the storage space corresponding to the LUN. space.
  • the storage device allocates the storage space for the data write request by using the selected allocation granularity to specifically include:
  • Storage space can be allocated S1031, the device compares the memory size of the data to be written with a particle size distribution of the M selected unallocated storage space size of L 1.
  • S1032 The storage device allocates a storage space of size kQ n for the data write request from the unallocated storage space when determining that L 1 is not less than M.
  • the storage space may be allocated for the data to be written in two manners.
  • the method is to allocate a storage space for the data to be written from the collected storage space of the selected allocation granularity, as shown in steps S1033' and S1034', and the second manner is to allocate a granularity from the selection.
  • a storage space is allocated for the allocated granularity in the unallocated storage space of the allocatable storage space that is adjacent to the allocated granularity of the selected allocation granularity, as shown in step S1033 and step S1034.
  • the first method specifically includes the following steps:
  • the reclaimed storage space refers to a storage space in the allocatable space of the selected allocation granularity that has been allocated and the data written therein has been erased.
  • the memory device determines the size of the unallocated storage space 1 and a particle size distribution of the selected storage space can be allocated in the L-recovered storage space is not less than 2 L and M, which is not from the memory device Allocating a storage space and storing a size of kQ n for the data write request in the recycled storage space, where M ⁇ kQ n ⁇ min ⁇ L 1 +L 2 , M+Q n ⁇ .
  • the storage device may perform the steps shown in step S1033 and step S1034 when it is determined that the sum of the unallocated storage space size L 1 and the allocated storage granularity of the allocated storage granularity L 2 is less than M
  • the second way is to allocate storage space for the data to be written.
  • the second method specifically includes the following steps:
  • the storage device is less than M L is determined identifying the selected allocation granularity adjacent allocation granularity 1, a particle size distribution from the adjacent storage space can be allocated unallocated storage space allocated to said selected Granular allocation allocates storage space.
  • the adjacent distribution granularity Q n-1 is greater than the selected distribution granularity Q n .
  • the storage device may allocate an allocatable storage space of size kQ n-1 for the selected allocation granularity from the unallocated storage space of the adjacent allocated granularity according to the size M of the data to be written.
  • kQ n-1 is greater than M and less than Q n-1 +M.
  • the size of the data to be written is 10M
  • the adjacent allocation granularity Q n-1 is 100M.
  • the storage device may be from the unallocated storage space of the adjacent allocated granularity.
  • the selected allocation granularity is allocated to a storage space of 100M in size.
  • the storage device may allocate an allocatable storage of size kQ n-1 for the selected allocation granularity from the unallocated storage space of the adjacent allocated granularity according to the difference between L 1 and M. Space, where kQ n-1 is greater than ML 1 and less than Q n-1 + ML 1 .
  • the size of data to be written to 120M, the particle size distribution adjacent to Q n-1 50M, the selected particle size distribution Q n is 40M, the selected unallocated memory space allocation granularity is 80M, the In this case, the storage device may allocate a storage space of a size of 50M for the selected allocation granularity from the unallocated storage space of the adjacent allocation granularity.
  • the storage device allocates a storage space of size kQ n for the data write request from the unallocated storage space of the selected allocation granularity.
  • step S1033 The method for allocating the allocatable storage space for the allocation granularity Q n from the allocatable storage space of the allocation granularity Q n-1 in the storage device in step S1033 is specifically described below with reference to FIG. 4, including:
  • the storage device compares a sum of the allotable storage space of the selected allocation granularity with the adjacent allocated granularity and an allocatable storage space quota preset for the selected allocated granularity.
  • the storage device determines that the sum of the allotable storage space of the selected allocation granularity and the adjacent allocation granularity is greater than a preset allocateable storage space quota for the selected allocated granularity, and is no longer the selection.
  • the allocation granularity allocates storage space, that is, returns write failure information.
  • the storage device cannot continue to allocate the granularity for 10M from the 40M allocated granularity of the allocatable storage space.
  • the storage space can be allocated, and the storage space allocation due to a certain allocation granularity is avoided, so that no storage space is available for other allocation granularities.
  • the storage device may Allocating storage space of the allocated granularity and the allocated storage space for the data to be written, when the sum of the unallocated storage space and the reclaimed storage space is insufficient to be the to-be-written When the data allocates space, the storage device returns write failure information.
  • the storage device determines that the sum of the allotable storage space of the selected allocation granularity and the adjacent allocation granularity is not greater than a preset allocateable storage space quota for the selected allocation granularity, and compares the adjacent allocation.
  • the first threshold may be equal to the size of the adjacent allocation granularity Q n-1 , in which case, when the unallocated storage space of the adjacent allocation granularity is less than one allocation granularity,
  • the selected allocation granularity allocation may allocate storage space.
  • the threshold value may be greater than the first adjacent particle size distribution Q n-1, to avoid the allocation granularity adjacent unallocated memory space is allocated to all of the selected allocation granularity.
  • the storage device determines that at least one contiguous address space of size Q n-1 is released to the adjacent allocation when there is at least one contiguous address space of size Q n-1 in the reclaimed storage space. Granular, allocatable storage space.
  • step S10336 after the at least one contiguous address space of size Q n-1 is released to the contiguous storage granularity of the allocatable storage space, the storage device may release the released storage space and the adjacent storage space.
  • the unallocated storage space of the allocated granularity is integrated and re-allocated according to the adjacent allocation granularity, which reduces storage fragmentation.
  • the selected allocation granularity corresponds to a reclaiming queue
  • the storage device may At least one address of the Q n-1 contiguous address space is added to the reclaim queue, so that the storage device can directly release the storage space from the reclaim queue according to the release granularity of size Q n-1 to the adjacent allocation. Granular in the allocatable storage space.
  • the storage device may further detect, in the reclaimed storage space of the allocated storage space of the selected allocation granularity, at least one consecutive address space of size Q n-1 , and upon determining that the storage space has been recovered at least a contiguous address space of size n-1, Q, the release of at least the size of a contiguous address space Q n-1 is adjacent to the particle size distribution can be assigned storage.
  • the storage device sequentially releases the reclaimed storage space of each allocated granularity, thereby sequentially integrating the small-sized storage space into a larger granular storage space with consecutive addresses, thereby reducing storage fragmentation.
  • the storage device determines that there is no at least one contiguous address space of size Qn -1 in the reclaimed storage space
  • the unallocated storage space may be further removed from the selected allocation granularity. And allocating storage space for the to-be-written data in the reclaimed storage space, where the sum of the unallocated storage space and the reclaimed storage space is insufficient to allocate space for the data to be written
  • the device returns a write failure message.
  • the storage device allocates an allocatable storage space for the selected allocation granularity from the unallocated storage space of the adjacent allocation granularity including the at least one consecutive address space of size Qn -1 .
  • the storage device can directly integrate the released storage space with the unallocated storage space of the adjacent allocated granularity, and After repartitioning, an allocatable storage space for allocation to the selected allocation granularity.
  • the storage device may also release the reclaimed storage space of each allocated granularity, thereby sequentially integrating the small-sized storage space into a larger granular storage space with consecutive addresses, and assigning each of the granularities to the granularity. After the reclaimed storage space is released in turn, allocate storage space for each allocation granularity to minimize storage fragmentation.
  • the storage device may trigger the allocation granularity adjacent to the selected allocation granularity. Allocating storage space for the selected allocation granularity in the allocated storage space.
  • the storage device may also be pre-set allocation granularity respective second threshold value, so that the storage space and a second threshold value R n of the storage device may be selected by comparing the particle size distribution can be allocated unallocated storage space, when When the unallocated storage space size R n in the allotable storage space of the selected allocation granularity is smaller than the second threshold, the selection is from the allotable storage space of the allocation granularity adjacent to the selected allocation granularity The allocation granularity allocation allocates storage space, thus ensuring that each allocation granularity has sufficient allocable storage space.
  • the storage spaces of the N allocation granularities are independent, and the relationship in the foregoing implementation manner does not exist.
  • the storage space of the storage device includes an allocatable storage space of the allocation granularity Q n , an allocatable storage space of the allocation granularity Q n-1 , and an allocatable storage space of the allocation granularity Q n-2 , wherein the allocation The allocatable storage space of the granularity Q n , the allocation granularity Q n-1 and the allocation granularity Q n-2 are all allocated from the total storage space of the storage device.
  • step S103 specifically includes step S1031, step S1032 and step S1033' and step S1034' shown in FIG. 3, and details are not described herein again.
  • the granularity Q n is allocated and the granularity Q n-1 is allocated.
  • the sum of the allocable storage space of the allocation granularity Q n-2 may be a storage space corresponding to one LUN, or may be a partial storage space in one LUN.
  • the storage device may reallocate the allocable storage space to the selected allocation granularity in the storage space corresponding to the LUN.
  • the embodiment of the present invention further provides a storage device 60, which is configured to perform a storage space allocation method provided by the foregoing method embodiment, where the storage space of the storage device 60 is pre-set with N different allocation granularities.
  • the allocation granularity is a unit for allocating the storage space, and each allocation granularity has an allocatable storage space, where N is a positive integer greater than one.
  • the storage Device 60 includes:
  • the receiving unit 61 is configured to receive a data write request, where the data write request includes data to be written;
  • a determining unit 62 configured to select, according to the size of the data to be written and the preset allocation granularity, an allocation granularity of the allocated storage space for the data write request from the N different allocation granularities;
  • the allocating unit 63 is configured to allocate a storage space for the data write request with the selected allocation granularity.
  • the allocating unit 63 is specifically configured to:
  • Comparing the size of the data to be written to the selected M and particle size distribution may be allocated storage space size of the memory space unallocated L 1;
  • a storage space of size kQ n is allocated for the data write request from the unallocated storage space, where k is a positive integer not less than 1, and Q n is the selected allocation Particle size, M ⁇ kQ n ⁇ min ⁇ L 1 , M+Q n ⁇ .
  • the allocating unit 63 is specifically configured to:
  • Comparing the size of the data to be written to the selected M and particle size distribution may be allocated storage space size of the memory space unallocated L 1;
  • the recycled storage space is Refers to the storage space that has been allocated in the allocatable space of the selected allocation granularity, and the storage space in which the data written therein has been erased;
  • the allocating unit 63 is specifically configured to:
  • Comparing the size of the data to be written to the selected M and particle size distribution may be allocated storage space size of the memory space unallocated L 1;
  • the particle size distribution is determined that the allocation is smaller than L 1 M, identifying the selected allocation granularity adjacent allocation granularity, the selection of the particle size from an adjacent dispensing allocated storage space unallocated storage space may be allocated for storage Space, wherein the adjacent distribution granularity Q n-1 is greater than the selected distribution granularity Q n .
  • the storage device 60 further includes a release unit 64, configured to compare the unallocated storage space size of the adjacent allocation granularity with a first threshold; determine unallocated storage of the adjacent allocated granularity When the size of the space is smaller than the first threshold, detecting whether there is at least one contiguous address space of size Q n-1 in the reclaimed storage space of the allocatable storage space of the selected allocation granularity; determining the reclaimed storage When there is at least one contiguous address space of size Q n-1 in the space, the at least one contiguous address space is released to the contiguous storage granularity of the allocatable storage space; the allocating unit 63 is specifically configured to include particle size distribution of said at least one unallocated storage space Q n-1 consecutive address space adjacent to the particle size distribution for dispensing the selected storage space can be allocated.
  • the allocating unit 63 is further configured to compare a sum of the allotable storage space of the selected allocation granularity with the adjacent allocated granularity and an allocatable storage space quota preset for the selected allocated granularity. And determining, when the sum of the allotable storage space of the selected allocation granularity and the adjacent allocation granularity is not greater than the preset allocatable storage space quota for the selected allocation granularity, the assignable from the adjacent allocation granularity The unallocated storage space of the storage space allocates an allocatable storage space for the selected allocation granularity.
  • the allocating unit 63 is further configured to compare a size of the unallocated storage space in the allotable storage space of the selected allocation granularity with a second threshold; when the selected allocated granularity is in the allotable storage space When the size of the unallocated storage space is less than the second threshold, the unallocated storage space in the allotable storage space of the allocation granularity adjacent to the selected allocation granularity increases the allocatable storage space for the selected allocation granularity wherein the particle size distribution of adjacent Q n-1 is greater than the selected particle size distribution Q n.
  • the releasing unit 64 is further configured to detect, in the reclaimed storage space of the selectable storage space of the selected allocation granularity, at least one consecutive size of Q n-1 An address space; when it is determined that there is at least one contiguous address space of size Q n-1 in the reclaimed storage space, releasing the at least one contiguous address space of size Q n-1 to the selected allocation granularity the particle size distribution may be adjacent to allocate storage space adjacent to the particle size distribution Q n-1 is greater than the selected particle size distribution Q n.
  • the above division of the storage device functional unit is only a logical function division, and the actual implementation may have another division manner.
  • the determination unit 62 and the allocation unit 63 may be divided into a processing unit.
  • the physical implementation of the above functional units may also be implemented in various manners.
  • the determining unit 62 may be a central processing unit or an application specific integrated circuit (ASIC).
  • ASIC application specific integrated circuit
  • the storage device is configured to allocate a storage space to the data write request by using a different allocation granularity for data write requests of different data sizes, so that the amount of data is different for each write to the storage device.
  • the storage device can allocate storage space with the allocation granularity closest to the size of each data write, thereby avoiding the problem of waste of storage space or excessive amount of metadata caused by a single allocation granularity.
  • the embodiment of the present invention further provides another storage device, as shown in FIG. 7, including: a processor 71, a communication interface 72, a memory 73, a memory 74, and a communication bus 75;
  • the processor 71, the communication interface 72, the memory 73, and the memory 74 complete communication with each other via the communication bus 75.
  • the communication interface 72 is configured to communicate with an external device.
  • the memory 73 includes a storage space for storing data.
  • the memory 74 is configured to store program code, where the program code is pre-set with N different allocation granularities for the storage space in the memory, where the allocation granularity is used as a unit for allocating the storage space, and each allocation The granularity has an allocatable storage space, where N is a positive integer greater than one.
  • the processor 71 is configured to execute the program code in the memory 74 to perform a method for allocating a storage space provided by the foregoing method embodiment. For details, refer to the method embodiment described above for FIG. 1 , FIG. 3 and FIG. Detailed description will not be repeated here.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the software functional units described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

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 (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

L'invention concerne un procédé d'attribution d'espace de stockage et un dispositif de stockage, se rapportant au domaine du stockage et utilisés pour attribuer un espace de stockage au moyen de différentes granularités d'attribution selon la taille de données écrites dans le dispositif de stockage à chaque fois. Le procédé comprend les opérations suivantes : un dispositif de stockage reçoit une requête d'écriture de données, la requête d'écriture de données comprenant des données à écrire (S101) ; selon la taille des données à écrire et N granularités d'attribution préréglées pour un espace de stockage, sélectionner, parmi les N granularités d'attribution différentes, une granularité d'attribution pour attribuer l'espace de stockage pour la requête d'écriture de données (S102) ; et attribuer l'espace de stockage pour la requête d'écriture de données au moyen de la granularité d'attribution sélectionnée (S103), la granularité d'attribution servant d'unité pour attribuer l'espace de stockage, et chaque granularité d'attribution ayant un espace de stockage capable d'être attribué.
PCT/CN2015/098108 2015-12-21 2015-12-21 Procédé d'attribution d'espace de stockage, et dispositif de stockage WO2017107015A1 (fr)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201580056639.4A CN107533435B (zh) 2015-12-21 2015-12-21 存储空间的分配方法及存储设备
PCT/CN2015/098108 WO2017107015A1 (fr) 2015-12-21 2015-12-21 Procédé d'attribution d'espace de stockage, et dispositif de stockage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/098108 WO2017107015A1 (fr) 2015-12-21 2015-12-21 Procédé d'attribution d'espace de stockage, et dispositif de stockage

Publications (1)

Publication Number Publication Date
WO2017107015A1 true WO2017107015A1 (fr) 2017-06-29

Family

ID=59088810

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/098108 WO2017107015A1 (fr) 2015-12-21 2015-12-21 Procédé d'attribution d'espace de stockage, et dispositif de stockage

Country Status (2)

Country Link
CN (1) CN107533435B (fr)
WO (1) WO2017107015A1 (fr)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688062A (zh) * 2020-05-18 2021-11-23 北京市商汤科技开发有限公司 用于存储数据的方法和相关产品
CN114115738A (zh) * 2021-11-23 2022-03-01 烽火通信科技股份有限公司 一种基于分布式存储的磁盘空间管理方法及系统
CN114442927A (zh) * 2021-12-22 2022-05-06 天翼云科技有限公司 一种数据存储空间的管理方法及装置
US20230214322A1 (en) * 2020-05-18 2023-07-06 Cambricon (Xi'an) Semiconductor Co., Ltd. Method and device for allocating storage addresses for data in memory

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669640B (zh) * 2018-12-24 2023-05-23 浙江大华技术股份有限公司 一种数据存储方法、装置、电子设备及介质
CN110221781B (zh) * 2019-06-04 2022-08-23 Oppo广东移动通信有限公司 一种磁盘碎片的制造方法、装置、存储介质及智能终端
CN110688345A (zh) * 2019-09-26 2020-01-14 重庆大学 一种内存文件系统的多粒度结构化空间管理机制
CN113485969B (zh) * 2021-05-31 2022-05-03 荣耀终端有限公司 一种存储碎片化方法及装置、终端及计算机存储介质
CN113660338A (zh) * 2021-08-17 2021-11-16 中国农业银行股份有限公司 数据交互方法、装置、系统和服务器

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976223A (zh) * 2010-10-09 2011-02-16 成都市华为赛门铁克科技有限公司 自动精简配置方法和装置
CN102650931A (zh) * 2012-04-01 2012-08-29 华为技术有限公司 一种写入数据的方法及系统
US20150169244A1 (en) * 2013-09-27 2015-06-18 Avalanche Technology, Inc. Storage processor managing nvme logically addressed solid state disk array

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8127096B1 (en) * 2007-07-19 2012-02-28 American Megatrends, Inc. High capacity thin provisioned storage server with advanced snapshot mechanism
CN102122284B (zh) * 2010-01-08 2014-07-02 腾讯科技(深圳)有限公司 一种复合文档存储、读写方法和装置
CN104915146A (zh) * 2014-03-14 2015-09-16 中兴通讯股份有限公司 基于自动精简配置的资源分配方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976223A (zh) * 2010-10-09 2011-02-16 成都市华为赛门铁克科技有限公司 自动精简配置方法和装置
CN102650931A (zh) * 2012-04-01 2012-08-29 华为技术有限公司 一种写入数据的方法及系统
US20150169244A1 (en) * 2013-09-27 2015-06-18 Avalanche Technology, Inc. Storage processor managing nvme logically addressed solid state disk array

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688062A (zh) * 2020-05-18 2021-11-23 北京市商汤科技开发有限公司 用于存储数据的方法和相关产品
US20230214322A1 (en) * 2020-05-18 2023-07-06 Cambricon (Xi'an) Semiconductor Co., Ltd. Method and device for allocating storage addresses for data in memory
CN114115738A (zh) * 2021-11-23 2022-03-01 烽火通信科技股份有限公司 一种基于分布式存储的磁盘空间管理方法及系统
CN114115738B (zh) * 2021-11-23 2023-12-26 烽火通信科技股份有限公司 一种基于分布式存储的磁盘空间管理方法及系统
CN114442927A (zh) * 2021-12-22 2022-05-06 天翼云科技有限公司 一种数据存储空间的管理方法及装置
CN114442927B (zh) * 2021-12-22 2023-11-03 天翼云科技有限公司 一种数据存储空间的管理方法及装置

Also Published As

Publication number Publication date
CN107533435A (zh) 2018-01-02
CN107533435B (zh) 2020-04-28

Similar Documents

Publication Publication Date Title
WO2017107015A1 (fr) Procédé d'attribution d'espace de stockage, et dispositif de stockage
CN110663019B (zh) 用于叠瓦式磁记录(smr)的文件系统
CN102255962B (zh) 一种分布式存储方法、装置和系统
EP3171277B1 (fr) Procédé de gestion de fichiers, système de stockage réparti et noeud de gestion
CN110612511B (zh) 使用流选择性地向分配区域中存储数据
US9329792B2 (en) Storage thin provisioning and space reclamation
US8751547B2 (en) Multiple file system and/or multi-host single instance store techniques
JP7467593B2 (ja) リソース割振り方法、記憶デバイス、および記憶システム
US20150227468A1 (en) Combining virtual mapping metadata and physical space mapping metadata
CN109144406B (zh) 分布式存储系统中元数据存储方法、系统及存储介质
WO2019001020A1 (fr) Procédé d'agencement d'espace de stockage, appareil et système basé sur un système distribué
US20240086092A1 (en) Method for managing namespaces in a storage device and storage device employing the same
WO2023124423A1 (fr) Procédé et appareil d'attribution d'espace de stockage, dispositif terminal et support de stockage
CN112631520A (zh) 分布式块存储系统、方法、装置、设备和介质
US10228885B2 (en) Deallocating portions of data storage based on notifications of invalid data
US20160364268A1 (en) Computer system, management computer, and management method
US9606909B1 (en) Deallocating portions of provisioned data storage based on defined bit patterns indicative of invalid data
CN104426965B (zh) 自管理存储方法和系统
US20200034445A1 (en) Techniques for limiting the maximum storage consumed by a file system without shrinking an underlying volume
US11144445B1 (en) Use of compression domains that are more granular than storage allocation units
CN114047886A (zh) 一种nvme命令处理方法、系统、电子设备及存储介质
US10168911B1 (en) Defragmentation of persistent main memory
US11886730B2 (en) Compression ratio-aware data deduplication

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15911015

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15911015

Country of ref document: EP

Kind code of ref document: A1