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

Add trim_finish notify script for ZED #10491

Merged
merged 1 commit into from Jun 24, 2020
Merged

Add trim_finish notify script for ZED #10491

merged 1 commit into from Jun 24, 2020

Conversation

kpfleming
Copy link
Contributor

Motivation and Context

This patch adds a ZED notification script which generates notifications when TRIM operations are completed.

Description

I copied the scrub_finish-notify script and removed the unnecessary portions.

How Has This Been Tested?

This has been tested on my ZoL machine running 0.8.4-1 on Debian Buster.

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:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • 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.

Allow users to configure notifications when TRIM operations are
completed on pools. Unlike resilver_finish and scrub_finish,
the trim_finish event is generated for each vdev in the pool
which was trimmed, so the script will generate a notification
for each one.

Signed-off-by: Kevin P. Fleming <kevin@km6g.us>
@kpfleming
Copy link
Contributor Author

I don't know why autogen.sh is failing in the FreeBSD test; it works on my system (which is Linux, but still should fail the same way).

@codecov
Copy link

codecov bot commented Jun 23, 2020

Codecov Report

Merging #10491 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10491      +/-   ##
==========================================
- Coverage   79.69%   79.67%   -0.03%     
==========================================
  Files         391      391              
  Lines      123817   123817              
==========================================
- Hits        98682    98656      -26     
- Misses      25135    25161      +26     
Flag Coverage Δ
#kernel 80.07% <ø> (-0.01%) ⬇️
#user 65.79% <ø> (-0.36%) ⬇️
Impacted Files Coverage Δ
module/zfs/vdev_raidz.c 89.97% <0.00%> (-3.60%) ⬇️
lib/libzfs/libzfs_changelist.c 84.37% <0.00%> (-1.96%) ⬇️
module/zfs/vdev_trim.c 95.34% <0.00%> (-0.76%) ⬇️
module/zfs/btree.c 82.90% <0.00%> (-0.59%) ⬇️
module/zfs/zio_checksum.c 97.75% <0.00%> (-0.57%) ⬇️
module/zfs/bpobj.c 90.61% <0.00%> (-0.54%) ⬇️
module/os/linux/zfs/zpl_xattr.c 83.26% <0.00%> (-0.43%) ⬇️
module/icp/api/kcf_cipher.c 16.18% <0.00%> (-0.42%) ⬇️
module/os/linux/zfs/vdev_disk.c 84.04% <0.00%> (-0.39%) ⬇️
module/os/linux/spl/spl-kmem-cache.c 84.44% <0.00%> (-0.37%) ⬇️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c08fa8...b41cb7b. Read the comment docs.

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.

Nice and straight forward, but I'm curious what your use case is for this?

@kpfleming
Copy link
Contributor Author

My NAS has three SSD-backed pools, and I've read things which claim that 'autotrim' can cause problems for some sorts of SSDS... so instead I have a monthly job to run zpool trim the weekend after it runs zpool scrub.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Jun 23, 2020
@behlendorf behlendorf merged commit f21de68 into openzfs:master Jun 24, 2020
@kpfleming kpfleming deleted the add-trim_finish-notify-script branch June 24, 2020 23:57
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
Allow users to configure notifications when TRIM operations are
completed on pools. Unlike resilver_finish and scrub_finish,
the trim_finish event is generated for each vdev in the pool
which was trimmed, so the script will generate a notification
for each one.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Kevin P. Fleming <kevin@km6g.us>
Closes openzfs#10491
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
Allow users to configure notifications when TRIM operations are
completed on pools. Unlike resilver_finish and scrub_finish,
the trim_finish event is generated for each vdev in the pool
which was trimmed, so the script will generate a notification
for each one.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Kevin P. Fleming <kevin@km6g.us>
Closes openzfs#10491
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

2 participants