The present inventive concepts relate to data storage, and more particularly, to a storage apparatus and method for autonomous space compaction of data.
It is expected that within the next few years, billions of sensors will be deployed around the world and connected to the Internet Of Things (IOT). The amount of data collected by such sensors will be stored at least temporarily, and in some cases, permanently. The IOT will therefore rely on vast storage databases and underlying storage devices. Storage space compaction is an important aspect of modern data storage. For example, NoSQL database systems periodically merge database files and/or tables to reduce search footprints and maximize free space. Log-structured file systems (e.g., append-only file systems) sometimes implement segment cleaning to improve contiguous space availability for sequential writes. Other conventional approaches include disk defragmentation processes, which clean up invalid space for better performance.
Conventional approaches commonly cause intensive read and/or write activity between host CPUs and storage devices for data compaction. For example, Sorted Strings Tables (SSTables) can be compacted in Apache Cassandra™, an open source distributed database management system, but the intensive communication activity between the host CPUs and storage devices can be a limiting factor for performance. By way of another example, Append Only File (AOF) file rewrites in Redis, an open source key-value cache and store, can be challenging to scale due to the communication overhead. Embodiments of the present inventive concept address these and other limitations in the prior art.
Embodiments of the inventive concept can include a storage device having a space compaction engine. The storage device can further include one or more data storage sections and a communication and routing logic section configured to receive and route a data compaction command including metadata from a host. The space compaction engine can be communicatively coupled to the communication and routing logic section and to the one or more data storage sections. The space compaction engine can be configured to receive, from the communication and routing logic section, the data compaction command including the metadata, and to compact preexisting stored data in the one or more data storage sections based at least on the metadata and the data compaction command received from the host.
Embodiments of the inventive concept can include a computer-implemented method for compacting space in a storage device. The method can include receiving, by a communication and routing logic section of the storage device, a data compaction command including metadata from a host. The method can include routing, by the communication and routing logic section, the data compaction command to a space compaction engine. The method can include receiving, by the space compaction engine, the data compaction command including the metadata. The method can include compacting, by the space compaction engine, preexisting stored data in one or more data storage sections of the storage device, based at least on the metadata and the data compaction command received from the host.
The foregoing and additional features and advantages of the present inventive principles will become more readily apparent from the following detailed description, made with reference to the accompanying figures, in which:
Reference will now be made in detail to embodiments of the inventive concept, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous specific details are set forth to enable a thorough understanding of the inventive concept. It should be understood, however, that persons having ordinary skill in the art may practice the inventive concept without these specific details. In other instances, well-known methods, procedures, components, circuits, and networks have not been described in detail so as not to unnecessarily obscure aspects of the embodiments.
It will be understood that, although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first logic section could be termed a second logic section, and, similarly, a second logic section could be termed a first logic section, without departing from the scope of the inventive concept.
The terminology used in the description of the inventive concept herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the inventive concept. As used in the description of the inventive concept and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term “and/or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. The components and features of the drawings are not necessarily drawn to scale.
Embodiments of the inventive concept improve performance, energy efficiency, and capacity of storage solutions, for example, by reducing the data movement between the CPU and the storage device and increasing the available capacity of the underlying storage devices via in-storage support for data compaction. Embodiments include a storage apparatus and method for autonomous in-storage space compaction initiated by a host-side command and according to metadata specified by a host.
A space compact engine can function as an independent module or logic section within a storage device, which can migrate data within the storage device, thereby freeing up capacity and making preexisting data more compact, as further described below. The space compact engine can cause self compact operations, self compact and trim operations, move and compact operations, and/or merge and compact operations, as also described in detail below. The space compact engine can notify the host of the completion of the operations. Memory bandwidth and host-CPU consuming work can be offloaded to an intelligent storage device to better utilize internal bandwidth and low power consumption of the storage device. In other words, such bandwidth and host-CPU consuming work can be replaced with a space compaction engine and process within the storage device, responsive to commands and metadata from the host.
The host 102 can include one or more applications 115 and a device driver 120. The one or more applications 115 can include, for example, a file system, a database, one or more processes, or the like. The one or more applications 115 can issue one or more command calls 125 to the device driver 120. For example, the one or more command calls 125 can include a data compaction command call 125. The data compaction command call 125 can be issued by way of an Ioctl, including a particular designated device, a command string, and metadata. For example, the Ioctl can be in the form of Ioctl(dev, “COMPACT”, metadata, . . . ). It will be understood that the data compaction command call 125 can take other suitable forms or can be issued in other suitable ways without departing from the inventive concept disclosed herein. For example, the compaction command can be issued via a web-service interface, an application programming interface (API), or the like.
The host 102 can communicate with the storage device 130 via an interface 152. The interface 152 can include a serial advanced technology attachment (SATA) interface, a serial attached small computer system interface (serial attached SCSI or SAS), a non-volatile memory host controller interface specification express (NVMe) interface, an Ethernet interface such as a 10G/40G/100G Ethernet interface, a Fibre Channel (FC) interface, an Infiniband interface, a remote direct memory access (RDMA) interface, or the like. The device driver 120 of the host 102 can receive the data compaction command call 125. The device driver 120 can generate a command 150 including metadata 155, which can be transmitted to the storage device 130 from the host layer 105 to the device layer 110 via the interface 152.
In this manner, the storage device 130 can inherit the user and/or application-defined compaction parameters according to their own data structure determined on the host layer 105. The lower level flash translation layer (FTL) (not shown) or flash garbage collector (GC) (not shown) of the storage device 130 need not be aware of the user and/or application-defined compaction parameters, and vice-versa. Rather, the space compaction engine 145 can inherit the parameters from the host and autonomously implement the compaction within the storage device 130 based on such parameters. Consequently, the space compaction engine 145 also need not be aware of the FTL or the flash GC, but can sit at a level higher in the hardware and/or software stack. The command 150 and associated metadata 155 is described in detail below.
The storage device 130 can include a communication and routing logic section 140. The communication and routing logic section 140 can receive the command 150 and associated metadata 155 from the device driver 120 of the host 102. In response to the command 150 being associated with the data compaction command call (e.g., 125), the communication and routing logic section 140 can route the command 150 to the space compaction engine 145 via line 160.
The space compaction engine 145 can be communicatively coupled to the communication and routing logic section 140 via lines 160 and/or 170, and to a physical storage section 135 via line 165. The physical storage section 135 can include one or more data storage sections, for example, such as one or more non-volatile memory sections 134 and/or one or more volatile memory sections 136. The physical storage section 135 can include one or more processors 132. The one or more processors 132 can include one or more microprocessors and/or central processing units (CPUs). The space compaction engine 145 can receive, from the communication and routing logic section 140, the data compaction command 150 including the metadata 155. The space compaction logic section 147 can process the data compaction command 150 and/or the metadata 155. The space compaction storage section 149 can store the the data compaction command 150 and/or the metadata 155. The space compaction engine 145 can compact preexisting stored data in the physical storage section 135 based at least on the metadata 155 and the data compaction command 150 received from the host 102, as further described in detail below. The space compaction engine 145 can generate and transmit a reply 170 to the communication and routing logic section 140, which can send a reply 175 to the device driver 120 of the host. The reply 170 and/or 175 can indicate, for example, success or failure of the storage compaction request.
The communication and routing logic section 140 can route non-compaction related commands (e.g., any command not related to data compaction or the space compaction engine 145) via regular paths 180 and 185. In other words, all other commands that are not associated with space compaction can be routed by the communication and routing logic section 140 directly to the physical storage section 135, with replies being sent via line 185 back to the communication and routing section 140, and then returned as the reply 175 to the device driver 120 of the host 102.
The space compaction engine 145 (of
In some embodiments, the object 210 can be a file 210. For example, the object 210 can be a file 210 within a file system, a database, a key store, or the like. In the illustrated example, one or more source data addresses 215 can correspond to a first range of logical block addresses (LBAs) 217 within the file 210 and a second range of LBAs 219 within the file 210. The one or more new data addresses 220 can correspond to a third range 226 of LBAs within the file 210. For example, the first range 217 can correspond to LBAs 1-400, the second range 219 can correspond to LBAs 1000-1100, and the third range 226 can correspond to LBAs 4000-4500. It will be understood that any suitable number of subsets of the preexisting stored data and associated LBA ranges can exist in the file 210. After the migration of data, some of the preexisting stored data can be located in a different portion of the file 210 while other of the preexisting stored data can be located in a same portion of the file 210.
After the migration of data, an empty portion 230 can exist toward the end or tail of the file 210 due at least in part to the invalid data 225 being discarded. A log tail 235 before the migration can be adjusted to a new location 240 after the migration. Accordingly, the compaction can reorganize the file 210 so that the valid data 222 is logically contiguously organized, and the free or empty space can be logically contiguously organized, based at least on the command 150 and the metadata 155 received from the host 102 (of
The object 310 can be a database table 310 including one or more pages (e.g., page 1 through N). Each of the one or more pages can include one or more valid records (e.g., valid R1, valid R2, etc.) and/or one or more unused and/or invalid entries (e.g., 320, 322, and/or 325). The space compaction engine 145 (of
For example, as shown in page 1 of the preexisting data 315 of the database table 310, valid record R1 is followed by unused and/or invalid space 320, which is followed by valid record R2, which is followed by unused space 322. After the space compaction engine 145 (of
By way of another example, as shown in page N of the preexisting data 315 of the database table 310, valid record R1 is followed by unused space 325, which is followed by valid record R3, which is followed by valid record R2. After the space compaction engine 145 (of
Accordingly, the space compaction engine 145 (of
The first AOF file 410 can include preexisting stored data 425. The preexisting stored data 425 can exist in the first AOF file 410 stored in the storage device 130 prior to the command 150 being generated. The space compaction engine 145 (of
The space compaction engine 145 (of
Accordingly, in advanced key-value cache stores such as Redis, the compaction can compact the first AOF file 410 into the second AOF file 20, based at least on the command 150 and the metadata 155 received from the host 102 (of
The object pointer 505 can point to an object 510, which can be stored on the storage device 130, and can include a first portion (e.g., keys 545, values 540, and/or stale values 535) of preexisting stored data. The first portion (e.g., keys 545, values 540, and/or stale values 535) of preexisting stored data can exist in the object 510 stored in the storage device 130 prior to the command 150 being generated. The object pointer 515 can point to another object 520, which can be stored on the storage device 130, and can include a second portion (e.g., keys 547, values 555, and/or stale value 550) of preexisting stored data. The second portion (e.g., keys 547, values 555, and/or stale value 550) of preexisting stored data can exist in the object 520 stored in the storage device 130 prior to the command 150 being generated. The object pointer 525 can point to an object 530, which can be pre-allocated and/or stored on the storage device 130.
The space compaction engine 145 (of
The first object 510 can correspond to a first Sorted Strings Table (SSTable) 510. The first portion of the preexisting stored data in the first SSTable 510 can include one or more keys 545, one or more values 540, and/or one or more stale values 535. The second object 520 can correspond to a second SSTable 520. The second portion of the preexisting stored data in the second SSTable 520 can include one or more values 555 and corresponding one or more keys 547. The second portion of the preexisting stored data in the second SSTable 520 can also include one or more stale values 550 and corresponding one or more keys 547. The third object 530 can correspond to a third SSTable 530, which can be pre-allocated on the storage device 130 for writing a new merged SSTable.
The space compaction engine 145 (of
The stale values (e.g., 535 and 550) need not be migrated. More specifically, the space compaction engine 145 (of
Accordingly, the compaction can merge the first SSTable 510 and the second SSTable 520 into the third SSTable 530, based at least on the command 150 and the metadata 155 received from the host 102 (of
Otherwise, if so, meaning that the command is a data compaction command, the flow can proceed to 720. At 720, the communication and routing logic section (e.g., 140 of
The following discussion is intended to provide a brief, general description of a suitable machine or machines in which certain aspects of the inventive concept can be implemented. Typically, the machine or machines include a system bus to which is attached processors, memory, e.g., random access memory (RAM), read-only memory (ROM), or other state preserving medium, storage devices, a video interface, and input/output interface ports. The machine or machines can be controlled, at least in part, by input from conventional input devices, such as keyboards, mice, etc., as well as by directives received from another machine, interaction with a virtual reality (VR) environment, biometric feedback, or other input signal. As used herein, the term “machine” is intended to broadly encompass a single machine, a virtual machine, or a system of communicatively coupled machines, virtual machines, or devices operating together. Exemplary machines include computing devices such as personal computers, workstations, servers, portable computers, handheld devices, telephones, tablets, etc., as well as transportation devices, such as private or public transportation, e.g., automobiles, trains, cabs, etc.
The machine or machines can include embedded controllers, such as programmable or non-programmable logic devices or arrays, Application Specific Integrated Circuits (ASICs), embedded computers, smart cards, and the like. The machine or machines can utilize one or more connections to one or more remote machines, such as through a network interface, modem, or other communicative coupling. Machines can be interconnected by way of a physical and/or logical network, such as an intranet, the Internet, local area networks, wide area networks, etc. One skilled in the art will appreciate that network communication can utilize various wired and/or wireless short range or long range carriers and protocols, including radio frequency (RF), satellite, microwave, Institute of Electrical and Electronics Engineers (IEEE) 545.11, Bluetooth®, optical, infrared, cable, laser, etc.
Embodiments of the present inventive concept can be described by reference to or in conjunction with associated data including functions, procedures, data structures, application programs, etc. which when accessed by a machine results in the machine performing tasks or defining abstract data types or low-level hardware contexts. Associated data can be stored in, for example, the volatile and/or non-volatile memory, e.g., RAM, ROM, etc., or in other storage devices and their associated storage media, including hard-drives, floppy-disks, optical storage, tapes, flash memory, memory sticks, digital video disks, biological storage, etc. Associated data can be delivered over transmission environments, including the physical and/or logical network, in the form of packets, serial data, parallel data, propagated signals, etc., and can be used in a compressed or encrypted format. Associated data can be used in a distributed environment, and stored locally and/or remotely for machine access.
Having described and illustrated the principles of the inventive concept with reference to illustrated embodiments, it will be recognized that the illustrated embodiments can be modified in arrangement and detail without departing from such principles, and can be combined in any desired manner. And although the foregoing discussion has focused on particular embodiments, other configurations are contemplated. In particular, even though expressions such as “according to an embodiment of the inventive concept” or the like are used herein, these phrases are meant to generally reference embodiment possibilities, and are not intended to limit the inventive concept to particular embodiment configurations. As used herein, these terms can reference the same or different embodiments that are combinable into other embodiments.
Embodiments of the inventive concept may include a non-transitory machine-readable medium comprising instructions executable by one or more processors, the instructions comprising instructions to perform the elements of the inventive concepts as described herein.
The foregoing illustrative embodiments are not to be construed as limiting the inventive concept thereof. Although a few embodiments have been described, those skilled in the art will readily appreciate that many modifications are possible to those embodiments without materially departing from the novel teachings and advantages of the present disclosure. Accordingly, all such modifications are intended to be included within the scope of this inventive concept as defined in the claims.
This application claims the benefit of U.S. Patent Application Ser. No. 62/169,551, filed Jun. 1, 2015, which is hereby incorporated by reference.
Number | Date | Country | |
---|---|---|---|
62169551 | Jun 2015 | US |