# US 10,768,829 B2 · Opportunistic use of streams for storing data on a solid state device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,768,829 B2
- Document ID: US10768829B2
- Status: Granted
- Kind: B2
- Application number: 15/628,994
- Filed: 2017-06-21
- Published: 2018-08-16
- Granted: 2020-09-08
- Earliest claimed: 2017-02-15
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Rajsekhar Das; Scott Chao-Chueh Lee; Chesong Lee; Tristan C. Griffith; William R. Tipton; Erik Schmidt
- Web page: https://patentgrep.com/patent/US10768829B2

## CPC

- G06F 3/0616: {in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]}
- G06F 3/061: {Improving I/O performance}
- G06F 3/064: {Management of blocks}
- G06F 3/0643: {Management of files}
- G06F 3/0652: {Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket}
- G06F 3/0679: {Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]}
- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 16/16: File or folder operations, e.g. details of user interfaces specifically adapted to file systems
- G06F 16/1724: {Details of de-fragmentation performed by the file system (saving storage space on storage systems G06F3/0608; management of blocks in storage devices G06F3/064)}
- G06F 16/1847: {specifically adapted to static storage, e.g. adapted to flash memory or SSD}
- G06F 2212/1016: Performance improvement
- G06F 2212/1036: Life time enhancement
- G06F 2212/214: Solid state disk
- G06F 2212/7202: Allocation control and policies
- G06F 2212/7205: Cleaning, compaction, garbage collection, erase control
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The use of steaming functionality on a storage device may be optimized by performing a combination of stream and non-stream writes based on a size of the data being written to a given stream. For example, a method may comprise writing data associated with a plurality of files to a first set of one or more erase blocks, determining that an amount of data associated with a given one of the plurality of files in the first set of one or more erase blocks has reached a threshold, and moving the data associated with the given file from the first set of one or more erase blocks to a stream, the stream comprising a second set of one or more erase blocks on the storage device different from the first set of one or more erase blocks.

## Claims

### Claim 1

A method for optimizing the use of streams for storing data on a storage device, comprising:
writing data associated with a plurality of files to a first set of one or more erase blocks located on the storage device that are not associated with one or more streams, each of the one or more streams comprising at least one other set of one or more erase blocks located on the storage device;
determining an amount of data associated with a given one of the plurality of files in the first set of one or more erase blocks;
determining that the amount of data associated with the given file has reached a predetermined threshold; and
in response to determining that the threshold has been reached, moving the data associated with the given file from the first set of one or more erase blocks to a stream of the one or more streams, the stream comprising a second set of one or more erase blocks located on the storage device that are different from the first set of one or more erase blocks.

### Claim 2 (depends on 1)

The method of claim 1, wherein the stream comprises data exclusive to the given file.

### Claim 3 (depends on 1)

The method of claim 1, further comprising writing data associated with the given file to the stream.

### Claim 4 (depends on 3)

The method of claim 3, further comprising, in response to determining that the amount of data in the stream has reached a second threshold, the second threshold being based on a size of the stream, writing data associated with the given file to the first set of one or more erase blocks.

### Claim 5 (depends on 4)

The method of claim 4, wherein the size of the stream is stored as metadata.

### Claim 6 (depends on 1)

The method of claim 1, further comprising performing a trim operation on the data associated with the given file in the first set of one or more erase blocks.

### Claim 7 (depends on 1)

The method of claim 1, wherein moving the data associated with the given file from the first set of one or more erase blocks to the stream comprises, by a file system:
writing the data associated with the given file to local memory;
sending, to the storage device, a request to write data associated with the given file to the stream; and
updating metadata associated with the file and maintained by the file system to reflect the new location of the data associated with the given file on the storage device.

### Claim 8 (depends on 1)

The method of claim 1, wherein moving the data associated with the given file from the first set of one or more erase blocks to the stream comprises, by the storage device:
receiving a stream identifier associated with the stream;
copying the data associated with the given file from the first set of one or more erase blocks to the stream; and
updating metadata maintained by the storage device to reflect the new location of the data associated with the given file in the stream on the storage device.

### Claim 9

A computing device comprising a processing unit, a memory, and a file system executing on the processing unit, the file system when executing on the processing unit performing operations comprising:
writing data associated with a plurality of files to a first set of one or more erase blocks located on the storage device that are not associated with one or more streams, each of the one or more streams comprising at least one other set of one or more erase blocks located on the storage device;
determining an amount of data associated with a given one of the plurality of files in the first set of one or more erase blocks;
determining that the amount of data associated with the given file has reached a predetermined threshold; and
in response to determining that the threshold has been reached, moving the data associated with the given file from the first set of one or more erase blocks to a stream of the one or more streams, the stream comprising a second set of one or more erase blocks located on the storage device that are different from the first set of one or more erase blocks.

### Claim 10 (depends on 9)

The computing device of claim 9, wherein the file system is further configured to perform operations comprising updating metadata associated with the file and maintained by the file system to reflect the new location of the data associated with the given file on the storage device.

### Claim 11 (depends on 10)

The computing device of claim 10, wherein the location of the data associated with the given file is a logical block address.

### Claim 12 (depends on 10)

The computing device of claim 10, wherein the metadata further comprises a size of the stream.

### Claim 13 (depends on 9)

The computing device of claim 9, wherein the file system is further configured to perform operations comprising instructing the storage device to execute a trim command on the data associated with the given file in the first set of one or more erase blocks.

### Claim 14 (depends on 9)

The computing device of claim 9, wherein moving the data associated with the given file from the first set of one or more erase blocks to the stream comprises, by the file system:
writing the data associated with the given file to the memory;
sending, to the storage device, a request for a stream identifier;
receiving, from the storage device, a stream identifier associated with the stream; and
sending, to the storage device, a request to write the data associated with the given file to the stream, wherein the request to write the data to the stream comprises the stream identifier associated with the stream.

### Claim 15

A computer-readable storage medium storing instructions that, when executed by a computing device, cause the computing device to perform operations comprising:
writing data associated with a plurality of files to a first set of one or more erase blocks located on the storage device that are not associated with one or more streams, each of the one or more streams comprising at least one other set of one or more erase blocks located on the storage device;
determining an amount of data associated with a given one of the plurality of files in the first set of one or more erase blocks;
determining that the amount of data associated with the given file has reached a predetermined threshold; and
in response to determining that the threshold has been reached, moving the data associated with the given file from the first set of one or more erase blocks to a stream of the one or more streams, the stream comprising a second set of one or more erase blocks located on the storage device that are different from the first set of one or more erase blocks.

### Claim 16 (depends on 15)

The computer-readable storage medium of claim 15, wherein the stream comprises data exclusive to the given file.

### Claim 17 (depends on 15)

The computer-readable storage medium of claim 15, wherein the instructions, when executed, further cause writing data associated with the given file to the stream.

### Claim 18 (depends on 17)

The computer-readable storage medium of claim 17, wherein the instructions, when executed, further cause, in response to determining that the amount of data in the stream has reached a second threshold, the second threshold being based on a size of the stream, writing data associated with the given file to the first set of one or more erase blocks.

### Claim 19 (depends on 15)

The computer-readable storage medium of claim 15, wherein the instructions, when executed, further cause performing a trim operation on the data associated with the given file in the first set of one or more erase blocks.

### Claim 20 (depends on 15)

The computer-readable storage medium of claim 15, wherein moving the data associated with the given file from the first set of one or more erase blocks to the stream comprises, by a file system:
writing the data associated with the given file to a memory;
sending, to the storage device, a request to write data associated with the given file to the stream; and
updating metadata associated with the file and maintained by the file system to reflect the new location of the data associated with the given file on the storage device.
