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

Combine zio caches if possible #11877

Merged
merged 1 commit into from
Apr 17, 2021
Merged

Conversation

mjguzik
Copy link
Contributor

@mjguzik mjguzik commented Apr 10, 2021

This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Signed-off-by: Mateusz Guzik mjguzik@gmail.com

I can make this FreeBSD-only or togglable at load time. I have not tested for impact on Linux, but it should be a win.

Motivation and Context

Description

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

Checklist:

@ahrens
Copy link
Member

ahrens commented Apr 10, 2021

On illumos, the “data” zio caches are not included in crash dumps, but the “metadata” ones are. @don-brady did we do the same for Linux? If so, we should think about if we are ok with changing that.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Apr 11, 2021
@behlendorf
Copy link
Contributor

@ahrens regarding crash dumps on Linux @don-brady implemented a slightly different mechanism (28c91ab) for this since the kernel doesn't provide a nodump flag I'm aware of for the caches. So this change shouldn't effect the kmem cache behavior on Linux, these buffers should still be included in the dump either way. What is excluded from the crash dumps are the ABD pages which are tagged as ZFS data pages and then as I understand it a modified version of the makedumpfile(8) utility is used to identify and selectively skip those pages.

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

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

@mjguzik thanks, I think this should be helpful on Linux to although I haven't verified that.

module/zfs/zio.c Show resolved Hide resolved
module/zfs/zio.c Outdated Show resolved Hide resolved
module/zfs/zio.c Outdated Show resolved Hide resolved
module/zfs/zio.c Outdated Show resolved Hide resolved
module/zfs/zio.c Outdated Show resolved Hide resolved
module/zfs/zio.c Outdated Show resolved Hide resolved
@mjguzik mjguzik force-pushed the combine_zio branch 3 times, most recently from d5ad1a3 to 76c4626 Compare April 16, 2021 17:57
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Apr 16, 2021
@behlendorf behlendorf merged commit 309c32c into openzfs:master Apr 17, 2021
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Apr 21, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
ghost pushed a commit to truenas/zfs that referenced this pull request May 6, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
ghost pushed a commit to truenas/zfs that referenced this pull request May 7, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
ghost pushed a commit to truenas/zfs that referenced this pull request May 10, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
ghost pushed a commit to truenas/zfs that referenced this pull request May 10, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
ghost pushed a commit to truenas/zfs that referenced this pull request May 10, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
ghost pushed a commit to truenas/zfs that referenced this pull request May 13, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
ghost pushed a commit to truenas/zfs that referenced this pull request May 17, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
behlendorf pushed a commit that referenced this pull request May 20, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #11877
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes openzfs#11877
tonyhutter pushed a commit that referenced this pull request Jun 23, 2021
This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #11877
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