IP Library › Granted Patent US 12,066,937
Granted Patent B2
US 12,066,937 · App. 17/746,367 · Granted Aug 20, 2024

Method, electronic device and computer program product for flushing metadata

Inventors: Ming Zhang (Beijing, CN); Chen Gong (Beijing, CN); Qiaosheng Zhou (Beijing, CN)
Assignee: EMC IP Holding Company LLC
G06F12/0802G06F3/0604G06F3/0659G06F3/067G06F16/172G06F2212/60
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,066,937
App. No.
17/746,367
Granted
Aug 20, 2024
Kind
B2
Abstract

Techniques for flushing metadata involve: receiving a flushing request, the flushing request instructing to flush metadata in at least one cache region to a persistent storage device; acquiring a plurality of target indicators, the target indicator at least indicating a type of a cache region and a block in the cache region, where the plurality of target indicators are classified based on types of cache regions indicated by the target indicators among the plurality of target indicators; determining, from the plurality of target indicators, at least one target indicator of the same type as the at least one cache region; and flushing metadata in a block indicated by the at least one target indicator. Such techniques avoid flushing a cache region that does not need to be flushed, shortens the response time to the flushing request, and reduces the occupancy of system resources.

Claims (80)

1. A method for flushing metadata in a file system, comprising:

receiving a flushing request, the flushing request instructing to flush metadata in at least one cache region to a persistent storage device;

acquiring a plurality of target indicators, the target indicator at least indicating a type of a cache region and a block in the cache region, wherein the plurality of target indicators are classified based on types of cache regions indicated by the target indicators among the plurality of target indicators;

determining, from the plurality of target indicators, at least one target indicator of the same type as the at least one cache region; and

flushing metadata in a block indicated by the at least one target indicator;

wherein the plurality of target indicators are classified as follows:

establishing, based on the number of types of cache regions indicated by the plurality of target indicators, position queues corresponding to the number of types; and

putting, based on the type of the cache region indicated by each target indicator among the plurality of target indicators, the target indicator into a position queue of a corresponding type.

2. The method according to claim 1 , wherein the method further comprises:

flushing, in response to the flushing request, a plurality of cache regions simultaneously for a plurality of the position queues.

3. The method according to claim 1 wherein receiving the flushing request includes:

acquiring the flushing request in response to a size of a log device reaching a threshold, the log device being constructed and arranged to record a summary of metadata changes from a set of transactions.

4. The method according to claim 1 wherein receiving the flushing request includes:

acquiring the flushing request in response to the at least one cache region reaching a traffic limit.

5. The method according to claim 1 wherein receiving the flushing request includes:

acquiring the flushing request in response to expiration of a timer reaching a preset time.

6. A method for flushing metadata in a file system, comprising:

receiving a flushing request, the flushing request instructing to flush metadata in at least one cache region to a persistent storage device;

acquiring a plurality of target indicators, the target indicator at least indicating a type of a cache region and a block in the cache region, wherein the plurality of target indicators are classified based on types of cache regions indicated by the target indicators among the plurality of target indicators;

determining, from the plurality of target indicators, at least one target indicator of the same type as the at least one cache region; and

flushing metadata in a block indicated by the at least one target indicator;

wherein the plurality of target indicators are classified as follows:

establishing a storage queue;

storing the acquired plurality of target indicators in the storage queue;

establishing, based on the number of types of cache regions indicated by the plurality of target indicators, position queues corresponding to the number of types; and

recording, based on the type of the cache region indicated by each target indicator among the plurality of target indicators, a storage position of the target indicator in the storage queue into a position queue of a corresponding type.

7. The method according to claim 6 , wherein the method further comprises:

flushing, in response to the flushing request, a plurality of cache regions simultaneously for a plurality of the position queues.

8. The method according to claim 6 , wherein the method further comprises:

determining whether a second block indicated by a second target indicator exists in a strip where a first block indicated by a first target indicator among the at least one target indicator is located, a first storage position of the first target indicator in the storage queue and a second storage position of the second target indicator in the storage queue being recorded in the same position queue; and

flushing, in response to determining that the second block indicated by the second target indicator exists in the strip where the first block is located, metadata in the second block and metadata in the first block using the same thread.

9. The method according to claim 6 wherein receiving the flushing request includes:

acquiring the flushing request in response to a size of a log device reaching a threshold, the log device being constructed and arranged to record a summary of metadata changes from a set of transactions.

10. The method according to claim 6 wherein receiving the flushing request includes:

acquiring the flushing request in response to the at least one cache region reaching a traffic limit.

11. The method according to claim 6 wherein receiving the flushing request includes:

acquiring the flushing request in response to expiration of a timer reaching a preset time.

12. An electronic device, comprising:

a processor; and

a memory coupled to the processor, the memory containing instructions stored therein, the instructions, when executed by the processor, causing the device to execute an action, the action comprising:

receiving a flushing request, the flushing request instructing to flush metadata in at least one cache region to a persistent storage device;

acquiring a plurality of target indicators, the target indicator at least indicating a type of a cache region and a block in the cache region, wherein the plurality of target indicators are classified based on types of cache regions indicated by the target indicators among the plurality of target indicators;

determining, from the plurality of target indicators, at least one target indicator of the same type as the at least one cache region; and

flushing metadata in a block indicated by the at least one target indicator;

wherein the plurality of target indicators are classified as follows:

establishing, based on the number of types of cache regions indicated by the plurality of target indicators, the position queues corresponding to the number of types; and

putting, based on the type of the cache region indicated by each target indicator among the plurality of target indicators, the target indicator into a position queue of a corresponding type.

13. The device according to claim 12 , wherein the action further comprises:

flushing, in response to the flushing request, a plurality of cache regions simultaneously for a plurality of the position queues.

14. The device according to claim 12 wherein receiving the flushing request includes:

acquiring the flushing request in response to a size of a log device reaching a threshold, the log device being constructed and arranged to record a summary of metadata changes from a set of transactions.

15. The device according to claim 12 wherein receiving the flushing request includes:

acquiring the flushing request in response to the at least one cache region reaching a traffic limit.

16. The device according to claim 12 wherein receiving the flushing request includes:

acquiring the flushing request in response to expiration of a timer reaching a preset time.

17. An electronic device, comprising:

a processor; and

a memory coupled to the processor, the memory containing instructions stored therein, the instructions, when executed by the processor, causing the device to execute an action, the action comprising:

receiving a flushing request, the flushing request instructing to flush metadata in at least one cache region to a persistent storage device:

acquiring a plurality of target indicators, the target indicator at least indicating a type of a cache region and a block in the cache region, wherein the plurality of target indicators are classified based on types of cache regions indicated by the target indicators among the plurality of target indicators;

determining, from the plurality of target indicators, at least one target indicator of the same type as the at least one cache region; and

flushing metadata in a block indicated by the at least one target indicator:

wherein the plurality of target indicators are classified as follows:

establishing a storage queue;

storing the acquired plurality of target indicators in the storage queue;

establishing, based on the number of types of cache regions indicated by the plurality of target indicators, position queues corresponding to the number of types; and

recording, based on the type of the cache region indicated by each target indicator among the plurality of target indicators, a storage position of the target indicator in the storage queue into a position queue of a corresponding type.

18. The device according to claim 17 , wherein the action further comprises:

flushing, in response to the flushing request, a plurality of cache regions simultaneously for a plurality of the position queues.

19. The device according to claim 17 , wherein the action further comprises:

determining whether a second block indicated by a second target indicator exists in a strip where a first block indicated by a first target indicator among the at least one target indicator is located, a first storage position of the first target indicator in the storage queue and a second storage position of the second target indicator in the storage queue being recorded in the same position queue; and

flushing, in response to determining that the second block indicated by the second target indicator exists in the strip where the first block is located, metadata in the second block and metadata in the first block using the same thread.

20. A computer program product having a non-transitory computer readable medium which stores a set of instructions to flush metadata in a file system; the set of instructions, when carried out by computerized circuitry, causing the computerized circuitry to perform a method of:

receiving a flushing request, the flushing request instructing to flush metadata in at least one cache region to a persistent storage device;

acquiring a plurality of target indicators, the target indicator at least indicating a type of a cache region and a block in the cache region, wherein the plurality of target indicators are classified based on types of cache regions indicated by the target indicators among the plurality of target indicators;

determining, from the plurality of target indicators, at least one target indicator of the same type as the at least one cache region; and

flushing metadata in a block indicated by the at least one target indicator;

wherein the plurality of target indicators are classified as follows:

establishing, based on the number of types of cache regions indicated by the plurality of target indicators, position queues corresponding to the number of types; and

putting, based on the type of the cache region indicated by each target indicator among the plurality of target indicators, the target indicator into a position queue of a corresponding type.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 8, 2022
From: ZHANG, MING; GONG, CHEN; ZHOU, QIAOSHENG
To: EMC IP HOLDING COMPANY LLC
Reel/Frame 060135/0950 →
Priority Claims (1)
CN 202111112176.2 · Sep 18, 2021 · national
Continuity (1)
Related Publication 20230086991A1 · Mar 23, 2023
Cited By (1)
US 12,572,297