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

[2.1] Unify arc_prune_async() code #16083

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

amotin
Copy link
Member

@amotin amotin commented Apr 11, 2024

There is no sense to have separate implementations for FreeBSD and Linux. Make Linux code shared as more functional and just register FreeBSD-specific prune callback with arc_add_prune_callback() API.

Aside of code cleanup this should fix excessive pruning on FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274698

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:

There is no sense to have separate implementations for FreeBSD and
Linux.  Make Linux code shared as more functional and just register
FreeBSD-specific prune callback with arc_add_prune_callback() API.

Aside of code cleanup this should fix excessive pruning on FreeBSD:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274698

Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
@amotin amotin mentioned this pull request Apr 11, 2024
13 tasks
@OlCe2
Copy link
Contributor

OlCe2 commented Apr 11, 2024

Testing.

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

OlCe2 commented Apr 11, 2024

Testing shows that this patch, when applied to stable/13, makes the main problems in my reproducer for FreeBSD's PR 275594 disappear.

@OlCe2
Copy link
Contributor

OlCe2 commented Apr 11, 2024

FWIW, I've also merged the code from commit 799e09f myself, and came up with exactly the same diff. This may help reviewing the code here faster.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Apr 12, 2024
@behlendorf behlendorf merged commit 5b81b1b into openzfs:zfs-2.1.16-staging Apr 12, 2024
10 of 11 checks passed
OlCe2 pushed a commit to OlCe2/freebsd-src that referenced this pull request Apr 12, 2024
There is no sense to have separate implementations for FreeBSD and Linux.  Make
Linux code shared as more functional and just register FreeBSD-specific prune
callback with arc_add_prune_callback() API.

Aside of code cleanup this fixes excessive pruning on FreeBSD.

[olce: This code comes from the OpenZFS pull request:
openzfs/zfs#16083, vendor-merged into our tree.  The
commit message above is an adaptation of the pull request's message to the
context.  The pull request has been reviewed and merged upstream into
'zfs-2.1.16-staging' as 5b81b1bf5e6d6aeb8a87175dcb12b529185cac2f, which should
come into our tree at the next vendor import.  This is the same code that was
merge in stable/14 and main as part of vendor merges, and released as an EN over
releng/14.0 by markj@.]

PR:             275594, 274698
Reported by:    Seigo Tanimura <[email protected]>, markj, and others
Tested by:      olce
Approved by:    XXX (mentor)
Security:       FreeBSD-EN-23:18.openzfs
Obtained from:  OpenZFS
Sponsored by:   iXsystems, Inc.
Sponsored by:   The FreeBSD Foundation
Signed-off-by:  Alexander Motin <[email protected]>
OlCe2 pushed a commit to OlCe2/freebsd-src that referenced this pull request Apr 12, 2024
There is no sense to have separate implementations for FreeBSD and Linux.  Make
Linux code shared as more functional and just register FreeBSD-specific prune
callback with arc_add_prune_callback() API.

Aside of code cleanup this fixes excessive pruning on FreeBSD.

[olce: This code comes from the OpenZFS pull request:
openzfs/zfs#16083, vendor-merged into our tree.  This
commit message is an adaptation of the latter's to the context.  The upstream
pull request has been reviewed and merged into 'zfs-2.1.16-staging' as
5b81b1bf5e6d6aeb8a87175dcb12b529185cac2f, which should come into our tree at the
next vendor import.  This is the same code that was merged into stable/14 and
main as part of vendor merges, and released as an EN over releng/14.0 by
markj@.]

PR:             275594, 274698
Reported by:    Seigo Tanimura <[email protected]>, markj, and others
Tested by:      olce
Approved by:    XXX (mentor)
Security:       FreeBSD-EN-23:18.openzfs
Obtained from:  OpenZFS
Sponsored by:   iXsystems, Inc.
Sponsored by:   The FreeBSD Foundation
Signed-off-by:  Alexander Motin <[email protected]>
OlCe2 pushed a commit to OlCe2/freebsd-src that referenced this pull request Apr 12, 2024
There is no sense to have separate implementations for FreeBSD and Linux.  Make
Linux code shared as more functional and just register FreeBSD-specific prune
callback with arc_add_prune_callback() API.

Aside of code cleanup this fixes excessive pruning on FreeBSD.

[olce: This code comes from the OpenZFS pull request:
openzfs/zfs#16083, vendor-merged into our tree.  Its
commit message has been slightly adapted to the present context.  The upstream
pull request has been reviewed and merged into 'zfs-2.1.16-staging' as
5b81b1bf5e6d6aeb8a87175dcb12b529185cac2f, which should come into our tree at the
next vendor import.  This is the same code that was merged into stable/14 and
main as part of vendor merges, and released as an EN (FreeBSD-EN-23:18.openzfs)
over releng/14.0 by markj@.]

PR:             275594, 274698
Reported by:    Seigo Tanimura <[email protected]>, markj, and others
Tested by:      olce
Approved by:    emaste (mentor)
Obtained from:  OpenZFS
Sponsored by:   iXsystems, Inc.
Sponsored by:   The FreeBSD Foundation
Signed-off-by:  Alexander Motin <[email protected]>
@OlCe2
Copy link
Contributor

OlCe2 commented Apr 12, 2024

Thanks all for your diligent work!

A merge of this is going to be committed in advance of vendor imports and merges in FreeBSD's stable/13.

freebsd-git pushed a commit to freebsd/freebsd-src that referenced this pull request Apr 12, 2024
There is no sense to have separate implementations for FreeBSD and Linux.  Make
Linux code shared as more functional and just register FreeBSD-specific prune
callback with arc_add_prune_callback() API.

Aside of code cleanup this fixes excessive pruning on FreeBSD.

[olce: This code comes from the OpenZFS pull request:
openzfs/zfs#16083, vendor-merged into our tree.  Its
commit message has been slightly adapted to the present context.  The upstream
pull request has been reviewed and merged into 'zfs-2.1.16-staging' as
5b81b1bf5e6d6aeb8a87175dcb12b529185cac2f, which should come into our tree at the
next vendor import.  This is the same code that was merged into stable/14 and
main as part of vendor merges, and released as an EN (FreeBSD-EN-23:18.openzfs)
over releng/14.0 by markj@.]

PR:             275594, 274698
Reported by:    Seigo Tanimura <[email protected]>, markj, and others
Tested by:      olce
Approved by:    emaste (mentor)
Obtained from:  OpenZFS
Sponsored by:   iXsystems, Inc.
Sponsored by:   The FreeBSD Foundation
Signed-off-by:  Alexander Motin <[email protected]>
@amotin amotin deleted the prune_2.1 branch April 12, 2024 18:16
freebsd-git pushed a commit to freebsd/freebsd-src that referenced this pull request Apr 24, 2024
There is no sense to have separate implementations for FreeBSD and Linux.  Make
Linux code shared as more functional and just register FreeBSD-specific prune
callback with arc_add_prune_callback() API.

Aside of code cleanup this fixes excessive pruning on FreeBSD.

[olce: This code comes from the OpenZFS pull request:
openzfs/zfs#16083, vendor-merged into our tree.  Its
commit message has been slightly adapted to the present context.  The upstream
pull request has been reviewed and merged into 'zfs-2.1.16-staging' as
5b81b1bf5e6d6aeb8a87175dcb12b529185cac2f, which should come into our tree at the
next vendor import.  This is the same code that was merged into stable/14 and
main as part of vendor merges, and released as an EN (FreeBSD-EN-23:18.openzfs)
over releng/14.0 by markj@.]

PR:             275594, 274698
Reported by:    Seigo Tanimura <[email protected]>, markj, and others
Tested by:      olce
Approved by:    emaste (mentor)
Approved by:	so
Obtained from:  OpenZFS
Sponsored by:   iXsystems, Inc.
Sponsored by:   The FreeBSD Foundation
Signed-off-by:  Alexander Motin <[email protected]>

(cherry picked from commit 330954b)
rkojedzinszky pushed a commit to dravanet/truenas-os that referenced this pull request Jul 12, 2024
There is no sense to have separate implementations for FreeBSD and Linux.  Make
Linux code shared as more functional and just register FreeBSD-specific prune
callback with arc_add_prune_callback() API.

Aside of code cleanup this fixes excessive pruning on FreeBSD.

[olce: This code comes from the OpenZFS pull request:
openzfs/zfs#16083, vendor-merged into our tree.  Its
commit message has been slightly adapted to the present context.  The upstream
pull request has been reviewed and merged into 'zfs-2.1.16-staging' as
5b81b1bf5e6d6aeb8a87175dcb12b529185cac2f, which should come into our tree at the
next vendor import.  This is the same code that was merged into stable/14 and
main as part of vendor merges, and released as an EN (FreeBSD-EN-23:18.openzfs)
over releng/14.0 by markj@.]

PR:             275594, 274698
Reported by:    Seigo Tanimura <[email protected]>, markj, and others
Tested by:      olce
Approved by:    emaste (mentor)
Approved by:	so
Obtained from:  OpenZFS
Sponsored by:   iXsystems, Inc.
Sponsored by:   The FreeBSD Foundation
Signed-off-by:  Alexander Motin <[email protected]>

(cherry picked from commit 330954b)
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