Adjusting spa_slop_shift

mm0nst3r

Dabbler
Joined
Sep 5, 2021
Messages
33
How do I adjust spa_slop_shift ?

echo 7 > /sys/module/zfs/parameters/spa_slop_shift
both in console and as post-init doesn't result in any additional free space on my pools
 

Thibaut

Dabbler
Joined
Jun 21, 2014
Messages
33
TrueNAS runs on FreeBSD, which is a UNIX like OS, not Linux.
The command that you are using is usable only on Linux systems, not on FreeBSD.

I'm also looking for a way to modify zfs's spa_slop_shift on my TrueNAS system but without success until now :frown:

What I've tried so far is setting a tunable variable of type SYSCTL with name vfs.zfs.spa.slop_shift in TrueNAS's web GUI under System > Tunables:
1670498333978.png


This parameter is referenced in the openzfs documentation as being dynamic, which means one doesn't have to restart the system for the parameter to be applied. This can be verified using the following command before and after setting the tunable variable:

Before setting the tunable variable (zfs default value for spa_slop_shift is indeed 5):
Code:
# arc_summary | grep slop
        spa.slop_shift                                                 5


After setting the vfs.zfs.spa.slop_shift tunable variable to 8:
Code:
# arc_summary | grep slop
        spa.slop_shift                                                 8


Unfortunately, this doesn't modify the AVAIL value returned by the zfs list command:
Before setting the tunable variable:
Code:
# zfs list -o name,used,avail MyPool
NAME   USED  AVAIL
MyPool 42.8T   323G


After setting the vfs.zfs.spa.slop_shift tunable variable to 8:
Code:
# zfs list -o name,used,avail MyPool
NAME   USED  AVAIL
MyPool 42.8T   323G


Starting the system using systemrescue-zfs on a USB key, then modifying the spa_slop_shift with the mentioned command:
Code:
# echo 8 > /sys/module/zfs/parameters/spa_slop_shift

Indeed changed the AVAIL value...

This was the only way I could recover from the "No space left on device", "Error removing file: No space left on device" deadlock I found myself in when the AVAIL value reached 0B on the pool!

Hopefully someone can explain why this doesn't work on TrueNAS (FreeBSD), or whether I'm using the wrong tunable?

Thanks...
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
TrueNAS runs on FreeBSD, which is a UNIX like OS, not Linux.
But this thread is in the SCALE part of the forum and SCALE is running on Linux.

I'm pretty sure there's something coming from iX configuration on boot (in CORE, maybe also in SCALE) which determines most of the ZFS tunable parameters before we can get to them, so despite the setting, it's not the one in effect.


As a general response to the thread, you may want to raise a feature request in Jira for it, otherwise, I think we're all just wasting our time trying to reverse engineer something.
 

Thibaut

Dabbler
Joined
Jun 21, 2014
Messages
33
Oups, sorry didn't pay attention to the fact it was in the TrueNAS SCALE section since I landed on this thread from a global search in the forums...

Will pay more attention next time :wink:
 
Top