IP Library Granted Patent US 12,468,626
Granted Patent B2
US 12,468,626 · App. 18/633,248 · Granted Nov 11, 2025

Techniques for garbage collecting zones in a file system

Inventors: Prathamesh Amritkar (Los Angeles, CA); Peng Xu (Los Angeles, CA); Jinhyuk Kim (Los Angeles, CA); Kyoungryun Bae (Los Angeles, CA)
Assignee: Lemon Inc.
G06F12/0253
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,468,626
App. No.
18/633,248
Granted
Nov 11, 2025
Kind
B2
Abstract

Described are examples for performing garbage collection in a file system having multiple zones of data. A garbage rate associated with an amount of invalid data in the zone can be computed for each zone of the multiple zones in the file system. One or more candidate zones, of the multiple zones, can be determined for garbage collection based on the garbage rate and a sequence number assigned to the zone. Garbage collection of the one or more candidate zones in the file system can be performed.

Claims (41)

1 . A computer-implemented method for performing garbage collection, in a file system having multiple zones of data, using sequence numbers assigned to the multiple zones to assess hotness or coldness of the data, comprising:

computing, for each zone of the multiple zones in the file system, a garbage rate associated with an amount of invalid data in the zone;

determining, based on the garbage rate and a sequence number assigned to each zone, one or more candidate zones, of the multiple zones, for garbage collection to prioritize garbage collection of zones having colder data than other zones, wherein the sequence number is assigned to each zone at a time the zone is created for storing data; and

performing garbage collection of the one or more candidate zones in the file system.

2 . The computer-implemented method of claim 1 , wherein determining the one or more candidate zones includes determining that the sequence number of the one or more candidate zones is outside of a dwell time from a highest sequence number of the multiple zones, wherein the dwell time represents a range of sequence numbers, from the highest sequence number, which corresponds to a latest assigned zone, to be avoided during garbage collection.

3 . The computer-implemented method of claim 1 , wherein the one or more candidate zones includes multiple candidate zones, and wherein determining the multiple candidate zones includes:

determining a subset of multiple ones of the one or more candidate zones having a highest garbage rate; and

removing, from the subset of multiple ones of the one or more candidate zones, at least one candidate zone having a garbage rate that is less than a garbage rate gap from the highest garbage rate of a top candidate zone in the subset, wherein the garbage rate gap is configured by the file system and represents a range of garbage rate from the highest garbage rate to be considered in garbage collection.

4 . The computer-implemented method of claim 3 , wherein performing the determining of the multiple candidate zones is based at least in part on determining that a capacity of the file system achieves a threshold.

5 . The computer-implemented method of claim 1 , wherein the one or more candidate zones includes multiple candidate zones, and wherein determining the multiple candidate zones includes:

determining a subset of multiple ones of the one or more candidate zones having a highest garbage rate; and

removing, from the subset of multiple ones of the one or more candidate zones, at least one candidate zone having a higher sequence number than other candidate zones in the subset to prioritize garbage collecting zones with colder data.

6 . The computer-implemented method of claim 5 , wherein performing the determining of the multiple candidate zones is based at least in part on determining that a capacity of the file system achieves a threshold.

7 . The computer-implemented method of claim 1 , wherein the one or more candidate zones includes multiple candidate zones, and wherein determining the multiple candidate zones includes:

determining a subset of multiple ones of the one or more candidate zones having a highest garbage rate; and

removing, from the subset of multiple ones of the one or more candidate zones, at least one candidate zone having a sequence number that is greater than a sequence number gap from a candidate zone in the subset having a lowest sequence number, wherein the sequence number gap is configured by the file system and represents a range of sequence numbers from the lowest sequence number to be considered in garbage collection.

8 . The computer-implemented method of claim 7 , wherein performing the determining of the multiple candidate zones is based at least in part on determining that a capacity of the file system achieves a threshold.

9 . The computer-implemented method of claim 1 , wherein determining the one or more candidate zones includes determining the one or more candidate zones having a highest garbage rate and having a sequence number that is outside of a dwell time from a highest sequence number of the multiple zones, wherein the dwell time represents a range of sequence numbers, from the highest sequence number, which corresponds to a latest assigned zone, to be avoided during garbage collection.

10 . The computer-implemented method of claim 9 , wherein determining the one or more candidate zones is based at least in part on determining that a capacity of the file system achieves a threshold.

11 . The computer-implemented method of claim 1 , wherein determining the one or more candidate zones includes determining that the one or more candidate zones are opened by a host application, such that zones opened by the file system for rewriting valid data are not considered for garbage collection.

12 . An apparatus for performing garbage collection in a file system having multiple zones of data, the apparatus comprising one or more processors and one or more non-transitory memories with instructions thereon, wherein the instructions upon execution by the one or more processors, cause the one or more processors to:

compute, for each zone of the multiple zones in the file system, a garbage rate associated with an amount of invalid data in the zone;

determine, based on the garbage rate and a sequence number assigned to each zone, one or more candidate zones, of the multiple zones, for garbage collection; and

perform garbage collection of the one or more candidate zones in the file system.

13 . The apparatus of claim 12 , wherein the instructions upon execution by the one or more processors, cause the one or more processors to determine the one or more candidate zones at least in part by determining that the sequence number of the one or more candidate zones is outside of a dwell time from a highest sequence number of the multiple zones.

14 . The apparatus of claim 12 , wherein the one or more candidate zones includes multiple candidate zones, and wherein the instructions upon execution by the one or more processors, cause the one or more processors to determine the multiple candidate zones at least in part by:

determining a subset of multiple ones of the one or more candidate zones having a highest garbage rate; and

removing, from the subset of multiple ones of the one or more candidate zones, at least one candidate zone having a garbage rate that is less than a garbage rate gap from the highest garbage rate of a top candidate zone in the subset.

15 . The apparatus of claim 12 , wherein the one or more candidate zones includes multiple candidate zones, and wherein the instructions upon execution by the one or more processors, cause the one or more processors to determine the multiple candidate zones at least in part by:

determining a subset of multiple ones of the one or more candidate zones having a highest garbage rate; and

removing, from the subset of multiple ones of the one or more candidate zones, at least one candidate zone having a higher sequence number than other candidate zones in the subset.

16 . The apparatus of claim 12 , wherein the one or more candidate zones includes multiple candidate zones, and wherein the instructions upon execution by the one or more processors, cause the one or more processors to determine the multiple candidate zones at least in part by:

determining a subset of multiple ones of the one or more candidate zones having a highest garbage rate; and

removing, from the subset of multiple ones of the one or more candidate zones, at least one candidate zone having a sequence number that is greater than a sequence number gap from a candidate zone in the subset having a lowest sequence number.

17 . The apparatus of claim 12 , wherein the instructions upon execution by the one or more processors, cause the one or more processors to determine the one or more candidate zones at least in part by determining the one or more candidate zones having a highest garbage rate and having a sequence number that is outside of a dwell time from a highest sequence number of the multiple zones.

18 . The apparatus of claim 12 , wherein the instructions upon execution by the one or more processors, cause the one or more processors to determine the one or more candidate zones at least in part by determining that the one or more candidate zones are opened by a host application.

19 . One or more non-transitory computer-readable storage media storing instructions that when executed by one or more processors cause the one or more processors to execute a method for performing garbage collection in a file system having multiple zones of data, wherein the method comprises:

computing, for each zone of the multiple zones in the file system, a garbage rate associated with an amount of invalid data in the zone;

determining, based on the garbage rate and a sequence number assigned to each zone, one or more candidate zones, of the multiple zones, for garbage collection; and

performing garbage collection of the one or more candidate zones in the file system.

20 . The one or more non-transitory computer-readable storage media of claim 19 , wherein determining the one or more candidate zones includes determining that the sequence number of the one or more candidate zones is outside of a dwell time from a highest sequence number of the multiple zones.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 21, 2025
From: BYTEDANCE INC.
To: LEMON INC.
Reel/Frame 072622/0280 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 21, 2025
From: BAE, KYOUNGRYUN
To: BYTEDANCE INC.
Reel/Frame 072622/0339 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 21, 2025
From: AMRITKAR, PRATHAMESH; XU, PENG; KIM, JINHYUK
To: BYTEDANCE INC.
Reel/Frame 072622/0443 →
Continuity (1)
Related Publication 20240256443A1 · Aug 1, 2024
References Cited (14)
US 9460008B1 · Leshinsky · 2016 [cited by examiner]
US 10996863B1 · Kuzmin · 2021 [cited by examiner]
US 12130798B1 · Brahmadesam · 2024 [cited by examiner]
US 20170139603A1 · Byun · 2017 [cited by examiner]
US 20170249969A1 · Aiello · 2017 [cited by examiner]
US 20210382818A1 · Sharma · 2021 [cited by examiner]
US 20220138099A1 · Kang · 2022 [cited by examiner]
US 20220171532A1 · Kang · 2022 [cited by examiner]
US 20220365875A1 · Mao · 2022 [cited by examiner]
US 20220405001A1 · Xie · 2022 [cited by examiner]
US 20230205460A1 · Ishihara et al. · 2023 [cited by applicant]
US 20250077091A1 · Park · 2025 [cited by examiner]
Extended European Search Report received for European Patent Application No. 24220642.3, mailed on Jun. 4, 2025, 11 pages. [cited by applicant]
Yu et al., “An Efficient Hot-Cold Data Separation Garbage Collection Algorithm Based on Logical Interval in NAND Flash-Based Consumer Electronics”, IEEE Transactions On Consumer Electronics, vol. 69, No. 3, Aug. 2023, p… [cited by applicant]