mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
L2ARC: Scan-based depth cap for persistent markers
With persistent markers and inclusive scanning, the marker traverses the entire ARC state across many feed cycles, writing buffers far from the tail that may no longer be relevant. Track cumulative bytes scanned per pass in l2arc_ext_scanned. When scans reach l2arc_ext_headroom_pct (default 25%) of the ARC state size, reset the pass markers to the tail via lazy reset flags. This keeps markers focused on the tail zone where buffers soon to be evicted have the most value for L2ARC. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Ameer Hamza <ahamza@ixsystems.com> Closes #18289
This commit is contained in:
committed by
Brian Behlendorf
parent
15fc3d64c8
commit
62ca8f721b
@@ -46,6 +46,10 @@ extern "C" {
|
||||
* and each of the states has two types: data and metadata.
|
||||
*/
|
||||
#define L2ARC_FEED_TYPES 4
|
||||
#define L2ARC_MFU_META 0
|
||||
#define L2ARC_MRU_META 1
|
||||
#define L2ARC_MFU_DATA 2
|
||||
#define L2ARC_MRU_DATA 3
|
||||
|
||||
/*
|
||||
* L2ARC state and statistics for persistent marker management.
|
||||
@@ -62,6 +66,12 @@ typedef struct l2arc_info {
|
||||
boolean_t *l2arc_sublist_busy[L2ARC_FEED_TYPES];
|
||||
boolean_t *l2arc_sublist_reset[L2ARC_FEED_TYPES];
|
||||
kmutex_t l2arc_sublist_lock; /* protects busy/reset flags */
|
||||
/*
|
||||
* Cumulative bytes scanned per pass since marker reset.
|
||||
* Limits how far persistent markers advance from tail
|
||||
* before resetting, based on % of state size.
|
||||
*/
|
||||
uint64_t l2arc_ext_scanned[L2ARC_FEED_TYPES];
|
||||
int l2arc_next_sublist[L2ARC_FEED_TYPES]; /* round-robin */
|
||||
} l2arc_info_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user