L2ARC: Write budget fairness for metadata monopolization

Under heavy metadata load, metadata passes can monopolize the write
budget every cycle while data passes get nothing written. Track
consecutive monopolized cycles per device in l2ad_meta_cycles. After
l2arc_meta_cycles (default 2) consecutive cycles where metadata fills
the write budget, skip metadata for one cycle to let data run.  Reset
the counter when nothing is written.

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 19:17:03 +05:00
committed by Brian Behlendorf
parent 62ca8f721b
commit b27a87f399
4 changed files with 50 additions and 0 deletions
+7
View File
@@ -233,6 +233,13 @@ resetting its markers to the tail.
Lower values keep the marker closer to the tail under active workloads.
Set to 0 to disable the depth cap.
.
.It Sy l2arc_meta_cycles Ns = Ns Sy 2 Pq u64
How many consecutive cycles metadata may monopolize the write budget
before being skipped to let data run.
The default of 2 gives metadata roughly 67% and data 33% of L2ARC
write bandwidth under sustained load.
Higher values favor metadata; set to 0 to disable.
.
.It Sy l2arc_write_max Ns = Ns Sy 33554432 Ns B Po 32 MiB Pc Pq u64
Maximum write rate in bytes per second for each L2ARC device.
Used directly during initial fill, when DWPD limiting is disabled,