Skip to content

Conversation

@tsoome
Copy link

@tsoome tsoome commented Oct 13, 2025

Extracted 2 commits and tailored to our current code.

Ryan Moeller and others added 2 commits October 13, 2025 14:45
FreeBSD needs arc_adjust_zthr to run periodically for kstats to be
updated.  A comment in the code suggests this may have been the
original intent in illumos as well:

https://github.com/openzfs/zfs/blob/c946d5a91329b075fb9bda1ac703a2e85139cf1c/module/zfs/arc.c#L4697-L4700

Create the thread with a 1 second timer.

Reviewed-by: Matt Macy <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #10371
Change-Id: I3977d33889f87d515e2a434ff208c2916ff68468
Change-Id: Ie3d6598023dd6831960e0959fe48f5688468d3f5
Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a good first attempt. The idea is, "you can now write into zfs_arc_max and zfs_arc_min and have the system fix things," right?

*/
uint64_t zfs_arc_max;
uint64_t zfs_arc_min;
uint64_t zfs_arc_max = 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C defaults to 0 for globals, but I do like the consistency.

@tsoome
Copy link
Author

tsoome commented Oct 13, 2025

Seems a good first attempt. The idea is, "you can now write into zfs_arc_max and zfs_arc_min and have the system fix things," right?

yes, and the few others too (they all do exist). The important thing is, we do get all the dependent other values re-evaluated according to new settings.

@tsoome
Copy link
Author

tsoome commented Oct 13, 2025

Seems a good first attempt. The idea is, "you can now write into zfs_arc_max and zfs_arc_min and have the system fix things," right?

yes, and the few others too (they all do exist). The important thing is, we do get all the dependent other values re-evaluated according to new settings.

There are 2 points to take:

  1. I took the liberty to pick DMU_MAX_ACCESS change from openzfs/zfs@f1512ee - so we are at the same state regarding to MIN_ARC_MAX setup.
  2. changed arc_adjust to timer, as explained in original commit message. Now both arc_adjust_zthr and arc_reap_zthr are timers and tick once per second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants