L2ARC: Implement DWPD-based rate limiting with adaptive feed intervals

Add DWPD (Drive Writes Per Day) rate limiting to control L2ARC write
speeds and protect SSD endurance. Write rate is constrained by the
minimum of l2arc_write_max and DWPD-calculated budget. Devices
accumulate unused write budget over 24-hour periods with automatic reset
and carry-over. Writes occur in controlled bursts (max 50MB) with
adaptive intervals to achieve target rates. Applies after initial device
fill.

Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #18093
This commit is contained in:
Ameer Hamza
2025-09-25 23:24:03 +05:00
committed by Brian Behlendorf
parent b525525b44
commit d1f290f1ea
5 changed files with 184 additions and 46 deletions
+16
View File
@@ -163,6 +163,22 @@ param_set_arc_int(SYSCTL_HANDLER_ARGS)
return (0);
}
int
param_set_l2arc_dwpd_limit(SYSCTL_HANDLER_ARGS)
{
uint64_t old_val = l2arc_dwpd_limit;
int err;
err = sysctl_handle_64(oidp, arg1, 0, req);
if (err != 0 || req->newptr == NULL)
return (err);
if (l2arc_dwpd_limit != old_val)
l2arc_dwpd_bump_reset();
return (0);
}
int
param_set_arc_max(SYSCTL_HANDLER_ARGS)
{