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

Restore FreeBSD resource usage accounting #11613

Merged
merged 1 commit into from
Feb 20, 2021

Conversation

ghost
Copy link

@ghost ghost commented Feb 17, 2021

Motivation and Context

Resource usage accounting was lost on FreeBSD.

Description

Add zfs_racct_* interfaces for platform-dependent read/write accounting.

How Has This Been Tested?

top -m io

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)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
@ghost ghost added the Status: Work in Progress Not yet ready for general review label Feb 17, 2021
@ghost ghost marked this pull request as ready for review February 18, 2021 19:19
@ghost ghost added Status: Code Review Needed Ready for review and testing and removed Status: Work in Progress Not yet ready for general review labels Feb 18, 2021
@ghost
Copy link
Author

ghost commented Feb 18, 2021

@trasz @mmatuska @avg-I @asomers pinging in case any of you FreeBSD people would like to review/test this. I slightly refactored the code that was introduced in freebsd/freebsd-src@825d80e freebsd/freebsd-src@440634a freebsd/freebsd-src@1f39d42 to simplify the platform abstraction.

I do find that I have to build with gmake KERNBUILDDIR=/usr/obj/usr/src/amd64.amd64/sys/GENERIC to include the racct parts when building with the OpenZFS build system. I believe this shouldn't be a problem when building in the FreeBSD tree.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Feb 18, 2021
@behlendorf behlendorf merged commit 64e0fe1 into openzfs:master Feb 20, 2021
@ghost ghost deleted the racct branch February 20, 2021 08:49
ghost pushed a commit to zfsonfreebsd/ZoF that referenced this pull request Mar 1, 2021
Add zfs_racct_* interfaces for platform-dependent read/write accounting.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11613
@problame
Copy link
Contributor

problame commented Mar 2, 2021

I stumbled across this in #11657 : Is the idea behind this that calls to task_io_account_{read,write} and the like should move to the zfs_racct_{read,write} functions?

@ghost
Copy link
Author

ghost commented Mar 2, 2021

Yeah it looks like they serve the same purpose. I didn't notice them hiding all the way over there... 👀

@behlendorf
Copy link
Contributor

Yes, this slipped my mind as well. Using a common set of wrappers for this would be nice, though I think we might need to extend them as needed for things like O_DIRECT IO which entirely bypasses the ARC.

ghost pushed a commit to zfsonfreebsd/ZoF that referenced this pull request Mar 5, 2021
Add zfs_racct_* interfaces for platform-dependent read/write accounting.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11613
behlendorf pushed a commit that referenced this pull request Mar 5, 2021
Add zfs_racct_* interfaces for platform-dependent read/write accounting.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11613
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
Add zfs_racct_* interfaces for platform-dependent read/write accounting.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11613
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