Page MenuHomeFreeBSD

zfs: set autotrim default to 'off'
ClosedPublic

Authored by yuripv on Jul 17 2023, 9:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 3:14 AM
Unknown Object (File)
Thu, May 2, 2:08 PM
Unknown Object (File)
Sat, Apr 27, 9:09 PM
Unknown Object (File)
Mon, Apr 8, 4:10 AM
Unknown Object (File)
Feb 5 2024, 4:00 PM
Unknown Object (File)
Jan 30 2024, 8:49 AM
Unknown Object (File)
Dec 23 2023, 1:39 AM
Unknown Object (File)
Dec 12 2023, 3:07 AM
Subscribers

Details

Summary

Coming back to this with what seems to be complete solution -- simply
default autotrim to 'off' and remove any FreeBSD-specific defines here.

As it turns out having autotrim default to 'on' on FreeBSD never really
worked due to mess with defines where userland and kernel module were
getting different default values (userland was defaulting to 'off',
module was thinking it's 'on').

PR: 264234

Test Plan

Build, install, check that autotrim value of 'off' says 'default' in source field, 'on' - 'local'.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

yuripv edited the test plan for this revision. (Show Details)
yuripv added a reviewer: ZFS.
mav added a subscriber: mav.

I like removal of IN_FREEBSD_BASE. I would be happy if autotrim was enabled by default, but if it wasn't for some time, then I see no problem to clean this up. I just wonder how long it was broken. Respective part of the patch will need to be upstreamed to OpenZFS also, may be in parallel to make sure more people are in sync about it.

This revision is now accepted and ready to land.Jul 17 2023, 1:47 PM
In D41056#934733, @mav wrote:

I like removal of IN_FREEBSD_BASE. I would be happy if autotrim was enabled by default, but if it wasn't for some time, then I see no problem to clean this up. I just wonder how long it was broken. Respective part of the patch will need to be upstreamed to OpenZFS also, may be in parallel to make sure more people are in sync about it.

It's been that way since the switch to openzfs (so 3 years?), and nobody seems to have complained, other than the PR mentioned and only about inconsistent source information.

To make sure I'm not imagining things (yet again), I have added a printf to the end of spa_load_impl(), and creating/exporting/importing the pool without this change gets me the following (where the pools with explicitly enabled autotrim show 1):

Solaris: NOTICE: autotrim=0

I will open PR against openzfs, with a note that it will NOT change anything there, both linux build and openzfs build in ports default to autotrim being 0 already.

This revision was automatically updated to reflect the committed changes.