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

Make the vfs.zfs.vdev.raidz_impl sysctl cross-platform #16980

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

asomers
Copy link
Contributor

@asomers asomers commented Jan 22, 2025

Signed-off-by: Alan Somers [email protected]
Sponsored by: ConnectWise

Motivation and Context

It creates a vfs.zfs.vdev.raidz_impl sysctl on FreeBSD, so the implementation can be queried or changed.

Description

Replace the Linux-specific module_param_call and MODULE_PARM_DESC with the portable ZFS_MODULE_PARAM_CALL.

How Has This Been Tested?

Tested on FreeBSD. Tried creating pools with every available raidz_impl testing. On Linux, compile-tested only.

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:

  • My code follows the OpenZFS code style requirements.
  • I have updated the documentation accordingly. (the setting was already in the man page)
  • 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.

Signed-off-by:	Alan Somers <[email protected]>
Sponsored by:	ConnectWise
@@ -6580,3 +6580,7 @@ ZFS_MODULE_PARAM_CALL(zfs_vdev, zfs_vdev_, max_auto_ashift,
param_set_max_auto_ashift, param_get_uint, ZMOD_RW,
"Maximum ashift used when optimizing for logical -> physical sector "
"size on new top-level vdevs");

ZFS_MODULE_PARAM_CALL(zfs_vdev, zfs_vdev_, raidz_impl,
param_set_raidz_impl, param_get_charp, ZMOD_RW,
Copy link
Member

Choose a reason for hiding this comment

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

It seems Linux get method is effectively missing. The param_get_charp() will just return "todo" from zfs_vdev_raidz_impl, that is never set. As I can see, vdev_raidz_impl_get() is not called on Linux.

@amotin amotin added the Status: Work in Progress Not yet ready for general review label Jan 23, 2025
@asomers asomers force-pushed the vfs.zfs.vdev.raidz_impl branch from f27d84f to 6a214e6 Compare January 23, 2025 18:30
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

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

It seems you are stil changing the behavior on Linus by using param_get_charp() instead of vdev_raidz_impl_get() before. I am not sure it is possible to drop the zfs_vdev_raidz_impl variable completely with existing macros, but I don't think it is really needed here.

@asomers
Copy link
Contributor Author

asomers commented Jan 23, 2025

It seems you are stil changing the behavior on Linus by using param_get_charp() instead of vdev_raidz_impl_get() before. I am not sure it is possible to drop the zfs_vdev_raidz_impl variable completely with existing macros, but I don't think it is really needed here.

Yes, exactly. The existing macros seem to require that variable.

@amotin
Copy link
Member

amotin commented Jan 23, 2025

Yes, exactly. The existing macros seem to require that variable.

But nobody should force you to use it, if as I understand in this case arbitrary string needs to be produced.

Instead, define the FreeBSD and Linux sysctls separately.

Signed-off-by:	Alan Somers <[email protected]>
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

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

That was an unexpected move.

@asomers
Copy link
Contributor Author

asomers commented Jan 24, 2025

That was an unexpected move.

Umm, what was unexpected?

@amotin
Copy link
Member

amotin commented Jan 24, 2025

That was an unexpected move.

Umm, what was unexpected?

Splitting the tunable into two completely separate for FreeBSD and Linux. You just missed one function, but decided to turn 180 degrees and go other direction.

@asomers
Copy link
Contributor Author

asomers commented Jan 24, 2025

Splitting the tunable into two completely separate for FreeBSD and Linux. You just missed one function, but decided to turn 180 degrees and go other direction.

Well, what would you like for me to do?

@amotin
Copy link
Member

amotin commented Jan 24, 2025

I was thinking you replace spl_param_get_charp() with a wrapper around vdev_raidz_impl_get().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Work in Progress Not yet ready for general review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants