# US 2023/0067709 A1 · Scalable segment cleaning for a log-structured file system

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

- Number: US 2023/0067709 A1
- Document ID: US20230067709A1
- Status: Published application
- Kind: A1
- Application number: 18/048,170
- Filed: 2022-10-20
- Published: 2023-03-02
- Earliest claimed: 2020-08-21
- Applicants: VMware, Inc.
- Inventors: Wenguang Wang; Junlong Gao; Vamsi Gunturu
- Web page: https://patentgrep.com/patent/US20230067709A1

## CPC

- G06F 3/0652: {Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket}
- G06F 3/0683: {Plurality of storage devices}
- G06F 3/0604: {Improving or facilitating administration, e.g. storage management}
- G06F 3/0608: {Saving storage space on storage systems}
- G06F 3/0664: {at device level, e.g. emulation of a storage device or system}
- G06F 3/0665: {at area level, e.g. provisioning of virtual or logical volumes}
- G06F 3/0673: {Single storage device}
- G06F 16/1734: {Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Scalable segment cleaning for log-structured file systems (LFSs) includes determining counts of segment cleaners and virtual nodes, with each virtual node being associated with a plurality of objects. Each virtual node is assigned to a selected segment cleaner. Based at least on the assignments, performing, for each virtual node, segment cleaning of the objects by the assigned segment cleaner. A portion, less than all, of the virtual nodes are reassigned to a newly selected segment cleaner based on a change of the count of the segment cleaners and/or a change of the count of the virtual nodes. Based at least on the reassignments, segment cleaning of the objects is performed, for each reassigned virtual node, by the reassigned segment cleaner. In some examples, the objects comprise virtual machine disks (VMDKs) and the segment cleaning uses a segment usage table (SUT) to track segment usage and identify segment cleaning candidates.

## Claims

### Claim 1

A method of segment cleaning, the method comprising:
determining a first count of a plurality of segment cleaners;
determining a first count of a plurality of virtual nodes, wherein each virtual node is associated with a plurality of objects;
assigning each virtual node of the plurality of virtual nodes to a selected one of the plurality of segment cleaners;
determining an occurrence of one or more of the following reassignment conditions:
the first count of the plurality of segment cleaners changing to a second count of the plurality of segment cleaners, the first count of the plurality of virtual nodes changing to a second count of the plurality of virtual nodes;
for a portion, less than all, of the plurality of virtual nodes, reassigning each virtual node of the portion to a newly selected segment cleaner; and
performing segment cleaning according to the reassignment.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first count of the plurality of segment cleaners is more than the second count of the plurality of segment cleaners, wherein the reassignment comprises reassigning only one or more of the plurality of virtual nodes, that were mapped to one or more of the plurality of segment cleaners that have ceased operation, to one or more of the plurality of segment cleaners that remain in operation.

### Claim 3 (depends on 1)

The method of claim 1, wherein the first count of the plurality of segment cleaners is less than the second count of the plurality of segment cleaners, wherein the reassignment comprises reassigning only one or more of the plurality of virtual nodes to one or more new segment cleaners that have been spawned.

### Claim 4 (depends on 3)

The method of claim 3, the method further comprising:
monitoring a workload of the plurality of segment cleaners;
based on the monitoring, determining that one or more of the plurality of segment cleaners are overloaded; and
based on determining that the one or more of the plurality of segment cleaners are overloaded, spawning the one or more new segment cleaners.

### Claim 5 (depends on 1)

The method of claim 1, wherein the first count of the plurality of virtual nodes is more than the second count of the plurality of virtual nodes, wherein the reassignment comprises reassigning only one or more of the plurality of virtual nodes that have ceased operation from the plurality of segment cleaners.

### Claim 6 (depends on 1)

The method of claim 1, wherein the first count of the plurality of virtual nodes is less than the second count of the plurality of virtual nodes, wherein the reassignment comprises reassigning only one or more new virtual nodes to the plurality of segment cleaners.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
summarizing, in a segment usage table (SUT), an amount of live space left in each of a plurality of log segments;
identifying one or more of the plurality of log segments for segment cleaning;
determining, by checking each block of the identified one or more of the plurality of log segments, whether a content addressable storage (CAS) points to one of the plurality of log segments;
upon determining that the CAS points to the one of the plurality of log segments, identifying those blocks as live blocks;
rewriting the live blocks in one or more new log segments; and
adjusting the CAS to point to the one or more new log segments and removing the one of the plurality of log segments.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
determining, for each of the plurality of log segments, a count of the live blocks as a live block count;
identifying at least one of the plurality of log segments for which the live block count is zero; and
over-writing the identified at least one of the plurality of log segments without moving any block from the identified at least one of the plurality of log segments.

### Claim 9

A computer system for segment cleaning, the computer system comprising:
a processor; and
a non-transitory computer readable medium having stored thereon program code that upon execution causes the processor to:
determine a first count of a plurality of segment cleaners;
determine a first count of a plurality of virtual nodes, wherein each virtual node is associated with a plurality of objects;
assign each virtual node of the plurality of virtual nodes to a selected one of the plurality of segment cleaners;
determine an occurrence of one or more of the following reassignment conditions: the first count of the plurality of segment cleaners changing to a second count of the plurality of segment cleaners, the first count of the plurality of virtual nodes changing to a second count of the plurality of virtual nodes;
upon determining the occurrence, for a portion, less than all, of the plurality of virtual nodes, reassign each virtual node of the portion to a newly selected segment cleaner; and
perform segment cleaning according to the reassignment.

### Claim 10 (depends on 9)

The computer system of claim 9, wherein the first count of the plurality of segment cleaners is more than the second count of the plurality of segment cleaners, wherein the reassignment comprises reassigning only one or more of the plurality of virtual nodes, that were mapped to one or more of the plurality of segment cleaners that have ceased operation, to one or more of the plurality of segment cleaners that remain in operation.

### Claim 11 (depends on 9)

The computer system of claim 9, wherein the first count of the plurality of segment cleaners is less than the second count of the plurality of segment cleaners, wherein the reassignment comprises reassigning only one or more of the plurality of virtual nodes to one or more new segment cleaners that have been spawned.

### Claim 12 (depends on 11)

The computer system of claim 11, the program code upon executing further causing the processor to:
monitor a workload of the plurality of segment cleaners;
based on the monitoring, determine that one or more of the plurality of segment cleaners are overloaded; and
based on determining that the one or more of the plurality of segment cleaners are overloaded, spawn the one or more new segment cleaners.

### Claim 13 (depends on 9)

The computer system of claim 9, wherein the first count of the plurality of virtual nodes is more than the second count of the plurality of virtual nodes, wherein the reassignment comprises reassigning only one or more of the plurality of virtual nodes that have ceased operation from the plurality of segment cleaners.

### Claim 14 (depends on 9)

The computer system of claim 9, wherein the first count of the plurality of virtual nodes is less than the second count of the plurality of virtual nodes, wherein the reassignment comprises reassigning only one or more new virtual nodes to the plurality of segment cleaners.

### Claim 15

A non-transitory computer readable storage medium having stored thereon program code executable by a processor, the program code embodying a method comprising:
determining a first count of a plurality of segment cleaners;
determining a first count of a plurality of virtual nodes, wherein each virtual node is associated with a plurality of objects;
assigning each virtual node of the plurality of virtual nodes to a selected one of the plurality of segment cleaners;
determining an occurrence of one or more of the following reassignment conditions: the first count of the plurality of segment cleaners changing to a second count of the plurality of segment cleaners, the first count of the plurality of virtual nodes changing to a second count of the plurality of virtual nodes;
upon determining the occurrence, for a portion, less than all, of the plurality of virtual nodes, reassigning each virtual node of the portion to a newly selected segment cleaner; and
performing segment cleaning according to the reassignment.

### Claim 16 (depends on 15)

The non-transitory computer readable storage medium of claim 15, wherein the first count of the plurality of segment cleaners is more than the second count of the plurality of segment cleaners, wherein the reassignment comprises reassigning only one or more of the plurality of virtual nodes, that were mapped to one or more of the plurality of segment cleaners that have ceased operation, to one or more of the plurality of segment cleaners that remain in operation.

### Claim 17 (depends on 15)

The non-transitory computer readable storage medium of claim 15, wherein the first count of the plurality of segment cleaners is less than the second count of the plurality of segment cleaners, wherein the reassignment comprises reassigning only one or more of the plurality of virtual nodes to one or more new segment cleaners that have been spawned.

### Claim 18 (depends on 17)

The non-transitory computer readable storage medium of claim 17, wherein the program code further comprises:
monitoring a workload of the plurality of segment cleaners;
based on the monitoring, determining that one or more of the plurality of segment cleaners are overloaded; and
based on determining that the one or more of the plurality of segment cleaners are overloaded, spawning the one or more new segment cleaners.

### Claim 19 (depends on 15)

The non-transitory computer readable storage medium of claim 15, wherein the first count of the plurality of virtual nodes is more than the second count of the plurality of virtual nodes, wherein the reassignment comprises reassigning only one or more of the plurality of virtual nodes that have ceased operation from the plurality of segment cleaners.

### Claim 20 (depends on 15)

The non-transitory computer readable storage medium of claim 15, wherein the first count of the plurality of virtual nodes is less than the second count of the plurality of virtual nodes, wherein the reassignment comprises reassigning only one or more new virtual nodes to the plurality of segment cleaners.
