Patent Description:
Solid-state drives (SSDs) are a type of storage device for storing data. An SSD is organized into blocks, with each block including a number of pages made up of a row of cells. SSDs read and write data as pages, but erase data at the block level. Once a block is erased, new data can be written to the cells of the block. A block can be written and erased a predefined amount of time before the SSD fails. For example, a block may be limited to writing and erasing a block <NUM> times. <CIT> discloses a method of instantiation containers in a unified volume.

According to the present invention there is provided a computer-implemented method according to accompanying claims <NUM> and <NUM>.

According to a second aspect of the invention there is provided a non-transitory computer-readable medium comprising program code that is executable by a processor according to accompanying claim <NUM>.

In another aspect of the present invention, a system is provided according to accompanying claims <NUM> and <NUM>.

Writes of multiple containers can be stored in a solid-state drive (SSD). Writes are data objects, such as files, that are transferred from one location to another. For example, a write can be a transfer of a data object to an SSD. The writes are interleaved based on when they are received, so data from one container is not stored in a continuous space. When free space of the SSD is limited, the SSD can erase data associated with containers that have shut down and released their SSD space. However, SSDs erase data by block, so an entire block has to include released data before the SSD can erase the data. As a result, the SSD performs reads and writes to move unreleased data in the block to a different block. Reading is the process of obtaining the data from the block and writing is the operation of transferring the read data to the different block. The writes from moving data to the different block are referred to as write amplification, which increases overhead of the system. Overhead can be an increase in bandwidth, computation time, memory usage, or other resource usage, resulting in suboptimal performance of the system. Additionally, write amplification can reduce the lifespan of the SSD, since SSDs are limited in the number of times a block can be erased.

Some examples of the present disclosure can overcome one or more of the abovementioned problems by providing a system that can designate a space of an SSD for a write of one or more containers. The system can store the write for the one or more containers in the space in response to loading the one or more containers for executing the one or more containers. The system can synchronize loading and executing the one or more containers, so that the write is stored in the designated space. The system can determine an end to an execution phase. The execution phase can be a phase during which the one or more containers are activated and performing read and write operations or other processes. The end of the execution phase can be a shut down or deactivation of the one or more containers. In response to determining the end to the execution phase, the system can remove the write from the space of the SSD. The system can maintain the write in the space until the system determines each of the one or more containers is no longer in the execution phase. Since the write for the containers is removed entirely at once, write amplification can be reduced for the SSD.

One particular example can involve two containers writing to the same SSD. The system can determine the write for the two containers is expected to be 8MB. As a result, the system can designated 8MB of continuous space in the SSD to store the write. The system can then load the two containers and store the write in the designated space. The system can determine an end to an execution phase for both of the containers. In response to the end of the execution phase for both of the containers, the system can remove the write from the designated space of the SSD. The system can erase the space without moving data to other spaces in the SSD, thereby reducing write amplification for the SSD.

These illustrative examples are given to introduce the reader to the general subject matter discussed here and are not intended to limit the scope of the disclosed concepts. The following sections describe various additional features and examples with reference to the drawings in which like numerals indicate like elements but, like the illustrative examples, should not be used to limit the present disclosure.

<FIG> is a block diagram of an example of a system <NUM> for managing write removal for a solid-state drive according to some aspects of the present disclosure. The system <NUM> includes a client device <NUM>, a server <NUM>, and a solid-state drive (SSD) <NUM>. Examples of the client device <NUM> can include a desktop computer, a laptop, a mobile phone, etc. The client device <NUM> can communicate with the server <NUM> over a network <NUM>, such as a local area network (LAN) or the Internet.

In some examples, the client device <NUM> can execute containers 104a-b. The client device <NUM> may execute the containers 104a-b individually or simultaneously. The server <NUM> can designate a space <NUM> of the SSD <NUM> to which a write <NUM> of one or more of the containers 104a-b is to be stored. If the client device <NUM> executes the containers 104a-b, the server <NUM> can designate the space <NUM> for the container 104a. A different space of the SSD <NUM> can be designated for the container 104b. To designate the space <NUM>, the server <NUM> can determine an expected space requirement for the write <NUM> of each of the containers 104a-b. The server <NUM> can designate the space <NUM> as the same size as the expected space requirement. For example, the expected space requirement can be a number of blocks in the SSD <NUM>. As one particular example, the server <NUM> can determine the write <NUM> for the containers 104a-b has an expected space requirement of 4MB and designate the space <NUM> as 4MB. The space <NUM> can be a continuous space of the SSD <NUM>. Pre-allocating the space <NUM> can allow the write <NUM> to be released without write amplification. Although 4MB is used in this example, the space may be any suitable size for a write of one or more containers.

The SSD <NUM> is a Zoned Namespace SSD. In such examples, the space <NUM> can be multiple zones that collectively satisfy the expected space requirement for the write <NUM>. Each container is designated to a different zone of the space <NUM> so that the data for each container is not interleaved. Alternatively, multiple containers are designated to a zone, but the number of containers per zone can be minimized to reduce write amplification. The server <NUM> may determine the space <NUM> to be a number of zones high enough to allow writes to run in parallel, but low enough for the zones to be filled.

In some examples, the server <NUM> can load the containers 104a-b to be executed during an execution phase. During the execution phase, the server <NUM> stores the write <NUM> for the containers 104a-b to the space <NUM> after loading the containers 104a-b. The containers 104a-b can be a container group and the server <NUM> coordinates the execution phase of the containers 104a-b so that the containers 104a-b are started and executed simultaneously. Alternatively, the server <NUM> coordinates the execution phase of the containers 104a-b so that containers 104a-b are executed in succession to each other. While the containers 104a-b are in the execution phase, the server <NUM> maintains the write <NUM> in the space <NUM>. Maintaining the write <NUM> can ensure that portions of the data of the write <NUM> are not removed before an entirety of the write <NUM> can be removed.

The server <NUM> monitors the containers 104a-b to determine when the execution phase for the containers 104a-b ends. The execution phase can end when the containers 104a-b shut down or are no longer performing operations. The server <NUM> determines an end to the execution phase, and in response, removes the write <NUM> from the space <NUM> of the SSD <NUM>. For example, the server <NUM> can determine the end of the execution phase and then transmit a command <NUM> to the SSD <NUM> indicating the write <NUM> is to be removed. The command <NUM> is a trim command specifying the write <NUM> in the space <NUM> is to be removed. If the containers 104a-b are executed simultaneously, the server <NUM> transmits the trim command subsequent to determining the end of the execution phase for all of the containers 104a-b. The SSD <NUM> can be configured to remove the write <NUM> from the space <NUM> in response to receiving the command <NUM>. Removing the write <NUM> can free up the space <NUM> for additional writes without moving data to other spaces of the SSD <NUM>. As a result, write amplification for the SSD <NUM> can be reduced.

It will be appreciated that <FIG> is intended to be illustrative and non-limiting. Other examples may include more components, fewer components, different components, or a different arrangement of the components shown in <FIG>. For instance, although the system <NUM> includes two containers in the example of <FIG>, the system <NUM> may coordinate a larger number of containers in other examples.

<FIG> is a block diagram of another example of a system <NUM> for managing write removal for a solid-state drive according to some aspects of the present disclosure. The system <NUM> includes a solid-state drive (SSD) <NUM> and a processor <NUM>. The processor <NUM> may be part of a server, such as the server <NUM> in <FIG>.

In this example, the processor <NUM> is communicatively coupled with a memory <NUM>. The processor <NUM> can include one processor or multiple processors. Non-limiting examples of the processor <NUM> include a Field-Programmable Gate Array (FPGA), an application-specific integrated circuit (ASIC), a microprocessor, etc. The processor <NUM> can execute instructions <NUM> stored in the memory <NUM> to perform operations. The instructions <NUM> can include processor-specific instructions generated by a compiler or an interpreter from code written in any suitable computer-programming language, such as C, C++, C#, etc..

The memory <NUM> can include one memory or multiple memories. Non-limiting examples of the memory <NUM> can include electrically erasable and programmable read-only memory (EEPROM), flash memory, or any other type of nonvolatile memory. At least some of the memory <NUM> includes a non-transitory computer-readable medium from which the processor <NUM> can read the instructions <NUM>. The non-transitory computer-readable medium can include electronic, optical, magnetic, or other storage devices capable of providing the processor <NUM> with computer-readable instructions or other program code. Examples of the non-transitory computer-readable medium can include magnetic disks, memory chips, ROM, random-access memory (RAM), an ASIC, optical storage, or any other medium from which a computer processor can read the instructions <NUM>.

In some examples, the processor <NUM> executes the instructions <NUM> to perform operations. For example, the processor <NUM> designates a space <NUM> of a SSD <NUM> for a write <NUM> of a container <NUM>. The processor <NUM> stores the write <NUM> for the container <NUM> in the space <NUM> in response to loading the container <NUM> for executing the container <NUM>. The processor <NUM> determines an end to an execution phase for the container <NUM>, and in response to determining the end to the execution phase <NUM>, the processor <NUM> removes the write <NUM> from the space <NUM> of the SSD <NUM>.

In some examples, the processor designates the space <NUM> for a plurality of containers. The processor <NUM> can synchronize loading and executing the plurality of containers, such that a write for each container is stored in the space <NUM>. The processor <NUM> determines the end of the execution phase for the plurality of containers and then removes the write <NUM> from the space. The processor <NUM> can synchronize the removal of the write <NUM>, such that the entirety of the write <NUM> is removed simultaneously, as opposed to a write for a portion of the plurality of containers <NUM>. The processor <NUM> transmits a command to the SSD <NUM> indicating the write <NUM> is to be removed in response to determining the end of the execution phase for the plurality of containers.

In some examples, the processor <NUM> can implement some or all of the steps shown in <FIG>. Other examples can include more steps, fewer steps, different steps, or a different order of the steps than is shown in <FIG>. The steps of <FIG> are discussed below with reference to the components discussed above in relation to <FIG>.

In block <NUM>, the processor <NUM> designates a space <NUM> of an SSD <NUM> for a write <NUM> of a container <NUM>. The processor <NUM> determines an expected space requirement for the write <NUM> and designates the space <NUM> based on the expected space requirement. The SSD <NUM> is a Zoned Namespace SSD, the processor <NUM> designates the space <NUM> as a plurality of zones of the Zoned Namespace SSD.

In block <NUM>, the processor <NUM> stores the write <NUM> for the container <NUM> in the space <NUM> in response to loading the container <NUM> for executing the container <NUM>. In examples where the space <NUM> is designated for a plurality of containers, the processor <NUM> can synchronize loading and executing the plurality of containers <NUM>.

In block <NUM>, the processor <NUM> determines an end to an execution phase <NUM> for the container <NUM>. The processor <NUM> can determine that the container <NUM> has shut down or is no longer performing operations to determine the end to the execution phase <NUM>. While the container <NUM> is in the execution phase, the processor <NUM> can maintain the write <NUM> in the space <NUM> of the SSD <NUM>.

In block <NUM>, the processor <NUM>, in response to determining the end to the execution phase <NUM>, removes the write <NUM> from the space <NUM> of the SSD <NUM>. The processor <NUM> transmits a trim command to the SSD <NUM> indicating the write <NUM> is to be removed. The SSD <NUM> is configured to remove the write <NUM> in response to receiving the command. As a result, data for the container <NUM> can be removed from a continuous space of the SSD <NUM>, therefore reducing write amplification for the SSD <NUM>.

Claim 1:
A system (<NUM>) comprising:
a processor (<NUM>); and
a memory (<NUM>) including instructions that are executable by the processor for causing the processor to:
designate a space (<NUM>) of a solid-state drive (<NUM>), SSD, for a write of a data object of a container (<NUM>);
store the write (<NUM>) of the data object of the container (<NUM>) in the space (<NUM>) in response to loading the container (<NUM>) for executing the container (<NUM>);
determine an end to an execution phase for the container (<NUM>);
in response to determining the end to the execution phase (<NUM>), remove the data object written for the container (<NUM>) from the space of the SSD (<NUM>); wherein
the memory (<NUM>) further includes instructions that are executable by the processor for causing the processor (<NUM>) to designate the space (<NUM>) by:
determining an expected space requirement for the write (<NUM>) of the data object of the container (104b); and
designating the space (<NUM>) based on the expected space requirement;
remove the write (<NUM>) of the data object of the container (<NUM>) from the space of the SSD by transmitting a trim command (<NUM>) to the SSD (<NUM>) indicating the write (<NUM>) of the data object of the container (104b) is to be removed;
wherein the container (<NUM>) is among a plurality of containers and the memory further includes instructions that are executable by the processor for causing the processor (<NUM>) to:
designate the space (<NUM>) for the write (<NUM>) of respective data objects of the plurality of containers;
store the write (<NUM>) of the respective data objects for the plurality of the containers in the space (<NUM>) in response to loading the plurality of containers for executing the plurality of containers;
determine the end to the execution phase (<NUM>) for the plurality of containers; and
in response to determining the end of the execution phase (<NUM>), remove the write of the respective data objects of the plurality of containers from the space of the SSD (<NUM>) and wherein the SSD (<NUM>) comprises a Zoned Namespace SSD and the space comprises a plurality of zones and each of the plurality of containers is designated to a respective zone of the space (<NUM>).