IP Library › Granted Patent US 12,248,376
Granted Patent B2
US 12,248,376 · App. 18/623,387 · Granted Mar 11, 2025

Maintaining and recomputing reference counts in a persistent memory file system

Inventors: Ananthan Subramanian (San Ramon, CA); Matthew Fontaine Curtis-Maury (Apex, NC); Vinay Devadas (Apex, NC)
Assignee: NetApp, Inc.
G06F11/1471G06F11/0772G06F11/3037G06F12/0246G06F12/0824G06F12/0882
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,248,376
App. No.
18/623,387
Granted
Mar 11, 2025
Kind
B2
Abstract

Techniques are provided for maintaining and recomputing reference counts in a persistent memory file system of a node. Primary reference counts are maintained for pages within persistent memory of the node. In response to receiving a first operation to link a page into a persistent memory file system of the persistent memory, a primary reference count of the page is incremented before linking the page into the persistent memory file system. In response to receiving a second operation to unlink the page from the persistent memory file system, the page is unlinked from the persistent memory file system before the primary reference count is decremented. Upon the node recovering from a crash, the persistent memory file system is traversed in order to update shadow reference counts for the pages with correct reference count values, which are used to overwrite the primary reference counts with the correct reference count values.

Claims (61)

1. A method comprising:

receiving, by a persistent memory file system of a node, a copy operation targeting a parent page stored within a persistent memory of the node;

executing the copy operation to create a copy of the parent page as a copied page within the persistent memory;

creating a visited flag for the copied page;

setting the visited flag to inherit a parent visited flag of the parent page;

setting a shadow reference count for the copied page to a value based upon a visited field of the parent page indicating that the parent page was encountered by a traversal of the persistent memory file system; and

utilizing the shadow reference count to correct a primary reference count for the copied page.

2. The method of claim 1 , comprising:

executing a scanner to traverse the persistent memory file system in response to the node recovering from a failure.

3. The method of claim 1 , comprising:

traversing, by a scanner, the persistent memory file system to determine a number of times each page of the persistent memory is encountered by the scanner.

4. The method of claim 3 , comprising:

each time a page is encountered by the scanner, incrementing shadow reference counts of one or more pages.

5. The method of claim 3 , wherein the scanner does not modify primary reference counts during the traversal of the persistent memory file system, and wherein the scanner encountering an error during the traversal does not affect the primary reference counts.

6. The method of claim 5 , comprising:

in response to the scanner completing, correcting the primary reference counts using shadow reference counts tracked and modified by the scanner during the traversal.

7. The method of claim 3 , comprising:

in response to the scanner recounting a failure during the traversal, restarting the scanner from where the scanner left off during the traversal.

8. A non-transitory machine readable medium comprising instructions for performing a method, which when executed by a machine, causes the machine to:

receive, by a persistent memory file system of a node, a copy operation targeting a parent page stored within a persistent memory of the node;

execute the copy operation to create a copy of the parent page as a copied page within the persistent memory;

set a shadow reference count for the copied page to a value based upon a visited field of the parent page indicating that the parent page was encountered by a traversal of the persistent memory file system; and

utilize the shadow reference count to correct a primary reference count for the copied page.

9. The non-transitory machine readable medium of claim 8 , wherein the instructions cause the machine to:

execute a scanner to traverse the persistent memory file system in response to the node recovering from a failure.

10. The non-transitory machine readable medium of claim 8 , wherein the instructions cause the machine to:

traverse, by a scanner, the persistent memory file system to determine a number of times each page of the persistent memory is encountered by the scanner.

11. The non-transitory machine readable medium of claim 10 , wherein the instructions cause the machine to:

each time a page is encountered by the scanner, increment shadow reference counts of one or more pages.

12. The non-transitory machine readable medium of claim 10 , wherein the scanner does not modify primary reference counts during the traversal of the persistent memory file system, and wherein the scanner encountering an error during the traversal does not affect the primary reference counts.

13. The non-transitory machine readable medium of claim 12 , wherein the instructions cause the machine to:

in response to the scanner completing, correct the primary reference counts using shadow reference counts tracked and modified by the scanner during the traversal.

14. The non-transitory machine readable medium of claim 10 , wherein the instructions cause the machine to:

in response to the scanner recounting a failure during the traversal, restart the scanner from where the scanner left off during the traversal.

15. The non-transitory machine readable medium of claim 8 , wherein the instructions cause the machine to:

create a visited flag for the copied page.

16. The non-transitory machine readable medium of claim 15 , wherein the instructions cause the machine to:

set the visited flag to inherit a parent visited flag of the parent page.

17. A system comprising:

a processor;

a persistent memory comprising pages of storage; and

a persistent memory file system of a node, wherein the persistent memory file system:

receives a copy operation targeting a parent page stored within a persistent memory of the node;

executes the copy operation to create a copy of the parent page as a copied page within the persistent memory;

creates a visited flag for the copied page;

sets the visited flag to inherit a parent visited flag of the parent page;

sets a shadow reference count for the copied page to a value based upon a visited field of the parent page indicating that the parent page was encountered by a traversal of the persistent memory file system; and

utilizes the shadow reference count to correct a primary reference count for the copied page.

18. The system of claim 17 , wherein the persistent memory file system:

executes a scanner to traverse the persistent memory file system in response to the node recovering from a failure.

19. The system of claim 17 , wherein the persistent memory file system:

traverses, by a scanner, the persistent memory file system to determine a number of times each page of the persistent memory is encountered by the scanner.

20. The system of claim 19 , wherein the persistent memory file system:

each time a page is encountered by the scanner, increments shadow reference counts of one or more pages.

21. A method, comprising:

receiving, by a persistent memory file system of a node, a copy-on-write operation targeting a parent page stored within a persistent memory of the node to create a copied page as a new page;

executing the copy-on-write operation to create a copy of the parent page as the copied page within the persistent memory;

creating a visited flag for the copied page;

setting the visited flag to inherit a parent visited flag of the parent page;

setting a shadow reference count for the copied page to a value based upon a visited field of the parent page indicating that the parent page was encountered by a traversal of the persistent memory file system; and

utilizing the shadow reference count to correct a primary reference count for the copied page.

Continuity (3)
Continuation 17892175 · Aug 22, 2022
Continuation 16944001 · Jul 30, 2020
Related Publication 20240241801A1 · Jul 18, 2024
References Cited (13)
US 8549222B1 · Kleiman et al. · 2013 [cited by applicant]
US 8819386B1 · Mather · 2014 [cited by applicant]
US 10956324B1 · Giles et al. · 2021 [cited by applicant]
US 11422903B2 · Subramanian et al. · 2022 [cited by applicant]
US 11947430B2 · Subramanian et al. · 2024 [cited by applicant]
US 20110035548A1 · Kimmel et al. · 2011 [cited by applicant]
US 20160077922A1 · Yoon et al. · 2016 [cited by applicant]
US 20180285276A1 · Kumar et al. · 2018 [cited by applicant]
US 20190050344A1 · Puthiyedath · 2019 [cited by applicant]
US 20200045010A1 · Sun et al. · 2020 [cited by applicant]
US 20220398172A1 · Subramanian et al. · 2022 [cited by applicant]
Non Final Office Action mailed Aug. 18, 2023 for U.S. Appl. No. 17/892,175, filed Aug. 22, 2022, 05 pages. [cited by applicant]
Notice of Allowance mailed on Dec. 5, 2023 for U.S. Appl. No. 17/892,175, filed Aug. 22, 2022, 7 pages. [cited by applicant]