WO2010021085A1 - 記憶領域管理方法、記憶領域割付方法及びプログラム - Google Patents

記憶領域管理方法、記憶領域割付方法及びプログラム Download PDF

Info

Publication number
WO2010021085A1
WO2010021085A1 PCT/JP2009/003452 JP2009003452W WO2010021085A1 WO 2010021085 A1 WO2010021085 A1 WO 2010021085A1 JP 2009003452 W JP2009003452 W JP 2009003452W WO 2010021085 A1 WO2010021085 A1 WO 2010021085A1
Authority
WO
WIPO (PCT)
Prior art keywords
size
allocation
storage area
area
main
Prior art date
Application number
PCT/JP2009/003452
Other languages
English (en)
French (fr)
Inventor
吉岡誠
國分光裕
新庄敏男
Original Assignee
株式会社エスグランツ
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社エスグランツ filed Critical 株式会社エスグランツ
Priority to EP09808021.1A priority Critical patent/EP2339471A4/en
Priority to JP2010525569A priority patent/JP4761590B2/ja
Priority to CN200980131921.9A priority patent/CN102124452B/zh
Publication of WO2010021085A1 publication Critical patent/WO2010021085A1/ja
Priority to US12/929,813 priority patent/US9164902B2/en
Priority to US14/865,977 priority patent/US9778872B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • 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/04Addressing variable-length words or parts of words
    • 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
    • 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/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device

Definitions

  • the present invention relates to a technique for managing a storage area of a storage device and allocating files and memory objects to the storage area.
  • a file system such as FAT (File Allocation Tables) or NTFS (NT File System) has been adopted.
  • FIG. 1A is a diagram for explaining partition assignment in an external storage device such as a hard disk conventionally employed.
  • a partition management table 195a storing a master boot record 195 and partition management data is arranged.
  • four partitions 1 to 4 (191, 192, 193, 194) are assigned by a utility program such as a disk allocator (not shown), and assigned to a certain file system.
  • the partition management table 195a includes entries for a partition number 196a, a start position 196b, and a partition size 196c.
  • the partition number 196a stores a partition number for identifying the partition, and is 3 in the illustrated example. Information on the top address of the section is stored at the start position, and the contents thereof are omitted in the illustrated example.
  • the partition size 196c stores the number of allocation unit areas of the partition, which is 52 in the illustrated example.
  • the disk allocation management for files in each partition is complicated because it depends on the allocation method specific to the file system to which each partition is allocated. For example, according to FAT, a link list indicating a block to which allocation is performed is held for each file. Further, according to NTFS, information about the start position of the block assigned for each file and the number of continuous blocks is held.
  • Buddy system manages the allocation by dividing each size comprising a storage area from 2 k.
  • a basic buddy system is employed for allocating memory objects in a simple system that does not use the virtual storage method.
  • FIG. 1B is a diagram illustrating the allocation principle of the buddy system.
  • the allocation area 490 is, for example, the sections 1 to 4 illustrated in FIG. 1A.
  • the tree structure 580 is a hierarchical model of the relationship of areas (extents using the terms of Patent Document 1) obtained by sequentially dividing the allocation area 490 into half the size of the allocation unit. It is. Assuming that the extent hierarchy of the allocation unit size is level 0, in the example shown in the figure, the level of the root node is 3, that is, the power of 2 which is the size of the allocation area 490.
  • the root node 480 of the tree structure 580 corresponds to the entire area (level 3 extent) before the allocation area 490 before the division, and “8” described in the node corresponds to the size of the corresponding allocation area 490. .
  • the numbers in parentheses are intra-level numbers that identify extents in the same level.
  • the node 440 connected to the root node 480 via the link 540 and the node 441 connected to the root node 480 via the link 541 correspond to an area (level 2 extent) obtained by dividing the allocation area 490 into two.
  • the size of each extent is 4 as shown in the figure.
  • node 440 Below the node 440 are a size 2 node 420 connected by a link 520 and a size 2 node 421 connected by a link 521. Similarly, a size 2 node 422 connected by a link 522 and a size 2 node 423 connected by a link 523 exist below the node 441. These four nodes correspond to level 1 extents.
  • a size 1 node 412 connected by a link 512 and a size 1 node 413 connected by a link 513 exist below the node 421, and a node 413 connected by a link 514 below the node 422.
  • the size 1 node 414 connected by the link 515 and the size 1 node 415 connected by the link 515 exist, and the size 1 node 416 connected by the link 516 and the size connected by the link 517 are below the node 423.
  • These eight nodes correspond to level 0 extents.
  • the nodes other than the root node 480 correspond to one of the extents obtained by dividing the extent corresponding to the parent node into two. Therefore, the total size of extents at each level matches the size of the allocation area 490.
  • a free extent is searched for and allocated from among extents of 2 k in size that are equal to or larger than that size, and when that file is released, that size is also freed. Since it is sufficient to return to the extent group, it is easy to allocate and release files and memory objects and manage areas.
  • the area is allocated in units of powers of 2, for example, when a 2.1 GB file is allocated, a 4 GB area is required, and data is written to the block after the file allocation.
  • a file cannot be added to the area in the conventional file system, and the area cannot be used effectively.
  • the buddy system since the area is allocated in units of power of 2, allocation and release of files and memory objects and management of the area are easy, but the area from the power of 2 size to the area not of power of 2 Since there is no management of the remaining area when acquiring the area, and management of the remaining area when acquiring the area of the power of 2 from the area that is not the power of 2 size, there is a problem that the area cannot be effectively used. is there.
  • the present invention can be applied to either a storage area that is not a power of 2 size from a storage area of a power of 2 or a storage area that is a power of 2 from a storage area that is not a power of 2 Even in this case, it is possible to manage the remaining storage area and to provide a technique capable of effectively utilizing the storage area.
  • the above-described problem is solved by dividing the acquired storage area into storage areas having different power-of-two sizes and managing them.
  • the allocation size of a partition is acquired, the sum of powers of two different from each other is calculated from the allocation size and the size of the allocation unit of the partition, and the partition is divided into the calculated two different values.
  • Each of the powers of the power is divided into areas having a product of the power of 2 and the size of the allocation unit of the section, and the section is managed for each divided section.
  • an empty space having a minimum size of a product of a power of 2 and the size of an allocation unit of a partition, including the allocation request size is accepted.
  • the storage area is acquired, a binary display of a value obtained by dividing the allocation request size by the allocation unit size of the partition is obtained, and for each received allocation request, for each bit position where bit 1 is set in the binary display.
  • a continuous storage area consisting of a storage area of the product of the power of 2 and the size of the allocation unit of the partition is allocated.
  • the storage area is managed by a combination of power-of-two sizes, it is possible to effectively manage a storage area of any size, and each of the storage areas of each power-of-two size obtained by dividing the storage area Since allocation management is performed, files and memory objects are allocated without waste to consecutive storage areas, so that the storage areas can be effectively used.
  • the “section” is an area allocated in advance as described with reference to FIG. 1A and is an area allocated first. In the present invention, it is assumed that the section has been acquired.
  • An “area” is an allocated or allocated area. Since a partition is a pre-allocated region, it is one of the zones and is a specific one of the zones. Dividing the area into a plurality of areas having the size of the product of the power of 2 and the assigned unit area is called “multi-layer division”. A multi-layered area is referred to as a “multi-layer area”. In the following description, reference to the allocation unit area is omitted, and the notation of the area size may be simply a notation such as a size of 2n.
  • vision means that an area is assigned or an area is divided and assigned, and is sometimes called “assignment”.
  • the division size of the region at this time is defined by different power-of-two sizes, but is allocated in order of size from the top of the region.
  • a region is an area or section. In particular, dividing the section is called “main section”.
  • main section the area assigned by the main division is called “main area”.
  • the main division is an initial allocation for a partition.
  • the power of 2 of the area or the allocation size of the main area by the section or the main section is referred to as “section level”. Referring to the tree structure 580 shown in FIG. 2, for example, the size of the extent of the level 3 corresponding to the node 441 is 4, so the partition level is 2.
  • a partition is divided into main sections, and the sections are managed for each main section.
  • an allocation request for an area including the allocation request size is received, and an area having a minimum size of the product of the power of 2 including the allocation request size and the size of the allocation unit of the partition is obtained. Further, the sum of different powers of 2 is calculated from the allocation request size and the size of the allocation unit of the partition, and the area that has received the allocation request is determined for each of the calculated different powers of power of 2.
  • a multi-layer area divided into multi-layer areas having a product of the power of 2 and the size of the allocation unit of the section is defined as a use area, and the remaining areas other than the use area of the acquired areas are defined as the remaining areas.
  • the product of the power of 2 and the size of the allocation unit for each of the powers of the different powers of 2 when the size is a product of the sum of different powers of 2 and the size of the allocation unit of the partition.
  • Storage device area management and area allocation and release processing are performed using a data storage device 308 by a data processing device 301 including at least a central processing unit 302 and a cache memory 303 shown in the figure.
  • the data storage device 308 includes an allocation division table 208, which will be described later, and an acquired partition 211 that is a management target.
  • the data storage device 308 can be realized by the main storage device 305, the external storage device 306, or a combination thereof, or a device disposed at a distance connected via the communication device 307. It is also possible to use.
  • the main storage device 305 can be the one in the data processing device 301, the allocation partition table 208 is held in the main storage device 305, and the partition 211 is often assigned to the external storage device 306.
  • the present invention is applicable even when the partition 211 is assigned to the main storage device 305.
  • the main storage device 305, the external storage device 306, and the communication device 307 are connected to the data processing device 301 by a single bus 304, but the connection method is not limited to this.
  • the value 3 stored in the partition number 196a is referred to as the partition number 196a, and the value stored or set in the storage region is the name of the storage region. Sometimes called.
  • the allocation size of a partition is acquired, the sum of different powers of two is calculated from the allocation size, the partition is mainly divided into main areas of the calculated different powers of two powers, The division is managed for each divided main area.
  • a utility program such as the disk allocator (not shown) described above, and it is sufficient that even the start position and size of the partition are given.
  • FIG. 3A is a diagram for explaining a concept of managing acquired partitions by main classification (initial allocation) in Embodiment 1 of the present invention.
  • FIG. 3A illustrates the relationship between the section size 220 of the acquired section 211 and the main sections 1 to 3 (81a, 82a, 83a).
  • the acquired section 211 can be, for example, the section 3 (193) shown in FIG. 1A.
  • a partition size of an arbitrary size can be expressed as a sum of powers of two different from each other, when the partition size is expressed as a sum of powers of two different from each other, there is a power in the sum
  • the size of the partition size is represented by a binary number display in which bit 1 is stored at the position of the multiplier to be performed (hereinafter sometimes referred to as a significant bit position) and bit 0 is stored at the position of the other power multiplier.
  • the partition size is not equal to the power of 2, and the acquired partition 211
  • Main areas 1 to 3 (81a, 82a, 83a) having power-size are allocated.
  • FIG. 3B shows an allocation division table 208 that manages the acquired division 211 that has performed the main division shown in FIG. 3A.
  • the allocation classification table 208 has an entry for each allocated main area, and each entry includes items of a main area number 205, an allocation position 202, and an allocation size 203.
  • the allocation position 202 stores the position information of the acquired section 211, and the allocation position 202 of the main area 1 with the main area number 1 has a value of the start position 219 (hereinafter may be referred to as a start position). However, 25 is stored in the allocation size 203. Similarly, the starting position in the allocation position 202 of the main section 2 +2 5, 2 4 is stored in the allocation size 203, the starting position in the allocation position 202 of the main section 3 +2 5 +2 4, the allocation size 203 2 2 is stored.
  • the division is set to the power of 2. Therefore, it is possible to adopt a buddy system method for each of the initially assigned main areas, and it is possible to efficiently use the acquired sections.
  • FIG. 3C is a diagram for explaining an example of a processing flow for mainly dividing a partition according to Embodiment 1 of the present invention.
  • the main classification process is, for example, a process of setting values in the allocation classification table 208 shown in FIG. 3B, for example. Below, it demonstrates with reference to the allocation division table 208 as an example.
  • step S201 a value obtained by binary display of the section size of the acquired section given to the allocation bitmap is set.
  • the allocation bitmap is an image of the partition size 220 shown in FIG. 3A.
  • the allocation bitmap is a work area (not shown). Also in the following description, in order to simplify the notation, there is a case where “X is set to X” without particularly saying that it is the work area name X.
  • step S202 the start position of the section is set as the allocation position.
  • step S203 an initial value is set for the main area number.
  • step S204 the most significant bit position of the assigned bit position is set as the bit position. In the example shown in FIG. 3A, 5 is set in the bit position.
  • step S205 the bit value pointed to by the bit position is extracted from the assigned bitmap, and it is determined whether the extracted bit value is 1 in step S206a. If the bit value is 1, the process proceeds to step S207a, and the value of the power of 2 at the bit position is set as the allocation size.
  • step S207b a power value of 2 is set, in which the value set in the allocation position in the allocation position 202 and the value set in the bit position in the allocation size 203 is a power multiplier in the allocation classification table 208 indicated by the main area number.
  • a power value of 2 is set, in which the value set in the allocation position in the allocation position 202 and the value set in the bit position in the allocation size 203 is a power multiplier in the allocation classification table 208 indicated by the main area number.
  • an initial value of 1 is set for the main area number 205
  • a start position is set for the allocation position 202
  • 25 is set for the allocation size 203.
  • step S208 it is determined whether the bit position is the least significant bit position. If it is the least significant bit position, the process ends. If it is not the least significant bit position, the process proceeds to step S209a. Set the value with the size added. In step S210, 1 is added to the main area number, and in step S211, the value set in the bit position is decreased by 1, and the process returns to step S205.
  • step S206a determines whether the bit position is the least significant bit position, and if it is the least significant bit position, the process is terminated. If it is not a lower bit position, the process proceeds to step S211.
  • the loop process from step S205 to step S211 is repeated until the bit position becomes the least significant bit position, and the process ends when the bit position becomes the least significant bit position.
  • the main division of the acquired section is completed by the above processing.
  • an acquisition request for an area including an allocation request size different from the power-of-two size from the request source is received, and the area of the minimum power-of-two size (assignment division level) including the allocation request size is buddyed. It is acquired by the system allocation process, and unused areas are released by the buddy system allocation process, whereby the used areas corresponding to the allocation request size are acquired as continuous areas of different division levels.
  • the acquisition of the above-mentioned allocation division level area can be performed from the main area that is mainly divided from the division in the first embodiment, but is not limited thereto.
  • FIG. 4A is a diagram illustrating a concept of acquiring an area having an allocation request size and releasing an unused area in the second embodiment of the present invention.
  • the relationship between the allocation request size 20a which is not equal to the power-of-two size and the area 80 acquired based thereon and the areas 1 to 4 (81b, 83b, 84c, 82c) obtained by dividing the acquired area 80 into multiple layers ) Is shown.
  • the allocation process 23 by the buddy system indicates that the allocation division level 44a is a power of 2 with 4 being a power of 2.
  • Area 80 is obtained.
  • Arbitrary existing buddy system allocation processing can be adopted to acquire the area 80. An example of allocation processing by the buddy system in the second embodiment will be described later with reference to FIGS. 6 and 5B. To do.
  • each bit value of the allocation request size 20a and the areas 1 to 4 (81b, 83b, 84c, 82c) is as shown by solid arrows 71b, 73b and dotted arrows 73c, 72c. That is, the allocation request size 20a that positions of significant bits of the most significant is 3, 2 3 is the size of the zone 1 (81b) is divided in response to being split assignment, the next bit position 2 it bit value is 0, 2 2 size area 2 (82c) corresponds to being split assignment.
  • FIG. 4B is a diagram illustrating an example of an allocation state of extents at each partition level according to the second embodiment of the present invention.
  • the extent allocation state and level number tree shown in FIG. 4B shows the extent allocation state 1 or 0 obtained by dividing the extent corresponding to the acquired area 80 shown in FIG. 4A by half (buddy division).
  • the classification levels 4 to 1 are shown.
  • Allocation state 1 corresponds to a closed state
  • allocation state 0 corresponds to an empty state.
  • the empty state is a state where the extent can be allocated
  • the closed state is a state where it is unknown whether all or a part of the extent can be allocated by itself.
  • the solid line connecting the allocation status of the upper category and the allocation status of the lower category indicates the relationship of extent buddy division for each allocation status.
  • In-level numbers are shown as starting from number 0.
  • the allocation state 616 of the division level 4 is that of the extent corresponding to the area 80, and 1 is set.
  • the one with level number 0 is that of the extent corresponding to area 1 (81b), and 1 is set, and the allocation status of the extent of the sub-division that is buddy divided All are set to 1.
  • those with an intra-level number 4 are those of extents corresponding to the area 3 (83b), and those with an intra-level number 5 are those of extents corresponding to the area 4 (84c). is there. 1 and 0 are set in correspondence with the use area and the non-use area, respectively.
  • the one with the in-level number 3 is the extent corresponding to the area 2 (82c), and 0 is set.
  • the extent number 3 in the division level 2 can be used as an empty state by buddy division.
  • the allocation state of the in-level numbers 6 and 7 of the division level 1 to 1, when searching for the empty extent of the division level 1 in the allocation state shown in FIG. 4B, the empty extent of the in-level number 5 is preferentially acquired. Is done. Therefore, the extent with the in-level number 3 of the partition level 2 can be left as an empty extent in order to search for an empty extent of the partition level 2 thereafter.
  • the allocation state is represented as a tree in FIG. 4B, but it is clear that the allocation state can be held in a bitmap in a continuous area.
  • the buddy system according to the second embodiment will be described with reference to FIGS. 5A to 5C.
  • the buddy system in the second embodiment will be described as performing the allocation and release of extents in the main area constituting the main section partitioned in the first embodiment, that is, given the main area number.
  • the present invention is not limited to this, and it is also possible to perform allocation release of extents of power-of-two sizes.
  • FIG. 5A is a diagram illustrating an example of a process flow for initializing the buddy system in the present embodiment.
  • step S501 the division level corresponding to the allocation size of the main area indicated by the main area number is set as the division level.
  • an initial value (for example, value 0) is set as the intra-level start number, and in step S503, the intra-level start number is set as the intra-level end number.
  • step S504 an empty state is set in the allocation state indicated by the in-level start number of the division level, and the process proceeds to step S505.
  • the empty state is set in the allocation state 616 of the division level 4.
  • the selection of the main area from which the area is acquired will be described later with reference to FIG.
  • the in-level numbers shown in FIG. 4B are generalized as in-level start numbers + assignment numbers.
  • the in-level start number is an arbitrary number
  • the allocation number is an offset from the in-level start number. Accordingly, if the in-level start number is 0, the in-level number and the assigned number have the same value.
  • step S505 it is determined whether the partition level is the lowest partition level. If it is the lowest division level, the initialization is completed and the process is terminated. If it is not the lowest division level, the process proceeds to step S506.
  • step S506 the value 1 is decreased from the division level.
  • step S507 the in-level start number is set as the allocation number, and in step S508, the value obtained by adding the value 1 to the value obtained by doubling the in-level end number is set.
  • step S509 the closed state is set in the allocation state indicated by the allocation number of the division level.
  • step S510 it is determined whether the allocation number is equal to the intra-level end number. If the allocation number is equal to the in-level end number, the process returns to step S505. If not equal, 1 is added to the allocation number in step S511, and the process returns to step S509.
  • the above-described processing from step 505 to step S511 is to set the closed state to the extent allocation state in which the main area is buddy divided.
  • the end number in the level is calculated in step 508 every time it goes through the processing loop with the initial values 0 to 1, 3, and 7, and the level from the start number 0 in the level of division level 3 to division level 1
  • the closed state is set to the assigned state indicated by the assigned number (number within the level) up to the inner end number.
  • the above-described empty state and blockage state can be set at bit positions corresponding to the extents that are divided by buddy in the bitmap representing the allocation state.
  • the buddy system of this embodiment is in the initial state.
  • the extent corresponding to the main area is made empty, and the extent that is substantially empty obtained by buddy-dividing the extent corresponding to the main area is made closed.
  • a blocked extent may or may not be usable.
  • FIG. 5B is a diagram illustrating an example of a processing flow for acquiring an empty extent by the buddy system in the present embodiment. It is assumed that the buddy system has been initialized by the initialization process described with reference to FIG. 5A before the empty extent is first acquired.
  • step S521 a division level corresponding to the allocation size of the main area indicated by the main area number is set in the main division level, and an allocation division level is set in the division level.
  • the allocation classification level is the classification level of the empty extent acquired by the buddy system. In the example shown in FIG. 5A, 4 is set.
  • step S522 an empty area in the division level is searched, and in step S523, it is determined whether there is an empty division level. If there is no space, the process branches to step S524 to determine whether the partition level indicates the main partition level, that is, the size of the main section. If it indicates the main division level, the process ends as an acquisition failure, and if it does not indicate the main division level, the process proceeds to step S525, and the value 1 is added to the division level, and the process returns to step S522.
  • step S523 it is determined whether the classification level is the allocation classification level. If the allocation level is the allocation classification level, the process ends. If it is not the allocation classification level, the process branches to step S528.
  • step S528 the value 1 is reduced from the division level, and the process proceeds to step S529 to double the allocation number.
  • the processing in step S528 and step S529 corresponds to buddy division processing.
  • step S530 an empty state is set to the assignment state indicated by the assignment number of the division level, and in step S531, an assignment number (hereinafter also referred to as a buddy) that forms a pair of the division level assignment number and the buddy division.
  • An empty state is set as the assigned state, and the process returns to step S522. That is, an empty state search is performed with the allocation state of two extents obtained by buddy division as an empty state.
  • the allocation state of the empty extent searched in step S526 is set to the closed status, and the allocation status of the buddy is set to the empty status until the segment level becomes the allocation category level, and the allocation extent level empty extent is obtained. To do.
  • FIG. 5C is a diagram illustrating an example of a processing flow for releasing an acquired extent by the buddy system in the present embodiment.
  • a partition level corresponding to the allocation size of the main section indicated by the main section number is set as the main section level, and a release section level is set as the section level.
  • the release division level is the division level of the extent that is closed by the buddy system.
  • the release division level is 3 corresponding thereto, and 3 is set as the division level.
  • an allocation number in a release section level that specifies a closed extent to be released is given as a release number.
  • step S543 it is determined whether the division level indicates the main division level. If it indicates the main partition level, the partition level corresponds to the root node, and there is no buddy, so the process branches to step S548, sets the empty state to the allocation state pointed to by the partition level release number, and ends the processing.
  • step S543 determines whether the partition level does not indicate the main partition level. If it is determined in step S543 that the partition level does not indicate the main partition level, the process proceeds to step S544, and it is determined whether the allocation state pointed to by the buddy of the partition level release number is empty. If it is not empty, the process proceeds to step S548 described above. If it is empty, the process branches to step S545.
  • step S545 the closed state is set to the allocated state pointed to by the buddy of the division level release number.
  • step S546 1 is added to the division level.
  • step S547 the quotient obtained by dividing the release number by 2 is set in the release number, and the process returns to step S543.
  • step S543 to step S547 is repeated until the partition level indicates the main partition level or the allocation number indicated by the buddy of the partition level release number is closed, and finally the allocation indicated by the partition level release number.
  • the allocation area release processing is completed. That is, in the process shown in FIG. 5D, if the allocation state pointed to by the buddy with the release number is empty, the allocation state of the pair pointed to by the release number and the buddy is both closed, and the allocation state pointed to by the buddy at the upper division level An empty state is set in the allocation state indicated by the release number when the block is closed or when the partition level indicating the main partition level is reached.
  • an allocation division level area in Embodiment 2 of the present invention is obtained, and the area is divided into multiple layers.
  • the use area corresponding to the allocation request size is a series of different division level areas. The process of acquiring the area and releasing the remaining unused area by the buddy system allocation process will be described with reference to FIGS. 6 to 7B.
  • FIG. 6 is a diagram illustrating an example of a processing flow for acquiring an area at the allocation request classification level in the present embodiment.
  • the allocation request section level area is acquired prior to acquiring the allocation request size area, and the process of acquiring the allocation request size area described later with reference to FIGS. 7A and 7B. It is a part of it.
  • the area of the allocation request classification level is acquired from the acquired section 211 shown in FIG. 3A, for example.
  • description will be made with reference to the allocation division table 208 shown in FIGS. 3A and 3B.
  • step S601 the lowest main area number of the allocation division table is set as the main area number.
  • 3 is set as the main area number of the allocation division table 208. That is, the acquisition process of the area of the allocation request size is started from the main area of the smallest size.
  • step S602 the allocation size of the allocation classification table indicated by the main area number is read, and in step S603, it is determined whether the read allocation size is smaller than the allocation request size. If it is smaller, the process branches to step S606.
  • the value 4 of the allocation size 203 with the main area number 205 being 3 is smaller than the allocation request size, and the process proceeds to step S607 via step S606. 2 is set as the next main area number.
  • step S603 determines whether the allocation size is smaller than the allocation request size. If it is determined in step S603 that the allocation size is not smaller than the allocation request size, the process proceeds to step S604, where an area at the allocation request classification level is obtained from the main area indicated by the main area number, and an allocation number is obtained. Details of step S604 have been described above with reference to FIG. 5B.
  • step S605 it is determined whether an area at the allocation request category level has been acquired in step S604. If the area of the allocation request category level has been acquired, the process branches to step S608, where the main area number, the allocation category level, and the allocation number are set in the acquisition result of the allocation category level area, and the process is terminated.
  • step S604 If it is determined in step S604 that an area at the allocation request category level has not been acquired, the process advances to step S606 to determine whether the main area number is the highest number. If the main area number is the highest number, the process ends as an acquisition failure. If the main area number is not the highest number, the next main area number is set as the main area number in step S607 and the process proceeds to step S602. Return.
  • step S602 The loop processing from step S602 to step S607 is repeated until the area of the allocation request classification level is acquired while updating the main area number, and the area of the allocation request classification level even if the main area number is the highest number. If it cannot be acquired, the process ends as an acquisition failure.
  • the allocation request size is 10
  • the allocation size of the main area 3 (83a) is 4, and the allocation size of the main area 2 (82a) is 16.
  • the allocation division level area in step S604 is acquired from the main area 2 (82a), and the acquisition fails, the acquisition of the allocation division level area from the main area 1 (81a) is attempted next. Since the size of the main area 2 (82a) is 16, and the size of the main area 1 (81a) is 32, the allocation number of the area at the allocation division level to be acquired is 0 or 1.
  • FIG. 7A is a diagram for explaining the former stage of the processing flow example for acquiring the area of the allocation request size in the second embodiment.
  • This preceding process is a process for acquiring an area at the allocation category level.
  • step S701 a value obtained by displaying the allocation request size in binary in the allocation bitmap.
  • the allocation bitmap is an image of the allocation request size 20a shown in FIG. 4A.
  • the allocation request size is assumed to be given from the request source.
  • step S702 the lowest bit position where the bit value of the assigned bitmap is 1 is set in the lowest bit position. In the example shown in FIG. 4A, 1 is set to the least significant bit position.
  • step S703 the most significant bit position where the bit value of the assigned bitmap is 1 is set in the most significant bit position.
  • 3 is set to the most significant bit position.
  • step S704 it is determined whether the most significant bit position matches the least significant bit position. If they match, the process branches to step S705.
  • the allocation request size 20a is equal to the power-of-two size, and there is only one bit position where bit 1 stands in the allocation bitmap set in step S701. . Therefore, in the following description, an allocation request equal to the power of 2 size is sometimes referred to as a single bit request.
  • step S705 If the process branches from step S704 to step S705, the most significant bit position is set in the allocation division level in step S705. In this case, the size of the allocation division level is equal to the allocation request size.
  • step S706 an area at the allocation division level is acquired by the process described with reference to FIG. 6, and a main area number and an allocation number are obtained.
  • the main area number here is the one set in step S601 or step S607 in FIG.
  • the allocation number is set in step S526 of the processing flow example in FIG. 5C called in step S604.
  • step S707 it is determined whether the allocation classification level, that is, the area of the allocation request size, has been acquired in the process of step S706. If not acquired, the process ends as an acquisition failure. If the area of the allocation request size has been acquired, in step S707a, the value obtained by adding the allocation number to the start number in the level is set in the intra-level number, and in step S707b, the main area number and allocation category are set in the acquisition result. Set the level and number within the level, and finish the process.
  • the allocation classification level that is, the area of the allocation request size
  • a value obtained by adding value 1 to the most significant bit position is set to the allocation division level in step S708, and the process proceeds to step S709. .
  • 4 is set as the allocation division level 44a.
  • bit 1 stands at a plurality of bit positions of the allocation bitmap set in step S701
  • an allocation request with an allocation request size that is not equal to a power-of-two size is called a multi-bit request. There is.
  • step S709 similarly to step S706, the area of the allocation division level is acquired by the process described with reference to FIG. 6, and the main area number and the allocation number are obtained.
  • step S710 it is determined whether an area of the allocation category level has been acquired in the process of step S709. If not acquired, the process ends as an acquisition failure, and if acquired, the process proceeds to step S711 shown in FIG. 7B. .
  • FIG. 7B is a diagram illustrating the latter part of the example of the processing flow for acquiring the area of the allocation request size in the multi-bit request according to the second embodiment.
  • the subsequent process is a process of acquiring an area having an allocation request size as a used area by releasing an unused area from the acquired allocation division level area.
  • step S711 a value obtained by doubling the allocation number obtained in step S709 is set in the allocation number, and in step S712, the most significant bit position is set in the bit position.
  • the allocation number is 0 or 1
  • the most significant bit position is 3, so 0 or 1 is set as the allocation number and 3 is set as the bit position.
  • step S713 the bit value pointed to by the bit position is extracted from the assigned bitmap, and it is determined whether the extracted bit value is 1 in step S714. If it is 1, the process proceeds to step S718, and if 0, step S715 is performed. Proceed to In step S715, the bit position is set in the release section level, and the flow advances to step S716 to set a value obtained by adding 1 to the allocation number in the release number.
  • step S717 the release number level area is released from the main area indicated by the main area number by the process described with reference to FIG. 5D.
  • step S717a the assignment number is doubled to the assignment number. The set value is set, and the process proceeds to step S720.
  • step S718 it is determined whether the bit position is the least significant bit position. If it is the least significant bit position, the process proceeds to step S721. If it is not the least significant bit position, the process branches to step S719 and 1 is added to the allocation number. Is set to a value twice, and the process proceeds to step S720. In step S720, 1 is subtracted from the bit position, and the process returns to step S713.
  • the allocation number of the area of allocation classification level 4 obtained in step S709 is 0 or 1 as described above. Therefore, after the allocation number of the division level 3 zone 1 (81b) obtained by buddy dividing the allocation division level zone is set to 0 or 2 in step S711, the first bit position 3 processing branches from step S718 to step S719. The allocation number is 2 or 6, and the bit position is 2. In the second process, since the bit value at bit position 2 is 0, the process proceeds to step S715. Then, 2 is set to the release section level and 3 or 7 is set to the release number.
  • zone 2 (82c) at zone 3 release level 3 is released and zone 1 (81b) at zone level 3 is assigned 2 If there is, the area 2 (82c) of the release number 7 of the division level 2 is released in the same manner.
  • step S718 determines whether the bit position is the least significant bit position. If it is determined in step S718 that the bit position is the least significant bit position, the process proceeds to step S721, where the bit position is set in the release section level, and in step S722, the value obtained by adding 1 to the allocation number is set. Set. In step S723, the area having the release number at the release section level is released from the main area indicated by the main area number by the process described with reference to FIG. 5D.
  • bit position 1 is the least significant bit position and the allocation number is 4 or 12 in the processing of step S717a of bit position 2
  • 1 is set as the release section level. Is set to 5 or 13. Therefore, if the assignment number of the division level 3 area 1 (81b) is 0, the division level 1 release number 5 area 4 (84c) is released, and the division level 3 area 1 (81b) assignment number is If it is 2, the area 4 (84c) of the release number 13 of the division level 1 is released in the same manner.
  • step S724 a value obtained by adding the allocation number to the intra-level start number is set in the intra-level number, and in step S725, the main area number, the allocation classification level, Set the in-level number and finish the process.
  • the allocation division level set here is the one set in step S708 of FIG. 7A.
  • FIG. 8A is a diagram illustrating the first stage of a processing flow example for releasing an area (usage area) of the acquired allocation request size according to the second embodiment.
  • the acquisition result of the allocation request size area described with reference to FIG. 7B can be included in the release request, and the allocation request size can also be included in the release request.
  • step S801 a value obtained by subtracting the in-level start number from the in-level number is set in the release number, and the allocation division level is set in the release division level.
  • step S802 an allocation request is made to the allocation bitmap.
  • step S803 the lowest bit position where the bit value of the assigned bitmap is 1 is set in the lowest bit position. In the example shown in FIG. 5A, 1 is set to the least significant bit position.
  • step S804 the most significant bit position where the bit value of the assigned bitmap is 1 is set in the most significant bit position.
  • step S805 it is determined whether the most significant bit position matches the least significant bit position. If they match, the process branches to step S806. In this case, the allocation request size 20a is equal to the power of 2 size, and the allocation request is a single bit request. In step S806, the area pointed to by the release number of the release section level is released from the main area pointed to by the main area number by the process described with reference to FIG. 5D, and the process ends.
  • step S805 determines whether the most significant bit position matches the least significant bit position. If it is determined in step S805 that the most significant bit position does not match the least significant bit position, the process proceeds to step S807 shown in FIG. 8B.
  • FIG. 8B is a diagram for explaining the latter part of the processing flow example for releasing the area (usage area) of the acquired allocation request size in the second embodiment.
  • the subsequent processing is processing for releasing the use area of the multi-bit request.
  • step S807 the value obtained by doubling the release number is set in the release number (assignment number) in step S807, and the most significant bit position is set in the bit position in step S808.
  • step S809 the bit value pointed to by the bit position is extracted from the assigned bitmap.
  • step S810 it is determined whether the extracted bit value is 1. If the bit value is not 1, in step S811, a value obtained by doubling the release number is set in the release number, and the process proceeds to step S814. If the bit value is 1, in step S813, the bit position and the release number are written to the stack, and in step S814, a value obtained by doubling the value obtained by adding the value 1 to the release number is set in step S814. The process proceeds to S814.
  • step S814 it is determined whether the bit position is the least significant bit position. If it is not the least significant bit position, 1 is decremented from the bit position in step S815, and the process returns to step S809. If it is the least significant bit position, it is determined in step S816 whether the stack is empty. If it is empty, the process ends. If it is not empty, the process proceeds to step S817, and the bit position and release number are extracted from the stack. In step S818, the bit position extracted in step S817 is set to the release section level. Then, by the process described with reference to FIG. 5C in step S819, the area of the release number at the release section level is released from the main area indicated by the main area number, and the process returns to step S816. By repeating the loop processing from step S816 to step S819 described above until the stack becomes empty, release of the area of the allocation request size is completed.
  • step S801 When releasing the use area of the allocation request size illustrated in FIG. 4A, 0 or 1 is set to the release number in step S801, and 0 or 2 is set to the release number in step S807.
  • step S808, 3 is set as the bit position, and bit position 3 and the release number 0 or 2 are initially set in the stack. After the release number is incremented by 1 and doubled and updated to 2 or 6, the release number is further doubled and updated to 4 or 12 in the processing of bit position 2. In the processing at bit position 1, bit position 1 and release number 4 or 12 are written to the stack.
  • bit position 1 and release number 4 or 12 are taken from the stack, the release partition level is set to 1, and the area of release number 4 or 12 is released. If the allocation number of zone 1 (81b) at division level 3 is 0, zone 3 (83b) at zone 4 (release level 4) is released, and zone 1 (81b) at zone 3 is assigned 2 If there is, the area 3 (83b) of the release number 12 of the division level 1 is released in the same manner. Subsequently, bit position 3 and release number 0 or 2 are extracted from the stack, the release section level is set to 3, and the area of release number 0 or 2 is released. That is, the section 1 (81b) of the section level 3 is released. As a result of the above processing, the area 1 (81b) and the area 3 (83b) constituting the use area are released.
  • the area is divided into areas equal to the power of 2
  • it is possible to manage each area so that it is possible to adopt the buddy system method for each area, and it is possible to efficiently use the acquired area.
  • a surplus area larger than the size requested by the request source can be managed as an unused area and used effectively.
  • the third embodiment corresponds to a modification of the second embodiment described above.
  • Accepts an acquisition request for an area including an allocation request size different from the power-of-two size from the request source acquires an area of the smallest power-of-two size (assignment classification level) that includes the allocation request size,
  • the used area corresponding to the allocation request size is acquired as a continuous area of areas of different division levels by being released by the allocation process of the buddy system.
  • the division level is updated by a buddy system corresponding to one main area, as described with reference to the processing flow examples shown in FIGS. 5B and 6. While searching for an empty extent, if no empty extent is found in the buddy system, the main area number is updated, and the buddy system corresponding to the main area of the main area number finds an empty extent to search for an empty extent.
  • empty extents are searched across different main areas, and when no empty extents are found in all main areas, the partition level is updated. , Repeatedly searching for empty extents across different main areas at that partition level .
  • the third embodiment of the present invention will be described with reference to FIG. 9 and FIG. 10 and different portions from the second embodiment of the present invention.
  • the difference between the second embodiment and the third embodiment is the procedure for obtaining the allocation division level areas for the different main areas. Therefore, among the embodiments 2 described with reference to FIGS. 4A to 8B, the portions different from the embodiment 3 are described with reference to the portions described with reference to FIGS. 5B and 6 and the related FIG. 4A. Is the part of the acquisition of the area of the assigned division level. Therefore, an example of a processing flow of the third embodiment corresponding to FIGS. 5B and 6 of the second embodiment will be described.
  • FIG. 9 is a diagram illustrating an example of a processing flow for acquiring an area at the allocation division level according to the third embodiment of the present invention.
  • the process flow example shown in FIG. 9 corresponds to the process flow example in the second embodiment of the present invention shown in FIG.
  • step S900 an allocation division level is set as the division level.
  • step S901 the lowest main area number in the allocation division table is set as the main area number.
  • 3 is set as the main area number. That is, the acquisition process of the area of the allocation request size is started from the main area of the smallest size.
  • step S902 a division level corresponding to the allocation size of the main area indicated by the main area number is set in the main division level.
  • step S903 it is determined whether the division level is greater than the main division level set in step S902. If it is not larger, the process proceeds to step S904, where an area at the allocation request classification level is acquired from the main area indicated by the main area number, and an allocation number is obtained. Details of step S904 will be described later with reference to FIG.
  • step S905 it is determined whether an area of the allocation request category level has been acquired in step S904. If the allocation requested division level area has been acquired, the process branches to step S908 to set the main area number, the allocation division level, and the allocation number in the acquisition result of the allocation division level area, and the process is terminated. If the area at the allocation request category level has not been acquired in the process of step S904, the process proceeds to step S906. If it is determined in step S903 that the division level is higher than the main division level set in step S902, the process proceeds to step S906.
  • step S906 it is determined whether the main area number is the highest number. If the main area number is not the highest number, the process proceeds to step S907, the next main area number is set as the main area number in step S907, and the process returns to step S902.
  • the loop processing from step S902 to step S907 described above is processing for searching for empty extents across different main areas for the same division level described above.
  • step S906a it is further determined whether the division level indicates the main division level. If the main division level is indicated, the processing ends as an acquisition failure and must be at the main division level. For example, the value 1 is added to the division level in step S907a, and the process returns to step S901.
  • the loop processing that returns from the determination processing in step S906a to step S901 through step S907a described above is processing for updating the division level and searching for an empty extent over different main areas at the division level.
  • the above double loop process is repeated until the allocation required division level area is acquired while updating the main area number and the division level, and the allocation request division level area can be acquired even if the division level is the main division level. If not, the process ends as an acquisition failure.
  • FIG. 10 shows a detailed flow example of the processing in step S904 shown in FIG. 9, and is a diagram for explaining a processing flow example for acquiring an empty extent in the third embodiment of the present invention.
  • the processing flow example shown in FIG. 10 corresponds to the processing flow example in the second embodiment of the present invention shown in FIG. 5B.
  • step S1022 an empty area in the division level is searched.
  • the division level is set in step S900 or step S907a shown in FIG.
  • step S1023 it is determined whether there is an empty classification level. If there is no space, the process ends as an acquisition failure.
  • step S1023 it is determined whether the classification level is the allocation classification level. If the allocation level is the allocation classification level, the process ends. If it is not the allocation classification level, the process branches to step S1028.
  • step S1028 the value 1 is decreased from the division level, and the process proceeds to step S1029 to double the allocation number.
  • the processes in steps S1028 and S1029 correspond to the buddy division process as in the second embodiment.
  • step S1030 an empty state is set in the assignment state indicated by the assignment number of the division level.
  • step S1031 an empty state is set in the assignment state indicated by the assignment number (buddy) that forms a pair of the assignment number of the division level and the buddy division.
  • step S1022 that is, an empty state search is performed with the allocation state of two extents obtained by buddy division as an empty state.
  • the allocation state of the empty extent searched in step S1026 is set to the closed status, and the allocation status of the buddy is set to the empty status until the allocation level reaches the allocation category level, and an allocation extent level empty extent is obtained. To do.
  • a desired partition level empty extent in one main area for example, a small main area
  • a desired partition level empty extent in another main area for example, a large main area. Can be obtained from another main area without buddy partitioning an empty extent of a partition level larger than the desired partition level of the smaller main area.
  • the storage area management method, storage area allocation method, storage area release method, and equivalents thereof according to the embodiments of the present invention described above can be realized by a program that causes a computer to execute them. is there. Therefore, the program and a computer-readable storage medium storing the program are also included in the embodiment of the present invention. It is also apparent that the execution means of each process of the storage area management method, storage area allocation method, and storage area release method according to the embodiment of the present invention is realized on a computer by the above program. Therefore, it is apparent that the storage area management apparatus, the storage area allocation apparatus, and the storage area release apparatus are realized by the program and the computer.

Landscapes

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

Abstract

2のべき乗サイズの記憶領域から2のべき乗サイズではない記憶領域を取得した場合でも、2のべき乗サイズではない記憶領域から2のべき乗サイズの記憶領域を取得した場合でも、残りの記憶領域を管理することが可能であり、記憶領域を有効活用する技術を提供する。記憶装置の記憶領域管理方法において、取得した記憶領域を異なる2のべき乗サイズの記憶領域に分割してそれぞれ管理する。また、割付要求サイズを含む記憶領域の割付要求を受付け、割付要求サイズを包含する、2のべき乗の最小のサイズの空記憶領域を取得し、割付要求サイズの2進数表示を求め、受け付けた割付要求に対して、該2進数表示でビット1の立っているビット位置毎の2のべき乗の大きさの記憶領域からなる連続した記憶領域を割り付ける。

Description

記憶領域管理方法、記憶領域割付方法及びプログラム
 本発明は、記憶装置の記憶領域を管理し、記憶領域にファイル及びメモリオブジェクトの割付を行う技術に関する。
 従来から、ハードディスク等の記憶装置に記憶するデータを管理するための方式として、例えばFAT(File Allocation Tables)やNTFS(NT File System)等のファイルシステムが採用されている。
 図1Aは、従来から採用されているハードディスク等の外部記憶装置における区画割付を説明する図である。
 図1Aに示すように、例えば外部記憶装置306の記憶領域の先頭には、マスターブートレコード195と区画の管理データを格納した区画管理テーブル195aが配置されている。更に図示しないディスクアロケータ等のユーティリティプログラムにより4つの区画1~4(191,192,193,194)が割り付けられ、それぞれあるファイルシステムに割り当てられている。図1Aに区画番号3についての区画情報196が例示されているように、区画管理テーブル195aは、区画番号196a、開始位置196b、区画サイズ196cのエントリを含んでいる。区画番号196aには、区画を識別する区画番号が格納されており、図示の例では3である。開始位置には、区画の先頭アドレスの情報が格納されており、図示の例ではその内容は省略している。区画サイズ196cには、区画の割当単位領域の個数が格納されており、図示の例では52である。
 各区画におけるファイルに対するディスクの割付管理は、それぞれの区画が割り当てられたファイルシステム特有の割付方法に依存するため煩雑であった。例えば、FATによれば、割付を行ったブロックを示すリンクリストをファイルごとに保持している。また、NTFSによれば、ファイルごとに割付を行ったブロックの開始位置及び連続するブロック数についての情報を保持している。
 これらのファイルシステムにおける割付管理の問題を解決するために、例えば、下記特許文献1及び非特許文献1に開示されているバディシステムに関する技術が提案されている。バディシステムは、記憶領域を2からなるサイズごとに分割して割付の管理を行う。仮想記憶方式を使用していない単純なシステムでのメモリオブジェクトの割り付けでは、基本的なバディシステムが採用されている。
 図1Bは、バディシステムの割付原理を説明する図である。図1Bに示すのは、サイズが2=8の割当領域490とそれに対応するツリー構造体580である。割当領域490は、例えば図1Aに例示した区画1~4等である。
 ツリー構造体580は、割当領域490を2分の1のサイズに順次割付単位のサイズまで分割して得られる領域(特許文献1の用語を用いればエクステント)の関係を階層的にモデル化したものである。割付単位のサイズのエクステントの階層をレベル0とすると、図に示す例では、ルートノードのレベルは3、すなわち割当領域490のサイズである2のべき乗のべき数となる。
 ツリー構造体580のルートノード480は、分割前の割当領域490全体の領域(レベル3のエクステント)に対応し、ノード内に記載された“8”は、対応する割当領域490のサイズに相当する。また、括弧内の数字は、同一レベル内のエクステントを識別するレベル内番号である。
 ルートノード480にリンク540で接続されたノード440と、ルートノード480にリンク541で接続されたノード441は割当領域490を2分割した領域(レベル2のエクステント)に対応する。それぞれのエクステントのサイズは図に示すように4である。
 ノード440の下位には、リンク520で接続されたサイズ2のノード420と、リンク521で接続されたサイズ2のノード421が存在する。同様に、ノード441の下位には、リンク522で接続されたサイズ2のノード422と、リンク523で接続されたサイズ2のノード423が存在する。これら4つのノードはレベル1のエクステントに対応する。
 ノード420の下位には、リンク510で接続されたサイズ1のノード410と、リンク511で接続されたサイズ1のノード411が存在する。同様に、ノード421の下位には、リンク512で接続されたサイズ1のノード412と、リンク513で接続されたサイズ1のノード413が存在し、ノード422の下位には、リンク514で接続されたサイズ1のノード414と、リンク515で接続されたサイズ1のノード415が存在し、ノード423の下位には、リンク516で接続されたサイズ1のノード416と、リンク517で接続されたサイズ1のノード417が存在する。これら8つのノードはレベル0のエクステントに対応する。
 ルートノード480以外のノードは親ノードの対応するエクステントを2分割したエクステントの1つに対応したものとなっている。したがって、各レベルのエクステントのサイズの総和は、割当領域490のサイズに一致する。
 上述のバディシステムによれば、ある大きさのファイルを割り付けるとき、その大きさと等しいかそれを超える2からなるサイズのエクステントの中から空きエクステントを探して割り付け、解放するときもそのサイズの空きエクステント群に戻せばよいので、ファイル及びメモリオブジェクトの割り付けと解放及び領域の管理が容易である。
特開平7-28693号公報
安井卓、「はじめて学ぶLinuxカーネル(第5回カーネル・メモリ管理)」日経Linux第6巻第1号(2004-01-08)p123-p130
 しかしながら、上記のバディシステムによれば、2のべき乗単位で領域を割り付けることから、例えば2.1GBのファイルを割り付けるとき、4GBの領域が必要となり、ファイル割付後のブロックには、データの書き込まれていない領域が生じるにも関わらず、従来のファイルシステムにおいてはその領域に対して更にファイルを追加することができず、領域を有効に使用することができなかった。
 また、例えば記憶装置全体の記憶容量が127GBであったとしても、記憶領域を要求する要求元に対して割り付ける物理的あるいは論理的な領域である区画について、最大でも64GBの区画として管理せざるを得なかった。区画についていえば、図1に例示した区画3(193)のサイズは52であるが、2=32のサイズの区画として管理せざるを得ないものである。
 すなわち、バディシステムによれば、2のべき乗単位で領域を割り付けることからファイル及びメモリオブジェクトの割り付けと解放及び領域の管理が容易ではあるが、2のべき乗サイズの領域から2のべき乗サイズではない領域を取得した場合の残りの領域の管理、及び2のべき乗サイズではない領域から2のべき乗サイズの領域を取得した場合の残りの領域の管理がなされていないため、領域を有効活用できないという課題がある。
 そこで本発明は、2のべき乗サイズの記憶領域から2のべき乗サイズではない記憶領域を取得した場合でも、2のべき乗サイズではない記憶領域から2のべき乗サイズの記憶領域を取得した場合でも、いずれの場合でも残りの記憶領域を管理することが可能であり、記憶領域を有効活用することのできる技術を提供することを目的とする。
 本発明の記憶領域管理手法によれば、取得した記憶領域を異なる2のべき乗サイズの記憶領域に分割して管理し割付を可能とすることにより、上述の課題を解決する。
 本発明の一つの態様によれば、区画の割付サイズを取得し、割付サイズと、区画の割付単位のサイズから互いに異なる2のべき乗の和を算出し、区画を、該算出された互いに異なる2のべき乗のべき乗数毎に該2のべき乗と区画の割当単位のサイズの積からなる大きさの区域に区分し、記区分された区域毎に区画を管理する。
また、本発明の別の態様によれば、割付要求サイズを含む記憶領域の割付要求を受付け、割付要求サイズを包含する、2のべき乗と区画の割当単位のサイズの積の最小のサイズの空記憶領域を取得し、割付要求サイズを区画の割付単位のサイズで割った値の2進数表示を求め、受け付けた割付要求に対して、該2進数表示でビット1の立っているビット位置毎の2のべき乗と前記区画の割当単位のサイズの積の大きさの記憶領域からなる連続した記憶領域を割り付ける。
 本発明によれば、記憶領域を2のべき乗サイズの組合せで管理するので任意のサイズの記憶領域を有効に管理することが可能であり、記憶領域を分割した各2のべき乗サイズの記憶領域で割付管理を行うことから、連続する記憶領域に無駄なくファイル及びメモリオブジェクトの割付がなされることとなるため、記憶領域の有効活用を図ることができる。
外部記憶装置における区画割付例を説明する図である。 バディシステムの割付原理を説明する図である。 本発明を実施するためのハードウェア構成例を説明する図である。 本発明の実施形態1における取得済み区画を主区分(初期割付)して管理する概念を説明する図である。 図3Aに示す主区分を行った取得済み区画を管理する割付区分表を説明する図である。 本発明の実施形態1における取得済み区画を主区分(初期割付)する処理フロー例を説明する図である。 本発明の実施形態2における割付要求サイズの区域を取得して使用区域を解放する概念を説明する図である。 本発明の実施形態2における各区分レベルのエクステントの割付状態例を説明する図である。 本発明におけるバディシステムを初期化する処理フロー例を説明する図である。 本発明におけるバディシステムによる空エクステントを取得する処理フロー例を説明する図である。 本発明におけるバディシステムによる取得エクステントを解放する処理フロー例を説明する図である。 本発明の実施形態2における割付区分レベルの区域を取得する処理フロー例を説明する図である。 本発明の実施形態2における割付要求サイズの区域を取得する処理フロー例の前段を説明する図である。 本発明の実施形態2における割付要求サイズの区域を取得する処理フロー例の後段を説明する図である。 本発明の実施形態2における取得した割付要求サイズの区域を解放する処理フロー例の前段を説明する図である。 本発明の実施形態2における取得した割付要求サイズの区域を解放する処理フロー例の後段を説明する図である。 本発明の実施形態3における割付区分レベルの区域を取得する処理フロー例を説明する図である。 本発明の実施形態3における空エクステントを取得する処理フロー例を説明する図である。
 以下、本発明の好適な実施の形態について、図面を参照して詳細に説明するが、その前に、本明細書で用いる用語を以下のとおり定義する。
最初に、あらためて区画の定義を行う。本発明において「区画」とは、図1Aを参照して説明したように、予め割り当てられた領域であり、最初に割り当てられる領域である。本発明においては、区画は取得済みであることを前提とする。
「区域」とは、割り当てられた、あるいは割り付けられた領域である。区画は予め割り当てられた領域であるから、区域の1つであり、区域のうちの特定のものである。
区域を、2のべき乗と割当単位領域の積のサイズを有する複数の区域に分割することを「多層区分」という。また、多層区分された区域を「多層区域」という。なお、以下の説明においては、割当単位領域についての言及は省略し、領域のサイズについて、単に2のn乗のサイズ等の表記を用いる場合がある。
以下、区域についての用語とそれに対応する区画についての用語を対比しながら定義する。
「区分」とは、領域を割り当てる、あるいは領域を分割して割り当てることであり、「割付」ということもある。このときの領域の分割サイズは、互いに異なる2のべき乗サイズで規定されるが、領域の先頭からサイズの大きさの順に割り付けられる。領域は、区域または区画である。特に区画を区分することを「主区分」という。また、主区分により割り付けられた区域を「主区域」という。主区分は、本発明においては、区画に対する初期割付である。
区分または主区分による区域または主区域の割付サイズの2のべき乗数を「区分レベル」という。図2に示すツリー構造体580を援用して説明すると、例えばノード441が対応するレベル3のエクステントのサイズは4であるから、その区分レベルは2である。
上記定義された用語により説明すると、本発明の一つの実施態様によれば、区画を主区分し、主区域毎に区画を管理する。
また、本発明の別の態様によれば、割付要求サイズを含む区域の割付要求を受付け、割付要求サイズを包含する2のべき乗と区画の割当単位のサイズの積の最小のサイズの区域を取得し、更に割付要求サイズと、区画の割付単位のサイズから互いに異なる2のべき乗の和を算出し、前記割付要求を受け付けた区域を、該算出された互いに異なる2のべき乗のべき乗数毎に該2のべき乗と前記区画の割当単位のサイズの積からなる大きさの区域に多層区分した多層区域を使用区域とし、前記取得した区域のうち使用区域以外の残りの区域を、該残りの区域のサイズを互いに異なる2のべき乗の和と区画の割当単位のサイズの積からなる大きさとしたときの該互いに異なる2のべき乗のべき乗数毎に、該2のべき乗と前記割当単位のサイズの積からなる大きさの区域に多層区分して該多層区分された多層区域を解放して未使用状態とする。
次に本発明を実施するためのハードウェア構成例について、図2を参照して説明する。
 本発明の一実施形態による記憶装置の領域管理及び区域の割付及び解放処理は図に示す中央処理装置302及びキャッシュメモリ303を少なくとも備えたデータ処理装置301によりデータ格納装置308を用いて実施される。データ格納装置308については、後に説明する割付区分表208と管理対象である取得済み区画211を含む。図3に示すように、データ格納装置308は、主記憶装置305または外部記憶装置306、あるいはそれらの組み合わせで実現することができ、あるいは通信装置307を介して接続された遠方に配置された装置を用いることも可能である。
 すなわち、主記憶装置305をデータ処理装置301内のものとすることもできるし、割付区分表208は主記憶装置305に持ち、区画211は外部記憶装置306に割り当てられるのが多くの場合と考えられるが、区画211が、主記憶装置305に割り当てられる場合でも本発明が適用可能であることは、後の説明から明らかである。
 図3の例示では、主記憶装置305、外部記憶装置306及び通信装置307が一本のバス304によりデータ処理装置301に接続されているが、接続方法はこれに限るものではない。
また、特に図示されてはいないが、処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶領域が用いられることは当然である。以下の説明においては、表記の簡略化のため、例えば区画番号196aに格納された値3を区画番号196aと呼ぶように、記憶領域に格納されたあるいは設定された値をその記憶領域の名前で呼ぶことがある。
以下、図3A~図3Cを参照して本発明の実施形態1を説明する。本実施形態は、区画の割付サイズを取得し、割付サイズから互いに異なる2のべき乗の和を算出し、区画を、該算出された互いに異なる2のべき乗のサイズの主区域に主区分し、主区分された主区域毎に区画を管理するものである。区画の取得方法には制限はなく、先に述べた図示しないディスクアロケータ等のユーティリティプログラムにより取得されていてもよく、区画の開始位置とサイズさえ与えられるものであればよい。
図3Aは、本発明の実施形態1における、取得済み区画を主区分(初期割付)して管理する概念を説明する図である。
図3Aに例示するのは、取得済み区画211の区画サイズ220と主区域1~3(81a、82a、83a)との関係である。取得済み区画211は、例えば、図1Aに示す区画3(193)とすることができる。
任意の大きさの区画サイズは互いに異なる2のべき乗の和で表現することができることから、区画サイズ220には、区画サイズを互いに異なる2のべき乗の和で表現したとき、その和にべき乗が存在するべき乗数の位置(以下、有意のビット位置ということがある。)にビット1をその他のべき乗数の位置にビット0を格納した2進数表示により区画サイズの大きさを表している。
図3Aに示す例では、区画サイズ220の複数のビット位置(5、4、2)にビット値1が格納されていることから、区画サイズは2のべき乗の値に等しくなく、取得済み区画211の区画サイズは2+2+2=52である。取得済み区画211の開始位置219から、矢印(225、224、222)で示すように区画サイズ220の有意のビット位置(5、4、2)に対応して、それぞれ2のビット位置の値のべき乗のサイズの主区域1~3(81a、82a、83a)が割り付けられる。
 図3Bに示すのは、図3Aに示す主区分を行った取得済み区画211を管理する割付区分表208である。割付区分表208は割り付けられた主区域毎にエントリを有し、各エントリは主区域番号205、割付位置202、割付サイズ203の項目を含んで構成される。
 割付位置202には、取得済み区画211の位置情報が格納されており、主区域番号が1の主区域1の割付位置202には開始位置219の値(以下、開始位置ということがある。)が、割付サイズ203には2が格納されている。同様に、主区域2の割付位置202には開始位置+2、割付サイズ203には2が格納され、主区域3の割付位置202には開始位置+2+2、割付サイズ203には2が格納されている。
 以上のような本発明の実施形態1の主区分の手法を採用することにより、取得済みの与えられた区画のサイズが2のべき乗の値に等しくなくても、その区画を2のべき乗の値に等しい区域に区分してそれぞれ管理することができるので、初期割付された主区域毎にバディシステムの手法を採用することが可能となり、取得済みの区画を効率よく利用することが可能となる。
 図3Cは、本発明の実施形態1における区画を主区分する処理フロー例を説明する図である。ここで主区分する処理は、具体的には例えば図3Bに示す割付区分表208の値を設定する処理である。以下では、例として割付区分表208を参照して説明する。
 最初にステップS201で、割付ビットマップに与えられた取得済み区画の区画サイズを2進数表示した値を設定する。割付ビットマップは図3Aに示す区画サイズ220のイメージのものとなる。
 ここで割付ビットマップは図示しないワークエリアである。以下の説明においても、表記の簡略化のため、ワークエリアの名称Xであることを特に断ることなく、「Xに・・・を設定する。」のように記述することがある。
 次にステップS202で、割付位置に区画の開始位置を設定する。次にステップS203で、主区域番号に初期値を設定する。次にステップS204で、ビット位置に割付ビット位置の最上位のビット位置を設定する。図3Aに示す例では、ビット位置には5が設定される。
 次にステップS205に進み、割付ビットマップより、ビット位置の指すビット値を取り出し、ステップS206aで、取り出したビット値が1であるか判定する。ビット値が1であればステップS207aに進み、割付サイズに、ビット位置の2のべき乗の値を設定する。
 次にステップS207bにおいて、主区域番号の指す割付区分表208の、割付位置202に割付位置に設定した値を、割付サイズ203にビット位置に設定した値をべき乗数とする2のべき乗の値を設定し、ステップS208に進む。
 図3Bに示す例における最初の処理においては、主区域番号205には初期値の1が、割付位置202には開始位置が、割付サイズ203には2が設定される。
 ステップS208では、ビット位置は最下位のビット位置であるか判定し、最下位のビット位置であれば処理を終了し、最下位のビット位置でなければステップS209aに移行し、割付位置に、割付サイズを加算した値を設定する。次にステップS210で主区域番号に1を加え、ステップS211でビット位置に設定する値を1つ減らしてステップS205に戻る。
一方ステップS206aでの判定がビット値は1ではないであれば、ステップS206bに進み、ビット位置は最下位のビット位置であるか判定し、最下位のビット位置であれば処理を終了し、最下位のビット位置でなければステップS211に移行する。
 上記ステップS205~ステップS211のループ処理をビット位置が最下位のビット位置になるまで繰り返し、ビット位置が最下位のビット位置になると処理を終了する。
 以上の処理により取得済み区画の主区分が完了する。
 次に、本発明の実施形態2について説明する。本実施形態2は、要求元から2のべき乗サイズと異なる割付要求サイズを含む区域の取得要求を受け付け、該割付要求サイズを包含する最小の2のべき乗サイズ(割付区分レベル)の区域を、バディシステムの割付処理により取得し、そのうち未使用区域をバディシステムの割付処理により解放することにより、割付要求サイズに対応する使用区域を異なる区分レベルの区域の連続領域として取得するものである。上述の割付区分レベルの区域の取得は、実施形態1で区画から主区分された主区域からとすることができるが、それに限るものではない。
図4Aは、本発明の実施形態2における、割付要求サイズの区域を取得し未使用区域を解放する概念を説明する図である。
 図4Aには、2のべき乗サイズとは等しくない割付要求サイズ20aと、それに基づいて取得した区域80との関係及び取得した区域80を多層区分した区域1~4(81b、83b、84c、82c)との関係が示されている。割付要求サイズ20aの有意のビット位置は3と1であり、割付要求サイズは2+2=10である。
 複数の有意ビットが存在する場合、すなわち割付要求サイズが2のべき乗のサイズでない場合は、割付要求サイズ20aの最上位の有意ビットの位置3より1つ上位の位置の値4が割付区分レベル44aとなる。そして、図の点線の矢印44に示すように、バディシステムによる割付処理23により、点線の矢印40で関係を示すように、割付区分レベル44aである4を2のべき乗数とする2のべき乗サイズの区域80を取得する。区域80の取得には、任意の既存のバディシステムの割付処理を採用することが可能であるが、後に図6及び図5Bを参照して、本実施形態2におけるバディシステムによる割付処理例を説明する。
 割付要求サイズ20aの各ビット値と区域1~4(81b、83b、84c、82c)との関係は、実線の矢印71b、73b及び点線の矢印73c、72cで示すとおりである。すなわち、割付要求サイズ20aの最上位の有意ビットの位置が3であることが、2のサイズの区域1(81b)が区分されて分割割付されることに対応し、次のビット位置2のビット値が0であることが、2のサイズの区域2(82c)が分割割付されることに対応する。そして、次のビット位置1が有意ビットの位置であることから、2のサイズの区域3(83b)が分割割付され、更にビット位置1が最下位の有意ビットの位置であることから、残りの領域が区域4(84c)として分割割付される。
 区域1(81b)と区域3(83b)により割付要求サイズに対応する使用区域が構成され、区域4(84c)と区域2(82c)により未使用区域が構成される。
 図4Bは、本発明の実施形態2における各区分レベルのエクステントの割付状態例を説明する図である。
 図4Bに示す各エクステントの割付状態とレベル内番号のツリーは、図4Aに示す取得した区域80に対応するエクステントを2分の1ずつ分割(バディ分割)したエクステントの割付状態1または0を、区分レベル4から区分レベル1まで示したものである。割付状態1は塞状態に相当し、割付状態0は空状態に相当する。空状態はそのエクステントが割付可能な状態であり、塞状態は、それ単独ではそのエクステントの全体あるいは一部が割付可能か不明な状態である。上位区分の割付状態と下位区分の割付状態を結ぶ実線は、各割付状態に関するエクステントのバディ分割の関係を示したものである。レベル内番号は0番から始まるものとして示している。
 区分レベル4の割付状態616は、区域80に対応するエクステントのものであり、1が設定されている。区分レベル3の割付状態608のうち、レベル内番号0のものは区域1(81b)に対応するエクステントのものであり、1が設定され、それをバディ分割した下位区分のエクステントの割付状態にはすべて1が設定されている。区分レベル1の割付状態602のうち、レベル内番号4のものは区域3(83b)に対応するエクステントのものであり、レベル内番号5のものは区域4(84c)に対応するエクステントのものである。それぞれ使用区域、不使用区域を構成することに対応して1及び0が設定されている。そして、区分レベル2の割付状態604のうち、レベル内番号3のものは区域2(82c)に対応するエクステントのものであり、0が設定されている。
 区分レベル1の割付状態602のうち、レベル内番号6と7のものは1ではあるが、それらの上位区分の区分レベル2の割付状態604のうちレベル内番号3の割付状態が0であることから、区分レベル2のレベル内番号3のエクステントをバディ分割することにより空状態として使用することができる。
 区分レベル1のレベル内番号6と7の割付状態を1とすることにより、図4Bに示す割付状態において区分レベル1の空エクステントを探索したとき、レベル内番号5の空エクステントが優先的に取得される。したがって、その後区分レベル2の空エクステントが探索されたときのために、区分レベル2のレベル内番号3のエクステントを空エクステントとして残しておくことができる。
 理解を容易にするため、図4Bには割付状態をツリーとして表記したが、割付状態を連続した領域におけるビットマップに保持することができることは明らかである。
 次に図5A~図5Cを参照して、実施形態2におけるバディシステムについて説明する。以下において、実施形態2におけるバディシステムを、実施形態1で主区分された区画を構成する主区域内のエクステントの割付解放を行うものとして、すなわち主区域番号が与えられるものとして説明するが、先に述べたように、それに限ることなく、2のべき乗サイズのエクステントの割付解放を行うものとしてもよい。
 図5Aは、本実施形態におけるバディシステムを初期化する処理フロー例を説明する図である。
 図に示すように、ステップS501において、区分レベルに、主区域番号の指す主区域の割付サイズに対応する区分レベルを設定する。次にステップS502で、レベル内開始番号に、初期値(例えば値0)を設定し、ステップS503で、レベル内終了番号に、レベル内開始番号を設定する。
 次にステップS504で、区分レベルのレベル内開始番号の指す割付状態に空状態を設定し、ステップS505に進む。
 上述のステップS501~ステップS504の処理は、図4Aの例示の区域80が主区域であるとして説明すると、区分レベル4の割付状態616に空状態を設定するものである。なお、区域を取得する主区域の選択については、後に図6を参照して説明する。また、図4Bに示すレベル内番号は、レベル内開始番号+割付番号として一般化をはかっている。レベル内開始番号は任意の番号であり、割付番号はレベル内開始番号からのオフセットである。したがって、レベル内開始番号を0とすると、レベル内番号と割付番号は同一の値となる。
 ステップS505においては、区分レベルは最下位の区分レベルか判定する。最下位の区分レベルであれば初期化は完了しているので処理を終了する。最下位の区分レベルでなければ、ステップS506に進む。
 ステップS506では、区分レベルより値1を減らす。次にステップS507で割付番号に、レベル内開始番号を設定し、ステップS508で、レベル内終了番号に、レベル内終了番号を2倍した値に値1を加えた値を設定する。
 次にステップS509で区分レベルの割付番号の指す割付状態に塞状態を設定し、ステップS510で、割付番号はレベル内終了番号と等しいか判定する。割付番号がレベル内終了番号と等しければステップS505に戻り、等しくなければ、ステップS511で割付番号に1を加えてステップS509に戻る。
 上述のステップ505~ステップS511の処理は、主区域をバディ分割したエクステントの割付状態に塞状態を設定するものである。図4Bに示す例では、レベル内終了番号が初期値の0から1、3、7と処理ループを回るたびにステップ508で計算され、区分レベル3~区分レベル1のレベル内開始番号0からレベル内終了番号までの割付番号(レベル内番号)の指す割付状態に塞状態が設定される。上述の空状態、塞状態は、先に述べたように、割付状態を表すビットマップのバディ分割された各エクステントに対応するビット位置に設定することができる。
 以上の処理により、本実施形態のバディシステムは初期状態となる。初期状態においては、主区域に対応するエクステントのみ空状態とし、主区域に対応するエクステントをバディ分割した実質的には空状態であるエクステントを塞状態とする。先に述べたとおり、塞状態のエクステントは使用可能な場合と使用不可能な場合とがある。
 図5Bは、本実施形態におけるバディシステムによる空エクステントを取得する処理フロー例を説明する図である。バディシステムは、空エクステントの取得が最初に行われる前には、図5Aを参照して説明した初期化処理により初期化されているものとする。
 最初に、ステップS521において、主区分レベルに、主区域番号の指す主区域の割付サイズに相当する区分レベルを設定すると共に、区分レベルに割付区分レベルを設定する。ここで割付区分レベルは、バディシステムにより取得する空エクステントの区分レベルである。図5Aに示す例では4が設定される。
 次にステップS522において、区分レベル内の空状態の区域を探索し、ステップS523で区分レベルに空があるか判定する。空がなければステップS524に分岐して、区分レベルは主区分レベルを指すか、すなわち主区域のサイズであるか判定する。主区分レベルを指す場合は取得失敗として処理を終了し、主区分レベルを指していなければ、ステップS525に進み、区分レベルに値1を加えてステップS522に戻る。
 一方、ステップS523で区分レベルに空があると判定されるとステップS526に進み、空状態の割付番号を取得し、割付番号の指す割付状態に塞状態を設定し、ステップS527に進む。ステップS527では、区分レベルは割付区分レベルか判定し、割付区分レベルであれば処理を終了し、割付区分レベルでなければステップS528に分岐する。
 ステップS528では、区分レベルから値1を減らし、ステップS529に進んで割付番号を2倍する。このステップS528とステップS529の処理は、バディ分割の処理に相当する。次にステップS530で区分レベルの割付番号の指す割付状態に空状態を設定し、ステップS531において、区分レベルの割付番号とバディ分割の対をなす割付番号(以下、バディということがある。)の指す割付状態に空状態を設定してステップS522に戻る。すなわち、バディ分割により得られた2つのエクステントの割付状態を空状態として空状態のエクステントの探索を行う。そして、ステップS526で探索された空状態のエクステントの割付状態を塞状態とし、バディの割付状態は空状態とすることを区分レベルが割付区分レベルとなるまで繰り返し、割付区分レベルの空エクステントを取得する。
 図5Cは、本実施形態におけるバディシステムによる取得エクステントを解放する処理フロー例を説明する図である。
 最初に、ステップS541において、主区分レベルに、主区域番号の指す主区域の割付サイズに相当する区分レベルを設定すると共に、区分レベルに解放区分レベルを設定する。ここで解放区分レベルは、バディシステムにより解放する塞状態のエクステントの区分レベルである。図4Aに示す例の区域1(81b)を解放する場合には、解放区分レベルはそれに対応した3であり、区分レベルには3が設定される。また、解放する塞状態のエクステントを特定する解放区分レベル内の割付番号が、解放番号として与えられているものとする。
 次にステップS543において、区分レベルは主区分レベルを指すか判定する。主区分レベルを指すのであれば区分レベルはルートノードに対応し、バディは存在しないのでステップS548に分岐し、区分レベルの解放番号の指す割付状態に空状態を設定して処理を終了する。
 一方ステップS543で区分レベルは主区分レベルを指さないと判定されるとステップS544に進み、区分レベルの解放番号のバディの指す割付状態は空状態か判定する。空状態でなければ先に説明したステップS548に進み、空状態であれば、ステップS545に分岐する。
 ステップS545では、区分レベルの解放番号のバディの指す割付状態に塞状態を設定する。次にステップS546で区分レベルに1を加え、ステップS547で解放番号に解放番号を2で割った商を設定してステップS543に戻る。
 以上のステップS543~ステップS547のループ処理を、区分レベルが主区分レベルを指すか区分レベルの解放番号のバディの指す割付番号が塞状態となるまで繰り返し、最後に区分レベルの解放番号の指す割付状態に空状態を設定することで割付区域の解放処理が完了する。すなわち、図5Dに示す処理では、解放番号のバディの指す割付状態が空状態であれば、解放番号とバディの指すペアの割付状態をともに塞状態とし、上位区分レベルにおいてバディの指す割付状態が塞状態となったとき、あるいは主区分レベルを指す区分レベルにまで至ったときに解放番号の指す割付状態に空状態を設定するものである。
 次に、本発明の実施形態2における割付区分レベルの区域を取得しその区域を多層区分し、多層区分された多層区域のうち、割付要求サイズに対応する使用区域を異なる区分レベルの区域の連続領域として取得し、残りの未使用区域をバディシステムの割付処理により解放する処理を、図6~図7Bを参照して説明する。
 図6は、本実施形態における割付要求区分レベルの区域を取得する処理フロー例を説明する図である。割付要求区分レベルの区域の取得は、割付要求サイズの区域を取得するのに先立って行われるものであり、後に図7A及び図7Bを参照して説明する割付要求サイズの区域を取得する処理の一部をなすものである。ここで割付要求区分レベルの区域は、例えば、図3Aに示す取得済み区画211から取得される。以下では、図4Aに示す例に加えて、図3A及び図3Bに示す割付区分表208を参照して説明する。
 図6に示すように、ステップS601において、主区域番号に、割付区分表の最下位の主区域番号を設定する。図3Bの例では、割付区分表208の主区域番号には3が設定される。すなわち、最も小さいサイズの主区域から割付要求サイズの区域の取得処理が開始される。
 次にステップS602で主区域番号の指す割付区分表の割付サイズを読み出し、ステップS603において該読み出した割付サイズは割付要求サイズより小さいか判定する。小さければ、ステップS606に分岐する。図4Aに示す例では、割付要求サイズは10であるから、最初の処理においては主区域番号205が3の割付サイズ203の値4は割付要求サイズより小さく、ステップS606を介してステップS607に進み、次の主区域番号として2が設定される。
 一方ステップS603において割付サイズは割付要求サイズより小さくないと判定されるとステップS604に進み、主区域番号の指す主区域から割付要求区分レベルの区域を取得し、割付番号を得る。ステップS604の詳細は、先に図5Bを参照して説明したものである。
 次にステップS605において、ステップS604で割付要求区分レベルの区域を取得したか判定する。割付要求区分レベルの区域を取得していれば、ステップS608に分岐し、割付区分レベルの区域の取得結果に、主区域番号、割付区分レベル、割付番号を設定して処理を終了する。
ステップS604の処理で割付要求区分レベルの区域を取得していなければ、ステップS606に進み、主区域番号は最上位の番号か判定する。主区域番号が最上位の番号であれば取得失敗として処理を終了し、主区域番号が最上位の番号でなければ、ステップS607において主区域番号に次の主区域番号を設定してステップS602に戻る。
以上のステップS602からステップS607までのループ処理を、主区域番号を更新しながら割付要求区分レベルの区域を取得するまで繰り返し、主区域番号が最上位の番号であっても割付要求区分レベルの区域を取得できなければ、取得失敗として処理を終了する。
図3Aに示す初期割付及び図4Aに示す割付要求サイズの例では、割付要求サイズが10、主区域3(83a)の割付サイズが4、主区域2(82a)の割付サイズが16であるから、主区域2(82a)からステップS604における割付区分レベルの区域の取得を試み、その取得に失敗した場合に次に主区域1(81a)から割付区分レベルの区域の取得を試みる。主区域2(82a)のサイズは16、主区域1(81a)のサイズは32であるから、取得される割付区分レベルの区域の割付番号は、0か1になる。
 次に図7A及び図7Bを参照して、割付要求サイズの区域を取得する処理を説明する。
 図7Aは、本実施形態2における割付要求サイズの区域を取得する処理フロー例の前段を説明する図である。この前段の処理は、割付区分レベルの区域を取得する処理である。
最初にステップS701で、割付ビットマップに割付要求サイズを2進数表示した値を設定する。割付ビットマップは図4Aに示す割付要求サイズ20aのイメージのものとなる。割付要求サイズは、要求元から与えられることを前提としている。
次にステップS702で、最下位ビット位置に割付ビットマップのビット値が1である最も下位のビット位置を設定する。図4Aに示す例では、最下位ビット位置には1が設定される。
次にステップS703で、最上位ビット位置に割付ビットマップのビット値が1である最も上位のビット位置を設定する。図4Aに示す例では、最上位ビット位置には3が設定される。
 次にステップS704において、最上位ビット位置と最下位ビット位置は一致するか判定する。一致すれば、ステップS705に分岐する。この場合は図4Aに示す例とは異なり、割付要求サイズ20aが2のべき乗サイズと等しい場合であり、ステップS701で設定した割付ビットマップでビット1が立っているビット位置は1箇所だけである。したがって以下の説明において、2のべき乗サイズと等しい割付要求をシングルビット要求ということがある。
 ステップS704からステップS705に分岐した場合は、ステップS705で、割付区分レベルに最上位ビット位置を設定する。この場合には、割付区分レベルのサイズは割付要求サイズと等しくなる。
 次にステップS706に進み、図6を参照して説明した処理により、割付区分レベルの区域を取得し、主区域番号と割付番号を得る。ここでの主区域番号は、図6のステップS601またはステップS607で設定されたものである。また割付番号は、ステップS604で呼び出す図5Cの処理フロー例のステップS526で設定されたものである。
 次にステップS707において、ステップS706の処理で割付区分レベル、すなわち割付要求サイズの区域を取得したか判定し、取得していなければ、取得失敗として処理を終了する。割付要求サイズの区域を取得していれば、ステップS707aにおいて、レベル内番号に、レベル内開始番号に割付番号を加えた値を設定し、ステップS707bで、取得結果に、主区域番号、割付区分レベル、レベル内番号を設定して処理を終了する。
 一方、図4Aの例のように最上位ビット位置と最下位ビット位置が一致しなければ、ステップS708で割付区分レベルに最上位ビット位置に値1を加えた値を設定してステップS709に進む。図4Aの例では、割付区分レベル44aとして4が設定される。この場合は、ステップS701で設定した割付ビットマップの複数のビット位置でビット1が立っているので、以下の説明において、2のべき乗サイズと等しくない割付要求サイズの割付要求をマルチビット要求ということがある。
 ステップS709では、ステップS706と同様に、図6を参照して説明した処理により、割付区分レベルの区域を取得し、主区域番号と割付番号を得る。
 次にステップS710において、ステップS709の処理で割付区分レベルの区域を取得したか判定し、取得していなければ、取得失敗として処理を終了し、取得していれば図7Bに示すステップS711に進む。
 図7Bは、実施形態2の、マルチビット要求における割付要求サイズの区域を取得する処理フロー例の後段を説明する図である。この後段の処理は、取得済みの割付区分レベルの区域から未使用区域を解放することにより、割付要求サイズの区域を使用区域として取得する処理である。
 まずステップS711において、割付番号に、ステップS709で得た割付番号を2倍した値を設定し、ステップS712において、ビット位置に、最上位ビット位置を設定する。図3A及び図4Aの例では、割付番号は0または1であり、最上位ビット位置は3であるから、割付番号には0または1が、ビット位置には3が設定される。
次にステップS713で、割付ビットマップより、ビット位置の指すビット値を取り出し、ステップS714において取り出したビット値が1であるか判定し、1であればステップS718に進み、0であればステップS715に進む。
ステップS715では、解放区分レベルにビット位置を設定し、ステップS716に進み、解放番号に、割付番号に1を加えた値を設定する。次にステップS717において、図5Dを参照して説明した処理により、主区域番号の指す主区域から解放区分レベルの解放番号の区域を解放し、ステップS717aにおいて、割付番号に、割付番号を2倍した値を設定してステップS720に進む。
一方ステップS718では、ビット位置が最下位ビット位置か判定し、最下位ビット位置であればステップS721へ進み、最下位ビット位置でなければ、ステップS719に分岐して割付番号に1を加えた値を2倍した値を設定し、ステップS720に進む。ステップS720では、ビット位置から1を減らしてステップS713に戻る。
図3A、図4Aの例では、先に述べたようにステップS709で得る割付区分レベル4の区域の割付番号は0または1である。そこで割付区分レベルの区域をバディ分割した区分レベル3の区域1(81b)の割付番号をステップS711で0または2とした後、初回のビット位置3の処理ではステップS718からステップS719に分岐して割付番号を2または6とし、ビット位置を2とする。2度目の処理では、ビット位置2のビット値は0なので、ステップS715に進む。そして解放区分レベルに2が、解放番号に3または7が設定される。区分レベル3の区域1(81b)の割付番号が0であれば、区分レベル2の解放番号3の区域2(82c)が解放され、区分レベル3の区域1(81b)の割付番号が2であれば、同様に区分レベル2の解放番号7の区域2(82c)が解放される。
一方、ステップS718でビット位置が最下位ビット位置と判定されると、ステップS721に進み、解放区分レベルにビット位置を設定し、ステップS722で、解放番号に、割付番号に1を加えた値を設定する。そして、ステップS723において、図5Dを参照して説明した処理により、主区域番号の指す主区域より解放区分レベルの解放番号の区域を解放する。
図3A、図4Aの例では、ビット位置1が最下位ビット位置であり、ビット位置2のステップS717aの処理で割付番号は4または12になっているので、解放区分レベルに1が、解放番号には5または13が設定される。したがって、区分レベル3の区域1(81b)の割付番号が0であれば、区分レベル1の解放番号5の区域4(84c)が解放され、区分レベル3の区域1(81b)の割付番号が2であれば、同様に区分レベル1の解放番号13の区域4(84c)が解放される。
ステップS723に引続きステップS724では、レベル内番号に、レベル内開始番号に割付番号を加えた値を設定し、ステップS725で、割付要求サイズの区域の取得結果に、主区域番号、割付区分レベル、レベル内番号を設定して処理を終了する。ここで設定される割付区分レベルは、図7AのステップS708で設定されたものである。
以上の処理により要求されたサイズに対応する使用区域の取得と未使用区域の解放が完了する。
 次に、図8A及び図8Bを参照して、割付要求サイズの使用区域を解放する処理を説明する。
 図8Aは、実施形態2における取得した割付要求サイズの区域(使用区域)を解放する処理フロー例の前段を説明する図である。図7Bを参照して説明した割付要求サイズの区域の取得結果は解放要求に含まれるものとし、また割付要求サイズも解放要求に含まれるものとすることができる。
最初にステップS801で、解放番号に、レベル内番号からレベル内開始番号を引いた値を設定するとともに、解放区分レベルに割付区分レベルを設定し、次にステップS802において、割付ビットマップに割付要求サイズを2進数表示した値を設定する。
次にステップS803で、最下位ビット位置に割付ビットマップのビット値が1である最も下位のビット位置を設定する。図5Aに示す例では、最下位ビット位置には1が設定される。次にステップS804で、最上位ビット位置に割付ビットマップのビット値が1である最も上位のビット位置を設定する。
 次にステップS805において、最上位ビット位置と最下位ビット位置は一致するか判定する。一致すれば、ステップS806に分岐する。この場合は割付要求サイズ20aが2のべき乗サイズと等しい場合であり、割付要求がシングルビット要求の場合である。ステップS806では、図5Dを参照して説明した処理により、主区域番号の指す主区域から解放区分レベルの解放番号の指す区域を解放し、処理を終了する。
 一方ステップS805の判定において、最上位ビット位置と最下位ビット位置が一致しなければ、図8Bに示すステップS807に進む。
 図8Bは、実施形態2における取得した割付要求サイズの区域(使用区域)を解放する処理フロー例の後段を説明する図である。この後段の処理は、マルチビット要求の使用区域を解放する処理である。
 図に示すように、ステップS807で解放番号(割付番号)に、解放番号を2倍した値を設定し、ステップS808でビット位置に、最上位ビット位置を設定する。
 次にステップS809で、割付ビットマップより、ビット位置の指すビット値を取り出し、ステップS810で、該取り出したビット値は1か判定する。ビット値が1でなければステップS811において、解放番号に、解放番号を2倍した値を設定してステップS814に進む。ビット値が1であれば、ステップS813において、スタックに、ビット位置と解放番号を書き込み、ステップS814で、解放番号に、解放番号に値1を加えた値を2倍した値を設定してステップS814に進む。
 ステップS814ではビット位置は最下位ビット位置か判定し、最下位ビット位置でなければステップS815でビット位置から1を減らしてステップS809に戻る。最下位ビット位置であれば、ステップS816においてスタックは空か判定し、空であれば処理を終了し、空でなければ、ステップS817に進み、スタックより、ビット位置と解放番号を取り出す。次にステップS818で解放区分レベルにステップS817で取り出したビット位置を設定する。そして、ステップS819で図5Cを参照して説明した処理により、主区域番号の指す主区域から解放区分レベルの解放番号の区域を解放し、ステップS816に戻る。
 上述のステップS816~ステップS819のループ処理をスタックが空になるまで繰り返すことにより、割付要求サイズの区域の解放が完了する。
 図4Aに例示する割付要求サイズの使用区域を解放する場合には、ステップS801で解放番号に0または1が設定され、ステップS807で解放番号に0または2が設定される。ビット位置にはステップS808で3が設定され、スタックには最初にビット位置3と解放番号0または2が設定される。解放番号に1を足して2倍し、2または6に更新した後、ビット位置2の処理で更に解放番号を2倍して4または12に更新する。そしてビット位置1の処理で、スタックにビット位置1と解放番号4または12を書き込む。
その後、スタックからビット位置1と解放番号4または12を取り出し、解放区分レベルに1を設定し、解放番号4または12の区域を解放する。区分レベル3の区域1(81b)の割付番号が0であれば、区分レベル1の解放番号4の区域3(83b)が解放され、区分レベル3の区域1(81b)の割付番号が2であれば、同様に区分レベル1の解放番号12の区域3(83b)が解放される。
 続いてスタックからビット位置3と解放番号0または2を取り出し、解放区分レベルに3を設定し、解放番号0または2の区域を解放する。すなわち区分レベル3の区域1(81b)が解放される。以上の処理により、使用区域を構成していた区域1(81b)と区域3(83b)が解放される。
以上のような本発明の実施形態2の手法を採用することにより、取得要求された区域のサイズが2のべき乗の値に等しくなくても、その区域を2のべき乗の値に等しい区域に区分して区域毎に管理することができるので、区域毎にバディシステムの手法を採用することが可能となり、取得済みの区域を効率よく利用することが可能となる。また、要求サイズを包含する2のべき乗サイズの区域を取得した場合でも、要求元が要求したサイズ以上の余りの領域を未使用区域として管理し、有効に利用することが可能となる。
次に、本発明の実施形態3について説明する。本実施形態3は、上述の実施形態2の変形例に相当するものである。要求元から2のべき乗サイズと異なる割付要求サイズを含む区域の取得要求を受け付け、該割付要求サイズを包含する最小の2のべき乗サイズ(割付区分レベル)の区域を取得し、そのうち未使用区域をバディシステムの割付処理により解放することにより、割付要求サイズに対応する使用区域を異なる区分レベルの区域の連続領域として取得することでは、実施形態2と同様である。
しかしながら割付区分レベルの区域の取得に関しては、実施形態2では、図5B及び図6に示す処理フロー例を参照して説明したように、1つの主区域に対応するバディシステムにより区分レベルを更新しながら空エクステントを探索し、そのバディシステム内で空エクステントが見つからなければ主区域番号を更新し、その主区域番号の主区域に対応するバディシステムにより、空エクステントを探索することを空エクステントが見つかるまで繰り返すものであるのに対し、実施形態3では、同一の区分レベルについて、異なる主区域に亘って空エクステントを探索し、すべての主区域において空エクステントが見つからなかったときに区分レベルを更新し、その区分レベルで異なる主区域に亘って空エクステントを探索することを繰り返す。
 以下、本発明の実施形態3について、図9及び図10を参照して本発明の実施形態2と異なる部分を説明する。先に述べたように、実施形態2と実施形態3で異なるところは、異なる主区域に対する割付区分レベルの区域の取得手順である。したがって、実施形態2について図4A~図8Bを参照して説明したうち、実施形態3で異なる部分は図5B及び図6を参照して説明した部分、及びそれに関連した図4Aを参照して説明した割付区分レベルの区域の取得の部分である。そこで、実施形態2の図5B及び図6に相当する実施形態3の処理フロー例について説明する。
図9は、本発明の実施形態3における割付区分レベルの区域を取得する処理フロー例を説明する図である。図9に示す処理フロー例は、図6に示す本発明の実施形態2における処理フロー例に対応するものである。
 図9に示すように、ステップS900で、区分レベルに、割付区分レベルを設定する。次にステップS901で、主区域番号に、割付区分表の最下位の主区域番号を設定する。図3Bの例では、主区域番号には3が設定される。すなわち、最も小さいサイズの主区域から割付要求サイズの区域の取得処理が開始される。
 次にステップS902で主区分レベルに、主区域番号の指す主区域の割付サイズに相当する区分レベルを設定し、ステップS903において、区分レベルはステップS902で設定した主区分レベルより大きいか判定する。大きくなければステップS904に進み、主区域番号の指す主区域から割付要求区分レベルの区域を取得し、割付番号を得る。ステップS904の詳細は、後に図10を参照して説明する
 次にステップS905において、ステップS904で割付要求区分レベルの区域を取得したか判定する。割付要求区分レベルの区域を取得していれば、ステップS908に分岐し、割付区分レベルの区域の取得結果に、主区域番号、割付区分レベル、割付番号を設定して処理を終了する。
ステップS904の処理で割付要求区分レベルの区域を取得していなければ、ステップS906に進む。
 また、ステップS903で区分レベルはステップS902で設定した主区分レベルより大きいと判定されると、ステップS906に進む。
ステップS906では、主区域番号は最上位の番号か判定する。主区域番号が最上位の番号でなければステップS907に進み、ステップS907で主区域番号に次の主区域番号を設定してステップS902に戻る。上述のステップS902~ステップS907のループ処理は、先に述べた同一の区分レベルについて、異なる主区域に亘って空エクステントを探索する処理である。
一方、主区域番号が最上位の番号であればステップS906aに進み、さらに区分レベルは主区分レベルを指すか判定し、主区分レベルを指せば取得失敗として処理を終了し、主区分レベルでなければ、ステップS907aにおいて区分レベルに値1を加えてステップS901に戻る。上述のステップS906aの判定処理からステップS907aを介してステップS901に戻るループ処理は、先に述べた、区分レベルを更新しその区分レベルで異なる主区域に亘って空エクステントを探索する処理である。
以上の2重のループ処理を、主区域番号と区分レベルを更新しながら割付要求区分レベルの区域を取得するまで繰り返し、区分レベルが主区分レベルであっても割付要求区分レベルの区域を取得できなければ、取得失敗として処理を終了する。
 図10は、図9に示すステップS904の処理の詳細なフロー例を示すものであり、本発明の実施形態3における空エクステントを取得する処理フロー例を説明する図である。図10に示す処理フロー例は、図5Bに示す本発明の実施形態2における処理フロー例に対応するものである。
図に示すように、まずステップS1022において、区分レベル内の空状態の区域を探索する。区分レベルは、図9に示すステップS900あるいはステップS907aで設定されたものである。次にステップS1023で区分レベルに空があるか判定する。空がなければ取得失敗として処理を終了する。
 一方、ステップS1023で区分レベルに空があると判定されるとステップS1026に進み、空状態の割付番号を取得し、割付番号の指す割付状態に塞状態を設定し、ステップS1027に進む。ステップS1027では、区分レベルは割付区分レベルか判定し、割付区分レベルであれば処理を終了し、割付区分レベルでなければステップS1028に分岐する。
 ステップS1028では、区分レベルから値1を減らし、ステップS1029に進んで割付番号を2倍する。このステップS1028とステップS1029の処理は、実施形態2の場合と同様にバディ分割の処理に相当する。次にステップS1030で区分レベルの割付番号の指す割付状態に空状態を設定し、ステップS1031において、区分レベルの割付番号とバディ分割の対をなす割付番号(バディ)の指す割付状態に空状態を設定してステップS1022に戻る。すなわち、バディ分割により得られた2つのエクステントの割付状態を空状態として空状態のエクステントの探索を行う。そして、ステップS1026で探索された空状態のエクステントの割付状態を塞状態とし、バディの割付状態は空状態とすることを区分レベルが割付区分レベルとなるまで繰り返し、割付区分レベルの空エクステントを取得する。
 以上説明した実施形態3によれば、ある主区域、例えばサイズの小さな主区域に所望の区分レベルの空エクステントがなく、別の主区域、例えばサイズの大きな主区域に所望の区分レベルの空エクステントが存在するとき、サイズの小さな主区域の所望の区分レベルより大きな区分レベルの空エクステントをバディ分割することなく、別の主区域から所望の区分レベルの空エクステントを取得することができる。
 以上本発明を実施するための最良の形態について詳細に説明したが、本発明に実施の形態はそれらに限ることなく種々の変形が可能であることは、当業者に明らかである。また、以上に説明した本発明の実施の形態による記憶領域管理方法、記憶領域割付方法及び記憶領域解放方法、更にその均等物は、それらをコンピュータに実行させるプログラムにより実現可能であることも明らかである。したがって、上記プログラム、及び上記プログラムを記憶したコンピュータ読み取り可能な記憶媒体も、本発明の実施の形態に含まれる。
 また、本発明の実施の形態による記憶領域管理方法、記憶領域割付方法及び記憶領域解放方法の各処理の実行手段は、上記プログラムにより、コンピュータ上に実現されることも明らかである。したがって、上記プログラムによりとコンピュータにより、記憶領域管理装置、記憶領域割付装置及び記憶領域解放装置が実現されることも明らかである。

Claims (14)

  1.  記憶装置の記憶領域管理方法において、
     予め割り付けられた記憶領域である区画の割付サイズを取得し、
     該割付サイズと、前記区画の割付単位のサイズから互いに異なる2のべき乗の和を算出し、
     前記区画を、該算出された互いに異なる2のべき乗のべき乗数毎に該2のべき乗と前記区画の割当単位のサイズの積からなる大きさの記憶領域である主区域に分割し、
    前記主区域毎に前記区画を管理することを特徴とする記憶領域管理方法。
  2. 請求項1に記載の記憶領域管理方法において、
    前記区画を前記主区域のサイズの大きさの順に分割することを特徴とする記憶領域管理方法。
  3. 請求項2に記載の記憶領域管理方法において、前記主区域の先頭アドレスである割付位置と主区域のサイズである割付サイズを、前記区画の割付サイズと前記区画の先頭アドレスから求めて前記主区域毎に保持することを特徴とする記憶領域管理方法。
  4. 請求項1に記載の記憶領域管理方法により前記区画を分割した主区域から割付要求された記憶領域のサイズである割付要求サイズの記憶領域を割り付ける記憶領域割付方法において、
    前記割付要求サイズを含む記憶領域の割付要求を受付け、
    前記主区域から前記割付要求サイズを包含する、2のべき乗と区画の割当単位のサイズの積の最小のサイズの空記憶領域を取得し、
    前記割付要求サイズを区画の割付単位のサイズで割った値の2進数表示を求め、
    前記受け付けた割付要求に対して、該2進数表示でビット1の立っているビット位置毎の2のべき乗と前記区画の割当単位のサイズの積の大きさの記憶領域からなる連続した記憶領域を、前記取得した2のべき乗と区画の割当単位のサイズの積の最小のサイズの空記憶領域に割り付けることを特徴とする記憶領域割付方法。
  5.  請求項4に記載の記憶領域割付方法において、
     前記区画を前記主区域のサイズの大きさの順に分割し、
     該分割した主区域のうちサイズの小さい主区域からサイズの大きい主区域に亘って前記2のべき乗と区画の割当単位のサイズの積の最小のサイズの空記憶領域を探索して取得し、該取得した2のべき乗と区画の割当単位のサイズの積の最小のサイズの空記憶領域に前記割付要求されたサイズの記憶領域を割り付けることを特徴とする記憶領域割付方法。
  6.  請求項5に記載の記憶領域割付方法において、
     前記最小のサイズの空記憶領域は、前記分割した主区域のうちサイズの小さい主区域からサイズの大きい主区域に亘って前記各主区域に対応するバディシステムにより探索して取得することを特徴とする記憶領域割付方法。
  7.  請求項5に記載の記憶領域割付方法において、
     前記最小のサイズの空記憶領域は、前記分割した主区域のうちサイズの小さい主区域からサイズの大きい主区域に亘って該最小のサイズの空記憶領域を探索し、すべての主区域において該最小のサイズの空記憶領域を取得できなかったときには、該探索した空記憶領域のサイズの2倍のサイズの空記憶領域を前記分割した主区域のうちサイズの小さい主区域からサイズの大きい主区域に亘って探索することを繰り返すことにより取得することを特徴とする記憶領域割付方法。
  8. 予め割り付けられた記憶領域である区画から割付要求された記憶領域のサイズである割付要求サイズの記憶領域を割り付ける記憶領域割付方法において、
    前記割付要求サイズを含む記憶領域の割付要求を受付け、
    前記区画から、前記割付要求サイズを包含する2のべき乗と前記区画の割当単位のサイズの積の最小のサイズの空記憶領域を取得し、
    前記割付要求サイズを前記割付単位のサイズで割った値の2進数表示を求め、
    前記受け付けた割付要求に対して、該2進数表示でビット1の立っているビット位置毎の2のべき乗と前記割当単位のサイズの積の大きさの記憶領域からなる連続した記憶領域を、前記取得した2のべき乗と区画の割当単位のサイズの積の最小のサイズの空記憶領域に割り付けることを特徴とする記憶領域割付方法。
  9. 請求項4乃至請求項8のいずれか1項に記載の記憶領域割付方法において、
    前記取得した最小のサイズの空記憶領域のうち前記割り付ける記憶領域以外の残りの記憶領域を解放することを特徴とする記憶領域割付方法。
  10.  請求項9に記載の記憶領域割付方法において、
     前記取得した最小のサイズの空記憶領域のうち前記割り付ける記憶領域以外の残りの記憶領域は、バディシステムにより解放することを特徴とする記憶領域割付方法。
  11.  請求項4乃至請求項10のいずれか1項に記載の記憶領域割付方法により割り付けた記憶領域を解放する記憶領域解放方法において、
     前記ビット位置の小さい記憶領域から順に、バディシステムにより解放することを特徴とする記憶領域解放方法。
  12.  請求項1~請求項11のいずれか1項に記載の方法をコンピュータに実行させるためのプログラム。
  13.  請求項1~請求項11のいずれか1項に記載の方法をコンピュータに実行させるためのプログラムを記憶したコンピュータ読み取り可能な記憶媒体。
  14.  予め割り付けられた記憶領域である区画の割付サイズを取得し、該割付サイズと、前記区画の割付単位のサイズから互いに異なる2のべき乗の和を算出し、前記区画を、該算出された互いに異なる2のべき乗のべき乗数毎に該2のべき乗と前記区画の割当単位のサイズの積からなる大きさの記憶領域である主区域に分割し、前記主区域毎に前記区画を管理する、記憶装置の記憶領域管理のための割付区分表のデータ構造において、
     前記割付区分表は、前記主区域を識別する主区域番号毎に、該主区域の割付位置とサイズを格納するものであり、
     前記主区域毎に記憶領域のバディシステムによる割付管理を可能とする割付管理表のデータ構造。
PCT/JP2009/003452 2008-08-17 2009-07-22 記憶領域管理方法、記憶領域割付方法及びプログラム WO2010021085A1 (ja)

Priority Applications (5)

Application Number Priority Date Filing Date Title
EP09808021.1A EP2339471A4 (en) 2008-08-17 2009-07-22 STORAGE REGION MANAGEMENT METHOD, STORAGE REGION ALLOCATION METHOD, AND PROGRAM
JP2010525569A JP4761590B2 (ja) 2008-08-17 2009-07-22 記憶領域管理方法、記憶領域割付方法及びプログラム
CN200980131921.9A CN102124452B (zh) 2008-08-17 2009-07-22 存储区域管理方法、存储区域分配方法以及程序
US12/929,813 US9164902B2 (en) 2008-08-17 2011-02-17 Storage region management method, storage region allocation method and program
US14/865,977 US9778872B2 (en) 2008-08-17 2015-09-25 Storage region management method, storage region allocation method and program

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2008209395 2008-08-17
JP2008-209395 2008-08-17
JP2008264689 2008-10-11
JP2008-264689 2008-10-11

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US12/929,813 Continuation US9164902B2 (en) 2008-08-17 2011-02-17 Storage region management method, storage region allocation method and program

Publications (1)

Publication Number Publication Date
WO2010021085A1 true WO2010021085A1 (ja) 2010-02-25

Family

ID=41706978

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/003452 WO2010021085A1 (ja) 2008-08-17 2009-07-22 記憶領域管理方法、記憶領域割付方法及びプログラム

Country Status (5)

Country Link
US (2) US9164902B2 (ja)
EP (2) EP3128431A1 (ja)
JP (1) JP4761590B2 (ja)
CN (1) CN102124452B (ja)
WO (1) WO2010021085A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2631821A1 (en) * 2011-03-21 2013-08-28 Huawei Technologies Co., Ltd. File storage method and device thereof

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8538926B2 (en) * 2011-03-08 2013-09-17 Rackspace Us, Inc. Massively scalable object storage system for storing object replicas
CN102981964B (zh) * 2012-11-01 2016-08-03 华为技术有限公司 数据存储空间的管理方法及系统
CN109308267B (zh) * 2017-07-28 2021-12-03 星宸科技股份有限公司 行车记录器的储存装置的控制方法与储存装置控制系统
US10877763B2 (en) 2018-08-02 2020-12-29 International Business Machines Corporation Dispatching, allocating, and deallocating instructions with real/virtual and region tags in a queue in a processor
CN113196757B (zh) * 2018-12-20 2024-04-26 瑞典爱立信有限公司 用于使用图片中的均匀片段分割进行视频编码的方法和装置
US20220244869A1 (en) * 2021-02-02 2022-08-04 Micron Technology, Inc. File system storage allocation based on zones of a memory device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0728693A (ja) 1993-06-30 1995-01-31 Microsoft Corp ディスクスペースを管理する変型バデイシステム
US6131150A (en) * 1993-10-05 2000-10-10 Digital Equipment Corporation Scaled memory allocation system
JP2002202902A (ja) * 2000-10-27 2002-07-19 Sony Computer Entertainment Inc パーティション作成方法および削除方法、プログラムを記録した記録媒体、情報処理装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7610468B2 (en) * 2006-10-26 2009-10-27 Hewlett-Packard Development Company, L.P. Modified buddy system memory allocation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0728693A (ja) 1993-06-30 1995-01-31 Microsoft Corp ディスクスペースを管理する変型バデイシステム
US6131150A (en) * 1993-10-05 2000-10-10 Digital Equipment Corporation Scaled memory allocation system
JP2002202902A (ja) * 2000-10-27 2002-07-19 Sony Computer Entertainment Inc パーティション作成方法および削除方法、プログラムを記録した記録媒体、情報処理装置

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
"METHOD FOR ALLOCATING COMPUTER DISK SPACE TO A FILE OF KNOWN SIZE", IBM TECHNICAL DISCLOSURE BULLETIN, vol. 27, no. 10B, March 1985 (1985-03-01), pages 6260 - 6261, XP002315149 *
HONG MIN ET AL.: "An Efficient Dynamic Memory Allocator for Sensor Operating Systems", PROCEEDINGS OF THE 2007 ACM SYMPOSIUM ON APPLIED COMPUTING, ACM, - March 2007 (2007-03-01), pages 1159 - 1164, XP008145436 *
See also references of EP2339471A4
TAKU YASUI: "First Study of the Linux Kernel (Part 5 Kernel Memory Management)", NIKKEI LINUX, vol. 6, no. 1, 8 January 2004 (2004-01-08), pages 123 - 130

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2631821A1 (en) * 2011-03-21 2013-08-28 Huawei Technologies Co., Ltd. File storage method and device thereof
EP2631821A4 (en) * 2011-03-21 2014-01-08 Huawei Tech Co Ltd METHOD FOR STORING FILES AND CORRESPONDING DEVICE
US10133666B2 (en) 2011-03-21 2018-11-20 Huawei Technologies Co., Ltd. File storage method and apparatus

Also Published As

Publication number Publication date
JPWO2010021085A1 (ja) 2012-01-26
US9778872B2 (en) 2017-10-03
US20110145538A1 (en) 2011-06-16
CN102124452B (zh) 2015-01-14
EP3128431A1 (en) 2017-02-08
EP2339471A4 (en) 2013-10-23
US20160266837A1 (en) 2016-09-15
EP2339471A1 (en) 2011-06-29
JP4761590B2 (ja) 2011-08-31
US9164902B2 (en) 2015-10-20
CN102124452A (zh) 2011-07-13

Similar Documents

Publication Publication Date Title
JP4761590B2 (ja) 記憶領域管理方法、記憶領域割付方法及びプログラム
CN108628753B (zh) 内存空间管理方法和装置
JP6205650B2 (ja) 不均等アクセス・メモリにレコードを配置するために不均等ハッシュ機能を利用する方法および装置
JP6542909B2 (ja) ファイル操作方法及び装置
US7933938B2 (en) File storage system, file storing method and file searching method therein
US10191998B1 (en) Methods of data reduction for parallel breadth-first search over graphs of connected data elements
CN103064639A (zh) 数据存储方法及装置
JP2006195960A5 (ja)
WO2019001020A1 (zh) 基于分布式系统的存储空间整理方法、装置及系统
CN107193503B (zh) 一种数据重删方法及存储设备
KR20080060117A (ko) 파일 시스템 장치 및 그 파일 시스템의 파일 저장 및 파일 탐색 방법
CN104424219B (zh) 一种数据文件的管理方法及装置
CN109407985B (zh) 一种数据管理的方法以及相关装置
CN107111627A (zh) 在线文件系统检查
KR102316271B1 (ko) 데이터 저장장치의 주소 맵핑 테이블 운용 방법
GB2593408A (en) Increasing data performance by transferring data between storage tiers using workload characteristics
JP5447523B2 (ja) データ処理装置、データ記録方法、データ記録プログラム
WO2016106757A1 (zh) 一种存储数据的管理方法、存储管理器及存储系统
US9740604B2 (en) Method for allocating storage space using buddy allocator
CN113722319A (zh) 基于学习索引的数据存储方法
CN107203479B (zh) 层级化存储系统、存储控制器及层级化控制方法
WO2016191964A1 (zh) 一种文件系统的管理方法及装置
JP6006740B2 (ja) インデックス管理装置
CN109582235A (zh) 管理元数据存储方法及装置
WO2022002128A1 (zh) 一种读数据的方法、写数据的方法、设备和系统

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 200980131921.9

Country of ref document: CN

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

Ref document number: 09808021

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2010525569

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2009808021

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2009808021

Country of ref document: EP