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

FreeBSD: Implement sysctl for fletcher4 impl #11270

Closed
wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 2, 2020

Motivation and Context

There is a tunable to select the fletcher 4 checksum implementation on
Linux but it was not present in FreeBSD.

Description

Implement the sysctl handler for FreeBSD and create a new macro
ZFS_MODULE_VIRTUAL_PARAM_CALL to provide the tunable on both platforms.

ZFS_MODULE_VIRTUAL_PARAM_CALL is like ZFS_MODULE_PARAM_CALL except it
does not try to pass the address of a variable to module_param_call on
Linux, so there does not need to be a variable with a name matching the
tunable.

How Has This Been Tested?

FreeBSD-13_0-CURRENT-9e082d278b9 ➜  ZoF git:(fletcher-4-impl) ✗ sysctl vfs.zfs.fletcher_4_impl
vfs.zfs.fletcher_4_impl: [fastest] scalar superscalar superscalar4 sse2 ssse3 avx2
FreeBSD-13_0-CURRENT-9e082d278b9 ➜  ZoF git:(fletcher-4-impl) ✗ sudo sysctl vfs.zfs.fletcher_4_impl=scalar
vfs.zfs.fletcher_4_impl: [fastest] scalar superscalar superscalar4 sse2 ssse3 avx2  -> fastest [scalar] superscalar superscalar4 sse2 ssse3 avx2
FreeBSD-13_0-CURRENT-9e082d278b9 ➜  ZoF git:(fletcher-4-impl) ✗ sudo sysctl vfs.zfs.fletcher_4_impl
vfs.zfs.fletcher_4_impl: fastest [scalar] superscalar superscalar4 sse2 ssse3 avx2
FreeBSD-13_0-CURRENT-9e082d278b9 ➜  ZoF git:(fletcher-4-impl) ✗ sudo sysctl vfs.zfs.fletcher_4_impl=fastest
vfs.zfs.fletcher_4_impl: fastest [scalar] superscalar superscalar4 sse2 ssse3 avx2  -> [fastest] scalar superscalar superscalar4 sse2 ssse3 avx2

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:

@ghost ghost added Status: Code Review Needed Ready for review and testing Status: Work in Progress Not yet ready for general review and removed Status: Code Review Needed Ready for review and testing labels Dec 2, 2020
@ghost
Copy link
Author

ghost commented Dec 4, 2020

Bah, forgot to fix the test -_-

@ghost
Copy link
Author

ghost commented Dec 7, 2020

  • Add ZFS_MODULE_VIRTUAL_PARAM_CALL() to fix the build on Linux, since ZFS_MODULE_PARAM_CALL() requires a variable with a particular name to actually exist so its address can be passed to module_param_call().

@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 Dec 7, 2020
@ghost
Copy link
Author

ghost commented Dec 8, 2020

The arc_summary failure brings to my attention some issues with the Python utilities that should be dealt with separately.

@ghost
Copy link
Author

ghost commented Dec 8, 2020

Weird, I don't find the tunable on Linux with this patch:

$ ls /sys/module/zfs/parameters/*impl
/sys/module/zfs/parameters/zfs_vdev_raidz_impl

@ghost ghost added Status: Work in Progress Not yet ready for general review and removed Status: Code Review Needed Ready for review and testing labels Dec 8, 2020
@behlendorf
Copy link
Contributor

On Linux the fletcher4 tunable appears in the zcommon and not zfs directory.

ls /sys/module/zcommon/parameters/*impl
/sys/module/zcommon/parameters/zfs_fletcher_4_impl

@ghost
Copy link
Author

ghost commented Dec 8, 2020

Ok great that explains why arc_summary was always fine on Linux :)

There is a tunable to select the fletcher 4 checksum implementation on
Linux but it was not present in FreeBSD.

Implement the sysctl handler for FreeBSD and use ZFS_MODULE_PARAM_CALL
to provide the tunable on both platforms.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Some tunables shown by arc_summary3 have string values that may exceed
the normal line length, leaving a negative offset between the name and
value fields.  The negative space is of course not valid and Python
rightly barfs up an exception traceback.

Handle an overflowing value field width by ignoring the line length
and separating the name from the value by a single space instead.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
@ghost
Copy link
Author

ghost commented Dec 9, 2020

I guess I pushed at a bad time, pushed again to retrigger the bots.

@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 Dec 9, 2020
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Dec 10, 2020
behlendorf pushed a commit that referenced this pull request Dec 11, 2020
Some tunables shown by arc_summary3 have string values that may exceed
the normal line length, leaving a negative offset between the name and
value fields.  The negative space is of course not valid and Python
rightly barfs up an exception traceback.

Handle an overflowing value field width by ignoring the line length
and separating the name from the value by a single space instead.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11270
@ghost ghost deleted the fletcher-4-impl branch December 11, 2020 18:43
ghost pushed a commit to zfsonfreebsd/ZoF that referenced this pull request Dec 23, 2020
There is a tunable to select the fletcher 4 checksum implementation on
Linux but it was not present in FreeBSD.

Implement the sysctl handler for FreeBSD and use ZFS_MODULE_PARAM_CALL
to provide the tunable on both platforms.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11270
ghost pushed a commit to zfsonfreebsd/ZoF that referenced this pull request Dec 23, 2020
Some tunables shown by arc_summary3 have string values that may exceed
the normal line length, leaving a negative offset between the name and
value fields.  The negative space is of course not valid and Python
rightly barfs up an exception traceback.

Handle an overflowing value field width by ignoring the line length
and separating the name from the value by a single space instead.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11270
behlendorf pushed a commit that referenced this pull request Dec 23, 2020
There is a tunable to select the fletcher 4 checksum implementation on
Linux but it was not present in FreeBSD.

Implement the sysctl handler for FreeBSD and use ZFS_MODULE_PARAM_CALL
to provide the tunable on both platforms.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11270
behlendorf pushed a commit that referenced this pull request Dec 23, 2020
Some tunables shown by arc_summary3 have string values that may exceed
the normal line length, leaving a negative offset between the name and
value fields.  The negative space is of course not valid and Python
rightly barfs up an exception traceback.

Handle an overflowing value field width by ignoring the line length
and separating the name from the value by a single space instead.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11270
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
There is a tunable to select the fletcher 4 checksum implementation on
Linux but it was not present in FreeBSD.

Implement the sysctl handler for FreeBSD and use ZFS_MODULE_PARAM_CALL
to provide the tunable on both platforms.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11270
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
Some tunables shown by arc_summary3 have string values that may exceed
the normal line length, leaving a negative offset between the name and
value fields.  The negative space is of course not valid and Python
rightly barfs up an exception traceback.

Handle an overflowing value field width by ignoring the line length
and separating the name from the value by a single space instead.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11270
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
There is a tunable to select the fletcher 4 checksum implementation on
Linux but it was not present in FreeBSD.

Implement the sysctl handler for FreeBSD and use ZFS_MODULE_PARAM_CALL
to provide the tunable on both platforms.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11270
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
Some tunables shown by arc_summary3 have string values that may exceed
the normal line length, leaving a negative offset between the name and
value fields.  The negative space is of course not valid and Python
rightly barfs up an exception traceback.

Handle an overflowing value field width by ignoring the line length
and separating the name from the value by a single space instead.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#11270
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.

None yet

1 participant