A method, apparatus, and medium for disk space allocation of a storage system
By traversing the disk block storage space from the outside in according to the distance from the center of the disk, and prioritizing the use of the outer ring space for disk space allocation, the problem of slowing down the storage system performance due to the low speed of the inner ring in the existing technology is solved, and more efficient disk space allocation and system performance improvement are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2022-10-14
- Publication Date
- 2026-04-21
AI Technical Summary
Existing disk space allocation algorithms do not take into account the speed differences at different locations on the disk, causing the storage system to slow down overall performance when some disks use the slow inner space.
The disk block storage space is traversed from the outside to the inside according to the distance from the center of the disk, and the high-speed outer space is used for allocation first. The allocation efficiency is improved by using a multi-layer bitmap structure.
This improves the performance and stability of the storage system, avoiding overall performance degradation caused by low-speed inner space.
Smart Images

Figure CN115562584B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular to a disk space allocation method, apparatus and medium for a storage system. Background Technology
[0002] Hard disk drives (HDDs), as the most basic storage unit in a distributed storage system, directly impact the system's performance through their read and write speeds. Current disk space allocation algorithms do not consider the speed differences between different locations on the disk. Instead, they allocate new space sequentially from the initial location, only resuming allocation after reaching the last allocation unit. While this approach often doesn't fill the entire storage system in practice, modifications to written data are frequent. For data security and performance reasons, storage systems use reallocation writes to modify data. This means that when modifying data, the existing data isn't deleted first; instead, a new disk space is allocated to write the new data. After the new data is written, the original data is deleted, and the disk space is released. The advantage of this approach is that data loss is prevented without the need for a logging mechanism.
[0003] However, this approach also introduces new disk space allocation operations. Therefore, even if the storage system has a small capacity, repeated data modifications and writes can lead to space being allocated at the end of the disk. Since the disk performance at that location is relatively low, this can slow down the overall performance of the storage system.
[0004] Therefore, how to avoid excessive disk usage and thus ensure the overall performance of the storage system is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a disk space allocation method, apparatus, and medium for a storage system to avoid excessive disk usage and thus ensure the overall performance of the storage system.
[0006] To address the aforementioned technical problems, this application provides a disk space allocation method for a storage system, comprising:
[0007] Receive disk space requests;
[0008] If the request is received, the block storage space of the disk is traversed from the outside to the inside according to the distance from the center of the disk space;
[0009] If a free block storage space is found, the block storage space is allocated.
[0010] Preferably, the disk space is divided into multiple levels of bitmaps, and the disk space corresponding to a higher-level bitmap includes the disk space corresponding to multiple lower-level bitmaps.
[0011] Traversing the block storage space of the disk to find free block storage space includes:
[0012] Traverse the disk space corresponding to the bitmap with the higher level;
[0013] If there is free disk space corresponding to the higher-level bitmap, then the corresponding disk space is determined as the target disk space;
[0014] Traverse the disk space corresponding to the lower-level bitmaps included in the target disk space until a free block storage space is found.
[0015] Preferably, the disk space is divided into an outer circle and an inner circle according to a preset threshold; wherein, the preset threshold is the distance of a position on the disk space from the center position of the disk space;
[0016] The block storage space traversed from the outside to the inside of the disk space according to the distance from the center position of the disk space includes:
[0017] Traverse the block storage space of the outer ring;
[0018] If there is no free block storage space in the outer ring, then the block storage space in the inner ring is traversed.
[0019] Preferably, traversing the block storage space of the outer ring to find free block storage space includes:
[0020] If the previously allocated block storage space is located in the outer ring, then traversal begins from the next block storage space after the previously allocated block storage space to find a free block storage space;
[0021] If the previously allocated block storage space is located in the inner circle, then the traversal starts from the block storage space corresponding to the starting position of the outer circle to find a free block storage space.
[0022] Preferably, traversing the block storage space of the outer ring to find free block storage space includes:
[0023] The process begins by traversing the block storage space corresponding to the starting position of the outer ring to find a free block storage space.
[0024] Preferably, traversing the block storage space of the inner circle to find free block storage space includes:
[0025] If the previously allocated block storage space is located in the outer ring, then start traversing from the block storage space corresponding to the starting position of the inner ring to find a free block storage space;
[0026] If the previously allocated block storage space is located in the inner circle, then the traversal begins from the next block storage space after the previously allocated block storage space to find a free block storage space.
[0027] Preferably, after allocating the block storage space if a free block storage space is found, the method further includes:
[0028] Update the state of the allocated block storage space.
[0029] To address the aforementioned technical problems, this application also provides a disk space allocation device for a storage system, comprising:
[0030] The receiving module is used to receive disk space request requests;
[0031] The traversal module is used to traverse the block storage space of the disk from the outside to the inside according to the distance from the center of the disk space if the application request is received.
[0032] The allocation module is used to allocate the block storage space if a free block storage space is found.
[0033] Preferably, the disk space allocation device of the storage system further includes: an update module, used to update the state of the allocated block storage space after allocating the block storage space if a free block storage space is found.
[0034] To address the aforementioned technical problems, this application also provides a disk space allocation device for a storage system, comprising: a memory for storing computer programs;
[0035] A processor is used to implement the disk space allocation method of the above-described storage system when executing computer programs.
[0036] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the disk space allocation method of the aforementioned storage system.
[0037] The disk space allocation method for a storage system provided in this application typically involves receiving a disk space request when modifying data of an object. Upon receiving the request, the method traverses the disk's block storage space from the outside in, based on distance from the center. If a free block storage space is found, it is allocated. This disk space allocation method utilizes the characteristic of high performance on the outer rings and low performance on the inner rings of a hard drive to divide the disk space. This prioritizes the use of the high-speed outer rings during disk space allocation, preventing the overall performance of the storage system from being slowed down by some disks using the low-speed inner rings, thus improving system performance and stability.
[0038] This application also provides a disk space allocation device for a storage system and a computer-readable storage medium, which correspond to the above-described method and therefore have the same beneficial effects as the above-described method. Attached Figure Description
[0039] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 A flowchart illustrating a disk space allocation method for a storage system provided in this application embodiment;
[0041] Figure 2 This is a schematic diagram illustrating the use of bitmaps to divide disk space, as provided in an embodiment of this application.
[0042] Figure 3 This application provides a schematic diagram of a disk space allocation process in accordance with an embodiment of the present application.
[0043] Figure 4 A structural diagram of a disk space allocation device for a storage system provided in an embodiment of this application;
[0044] Figure 5 This is a structural diagram of a disk space allocation device for a storage system provided in another embodiment of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0046] The core of this application is to provide a disk space allocation method, device, and medium for a storage system to avoid excessive disk usage and thus ensure the overall performance of the storage system.
[0047] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] Distributed storage systems consist of multiple storage servers (nodes) connected via a network. Object-based storage devices (OSDs) are deployed on disks, and algorithms are used to evenly distribute data across these OSDs, achieving high-performance, high-reliability, and easily scalable data storage. To shorten the data read / write (I / O) path and achieve higher performance, current distributed storage systems directly manage the physical disks, independent of the file system, and automatically allocate and release disk space. HDDs, as the most basic storage unit in a distributed storage system, directly impact the system's performance with their read / write speed. Because HDDs require increased storage unit density and improved storage medium utilization, the number of sectors per track differs between the inner and outer rings of the disk. At the same density, the outer ring has fewer storage units than the inner ring. When the disk's angular velocity is constant, the linear velocity of the outer ring is faster than the inner ring, allowing for the reading of more sectors; therefore, the outer ring's read / write speed is faster than the inner ring. Under the same test conditions, starting from the beginning of the disk, the closer to the inner ring, the worse the read / write performance, with speed differences reaching more than double. This application presents a disk space allocation method for a storage system that prioritizes the use of the high-speed outer ring space of the disk during allocation and improves the efficiency of disk space allocation through a hierarchical bitmap structure. This avoids the storage system slowing down due to some disks using the low-speed inner ring space, thus improving system performance and stability. Figure 1 A flowchart illustrating a disk space allocation method for a storage system provided in this application embodiment; as follows: Figure 1 As shown, the method includes the following steps:
[0049] S10: Receive disk space request.
[0050] S11: If an application request is received, the block storage space of the disk is traversed from the outside to the inside according to the distance from the center of the disk space.
[0051] S12: If a free block storage space is found, the block storage space is allocated.
[0052] This application provides a specific implementation scheme. It should be noted that this application is not limited to the following scheme; other schemes obtained without inventive effort based on the technical solutions disclosed in this application are all within the protection scope of this application. The specific scheme for traversing the block storage space of the disk from the outside in based on the distance from the center of the disk space is not limited here, as long as the space on the outer edge of the disk is used preferentially. Here, the starting position of the outer edge of the disk is set as position 0, and the entire disk space is divided into multiple logical blocks (i.e., block storage spaces) of the smallest allocation unit. A three-level bitmap (L2, L1, L0) is used for management from top to bottom. The bitmap is divided into high-speed and low-speed unit areas according to a certain threshold. If the previously allocated space is in the high-speed area, the search for free space continues from that position; otherwise, the search restarts from the starting position of the high-speed area, ensuring that the space on the outer edge of the disk is used preferentially. The specific scheme is as follows.
[0053] Figure 2 This application provides a schematic diagram illustrating the partitioning of disk space using a bitmap, as shown in the embodiments of the present application. Figure 2As shown, the disk space allocation method of the storage system in this embodiment uses a bitmap to divide the disk space and divides the disk space into high-speed and low-speed areas according to a certain threshold, increasing search efficiency through a tree structure. First, the HDD is divided into multiple blocks according to the smallest allocation unit size (which can be 4k, 8k or larger), forming a three-level bitmap L2, L1, and L0 from top to bottom. This can be organized using an array data structure. The status bit of each position index (position, pos) is set to 0 or 1 to indicate the occupancy status of that position. Each pos in L0 is directly mapped one-to-one with each block of the physical disk. When its status bit is 0, it indicates that the space of the smallest allocation unit is occupied; when it is set to 1, it indicates that the space is free. Each position (pos) in L1 maps to 64 positions in L0, meaning one position contains 64 blocks on disk. When all positions in L0 mapped to a position in L1 are set to 0, the corresponding position in L1 is set to 0; otherwise, it is set to 1. A bit set to 0 indicates that all blocks under that position in L1 are occupied, and a bit set to 1 indicates that there are free blocks under that position. Each position in L2 maps to 64 positions in L1, meaning one position in L2 contains 64*64 blocks on disk. Similarly, when all positions in L1 mapped to a given position are set to 0, the corresponding position in L2 is set to 0; otherwise, it is set to 1. Additionally, the L2 cache is divided into high-speed and low-speed zones according to a preset threshold (e.g., the middle position between the center and the boundary of the disk, i.e., the first half of the disk is considered the outer ring and the second half the inner ring; this can be adjusted based on disk performance and business needs). The boundary between the high-speed and low-speed zones is the critical position. All positions (pos) in the L2 layer below the critical position are considered to be in the high-speed zone, and the remaining positions are considered to be in the low-speed zone. This scheme also needs to record the last allocated disk space position in the L2 layer, last_pos (initialized to 0). When allocating space, it first checks if last_pos is in the high-speed zone. If so, it searches for free positions starting from that position. After finding one, it recursively searches for available disk space from L2 to L0. After finding and allocating the disk space, it finally backtracks to update the available space in the bitmap from L0 to L2.
[0054] Figure 3 This application provides a schematic diagram of a disk space allocation process as an embodiment; for example... Figure 3As shown, the method includes the following steps: S20: Allocate disk space. S21: Determine if last_pos is located in the high-speed area; if yes, proceed to step S22; otherwise, proceed to step S23. S22: Search for a free pos in L2 starting from this position. S23: Search for a free pos in L2 starting from pos0. S24: Determine if a free pos is found; if yes, proceed to step S25; otherwise, proceed to step S26. S25: Search for a free pos in L2 starting from this position. S26: Return false. S27: Recursively search for an available block in the lower layers. S28: Return the location of an available block. S29: Backtrack from L0 and set the bit. S30: Update last_pos. Figure 3 The allocation process, as shown, upon receiving a disk space request, first checks if the last allocated space at the L2 level (last_pos) is less than the critical pos. If so, it starts searching backward from that position; otherwise, it searches backward from pos0. It iterates backward through pos, continuing the search if a pos is occupied, and recursively searching downwards if a pos is free. If no free pos is found after iterating through all pos, it returns false. Based on the starting position of the L1 level pos mapped to the free pos at the L2 level, it searches backward for a free pos at the L1 level. Once found, it searches for a free block based on the starting position of the L0 level pos mapped to that free pos at the L1 level. It returns the position of the found free block, thus allocating disk space at that position. The corresponding L0 level pos is set to 0, indicating it is occupied. The process then backtracks upwards, setting bits accordingly. If all L0 level pos mapped to this L1 level pos have 0 status bits, then this L1 level pos is set to 0. This process continues in the L2 level (i.e., after allocating block storage space, the status of the allocated block storage space is updated). The variable `last_pos`, representing the last allocated space location, is updated to `pos`, representing the L2 level where the current allocated space location is located. This embodiment of the application divides the disk space into high-speed and low-speed zones based on the characteristic that the outer rings of a hard disk drive have high performance and the inner rings have low performance, ensuring that space in the high-speed zone is allocated first. By recording the last allocation location, the retrieval efficiency during space allocation is improved by avoiding searching from the starting position each time and by using a layered bitmap structure.
[0055] In practical applications, the traversal is not limited to dividing the disk into outer and inner circles. It can be divided into more circles, or no division at all; simply traverse the disk's block storage space from the outside in. The bitmap is not limited to L2, L1, and L0. The starting position of the traversal can also be adjusted according to actual needs. The scheme in the above embodiment avoids starting the traversal from the initial position each time. Because allocation is sequential, most of the block storage space before the previously allocated block storage space is occupied. Therefore, starting the traversal from the block storage space after the allocation point can speed up the traversal efficiency of the outer circle. However, in specific implementations, it can also be set to start the traversal from the starting position each time, which is simpler to implement.
[0056] The disk space allocation method for a storage system provided in this application embodiment generally involves receiving a disk space request when modifying data of an object. Upon receiving the request, the method traverses the disk's block storage space from the outside in, based on the distance from the center of the disk space. If a free block storage space is found, it is allocated. This disk space allocation method for a storage system, based on the characteristic that the outer rings of a hard drive have high performance and the inner rings have low performance, divides the disk space. This allows for priority use of the high-speed outer ring space when allocating disk space, preventing the storage system from slowing down overall performance due to some disks using the low-speed inner ring space, thus improving system performance and stability.
[0057] In practical applications, directly traversing the block storage space of the disk is inefficient. Therefore, this embodiment divides the disk space into multiple levels of bitmaps, and the disk space corresponding to a higher-level bitmap includes the disk space corresponding to multiple lower-level bitmaps, such as... Figure 2 The algorithm uses three levels of bitmaps: L2, L1, and L0. Traversing the disk's block storage space to find free block storage space involves: traversing the disk space corresponding to higher-level bitmaps; if a free block space exists corresponding to a higher-level bitmap, that space is designated as the target disk space; then, the algorithm traverses the disk spaces corresponding to lower-level bitmaps included in the target disk space until a free block storage space is found. For a detailed solution, please refer to [reference needed]. Figure 2 The algorithm uses a three-layer bitmap (L2, L1, L0). First, it iterates through the available positions (pos) in the L2 layer. If a pos is occupied, the search continues; if a pos is free, the search recursively moves down to the next layer. If no free pos is found after iterating through all pos, it returns false. Based on the starting position of the L1 layer pos mapped from the free pos in L2, it searches for a free pos in L1. Once found, it searches for a free block based on the starting position of the L0 layer pos mapped from that free pos in L1. Finally, it returns the location of the found free block, allocating disk space at that location. This implementation improves the efficiency of disk space allocation through its layered bitmap structure.
[0058] Because HDDs require increased storage cell density and improved storage medium utilization, the number of sectors per track differs between the inner and outer rings of the disk. At the same density, the outer ring has fewer storage cells than the inner ring. When the disk's angular velocity is constant, the linear velocity of the outer ring is faster than the inner ring, resulting in more sectors being read. Therefore, the outer ring's read / write speed is faster than the inner ring's. Here, "outer ring" refers to the outer ring relative to the inner ring. In practical applications, disk space can be explicitly divided into outer and inner rings based on a preset threshold. This preset threshold is the distance of a location on the disk from its center. The value of the preset threshold is not limited but is generally set midway between the center and the boundary of the disk. Traversing the disk's block storage space from the outside in, based on distance from the center, includes: traversing the outer ring's block storage space; if no free block storage space exists on the outer ring, then traversing the inner ring's block storage space. This solution prioritizes the use of the disk's high-speed outer ring space when allocating disk space.
[0059] Correspondingly, after clearly defining the outer and inner circles, the specific scheme for traversing the block storage space can also be adjusted. For example, the first scheme involves traversing the outer circle's block storage space to find free block storage space, including: if the previously allocated block storage space is located in the outer circle, then start traversing from the block storage space following the previously allocated block storage space to find free block storage space; if the previously allocated block storage space is located in the inner circle, then start traversing from the block storage space corresponding to the starting position of the outer circle to find free block storage space. This method avoids starting traversal from the initial position each time, because if allocation is performed sequentially, most of the block storage space before the previously allocated block storage space will be occupied. Therefore, starting traversal from the block storage space after the allocation point can speed up the traversal efficiency of the outer circle. The corresponding alternative scheme involves traversing the outer circle's block storage space to find free block storage space, including: always starting traversal from the block storage space corresponding to the starting position of the outer circle to find free block storage space. This approach does not require recording the previously allocated block storage space or making any judgments; it simply requires traversing from the starting position each time, making it much simpler to implement.
[0060] The above examples illustrate two methods for traversing the outer ring. Once the outer ring is occupied, it's necessary to allocate block storage space for the inner ring. Traversing the inner ring's block storage space to find free block storage space includes: if the previously allocated block storage space is located in the outer ring, then start traversing from the block storage space corresponding to the starting position of the inner ring to find free block storage space; if the previously allocated block storage space is located in the inner ring, then start traversing from the next block storage space after the previously allocated block storage space to find free block storage space. The method in this example corresponds to the first method for allocating outer ring space, avoiding traversing from the initial position each time, which can speed up the traversal efficiency of the inner ring.
[0061] In the above embodiments, the disk space allocation method of the storage system has been described in detail. This application also provides embodiments corresponding to the disk space allocation device of the storage system. It should be noted that this application describes the embodiments of the device part from two perspectives: one is based on the functional module, and the other is based on the hardware.
[0062] From the perspective of functional modules, this embodiment provides a disk space allocation device for a storage system. Figure 4 A structural diagram of the disk space allocation device for the storage system provided in the embodiments of this application is shown below. Figure 4 As shown, the device includes:
[0063] The receiving module 10 is used to receive disk space request requests;
[0064] Traversal module 11 is used to traverse the block storage space of the disk from the outside to the inside according to the distance from the center of the disk space if an application request is received.
[0065] The allocation module 12 is used to allocate block storage space if a free block storage space is found.
[0066] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.
[0067] In a preferred embodiment, the disk space allocation device of the storage system further includes an update module, which is used to update the state of the allocated block storage space after allocating the block storage space if a free block storage space is found.
[0068] The disk space allocation device for the storage system provided in this embodiment corresponds to the method described above, and therefore has the same beneficial effects as the method described above.
[0069] From a hardware perspective, this embodiment provides another disk space allocation device for a storage system. Figure 5 A structural diagram of a disk space allocation device for a storage system provided in another embodiment of this application is shown below. Figure 5 As shown, the disk space allocation device of the storage system includes: a memory 20 for storing computer programs;
[0070] The processor 21 is used to implement the steps of the disk space allocation method of the storage system as described in the above embodiments when executing a computer program.
[0071] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0072] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the disk space allocation method of the storage system disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the disk space allocation method of the storage system.
[0073] In some embodiments, the disk space allocation device of the storage system may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0074] Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the disk space allocation device of the storage system and may include more or fewer components than shown.
[0075] The disk space allocation device for a storage system provided in this application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: disk space allocation method for a storage system.
[0076] The disk space allocation device for the storage system provided in this embodiment corresponds to the method described above, and therefore has the same beneficial effects as the method described above.
[0077] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.
[0078] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0079] The computer-readable storage medium provided in this embodiment corresponds to the method described above, and therefore has the same beneficial effects as the method described above.
[0080] The foregoing has provided a detailed description of a disk space allocation method, apparatus, and medium for a storage system provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0081] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the aforementioned element.
Claims
1. A disk space allocation method for a storage system, characterized in that, include: Receive disk space requests; If the request is received, the block storage space of the disk is traversed from the outside to the inside according to the distance from the center of the disk space; If a free block storage space is found, the block storage space is allocated. When the disk space is divided into an outer circle and an inner circle according to a preset threshold; wherein, the preset threshold is the distance of a position on the disk space from the center position of the disk space; The block storage space traversed from the outside to the inside of the disk space according to the distance from the center position of the disk space includes: If the previously allocated block storage space is located in the outer ring, then traversal begins from the next block storage space after the previously allocated block storage space to find a free block storage space; If the previously allocated block storage space is located in the inner circle, then start traversing from the block storage space corresponding to the starting position of the outer circle to find a free block storage space; If there is no free block storage space in the outer ring, then the block storage space in the inner ring is traversed.
2. The disk space allocation method for a storage system according to claim 1, characterized in that, The disk space is divided into multiple levels of bitmaps, and the disk space corresponding to a higher-level bitmap includes the disk space corresponding to multiple lower-level bitmaps. Traversing the block storage space of the disk to find free block storage space includes: Traverse the disk space corresponding to the bitmap with the higher level; If there is free disk space corresponding to the higher-level bitmap, then the corresponding disk space is determined as the target disk space; Traverse the disk space corresponding to the lower-level bitmaps included in the target disk space until a free block storage space is found.
3. The disk space allocation method for a storage system according to claim 1, characterized in that, Traversing the outer ring of block storage space to find free block storage space includes: The process begins by traversing the block storage space corresponding to the starting position of the outer ring to find a free block storage space.
4. The disk space allocation method for a storage system according to claim 1 or 3, characterized in that, Traversing the block storage space of the inner circle to find free block storage space includes: If the previously allocated block storage space is located in the outer ring, then start traversing from the block storage space corresponding to the starting position of the inner ring to find a free block storage space; If the previously allocated block storage space is located in the inner circle, then the traversal begins from the next block storage space after the previously allocated block storage space to find a free block storage space.
5. The disk space allocation method for a storage system according to claim 1, characterized in that, If a free block storage space is found, after allocating the block storage space, the method further includes: Update the state of the allocated block storage space.
6. A disk space allocation device for a storage system, characterized in that, include: The receiving module is used to receive disk space request requests; A traversal module is used to, upon receiving the application request, traverse the block storage space of the disk from the outside in, based on the distance from the center of the disk space; when the disk space is divided into an outer circle and an inner circle according to a preset threshold; wherein, the preset threshold is the distance of a position on the disk space from the center of the disk space; the traversal of the block storage space of the disk from the outside in, based on the distance from the center of the disk space, includes: if the previously allocated block storage space is located in the outer circle, then starting the traversal from the next block storage space after the previously allocated block storage space to find a free block storage space; if the previously allocated block storage space is located in the inner circle, then starting the traversal from the block storage space corresponding to the starting position of the outer circle to find a free block storage space; if there is no free block storage space in the outer circle, then traversing the block storage space of the inner circle; The allocation module is used to allocate the block storage space if a free block storage space is found.
7. A disk space allocation device for a storage system, characterized in that, Includes memory used to store computer programs; A processor, configured to implement the disk space allocation method of the storage system as described in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the disk space allocation method of the storage system as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Disk space management method and system based on distributed storage
CN114115738A
Allocating Disk Space On A Disk Drive
US20080320266A1