Data compression method and structure for a direct access storage device

Abstract: A data compression method and compression data structure are provided for a direct access storage device (DASD). The DASD is segmented into a plurality of compression groups. Each of the compression groups has a fixed logical size. A directory table is written within each of the compression groups. Eachcompression group has at least one compressed data region on which compressed data can be written and an exception region on which compressed data exceptions can be written. The compressed data exceptions include updated compressed data which exceeds an original storage space for corresponding original compressed data.

Description: Field of the Invention The present invention relates to a data compression method and structure for a direct access storage device (DASD) using fixed block architecture (FBA). Description of the Prior Art Computers often include auxiliary memory storage units having media on which data can be written and from which data can be read. Disk drive units or DASDs, often incorporating stacked, commonly rotated rigid magnetic disks, are used for storage of data in magnetic form on the disk surfaces. Data is recorded in radially spaced data information tracks arrayed on the surfaces of the disks. Transducer heads driven in a path toward and away from the drive axis write data to the disks and read data from the disks. A data cylinder includes a set of corresponding data information tracks for the stack of disk surfaces. In a DASD using fixed block architecture (FBA), the data information tracks are divided into equally sized segments or sectors. Each sector is assigned a number or logical block address (LBA). Typically, a data file is written and read using consecutive LBA's, trackfollowing on the data information tracks of successive consecutive logical data surfaces from the starting LBA. Fragmentation occurs when blocks of data from the file are written to available discontinuous sectors at different locations on the DASD. To utilize the relatively limited amount of the available data storage capacity of DASDs, data may be stored by a compression technique. However to effectively utilize DASDs, response time should be both predictable and fast. Response time consistency is an extremely important consideration. In cases of heavy work load, response time must at least be predictable For batch operations, businesses typically rely on certain windows of low system load to run background applications. If time requirements for these applications are not consistent and predictable, it becomes difficult to schedule the work flow, Potentially resulting in windows of time where the system is heavily overloaded. The operational characteristics of DASDs that do not use data compression provide a yardstick by which consistency and operational predictability are measured. When compression is enabled on commercial systems, response time consistency should be similar to DASD subsystem without data compression. Applying data compression techniques for DASD on a system with fixed page sizes results in compressed pages of variable size that can subsequently change in size as they are updated over time. When these compressed pages are stored on DASD that use a fixed block architecture (FBA) or fixed sector size, a mechanism must be provided to manage this variation in size. Current techniques typically move the data to some discontiguous area on the DASD when confronted with the case where subsequently updated compressed data has grown to the point where it no longer fits in the original space. This results in fragmentation when the updated compressed page is a member of a larger sequential data block. Fragmentation can lead to wide variations in performance as data is accessed sequentially at later points in time. Performance degradation can result from the additional mechanical seek times incurred as the actuator moves to access pages that are located on different tracks, out of order. To date, this characteristic of compressed data has been a major inhibitor to using data compression in high performance computer systems, such as, an IBM AS/400 commercial system. It is highly desirable to provide an improved data compression method and structure for a direct access storage device (DASD) having performance and response time consistency similar to a DASD subsystem without compression. European Patent Application EP-A-0 587 437 (IBM Corporation) entitled "Data compression/decompression and storage of compressed and uncompressed data on a single data storage volume" discloses a data file having a plurality of data blocks divided into one or more transfer units of data blocks. Before data storage, each transfer unit of data blocks is subjected to its own data compression cycle to create a group of compressed data blocks. The size of the data transfer unit, in bytes, is selected to be facile for addressing and retrieving individual recorded groups of compressed data blocks while providing good channel utilization and compression efficiency. Also the data-tranfer unit size is selected in part based upon data storage efficiency, i.e. the storage of the compressed data should fill as many addressable data storage areas as possible. Upon recording each group of compressed data bytes, an entry is made into a file directory for enabling addressing the recorded compressed data blocks. International Patent Application WO 91 20076 A (Storage Technology Corporation) entitled "Apparatus for compressing data in a dynamic mapped virtual data storage subsystem" discloses a dynamically mapped virtual memory system for storing data so that each data record occupies only the physical space required for the data. Furthermore, the data storage subsystem manages the allocation of physical space on the disk drives and does not rely on the file extend defined in the count key data format. Data compaction apparatus is provided to remove the gaps contained in the stream of count key data records received from the host processor. A data compression algorithm is then used to compress the received data into a compressed format for storage on the disk drives. It is the compacted compressed data that is finally stored on the disk drives. Furthermore, any data record received from the host processor absent data in the user data field therein is simply listed in the virtual memory map as a null field occupying no physical space on the disk drives. The data storage control, though its mapping capability, stores the actual data in the minimum physical space required by overcoming the limitations imposed on large form factor disk drives by the use of count key data format data records. However, the data storage subsystem returns this stored data to the host processor in count key data format through a data record reformatting process once the stored compacted compressed data is staged to the cache memory for access by the host processor. The data storage subsystem is operationally independent of the host processor, yet performs as if it were a standard operationally dependent large form factor disk subsystem. International Patent Application WO 91 19255 A (Maxtor Corporation) entitled "Apparatus and method for efficient organization of compressed data on a hard disk) discloses an apparatus and method for efficiently storing compressed data on a disk by using a logical block size smaller than the physical formatted block size. An embedded controller system comprising a microprocessor, a compression/decompression coprocessor, and an LBA/HCS Table selects a logical block size based on a user-selected Compression Ration most likely. Compressed data is stored in a logical block while the LBA/HCS Table stores information concerning the length and location of compressed data. When a block of compressed data is too large to fit within a single logical block, an overflow condition occurs. The overflow data is stored in other physical blocks in a reserve partition of the disk; the blocks used may be non-sequential. The LBA/HCS Table stores information linking the blocks that contain related data from a compressed data block. Summary of the Invention The invention is defined according to claim 1. Important objects of the present invention are to provide an improved data compression method and structure for a direct access storage device (DASD) and to provide such method and structure that overcomes many of the disadvantages of prior art arrangements. In brief, a data compression method and compression data structure are provided for a direct access storage device (DASD). The DASD is segmented into a plurality of compression groups. Each of the compression groups has a fixed logical size. A directory table is written within each of the compression groups. Each compression group has at least one compressed data region on which compressed data can be written and an exception region on which compressed data exceptions can be written. The compressed data exceptions include updated compressed data which exceeds an original storage space for corresponding original compressed data. Brief Description of the Drawings The present invention together with the above and other objects and advantages may best be understood from the following detailed description of the preferred embodiments of the invention illustrated in the drawings, wherein: FIG. 1 is a block diagram illustrating a system employing a storage controller for implementing integrated direct access storage device (DASD) compression and a data compression structure in accordance with the present invention; FIG. 2 is a block diagram illustrating a data compression structure in accordance with the present invention; FIGS. 3-5 are flow charts illustrating logical steps performed by a storage controller of the DASD compression system of FIG. 1 in accordance with the present invention. Detailed Description of the Preferred Embodiments Referring now to the drawings, in FIG. 1 there is illustrated a block diagram representation of an exemplary system generally designated by 10 for performing a data compression method of the invention. As illustrated, the exemplary system 10 includes a data processing or host system generally designated by 12. Host system 12 includes an application operating system 14, a file system 16 and a direct access storage device (DASD) data storage management function 18 used to store data onto at least one DASD 36. DASD storage management function 18 includes a logical directory 20 that stores the logical block addresses where data is placed on the associated DASD or DASDs 36. Data is accessed on the DASD 36 through a storage controller generally designated by 22 that compresses data when it is written to the DASD and decompresses data when it is read from the DASD. Storage controller 22 includes a compression and decompression functional block 24, a data buffer 26 for storing data, a compression management logic block 28 for performing address translation and a physical directory cache 30 that is used for storing cache directory elements of the DASD directory generated within the storage controller 22. Storage controller 22 receives data pages from the host system 12, compresses it, and creates compressed data pages to be stored in sectors, appending compression headers that enable directory recovery to occur. Once the physical location of data on DASD is determined by the compression management logic 28, compressed data is passed to or received from the DASD 36 via a device bus interface 32. DASD 36 includes a plurality of variable sized compression groups 38, each compression group is used for storing related host system data. Each compression group includes a compressed data area 40 for storing original and updated compressed data, an exception region 42 for storing updated compressed pages that are larger than their original allocated space and a directory or micro table 44 for locating data within the compression group. The compressed data area 40 consists of multiple compression regions 50. A feature of the invention is that compressed data is organized on DASD 36 so that the spatial relationships of related data are maintained within each compression group 38, together with necessary space management parameters. The resulting structure of the compressed data provides consistent performance in a commercial environment and minimizes performance impact due to using data compression. Having reference now to FIG. 2, the data compression structure is illustrated. Segmentation of data on DASD is provided into multiple finite blocks or compression groups 38 (CG0 through CG N). Each compression group 38 is managed as an integral unit with space allocated flexibly within it according to a compressed data hierarchy of the invention. Data within each compression group 38 represents a fixed logical address range from the view of host system 12 with variations in physical size depending on the compression characteristics of the stored data. A compression group 38 is not limited to any particular size; however, data storage efficiencies are realized when the compression group size is chosen to be as large or larger than the majority of data blocks that the host system 12 allocates. It should also be relatively large with respect to the system page size. The compression group size is chosen to generally match file system storage management allocation and access patterns. For an IBM AS/400 computer system 12, the compression group size has been selected to be lMB with a system page size of 4K. Within the compression group 38, data is stored sequentially in the order dictated by the system addressing model. Each system data page is compressed individually within the group and stored in the physical space equivalent to its compressed size. There is no requirement that compression groups 38 maintain any spatial relationship with respect to one another. Each compression group 38 consists of a variable number of compression regions 50, and is therefore variable in terms of physical size. As shown, each compression group 38 physically comprises an integral number of compression regions 50 (CR 0 through CR M). Compression regions 50 are used to provide a convenient granularity for managing disk space. Although any size could be used including a sector, the functionally indivisible, minimum addressable data area on DASD 36, selecting the size of the compression region 50 to match the disk geometry, for example, a track size or other implementation dependent size, is beneficial. The use of compression regions 50 is optional, although it contributes to the realization of efficient implementations. In FIG. 2, the exception and administration region (EXCP) includes the exception region 42 and the micro table directory 44. EXCP region is predefined space within the compression group 38 for compressed pages that no longer fit in the space currently allocated for them and directory data. The EXCP region consists of an integral number of compression regions 50. Although the EXCP region does affect the sequential storage of data within a compression group 38, exception region 42 ensures that updated data is not stored far from its original storage space and neighboring file data. In many cases, the use of the small computer system interface (SCSI) Skip Read and Skip Write Commands allow for the acquisition of exception region stored data along with its neighboring pages in a single operation. The SCSI Skip Read and Skip Write Commands utilize a skip mask to set selected sectors to be read or written with other sectors set as zero that are skipped. Even when this cannot be accomplished, a long seek is avoided due to the close proximity of the EXCP region. Directory information to aid in the location of data within each block is kept with the data in each compression group 38. Similarly, the close proximity of the directory information to its related data minimizes DASD seeks when the directory must be accessed. In practice, directory information also is cached in the storage controller 22, minimizing updates of directory information in the compression group micro table directory 44. Each compression region 50 includes multiple compression pages 52 (CP 1 to CP J). The size of the compression page 52 advantageously is selected to be equal to the system page size. This eliminates the need for the DASD subsystem controller 22 to perform read-modify-write operations to a compressed page 52 where only a portion of the data has been modified by the host system 12. The compression region 50 consists of a fixed number of physical sectors 54 containing a variable number of compression pages 52. Physical size of compression page 52 is 1 to n physical sectors 54 (PS 0 - PS i) dependent on the particular compression ratio. Compression pages 52 may span compression regions 50 within a compression group 38. The physical sector 54 includes compressed data 56 and an optional physical sector header 58 for control information. Referring now to FIG. 3, there is shown a flow chart illustrating sequential operations for a read sequence starting at a block 300. First a read command from host computer 12 is received by the storage controller 22 as indicated at a block 302. Storage controller 22 determines a compression group 38 using the high order bits in host logical block address (LBA) as indicated at a block 304. Storage controller 22 locates the compression group directory from physical directory cache 30 if present, or directly from the DASD 36 as indicated at a block 306. Next storage controller 22 determines the physical offset and length of the target page or pages to be read. As indicated at a block 308, storage controller 22 calculates the DASD logical block address using the compression group directory and low order bits in the host logical block address, for example, as an index and calculates number of blocks using compression group directory. With a single or multiple page read operation with exceptions, then storage controller 22 calculates the LBA of the exception region 42 using the compression group directory and low order bits in the host logical block address, for example, as an index and calculates the device exception region number of blocks using compression group directory as indicated at a block 310. Then storage controller 22 generates the device operation or operations using the calculated device logical block address, device number of blocks, device exception region logical block address, and device exception region number of blocks as indicated at a block 312. When the read operation includes exceptions and the exceptions are within the span of a SCSI skip operation, storage controller 22 generates the skip read command for this operation. Otherwise, when the exceptions are not within the span of a SCSI skip operation, controller generates two operations. Storage controller 22 send the commands or operations to the DASD 36, receives and decompresses the data as indicated at a block 314. This competes the read sequence. FIG. 4 illustrates sequential operations for a write sequence starting at a block 400. First storage controller 22 receives a write command from the host computer 12 as indicated at a block 402. Storage controller 22 compresses the data to be written and determines the compressed length as indicated at a block 404. Then storage controller 22 determines the compression group 38 using the high order bits in host logical block address as indicated at a block 406. Storage controller 22 locates the compression group in directory 30 as indicated at a block 408. Storage controller 22 calculates the starting physical address or DASD logical block address using the compression group directory 30 and the low order bits in host logical block address, for example, as an index and calculates the number of blocks using compression group directory and compressed data length as indicated at a block 410. If the compressed host pages do not fit in the physical space available, storage controller 22 calculates the exception region logical block address using the compression group directory and low order bits in host logical block address, for example, as an index. Storage controller 22 calculates the device exception region number of blocks using the compression group directory 30 and the compressed data length as indicated at a block 412. Storage controller 22 generates the device operation or operations using the calculated values for the device logical block address, device number of blocks, device exception region logical block address, and device exception region number of blocks as indicated at a block 414. Next storage controller 22 updates the compression group directory 30 as indicated at a block 416. Storage controller 22 sends the commands or operations to the device 36 and provides the compressed data as indicated at a block 418. This completes the write sequence. Some localized fragmentation can occur within a compression group 38. No global fragmentation occurs because related data physically resides within one compression group 38. Any localized fragmentation is cleaned up within the compression group 38 at desired intervals. The sweep sequence provides background operations required to periodically rectify localized fragmentation. Referring to FIG. 5, there is shown a flowchart illustrating sequential steps for a background sweep operation that is initiated to correct localized fragmentation of the stored compressed data. First storage controller 22 determines the amount of physical device space needed to hold a particular compression group 38 using the compression group directory 30 as indicated at a block 502. Storage controller 22 allocates physical space on the device 36 to hold this compression group 38 as indicated at a block 504. Next storage controller 22 generates a new compression group directory with all compressed data reordered in ascending host logical block address sequence and with the exception region 42 empty as indicated at a block 506. Storage controller 22 uses the original compression group directory 30 to generate read operations to gather all data in the original compression group as indicated at a block 508. Storage controller 22 then uses the new compression group directory to generate write operations to store all data in the new compression group 38 as indicated at a block 510. Storage controller 22 sends operations to the device 36 and receives the compressed data as indicated at a block 512. Storage controller 22 sends operations to the device 36 and provides the compressed data as indicated at a block 514. Storage controller 22 deallocates the original compression group physical space on the device 36 and updates the compressed DASD directory as indicated at a block 516. This completes the sweep sequence.

Claims: A method for storing compressed data in a direct access storage device DASD (36) of the type including a fixed block architecture, comprising the steps of: segmenting the DASD (36) into a plurality of compression groups (38) ; each of said compression groups (38) having a fixed logical size; allocating at least one compressed data region (50) and an exception region (42) within each compression group (38); writing (400..420) and reading (300..136) related compressed data to and from said at least one compressed data region (50) of one of said plurality of compression groups (38); writing (400..420) and reading (300..316) compressed data exceptions to and from said exception region (42); said compressed data exceptions including updated compressed data which exceeds an original storage space for corresponding original compressed data; and writing a corresponding directory table (44) within said exception region (42) for each of said compression groups (38); said method characterized in that it comprises the further steps: periodically performing (500..518) a background sweep operation to correct fragmentation within an identified compression group (38), said fragmentation resulting from compressed data exceptions written to the exception region (42). The method for storing compressed data as recited in claim 1 wherein said steps of performing a background sweep operation includes the steps of: identifying (502) an amount of DASD physical space required for the compression group utilizing an original compression group directory, generating (506) a new compression group directory with all compressed data of said identified compression group reordered in ascending host logical block address sequence with said exception region being empty in a new compression group; utilizing (508) said original compression group directory to gather all data in said identified compression group; and utilizing (510) said generated new compression group directory to store all data in said new compression group. The method for storing compressed data as recited in claim 1 wherein said step of writing related compressed data to said at least one compressed data region includes the steps of compressing (404) data received from a host computer and identifying a compressed data length. The method for storing compressed data as recited in claim 3 wherein said step of writing related compressed data to said at least one compressed data region includes the steps of identifying (406) one of said compression groups utilizing a host logical block address for the data received from the host computer. The method for storing compressed data as recited in claim 1 wherein said step of writing related compressed data to said at least one compressed data region includes the steps of calculating (410) a DASD logical block address utilizing a compression group directory and said host logical block address, calculating a DASD number of blocks using said compression group directory and said identified compressed data length. The method for storing compressed data as recited in claim 1 wherein said step of writing compressed data exceptions to said exception region includes the steps of: compressing data received from a host computer and identifying a compressed data length; identifying one of said compression groups utilizing a host logical block address for the data received from the host computer; calculating (412) a DASD exception region logical block address utilizing a compression group directory and said host logical block address, and calculating (412) a DASD exception region number of blocks using said compression group directory and said identified compressed data length. A system (10..50) for reading and writing compressed data comprising means for carrying out the method for storing a compression data in a direct access storage device (36) according to any one of the preceding claims.

Inventors: BAKKE BRIAN ERIC, MOERTL DANIEL FRANK, WALK BRUCE MARSHALL, BAKKE, BRIAN ERIC, MOERTL, DANIEL FRANK, WALK, BRUCE MARSHALL
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1996
Main classification: G06F3
IPC codes: G06F3, G11B20