mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
committed by
Brian Behlendorf
parent
b525525b44
commit
d1f290f1ea
@@ -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)
|
||||
{
|
||||
|
||||
@@ -410,6 +410,22 @@ param_set_arc_int(const char *buf, zfs_kernel_param_t *kp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
param_set_l2arc_dwpd_limit(const char *buf, zfs_kernel_param_t *kp)
|
||||
{
|
||||
uint64_t old_val = l2arc_dwpd_limit;
|
||||
int error;
|
||||
|
||||
error = spl_param_set_u64(buf, kp);
|
||||
if (error < 0)
|
||||
return (SET_ERROR(error));
|
||||
|
||||
if (l2arc_dwpd_limit != old_val)
|
||||
l2arc_dwpd_bump_reset();
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||
static int
|
||||
arc_hotplug_callback(struct notifier_block *self, unsigned long action,
|
||||
|
||||
Reference in New Issue
Block a user