L2ARC: Lazy sublist reset flags for persistent markers

Replace direct marker-to-tail manipulation with per-sublist boolean
flags consumed lazily by feed threads.  Each scanning thread resets its
own marker when it sees the flag, rather than having another thread
manipulate the marker directly.

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:
Ameer Hamza
2026-03-05 20:12:55 +05:00
committed by Brian Behlendorf
parent 22fdaf0b1f
commit 15fc3d64c8
2 changed files with 64 additions and 38 deletions
+4 -2
View File
@@ -56,10 +56,12 @@ typedef struct l2arc_info {
uint64_t l2arc_total_capacity; /* total L2ARC capacity */
uint64_t l2arc_smallest_capacity; /* smallest device capacity */
/*
* Per-device thread coordination for sublist processing
* Per-device thread coordination for sublist processing.
* reset: flags sublist marker for lazy reset to tail.
*/
boolean_t *l2arc_sublist_busy[L2ARC_FEED_TYPES];
kmutex_t l2arc_sublist_lock; /* protects busy flags */
boolean_t *l2arc_sublist_reset[L2ARC_FEED_TYPES];
kmutex_t l2arc_sublist_lock; /* protects busy/reset flags */
int l2arc_next_sublist[L2ARC_FEED_TYPES]; /* round-robin */
} l2arc_info_t;