Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arc: Periodically update ARC kstats #10371

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

ghost
Copy link

@ghost ghost commented May 26, 2020

Motivation and Context

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:

zfs/module/zfs/arc.c

Lines 4697 to 4700 in c946d5a

* anon, mru, mru_ghost, mfu, and mfu_ghost lists. Even
* with this change, the data might be up to 1 second
* out of date(the arc_adjust_zthr has a maximum sleep
* time of 1 second); but that should suffice. The

Description

Create the thread with a 1 second timer.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

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.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label May 26, 2020
@codecov-commenter
Copy link

codecov-commenter commented May 27, 2020

Codecov Report

Merging #10371 into master will increase coverage by 0.23%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10371      +/-   ##
==========================================
+ Coverage   79.52%   79.75%   +0.23%     
==========================================
  Files         391      391              
  Lines      123590   123590              
==========================================
+ Hits        98288    98575     +287     
+ Misses      25302    25015     -287     
Flag Coverage Δ
#kernel 80.24% <100.00%> (+0.23%) ⬆️
#user 66.54% <100.00%> (+0.60%) ⬆️
Impacted Files Coverage Δ
module/zfs/arc.c 89.60% <100.00%> (+0.76%) ⬆️
module/zfs/dsl_scan.c 84.95% <0.00%> (-1.60%) ⬇️
module/zfs/vdev_raidz.c 92.59% <0.00%> (-0.66%) ⬇️
module/zfs/vdev_indirect_mapping.c 98.55% <0.00%> (-0.49%) ⬇️
module/zfs/dnode.c 94.59% <0.00%> (-0.37%) ⬇️
lib/libefi/rdwr_efi.c 60.37% <0.00%> (-0.32%) ⬇️
module/zfs/metaslab.c 95.87% <0.00%> (-0.28%) ⬇️
module/zfs/dmu.c 86.42% <0.00%> (-0.12%) ⬇️
module/os/linux/zfs/zfs_znode.c 85.39% <0.00%> (-0.12%) ⬇️
lib/libzfs/libzfs_pool.c 73.41% <0.00%> (-0.06%) ⬇️
... and 46 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c946d5a...8d71584. Read the comment docs.

@ghost ghost requested a review from amotin May 27, 2020 16:56
@ghost ghost closed this Jun 1, 2020
@ghost ghost deleted the arc_adjust_zthr-timer branch June 1, 2020 15:26
@ghost ghost restored the arc_adjust_zthr-timer branch June 2, 2020 17:47
@ghost
Copy link
Author

ghost commented Jun 2, 2020

I thought this got committed, weird

@ghost ghost reopened this Jun 2, 2020
Copy link
Contributor

@mattmacy mattmacy left a comment

Choose a reason for hiding this comment

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

This was in the initial port and was only reverted to minimize the diff when merging.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jun 3, 2020
@behlendorf behlendorf merged commit a9dcfac into openzfs:master Jun 3, 2020
@ghost ghost deleted the arc_adjust_zthr-timer branch June 3, 2020 17:01
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
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 <mmacy@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#10371
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants