CN117472792A - Apparatus and method for managing storage space, and computing device - Google Patents

Apparatus and method for managing storage space, and computing device Download PDF

Info

Publication number
CN117472792A
CN117472792A CN202210853748.0A CN202210853748A CN117472792A CN 117472792 A CN117472792 A CN 117472792A CN 202210853748 A CN202210853748 A CN 202210853748A CN 117472792 A CN117472792 A CN 117472792A
Authority
CN
China
Prior art keywords
space
request
sub
storage
storage unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210853748.0A
Other languages
Chinese (zh)
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Moore Threads Technology Co Ltd
Original Assignee
Moore Threads Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Moore Threads Technology Co Ltd filed Critical Moore Threads Technology Co Ltd
Priority to CN202210853748.0A priority Critical patent/CN117472792A/en
Publication of CN117472792A publication Critical patent/CN117472792A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)

Abstract

The disclosure relates to an apparatus and a method for managing storage space, and a computing device. The device comprises: a first interface connected to the external request source and configured to receive a space management request from the external request source; the second interface is connected with the memory, and the memory comprises a storage space; an initialization module configured to: after the device is powered on, writing a plurality of storage unit indexes into a first storage area of the storage space through a second interface, wherein each storage unit index is used for representing one storage unit in a second storage area of the storage space, each storage unit in the second storage area has one preset size in a preset size set, and the preset size set comprises at least two preset sizes which are different from each other; a space management module configured to: based on the space management request, the storage unit index within the first storage area is managed via the second interface. Thus, multi-granularity storage space management can be achieved.

Description

Apparatus and method for managing storage space, and computing device
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to a storage space management device, a computing apparatus, and a method for managing storage space.
Background
With the development of computer technology, more and more various computing devices are presented in life, work and study of people. Generally, in these computing devices, there are various forms of processors, controllers, or microcontrollers that, when they run an application to perform a function, need to request a certain amount of space from memory, and when the application is running, the corresponding space can be freed. This involves the management of memory space.
At present, the management of the memory space is generally realized in a software mode, that is, a CPU (central processing unit ) or an MCU (Microcontroller Unit, micro control unit) runs a memory management policy, and issues an instruction, so that a hardware system processes the instruction, and then the read-write operation of the memory is realized through a bus. In the memory management scheme implemented by the software, the problems of long path, high delay, complex structure and the like generally exist.
Disclosure of Invention
In view of the above, the present disclosure provides an apparatus for managing storage space, a method for managing storage space, and a computing device, which may alleviate, mitigate, or even eliminate the above-mentioned problems.
According to an aspect of the present disclosure, there is provided an apparatus for managing storage space, including: a first interface connected to the external request source and configured to receive a space management request from the external request source; the second interface is connected with the memory, and the memory comprises a storage space; an initialization module configured to: after the device is powered on, writing a plurality of storage unit indexes into a first storage area of the storage space through a second interface, wherein each storage unit index is used for representing one storage unit in a second storage area of the storage space, each storage unit in the second storage area has one preset size in a preset size set, and the preset size set comprises at least two preset sizes which are different from each other; a space management module configured to: based on the space management request, the storage unit index within the first storage area is managed via the second interface.
In some embodiments, writing the plurality of storage unit indexes in the first storage area of the storage space includes: at least one storage unit index is written in each sub-area in the first storage area such that all storage unit indexes in each sub-area correspond to a preset size.
In some embodiments, the spatial management module comprises: and the space counting module is configured to receive the space management request and split the space management request into one or more sub-management requests when the space counting module is in an idle state, wherein each sub-management request corresponds to one preset size in the preset size set.
In some embodiments, the space management request includes a space allocation request and a space reclamation request, and wherein splitting the space management request into one or more sub-management requests includes: responding to the space management request as a space recycling request, and splitting the space recycling request into one or more sub-recycling requests according to storage unit indexes corresponding to the space requested to be recycled by the space recycling request, wherein each sub-recycling request corresponds to one preset size in a preset size set; responding to the space management request as a space allocation request, and splitting the space allocation request into one or more sub-allocation requests according to the size of the space requested to be allocated by the space allocation request, wherein each sub-allocation request corresponds to one preset size in a preset size set.
In some embodiments, the space management module further comprises: a space allocation module configured to receive the sub-allocation request from the space counting module and to read one or more storage unit indexes from the first storage area via the second interface based on the sub-allocation request; and the space recycling module is configured to receive the sub recycling request from the space counting module and write a corresponding storage unit index into the first storage area through the second interface based on the sub recycling request.
In some embodiments, the space allocation module includes at least two sub-allocation modules, each sub-allocation module corresponding to one of the set of preset sizes and configured to receive a sub-allocation request corresponding to the respective preset size; the space reclamation module includes at least two sub reclamation modules, each sub reclamation module corresponding to one of a set of preset sizes and configured to receive sub reclamation requests corresponding to the corresponding preset size.
In some embodiments, each child allocation module is configured to read, via the second interface, the storage unit index from the first storage area according to a location pointed to by a first pointer corresponding to the child allocation module based on the received child allocation request; and wherein each sub-reclamation module is configured to write, via the second interface, the storage unit index to the first storage area according to a location pointed to by a second pointer corresponding to the sub-reclamation module based on the received sub-reclamation request.
In some embodiments, splitting the space allocation request into one or more child allocation requests includes: the space requested to be allocated in response to the space allocation request may be completely split into a combination of one or more storage units, wherein each split storage unit has one of the set of preset sizes, splitting the space requested to be allocated in response to the space allocation request to determine the number of storage units having each preset size, and minimizing the number of split storage units.
In some embodiments, splitting the space allocation request into one or more child allocation requests further comprises: in response to the available number of storage units of each preset size being greater than or equal to the number of storage units of such preset size determined by the splitting, one or more sub-allocation requests are sequentially sent based on the split one or more storage units, wherein each sub-allocation request corresponds to one of the preset sizes in the set of preset sizes and includes the number of storage units of that preset size determined by the splitting.
In some embodiments, splitting the space allocation request into one or more child allocation requests further comprises: in response to the number of available memory cells of one predetermined size being less than the number of memory cells of the predetermined size determined by the splitting, information indicative of an error is reported.
In some embodiments, splitting the space allocation request into one or more child allocation requests further comprises: the space requested to be allocated in response to the space allocation request cannot be completely split into a combination of one or more storage units, wherein each split storage unit has one of a set of preset sizes, and information indicating an error is reported.
In some embodiments, the spatial counting module includes at least two index counters, each index counter corresponding to one of a set of preset sizes, and the spatial counting module is further configured to: based on the number of storage unit indexes related to the split one or more sub-reclamation requests, enabling the corresponding one or more index counters to change in a first direction; based on the number of storage unit indexes related to the split one or more sub-allocation requests, the corresponding one or more index counters are changed in a second direction, and the second direction is opposite to the first direction.
In some embodiments, the apparatus further comprises: an address register configured to store address modification data for a start address and/or a stop address of one or more sub-areas in the first memory area based on user input and, upon power-up of the device, to send the address modification data to the initialization module and/or the space management module.
According to another aspect of the present disclosure, there is provided a computing device comprising an apparatus for managing storage space according to embodiments in the foregoing aspects.
According to yet another aspect of the present disclosure, there is provided a method for managing storage space, comprising: after the device is powered on, writing a plurality of storage unit indexes in a first storage area of a storage space, wherein each storage unit index is used for representing one storage unit in a second storage area of the storage space, and each storage unit in the second storage area has one preset size in a preset size set, and the preset size set comprises at least two preset sizes which are not equal to each other; receiving a space management request from an external request source; based on the space management request, the storage unit index within the first storage area is managed.
Through the device for managing the storage space, which is provided by the invention, the memory management is allowed to be realized in a hardware mode, and the problems of long path, high delay and the like caused by a software mode are avoided, so that the management efficiency of the storage space is improved, and the running speed of the whole computing system is improved. Meanwhile, the resources of the processor, the controller or the microcontroller can be released by means of the independent hardware device for memory management, so that the optimal configuration of the resources is realized, and the overall performance of the computing system is improved. Specifically, the apparatus for managing storage space provided by the present disclosure may receive a space management request from an external request source through a hardware interface, and implement management (e.g., allocation and reclamation) of storage space by managing storage unit indexes within a first storage area. This can enable a quick management of the memory space. In addition, by dividing the second storage area into storage units having different preset sizes, the storage units having different preset sizes are allowed to be scheduled according to the different sizes of the storage spaces involved in the space management request, thereby allowing the storage space management to be realized with fewer storage unit indexes, which helps to reduce occupation of the data transmission line and further helps to improve the storage space management efficiency.
These and other aspects of the disclosure will be apparent from and elucidated with reference to the embodiments described hereinafter.
Drawings
Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments, with reference to the following drawings, wherein:
FIG. 1 is a schematic diagram illustrating a memory management architecture in the related art;
FIG. 2 schematically illustrates an example block diagram of a storage space management system according to some embodiments of the disclosure;
FIGS. 3A and 3B schematically illustrate a partitioning scheme of storage space according to some embodiments of the present disclosure;
FIG. 4 schematically illustrates an example structure of a storage space index according to some embodiments of the present disclosure;
FIG. 5A schematically illustrates another example block diagram of a storage space management system according to some embodiments of this disclosure;
FIG. 5B schematically illustrates an example block diagram of an apparatus for managing storage space, according to some embodiments of the disclosure;
FIG. 6 schematically illustrates an example state machine for a space counting module according to some embodiments of the disclosure;
FIG. 7 schematically illustrates an example block diagram of a space counting module according to some embodiments of the disclosure;
FIG. 8 schematically illustrates an example arrangement for storing unit indices by means of a first pointer and a second pointer;
FIG. 9 schematically illustrates an example state machine for a child allocation module according to some embodiments of the present disclosure;
FIG. 10 schematically illustrates an example block diagram of a child distribution module according to some embodiments of the disclosure;
FIG. 11 schematically illustrates an example state machine for a sub-reclamation module according to some embodiments of the present disclosure;
FIG. 12 schematically illustrates an example block diagram of a sub-reclamation module according to some embodiments of the present disclosure;
FIG. 13 schematically illustrates an example block diagram of a request classification module according to some embodiments of the disclosure;
FIG. 14 schematically illustrates an example block diagram of a computing device according to some embodiments of the disclosure;
fig. 15 schematically illustrates an example flow chart of a space management method according to some embodiments of the disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure. It should be understood that the described embodiments are merely some, but not all embodiments of the present disclosure. Based on the embodiments in this disclosure, all other embodiments that a person of ordinary skill in the art would obtain without making any inventive effort are within the scope of protection of this disclosure.
Fig. 1 schematically illustrates a memory management architecture 100 in the related art. As shown in fig. 1, in the related art, the memory 110 may be directly managed by the processor 120 or the like via the bus 130. For example, when the processor 120 needs to write data into the memory space, the usable space may be determined according to the internal memory space management policy, and then an instruction for writing data into the corresponding memory space is issued, and the instruction may be processed by hardware and sent to the memory 110 via the bus 130, so as to implement data writing. The process of data reading, deleting, etc. may be similarly implemented. However, the applicant has found that performing memory management in this manner has the following drawbacks: firstly, the resources of a processor (or a controller, a microcontroller and the like) are required to be occupied to execute operations such as space allocation, recovery and the like, which is not beneficial to the efficient utilization of the resources; secondly, the allocation and recovery of the memory space are implemented through software, the instruction is required to be processed through hardware, and then the read-write operation is performed in the memory space through a bus, so that the characteristics of long path, high delay, complex structure and the like are achieved; thirdly, the parallel operation of space recovery and space allocation is difficult to realize by managing the memory in a software mode, so that the improvement of the operation efficiency is limited; etc.
Based on the above considerations, the applicant has proposed a solution for implementing memory management by means of hardware circuits, which helps to solve or alleviate the various problems described above.
FIG. 2 schematically illustrates an example block diagram of a storage space management system 200 according to some embodiments of the disclosure. The storage space management system 200 includes means 210 for managing storage space that can receive a space management request from an external request source 220 and process the received space management request to manage storage space in a memory 230. The memory 230 may be various memories used as a memory, such as a Double Data Rate (DDR) synchronous dynamic random access memory, or other types of memories. By way of example, external request source 220 may be any device that may initiate a space management request, such as a CPU, MCU, etc.
As shown in fig. 2, the apparatus 210 may include a first interface 211, a second interface 212, an initialization module 213, and a space management module 214. The first interface 211 may be connected to the external request source 220, for example, via a private line or a public line (such as a bus), and is used to enable communication between the external request source 220 and the device 210, for example, to enable data communication via a handshake. The first interface 211 may be configured to receive a space management request from the external request source 220, and may be configured to feed back a management result from the space management module, which may be, for example, information indicating a storage unit index of the allocated space, a space allocation failure, a space reclamation success, etc., to the external request source 220. The second interface 212 may be configured to connect with the memory 230 and to enable communication between the memory 230 and the device 210, e.g., may send read or write requests from the device 210 to the memory 230, feed back data from the memory 230 to the device 210, etc.
The initialization module 213 may be configured to, after powering up the apparatus 210, write a plurality of storage unit indexes in a first storage area of the storage space of the memory 230 via the second interface 212, wherein each storage unit index is used to characterize one storage unit in a second storage area of the storage space, each storage unit in the second storage area having one of a set of preset sizes, the set of preset sizes including at least two mutually unequal preset sizes. For example, after a power-on reset of the hardware circuit, the initialization module 213 may first write the memory location index into a first memory area of the memory 230, which may be a pre-specified area, and whose size and location may be adjusted as desired. After all the storage unit indexes are written, the device 210 may begin to respond to the space management request from the external request source 220, and thereafter the initialization module 213 may no longer operate until the hardware circuitry is powered down and is again started after the next power-up. Illustratively, when the initialization module 213 completes the index write operation described above, a signal may be sent to a front-end circuit (e.g., a request classification module or other circuit module described below) to inform the front-end circuit that the space management request may begin to be received.
Illustratively, FIG. 3A shows a schematic diagram of a storage space 300. As shown, the storage space 300 may include a first storage area 310 and a second storage area 320. Optionally, the storage space 300 may also include other storage areas 330 reserved for other uses. The second storage area 320 may be divided into a plurality of storage units, each of which may have one of a set of preset sizes. The set of preset sizes may be set according to specific needs, for example may be set to include one or more of 2 MB, 512 KB, 128 KB, 64 KB, 16 KB, 4KB, or may include other preset sizes as well. The first storage area 310 may be written to a plurality of storage unit indexes, each of which may characterize one storage unit in the second storage area 320. For example, when the size of the second storage area is 8Gb, assuming that the storage space of 4 Gb is divided by 2 MB granularity, the storage space of 2 GB is divided by 512 KB granularity, the storage space of 1 GB is divided by 128 KB granularity, the storage space of 512 MB is divided by 64 KB granularity, the storage space of 256 MB is divided by 16 KB granularity, and the storage space of 256 MB is divided by 4KB granularity, the storage area can be divided into 2048 storage units of 2 MB, 4096 storage units of 512 KB, 8192 storage units of 128 KB, 8192 storage units of 64 KB, 16384 storage units of 16 KB, and 65536 storage units of 4 KB. If a 4 byte (byte) storage unit index is allocated to each storage unit, the storage unit index corresponding to the storage unit of 2 MB needs to be stored in 8 KB, the storage unit index corresponding to the storage unit of 512 KB needs to be stored in 16 KB, the storage unit index corresponding to the storage unit of 8192 128 KB needs to be stored in 32 KB, the storage unit index corresponding to the storage unit of 64 KB needs to be stored in 32 KB, the storage unit index corresponding to the storage unit of 16 KB needs to be stored in 64 KB, and the storage unit index corresponding to the storage unit of 4KB needs to be stored in 256 KB. Thus, the first storage area may be 408 KB in size.
In some embodiments, at least one storage unit index may be written in each sub-region in the first storage region such that all storage unit indexes in each sub-region correspond to a preset size. Illustratively, as shown in fig. 3B, the first memory area 310 may be divided into sub-areas 311, 312, etc., and each sub-area may write only memory cell indexes corresponding to the same preset size. Taking the foregoing example as an example, the first storage area may be divided into 6 sub-areas, and the storage unit indexes corresponding to the storage units of 2 MB, 512 KB, 128 KB, 64 KB, 16 KB, and 4 KB are stored respectively. This may further facilitate the management of storage units of different preset sizes (or so-called different granularities).
In some embodiments, to identify the storage unit indexes corresponding to different preset sizes, an identifier indicating the preset size may be included in each storage unit index. For example, as shown in fig. 4, the storage unit index 400 may be divided into an identifier part 410 and a unit index part 420, the identifier part 410 may be used to store an identifier indicating a preset size, and the unit index part 420 may be used to store an index value of a storage unit having a corresponding preset size. Illustratively, in the example described above having 6 preset sizes of 2 MB, 512 KB, 128 KB, 64 KB, 16 KB, 4 KB, and representing the storage unit index in 4 bytes, the preset size may be represented in 3 bits higher for each storage unit index, e.g., 4 KB may be represented in 000, 16 KB in 001, 64 KB in 010, 128 KB in 011, 512 KB in 100, 2 MB in 101, and the remaining 29 bits represent specific index values.
The space management module 214 may be configured to manage, via the second interface 212, storage unit indexes within the first storage area in the memory 230 based on the space management request. Illustratively, the space management module 214 may read or write the storage unit index from or to the first storage area based on the space management request to complete allocation and reclamation of the corresponding storage unit in the second storage area.
By way of example, the memory space device 210 may be implemented as various types of hardware circuits, such as formed as an integrated circuit, packaged as a chip structure, etc., so as to be used as desired, such as soldered at corresponding pins of a circuit board or plugged into corresponding sockets of a circuit board, etc.
Through the device 210, the storage space of the memory 230 (for example, the internal memory such as DDR) can be managed in a hardware manner, so that the disadvantage of a software management manner can be avoided, a more convenient management manner can be provided, which is beneficial to improving the space management efficiency, saving the processing resources of the main control unit such as CPU or MCU, further improving the operation efficiency of the whole computing system, and optimizing the resource allocation of the whole computing system.
In addition, the device 210 may divide the storage space in the memory into storage units with multiple granularities for management, which is helpful for reducing the storage space occupied by the storage unit index, reducing the data transmission resources required for reading and writing the storage unit index, and improving the read and write efficiency, compared with the single granularity division, thereby further improving the storage space management efficiency. In particular, still taking the above-mentioned division of 8 GB storage space as an example, in order to ensure that storage space can be reasonably and efficiently allocated when divided at a single granularity, it can only be divided at a smaller granularity, for example, when 8 GB storage space is divided at a granularity of 4 KB, the total need is divided into 2097152 storage units, thereby requiring 2097152 storage unit indexes in total. Still assuming that each storage unit index is stored in 4 bytes (bytes) in the first storage area, the size of the first storage area would need to reach 8 MB. It is apparent that the size of the first storage area at this time is much larger than that in the scheme according to the embodiment of the present disclosure. In other words, the multi-granularity partitioning approach in embodiments of the present disclosure may reduce the consumption of storage space compared to single-granularity partitioning approach, such that more space in memory may be allocated to external request sources for use. Further, since the number of storage unit indexes to be written by the initialization module is greatly reduced, the required writing time is also greatly reduced, that is, the writing process of the storage unit indexes can be completed more quickly, so that the processing of the space management request can be started more quickly after the device is powered on. In addition, during the processing of the space management request, that is, during the management of the storage unit index, the multi-granularity mode in the embodiment of the disclosure can also improve the read-write efficiency of the storage unit index compared to the single-granularity mode. Specifically, taking a request related to management of 2 MB storage space as an example, if managed in a 4 KB single granularity manner, 512 storage unit indexes are required to be read/written in total; if managed in the multi-granularity manner mentioned above, only 1 storage unit index corresponding to 2 MB storage units may need to be read/written. It can be seen that the latter can greatly reduce the number of storage unit indexes required to be read and written, thereby helping to reduce the read and write time. Further exemplary, in the case where the reading and writing of the memory cell index is completed through the bus, for the former, if the bus burst length is 128, 4 read/write requests are triggered in total; for the latter, the bus burst length is set to 1. The latter can be seen to greatly reduce bus occupation time.
Fig. 5 schematically illustrates an example block diagram of a storage space management system 500 according to some embodiments of this disclosure. Similar to fig. 2, the storage space management system 500 includes a device 510 for managing storage space, an external request source 520, and a memory 530, wherein the external request source 520 and the memory 530 are similar to the external request source 220 and the memory 230 in fig. 2, and are not described herein. The apparatus 510 includes an initialization module 512, which is similar to the initialization module 213 in fig. 2 and is not described herein. In addition, in fig. 5, drawing of the first interface and the second interface is omitted for brevity.
As shown in fig. 5, in some embodiments, the space management module may include a space counting module 513. The space counting module 513 may be configured to receive the space management request and split the received space management request into one or more sub-management requests when in an idle state, wherein each sub-management request corresponds to one of a set of preset sizes. Illustratively, the space counting module 513 may receive the space management request from the external request source 520 directly via the first interface, or may also receive the space management request from the external request source 520 via other circuit modules (e.g., the request classification module 511, which will be described below). The space counting module 513 may split the space management request according to one or more preset sizes in the preset size set, and transmit the split sub-management request to the lower circuit module for further processing. Thus, the process of processing the space management request from the external request source based on the multi-granularity storage unit can be conveniently realized. And, by splitting the space management request into one or more sub management requests related to only single granularity storage units, the fusion of the scheme provided by the embodiment of the disclosure and the single granularity storage space management scheme can be facilitated, so that the device provided by the embodiment of the disclosure can be allowed to be obtained more conveniently based on the circuit design modification of the single granularity scheme.
In some embodiments, the space management request may include a space allocation request and a space reclamation request. Thus, when a space management request is received, the space counting module may determine whether the space management request is a space allocation request or a space reclamation request, e.g., by an identifier associated with space allocation or space reclamation in the request, or by other means.
If the space management request is a space reclamation request, the space reclamation request may be split into one or more sub-reclamation requests according to a storage unit index corresponding to a space requested to be reclaimed by the space reclamation request, where each sub-reclamation request may correspond to one of the preset sizes in the preset size set. For example, the space reclamation request may include one or more storage unit indexes, or may include data related to one or more storage unit indexes. The space counting module may generate one or more sub-reclamation requests from one or more storage unit indexes derived from the space reclamation request, each of which may be used to request reclamation of a storage unit index of a preset size.
If the space management request is a space allocation request, the space allocation request may be split into one or more sub-allocation requests according to the size of the space requested to be allocated by the space allocation request, where each sub-allocation request may correspond to one of the preset sizes in the preset size set. For example, the space allocation request may include a size of the space requested to be allocated, or may include data related to the size of the space requested to be allocated. The space counting module may split the space requested to be allocated based on a preset size in the preset size set, so that the space requested to be allocated may be split into one or more storage units with the same or different preset sizes, thereby splitting the space allocation request into one or more sub-allocation requests, each of which may be used to request allocation of a storage unit index of a preset size.
In some embodiments, in splitting a space allocation request, to avoid circuit processing errors, it may be pre-determined whether the space allocation request may be completely split. If the space requested to be allocated by the space allocation request can be completely split into a combination of one or more storage units, wherein each split storage unit has one of the set of preset sizes, the space requested to be allocated by the space allocation request can be split to determine the number of storage units having each preset size, and the number of split storage units is minimized. Otherwise, if the space requested to be allocated by the space allocation request cannot be completely split into one or more combinations of storage units, where each split storage unit has one preset size in the preset size set, information indicating an error may be reported. For example, taking the foregoing example of dividing the storage space with granularity of 2MB, 512KB, 128KB, 64KB, 16KB, and 4KB as an example, it may be determined whether the space requested to be allocated by the space allocation request satisfies the rule of a×2mb+b×512 kb+c×128 kb+d×64 kb+e×16kb+f×4kb, where A, B, C, D, E, F is an integer greater than or equal to zero. If satisfied, the space allocation request may be considered to be completely split, and if not, the space allocation request may be considered to be incompletely split. In the case of complete splitting, A, B, C, D, E, F represents the required number of storage units for each preset size. Optionally, in splitting the space allocation request, in order to further reduce the number of storage unit indexes to be read and improve the reading efficiency, the number of storage units after splitting may be minimized as much as possible. For example, in the above example, the value of a+b+c+d+e+f may be minimized.
In some embodiments, in order to avoid processing errors of the lower-level circuit, after determining that the space allocation request can be completely split, it may also be determined in advance whether the available number of storage units of each preset size (i.e., the number of storage unit indexes that can be allocated currently) is greater than or equal to the number of corresponding storage units after splitting. If the available number of storage units of each preset size is greater than or equal to the number of storage units of the preset size determined by splitting, one or more sub-allocation requests may be sequentially sent based on the split one or more storage units, where each sub-allocation request corresponds to one of the preset sizes in the set of preset sizes and includes the number of storage units of the preset size determined by splitting. If the available number of storage units of one preset size is smaller than the number of storage units of the preset size determined by splitting, information indicating an error can be reported. Continuing with the example described above, assuming that a certain space allocation request can be split completely into a 2 MB storage units, B512 KB storage units, C128 KB storage units, D64 KB storage units, E16 KB storage units, and F4 KB storage units, reporting information indicating an error if any one or more of the following occurs: the available number of 2 MB memory cells is less than A, the available number of 512 KB memory cells is less than B, the available number of 128 KB memory cells is less than C, the available number of 64 KB memory cells is less than D, the available number of 16 KB memory cells is less than E, and the available number of 4 KB memory cells is less than F. If none of the above situations occur, one or more child allocation requests may be sent in sequence based on the split one or more storage units. For example, one or more child allocation requests may be sent sequentially in order of large to small or small to large storage units or in other orders.
In some embodiments, to record the available number of storage units of each preset size, the spatial counting module may include at least two index counters, each of which may correspond to one of the preset sizes in the set of preset sizes. Illustratively, as shown in FIG. 5B, the spatial count module 513 may include index counters 5131-1 to 5131-N, where N is an integer greater than or equal to 2. In such an embodiment, the spatial counting module may be further configured to: based on the number of storage unit indexes related to the split one or more sub-reclamation requests, enabling the corresponding one or more index counters to change in a first direction; and changing the corresponding one or more index counters in a second direction based on the number of storage unit indexes related to the split one or more sub-allocation requests, wherein the second direction is opposite to the first direction. Continuing with the example previously described of dividing 8 GB storage space by six granularity of 2 MB, 512 KB, 128 KB, 64 KB, 16 KB, 4 KB, 6 index counters may be provided, corresponding to 2 MB, 512 KB, 128 KB, 64 KB, 16 KB, 4 KB, respectively. When the space allocation request is split, based on the number of the storage units with preset sizes obtained by splitting, the corresponding index counter can be reduced by a corresponding number; for space reclamation requests, the corresponding index counter may be incremented by a corresponding amount based on the number of memory cells of each preset size involved. Alternatively, the reverse may be performed, i.e., the index counter is incremented for space allocation requests and decremented for space reclamation requests. It should be appreciated that each index counter may have a maximum value and a minimum value. For example, the minimum value may be zero and the maximum value may be the total number of memory cells of a corresponding preset size. Thus, the available number of storage units of each preset size may be determined based on the index counter, and further it may be determined whether the available number of storage units of each preset size is greater than or equal to the number of storage units of such preset size determined by splitting according to the embodiments described above.
For example, when the space allocation request or the space reclamation request is split and sent to or synchronized with the latter stage circuit module, the corresponding index counter may be updated. When all sub-reclamation or sub-allocation requests have been transmitted, the space count module 513 may be restored to the idle state. In addition, after reporting an error due to the space allocation request being incompletely split or the available number of one or more storage units of a predetermined size failing to meet the required number, the space counting module 513 may be restored to the idle state. After restoring the idle state, the space count module 513 may receive a new space management request.
Illustratively, the space count module 513 may be controlled by the state machine 600 shown in fig. 6.
As shown in fig. 6, when no space allocation request is received, the state machine 600 may be in an IDLE state, i.e., the above-described IDLE state. When a space management request is received, it may be determined whether the space management request is a space allocation request or a space reclamation request. If the space reclamation request is a space reclamation request, a corresponding sub reclamation request is generated and sequentially output to a later stage circuit module (for example, a space reclamation module described below) to reclaim a corresponding storage unit index and update a corresponding index counter. And after all the sub-recycling requests are output, the state can be restored to the IDLE state. If the space allocation request is a space allocation request, it can be determined whether the space requested to be allocated by the space allocation request can be completely split into a combination of storage units with preset sizes. If the split is incomplete, an error can be reported and then restored to the IDLE state. If the space allocation request can be completely split, the space allocation request is split, and whether the available number of the storage units with each preset size meets the required number is judged. If not, an error may be reported and then restored to the IDLE state. If so, the sub-allocation request can be sequentially output to the later-stage circuit module to allocate the corresponding storage unit index and update the corresponding index counter. After all the sub-allocation requests are output, the state can be restored to the IDLE state. Various operations involved in state machine 600 have been described in various embodiments with respect to space count module 513 described with reference to fig. 5 and are not described in detail herein.
In some embodiments, the spatial counting module 513 may be implemented by the circuit structure shown in fig. 7 or other similar structures.
As shown in fig. 7, the space counting module 513 may include a counter circuit 5131, a request classification circuit 5132, and a correspondence logic circuit 5133. The counter circuit 5131 may include one or more index counters as previously mentioned. The request classification circuit 5132 may be used to determine whether a received space management request is a space allocation request or a space reclamation request. The corresponding logic 5133 may perform splitting, transferring, and updating of the index counter of the space allocation request and the space reclamation request according to the various embodiments described above. Alternatively or additionally, the space counting module may also comprise other circuitry, as long as the functionality of the space allocation module described in the various embodiments above may be implemented.
Returning to fig. 5A, as shown in fig. 5A, the space management module may also include a space allocation module 514 and a space reclamation module 515.
The space allocation module 514 may be configured to receive the sub-allocation request from the space counting module 513 and to read one or more storage unit indexes from the first storage area via the second interface based on the received sub-allocation request. Illustratively, the read memory cell index is fed back to an external request source, e.g., may be fed back to the external request source 520 via a pre-stage circuit such as the space count module 513. In some embodiments, as shown in FIG. 5B, the space allocation module 514 may include at least two sub-allocation modules 5141-1 to 5141-N, where N is an integer greater than or equal to 2. Each of the sub-allocation modules 5141-1 to 5141-N may correspond to one of a set of preset sizes and be configured to receive a sub-allocation request corresponding to the respective preset size. Thus, in general, the number of sub-allocation modules may be kept consistent with the number of pre-sized categories in the pre-sized set, i.e. with the number of index counters. Optionally, each of the sub-allocation modules 5141-1 to 5141-N may be configured to read, based on the received sub-allocation request, the storage element index from the first storage area via the second interface according to the location pointed to by the first pointer corresponding to the sub-allocation module. Illustratively, the sub-allocation module may read the corresponding memory cell index by sending an index read request to the memory 530, which may include the first pointer and the number of indexes that need to be read. When the number of the storage unit indexes corresponding to the sub allocation requests is large, the storage unit indexes can be read in a plurality of batches.
The space reclamation module 515 may be configured to receive the sub-reclamation request from the space counting module 513 and write a corresponding storage unit index to the first storage region via the second interface based on the received sub-reclamation request. Illustratively, the space reclamation module 515 may feed back information indicating reclamation to the external request source after the index of the storage unit to be reclaimed is all written to the first storage area in the memory, for example, may feed back to the external request source 520 via a pre-stage circuit such as the space counting module 513. In some embodiments, as shown in FIG. 5B, the space reclamation module 515 includes at least two sub-reclamation modules 5151-1 to 5151-N, where N is an integer greater than or equal to 2. Each of the sub-reclamation modules 5151-1 to 5151-N may correspond to one of a set of preset sizes and may be configured to receive sub-reclamation requests corresponding to the respective preset sizes. Thus, similarly, in general, the number of child reclamation modules may be consistent with the number of pre-sized categories in the pre-sized set, i.e., with the number of child allocation modules, index counters. Optionally, each of the sub reclamation modules 5151-1 to 5151-N may be configured to write a storage unit index to the first storage area according to a location pointed to by a second pointer corresponding to the sub reclamation module via the second interface based on the received sub reclamation request. Illustratively, the sub-reclamation module may write the corresponding storage unit index by sending an index write request to the memory 530, which may include the second pointer and the index to be written. When the number of storage unit indexes corresponding to the sub reclamation request is large, the storage unit indexes can be written into a plurality of batches.
By providing separate space allocation modules and space reclamation modules to manage the various sub allocation requests and the various sub reclamation requests, respectively, and managing the reading and writing of storage unit indexes corresponding to various preset sizes in the first storage area by means of two or more sets of first pointers and second pointers, respectively, space allocation requests and space reclamation requests from external request sources can be processed more efficiently and orderly. Therefore, the storage space management efficiency is further improved.
Illustratively, fig. 8 schematically illustrates an example scheme 800 of a read and write process of a sub-allocation module and a sub-reclamation module corresponding to one preset size in respective sub-areas of a first memory region by means of a set of first pointers and second pointer management memory unit indexes. As shown in sub-graph a, when the device is powered up, the first pointer and the second pointer may be initialized to point to the same location in the sub-region 810, e.g., both point to the minimum address of the sub-region 810, or may point to other locations as well. As shown in sub-view B, when a sub-allocation request is processed by the sub-allocation module, a number of memory location indices from sub-area 810 are read, at which point the first pointer will be shifted downward, e.g., to the location of the next readable memory location index. As shown in Panel C, when a sub-reclamation request is processed by the sub-reclamation module, the corresponding memory location index will be written to sub-region 810, at which point the second pointer will be shifted downward, e.g., to the location of the next writable memory location index. As shown in subimage D, when the first pointer and/or the second pointer are offset to the maximum address of the sub-region 810, they will wrap around to the starting position. The above description is merely exemplary, and the first pointer and the second pointer may also be offset in other ways with the reading and writing of the storage unit index.
Illustratively, each of the sub-allocation modules in the space allocation module may be controlled by a state machine 900 shown in FIG. 9. As shown in fig. 9, the state machine 900 may be in an IDLE state, i.e., an IDLE state, when no child allocation request is received. When a sub-allocation request is received, a memory location index may be read from the first memory region, e.g., from a sub-region corresponding to a respective preset size, and stored to a local index queue. Then, in the case that the local index queue is not empty, the storage unit index may be allocated, that is, the storage unit index in the local index queue is fed back to the external request source until all the storage unit indexes are fed back, and the state is restored to the IDLE state again. Optionally, especially when the space counting module does not determine whether the number of storage units with preset sizes meets the allocation requirement, after receiving the sub-allocation request, each sub-allocation module may also determine whether the number of storage units with corresponding preset sizes meets the requirement of the current sub-allocation request, that is, whether the number of currently available storage units is greater than or equal to the number of storage units related to the current sub-allocation request. If so, a memory cell index read operation may be performed as described above; if not, the information indicating the space allocation failure can be fed back to the external request source, and the IDLE state can be skipped.
In some embodiments, each of the sub-allocation modules in the space allocation module may be implemented by the circuit structure shown in fig. 10 or other similar structure.
As shown in fig. 10, the sub-allocation module 1000 may include a read address maintenance circuit 1010, a bus data sort circuit 1020, a response processing circuit 1030, and a FIFO 1040. The read address maintenance circuit 1010 may manage the first pointer in accordance with the manner described above with reference to fig. 8. Bus data sort circuit 1020 may process the received sub-allocation requests to generate control signals that conform to the respective bus protocol, which may include, for example, the index read requests for memory space indexes mentioned previously, and which may be sent to memory (e.g., DDR memory, etc.) via the respective bus structures. FIFO 1040 may serve as the local index queue for the aforementioned sub-allocation module and serve to buffer the storage unit index from memory. For example, the memory may send respective data signals, which may include one or more memory cell indexes corresponding to the index read request, to the sub-allocation module 1000 in response to the control signal. And, illustratively, when all the unit indexes have been sent, the memory may send a response signal to the sub-allocation module 1000 indicating that the index read request is processed (or, alternatively, that the unit indexes have been sent). The response processing module 1030 may receive the response signal and feedback a completion signal to the external request source based on the response signal, for example, via the superior circuit module, which may include at least one of the following information: information indicating that the current space allocation request has been processed, a storage unit index read from the memory, and the like. Alternatively or additionally, the sub-allocation module 1000 may also include other circuitry as long as the functions of the space allocation module described in the various embodiments above may be implemented.
Illustratively, each of the sub-reclamation modules in the space reclamation module may be controlled by a state machine 1100 shown in FIG. 11. As shown in fig. 11, the state machine 1100 may be in the IDLE state when no child reclamation request is received. When a child reclamation request is received, a write operation to the storage unit index may be initiated. For example, the storage unit index to which the child reclamation request relates may be written to the local index queue first, and then the index write request may be generated based on the storage unit index in the local index queue. Then, a write operation to the memory may be initiated, i.e. the memory cell index in the local index queue is written to the first memory area in the memory by sending an index write operation, e.g. a sub-area corresponding to the corresponding preset size is written, until all the memory cell indexes are written, and the state is restored again to the IDLE state.
In some embodiments, each sub-recycling module of the space recycling module may be implemented by the circuit structure shown in fig. 12 or other similar structures.
As shown in fig. 12, the sub-reclamation module 1200 may include a write address maintenance circuit 1210, a bus data sort circuit 1220, a response processing circuit 1230, and a FIFO 1240. The write address maintenance circuit 1210 may manage the second pointer in accordance with the manner described above with reference to fig. 8. The bus data grooming circuit 1220 may process the received sub-reclamation requests to generate control signals and data signals that conform to the respective bus protocol, which may include, for example, the index write requests for the memory space index mentioned earlier, which may include the memory cell index to be written to the first memory region of the memory, and which may be sent to the memory (e.g., DDR memory, etc.) via the respective bus structure. FIFO 1240 may act as the aforementioned local index queue of the child reclamation module and serve to buffer the storage unit index associated with the received child reclamation request, i.e., the storage unit index requested to be reclaimed by the child reclamation request. For example, the memory may perform an index write operation in response to the control signal and the data signal, and transmit a corresponding response signal to the sub-allocation module 1200 after the write is completed. The response processing module 1230 may receive the response signal and feedback a completion signal to the higher-level circuit module (e.g., space counting module) based on the response signal, where the completion signal may include information indicating that the sub-reclamation request is processed, etc. Alternatively or additionally, the sub-allocation module 1200 may also include other circuitry as long as the functions of the space allocation module described in the various embodiments above may be implemented.
It should be appreciated that the pointer management approaches, state machines, and internal circuit structures described above with respect to the sub-allocation and sub-reclamation modules are merely exemplary, and that in practice, the sub-allocation and sub-reclamation modules may be implemented in other ways.
Returning to fig. 5A and 5B, in some embodiments, the means 510 for managing storage space may further comprise a request classification module 511. The request classification module 511 may be configured to store a space allocation request to a first queue when the space management request is a space allocation request and store a space reclamation request to a second queue when the space management request is a space reclamation request. Therefore, the space management requests from the external request sources can be classified and stored, and the space management requests can be managed independently. In addition, the first queue and the second queue can store the received space allocation requests and space reclamation requests, so that when an external request source initiates multiple requests, the back pressure of the external request source can be reduced, and the system efficiency is improved.
Illustratively, fig. 13 schematically illustrates an example block diagram of the request classification module 511, according to some embodiments of the disclosure. As shown in fig. 13, the request classification module 511 may include a first queue 5111 (or referred to as an allocation queue) and a second queue 5112 (or referred to as a reclamation queue). Illustratively, the first queue 5111 and the second queue 5112 may be implemented by one FIFO (First Input First Output, first-in first-out) memory, respectively. Illustratively, the request classification module 511 may receive space management requests from the external request source 520 via the first interface in a handshake manner, and may then store space allocation requests in the received space management requests to the first queue 5111 and space reclamation requests in the received space management requests to the second queue 5112. Alternatively, the request classification module 511 may be connected to, or may include, a first interface. For example, when the space counting module of the subsequent stage is in an idle state, the request stored in the first queue and/or the second queue for the earliest time (i.e., the first write) may be passed to the space counting module. For example, the request stored in the first queue and the second queue with the earliest time may be transferred to the space counting module, or the requests in the first queue and the second queue may be transferred to the space counting module in turn, or the like.
Alternatively, due to the limited FIFO memory space, a pre-fill threshold may be set for the first queue 5111 and the second queue 5112. When the number of space allocation requests stored in the first queue 5111 reaches a corresponding pre-full threshold (or referred to as a first threshold), the first queue 5111 may perform a pre-full back pressure and may no longer receive space allocation requests from external request sources; when the number of space reclamation requests stored in the second queue 5112 reaches a corresponding pre-full threshold (or referred to as a second threshold), the second queue 5112 may perform a pre-full back pressure and may no longer receive space reclamation requests from external request sources. Alternatively, the request classification module 511 may back-pressure the front stage when the number of requests stored in either of the first queue 5111 and the second queue 5112 reaches a respective pre-full threshold, i.e., when the number of space allocation requests in the first queue 5111 reaches a first threshold or the number of space reclamation requests in the second queue 5112 reaches a second threshold, no space management requests from the external request source 520 are received anymore. By means of the backpressure mechanism, the request classification module 511 may be prevented from receiving space allocation requests and/or space reclamation requests that exceed its storage capacity, thereby avoiding processing errors.
Returning to fig. 5A and 5B, in some embodiments, the apparatus 510 may further include a bus 516 that may connect the initialization module and the space management module to the second interface. Illustratively, as shown in FIG. 5A, a bus 516 may be coupled to the initialization module 512, the space allocation module 514, and the space reclamation module 515 so that these modules may interact with the memory 530 via a second interface (not shown) of the apparatus 500. The bus 516 may be a standard NOC (Network on Chip) bus, for example, or may be implemented using other types of buses. Further, the bus 516 may also optionally connect other modules related or unrelated to the various modules described in the present disclosure.
To facilitate configuration of the means for managing storage space, in some embodiments, the means 510 may further comprise or be connected to an address register (not shown). The address register may be configured to store address modification data for a start address and/or a stop address of one or more sub-regions in the first memory area based on user input and, upon power-up of the apparatus 510, to send the stored address modification data to the initialization module and/or the space management module. In this way, the user may be allowed to modify the start address or the end address of each sub-region in the first memory area by software or other means according to the actual requirements, contributing to increased configuration flexibility of the device for managing memory space.
In addition, in some embodiments, the apparatus 510 may also receive a storage unit index from an external register to be written to the first storage area. In this way, the user can be allowed to more flexibly adjust the division of the storage units in the second storage area, which also contributes to an increase in the configuration flexibility of the apparatus for managing the storage space.
In some embodiments of the present disclosure, a computing device is also provided that may include the apparatus for managing storage space described previously, such as the apparatus 210, 510. Schematically, fig. 14 illustrates an example block diagram of a computing device 1400. As shown, computing device 1400 may include means 1410 for managing storage space, which may perform storage space management functions as described in the various embodiments above. Computing device 1400 may also include a processor or controller 1420 that may be implemented as a CPU, MCU, or similar structure and may be used to perform various processing or control operations. Computing device 1400 may also include memory 1430 that can be used to store data such as various program data required by the processor or controller 1420 in executing an application or data used or generated during execution of an application, and the like. The memory 1430 is implemented as a single memory, for example, or may be implemented as a combination of two or more memories. For example, memory 1430 may include one or more internal memories, such as DDR memory or SDRAM memory or the like, used as memory. The device 1410, the processor/controller 1420, and the memory 1430 may be coupled together by communication lines 1440 and enable data transfer between each other. Illustratively, the communication line 1440 may be a bus (such as an AXI bus, etc.) or other type of communication line, or may be a combination thereof.
In some embodiments of the present disclosure, a method for managing storage space is also provided. Illustratively, FIG. 15 shows an example flow chart of a method 1500 for managing storage space.
As shown in fig. 15, at step 1510, after the device is powered on, writing a plurality of storage unit indexes in a first storage area of the storage space, wherein each storage unit index is used to characterize one storage unit in a second storage area of the storage space, each storage unit in the second storage area having one of a set of preset sizes, the set of preset sizes including at least two mutually unequal preset sizes; at step 1520, a space management request from an external request source may be received; at step 1530, the storage unit index within the first storage area may be managed based on the space management request.
The method 1500 may have the same or similar embodiments as the previously described means for managing storage space and may have the same or similar technical effects. For brevity, the description is omitted here.
In the description of the present disclosure, the azimuth or positional relationship indicated by the terms "upper", "lower", "left", "right", etc., are based on the azimuth or positional relationship shown in the drawings, and are merely for convenience of describing the present disclosure, not to require that the present disclosure must be constructed and operated in a specific azimuth, and thus should not be construed as limiting the present disclosure.
In the description of the present specification, reference to the term "one embodiment," "another embodiment," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment is included in at least one embodiment of the present disclosure. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction. In addition, it should be noted that, in this specification, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present disclosure, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the present disclosure, unless explicitly specified and limited otherwise, the terms "mounted," "connected," "secured," and the like are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally formed; the device can be mechanically connected, electrically connected and communicated; can be directly connected or indirectly connected through an intermediate medium, and can be communicated with the inside of two elements or the interaction relationship of the two elements. The specific meaning of the terms in this disclosure will be understood by those of ordinary skill in the art as the case may be.
The foregoing is merely a specific embodiment of the disclosure, but the scope of the disclosure is not limited thereto. Any changes or substitutions that would be readily apparent to one of ordinary skill in the art within the scope of the present disclosure are intended to be encompassed within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (15)

1. An apparatus for managing storage space, comprising:
a first interface connected to an external request source and configured to receive a space management request from the external request source;
The second interface is connected with a memory, and the memory comprises a storage space;
an initialization module configured to: after the device is powered on, writing a plurality of storage unit indexes into a first storage area of the storage space through the second interface, wherein each storage unit index is used for representing one storage unit in a second storage area of the storage space, and each storage unit in the second storage area has one preset size in a preset size set, and the preset size set comprises at least two preset sizes which are not equal to each other;
a space management module configured to: based on the space management request, a storage unit index within the first storage area is managed via the second interface.
2. The apparatus of claim 1, wherein the writing a plurality of storage unit indexes in the first storage area of the storage space comprises:
writing at least one storage unit index into each sub-area in the first storage area, so that all storage unit indexes in each sub-area correspond to a preset size.
3. The apparatus of claim 1 or 2, wherein the space management module comprises:
And the space counting module is configured to receive a space management request and split the space management request into one or more sub-management requests when the space counting module is in an idle state, wherein each sub-management request corresponds to one preset size in the preset size set.
4. The apparatus of claim 3, wherein the space management request comprises a space allocation request and a space reclamation request, and wherein the splitting the space management request into one or more sub-management requests comprises:
responding to the space management request as a space recycling request, and splitting the space recycling request into one or more sub-recycling requests according to storage unit indexes corresponding to the space requested to be recycled by the space recycling request, wherein each sub-recycling request corresponds to one preset size in the preset size set;
responding to the space management request as a space allocation request, and splitting the space allocation request into one or more sub-allocation requests according to the size of the space requested to be allocated by the space allocation request, wherein each sub-allocation request corresponds to one preset size in the preset size set.
5. The apparatus of claim 4, wherein the spatial management module further comprises:
a space allocation module configured to receive a child allocation request from the space counting module and to read one or more storage unit indexes from the first storage area via the second interface based on the child allocation request;
and the space recycling module is configured to receive the sub recycling request from the space counting module and write a corresponding storage unit index to the first storage area through the second interface based on the sub recycling request.
6. The apparatus of claim 5, wherein,
the space allocation module comprises at least two sub-allocation modules, each sub-allocation module corresponds to one preset size in the preset size set and is configured to receive a sub-allocation request corresponding to the corresponding preset size;
the space reclamation module includes at least two sub reclamation modules, each sub reclamation module corresponding to one of the set of preset sizes and configured to receive sub reclamation requests corresponding to the corresponding preset size.
7. The apparatus of claim 6, wherein each sub-allocation module is configured to read, based on the received sub-allocation request, a storage unit index from the first storage area via the second interface according to a location pointed to by a first pointer corresponding to the sub-allocation module; and
Wherein each sub-reclamation module is configured to write a storage unit index to the first storage area via the second interface according to a location pointed to by a second pointer corresponding to the sub-reclamation module based on the received sub-reclamation request.
8. The apparatus of claim 4, wherein the splitting the space allocation request into one or more child allocation requests comprises:
the space requested to be allocated in response to the space allocation request may be completely split into a combination of one or more storage units, wherein each split storage unit has one of the set of preset sizes, splitting the space requested to be allocated by the space allocation request to determine the number of storage units having each preset size, and minimizing the number of split storage units.
9. The apparatus of claim 8, wherein the splitting the space allocation request into one or more child allocation requests further comprises:
in response to the available number of storage units of each preset size being greater than or equal to the number of storage units of such preset size determined by the splitting, one or more sub-allocation requests are sent in turn based on the split one or more storage units, wherein each sub-allocation request corresponds to a preset size of the set of preset sizes and includes the number of storage units of the preset size determined by the splitting.
10. The apparatus of claim 9, wherein the splitting the space allocation request into one or more child allocation requests further comprises:
in response to the number of available memory cells of one predetermined size being less than the number of memory cells of the predetermined size determined by the splitting, information indicative of an error is reported.
11. The apparatus of claim 8, wherein the splitting the space allocation request into one or more child allocation requests further comprises:
and responding to the space allocation request, wherein the space requested to be allocated cannot be completely split into one or more combinations of storage units, each split storage unit has one preset size in the preset size set, and information indicating errors is reported.
12. The apparatus of claim 4, wherein the spatial counting module comprises at least two index counters, each index counter corresponding to one of the set of preset sizes, and
the space counting module is further configured to:
based on the number of storage unit indexes related to the split one or more sub-reclamation requests, enabling the corresponding one or more index counters to change in a first direction;
Based on the number of storage unit indexes related to the split one or more sub-allocation requests, the corresponding one or more index counters are changed in a second direction, and the second direction is opposite to the first direction.
13. The apparatus of claim 2, further comprising:
an address register configured to store address modification data for a start address and/or a stop address of one or more sub-areas in the first storage area based on user input, and to send the address modification data to the initialization module and/or the space management module after the device is powered on.
14. A computing device comprising the apparatus for managing storage space of any of claims 1-13.
15. A method for managing storage space, comprising:
after the device is powered on, writing a plurality of storage unit indexes in a first storage area of the storage space, wherein each storage unit index is used for representing one storage unit in a second storage area of the storage space, each storage unit in the second storage area has one preset size in a preset size set, and the preset size set comprises at least two preset sizes which are not equal to each other;
Receiving a space management request from an external request source;
and managing the storage unit index in the first storage area based on the space management request.
CN202210853748.0A 2022-07-20 2022-07-20 Apparatus and method for managing storage space, and computing device Pending CN117472792A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210853748.0A CN117472792A (en) 2022-07-20 2022-07-20 Apparatus and method for managing storage space, and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210853748.0A CN117472792A (en) 2022-07-20 2022-07-20 Apparatus and method for managing storage space, and computing device

Publications (1)

Publication Number Publication Date
CN117472792A true CN117472792A (en) 2024-01-30

Family

ID=89633438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210853748.0A Pending CN117472792A (en) 2022-07-20 2022-07-20 Apparatus and method for managing storage space, and computing device

Country Status (1)

Country Link
CN (1) CN117472792A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271428A (en) * 2008-02-25 2008-09-24 北京理工大学 Apparatus and method for object data storage management
CN107608914A (en) * 2017-09-29 2018-01-19 锤子科技(北京)股份有限公司 A kind of access method, device and the mobile terminal of multichannel storage device
CN113032293A (en) * 2019-12-24 2021-06-25 北京忆芯科技有限公司 Cache manager and control component

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271428A (en) * 2008-02-25 2008-09-24 北京理工大学 Apparatus and method for object data storage management
CN107608914A (en) * 2017-09-29 2018-01-19 锤子科技(北京)股份有限公司 A kind of access method, device and the mobile terminal of multichannel storage device
CN113032293A (en) * 2019-12-24 2021-06-25 北京忆芯科技有限公司 Cache manager and control component

Similar Documents

Publication Publication Date Title
CN109983449B (en) Data processing method and storage system
CN110809760B (en) Resource pool management method and device, resource pool control unit and communication equipment
US11726701B2 (en) Memory expander, heterogeneous computing device using memory expander, and operation method of heterogenous computing
JP2000311156A (en) Reconfigurable parallel computer
JP7467593B2 (en) Resource allocation method, storage device, and storage system - Patents.com
CN104407933A (en) Data backup method and device
CN111176584A (en) Data processing method and device based on hybrid memory
AU2015402888A1 (en) Computer device and method for reading/writing data by computer device
CN115658328B (en) Device and method for managing storage space, computing device and chip
EP4002139A2 (en) Memory expander, host device using memory expander, and operation method of server system including memory expander
CN115658326B (en) Device and method for managing storage space, computing device and chip
CN113254222B (en) Task allocation method and system for solid state disk, electronic device and storage medium
WO2024051292A1 (en) Data processing system, memory mirroring method and apparatus, and computing device
WO2023169142A1 (en) Storage apparatus and related data partition management method
CN117472792A (en) Apparatus and method for managing storage space, and computing device
EP4390646A1 (en) Data processing method in distributed system, and related system
CN115658327B (en) Device and method for managing storage space, computing device and chip
CN115599705B (en) Device and method for managing storage space, computing equipment and chip
CN113778688B (en) Memory management system, memory management method, and memory management device
CN115599556B (en) Device and method for managing storage space, computing equipment and chip
CN115617707B (en) Device and method for managing storage space, computing equipment and chip
CN117472794A (en) Apparatus and method for managing storage space, and computing device
CN117472793A (en) Apparatus and method for managing storage space, and computing device
CN117971135B (en) Storage device access method and device, storage medium and electronic device
US11971771B2 (en) Peer storage device messaging for power management

Legal Events

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