Solved Does ZFS on i386 require a custom kernel in 10.3?

Does ZFS on i386 (1GB RAM) require a custom kernel in 10.3?

The handbook suggests is does but freebsd-update is just so convenient.

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/zfs-advanced.html

The plan is to plug-in a spare disk to an existing FreeBSD (UFS) system and put a ZFS filesystem on it so I can start exploring the tech. I suppose it will be necessary to shut down X11 and most of the daemons then start ZFS for tinker sessions.

Any advice or words of wisdom?
 
It certainly does because the available kernel virtual memory is not enough for ZFS on the GENERIC kernel on the i386 platform. The GENERIC kernel makes this compromise to not to default to the larger virtual kernel memory space because it reduces the memory available for applications considerably and renders the system unusable for certain other tasks.

The amd64 platform has no such problems because the virtual address space available for the kernel is not limited to 4GBs but (theoretically) to 2^64 (2 to the power of 64) bytes.
 
  • ZFS was specifically designed for 64-bit CPUs.
  • Using ZFS with less than 4Gb of RAM will lead to at least an occasional performance issue; using it on 1Gb of RAM will almost certainly be a disaster.

Yeah, I don't have a 64-bit system available for tinkering. The handbook says:
On a test system with 1 GB of physical memory, success was achieved with these options added to /boot/loader.conf, and the system restarted:
Code:
vm.kmem_size="330M"
vm.kmem_size_max="330M"
vfs.zfs.arc_max="40M"
vfs.zfs.vdev.cache.size="5M"
So it seems like a little experimenting with ZFS on this system might not result terrible carnage.
 
I am compiling a kernel now. Does it make sense to set KVA_PAGES=512 on a machine with only 1GB of physical RAM?
19.6.2.2. Kernel Configuration
Due to the address space limitations of the i386™ platform, ZFS users on the i386™ architecture must add this option to a custom kernel configuration file, rebuild the kernel, and reboot:
Code:
options        KVA_PAGES=512
This expands the kernel address space, allowing the vm.kvm_size tunable to be pushed beyond the currently imposed limit of 1 GB, or the limit of 2 GB for PAE. To find the most suitable value for this option, divide the desired address space in megabytes by four. In this example, it is 512 for 2 GB.
 
Just pull down an older version of freebsd. I have tested 9.2 or 9.1 a bunch of times on 1gb ram.
Maybe ZFS on 10.3-i386 will also work with 1GB of RAM. Some hints about the tunables to jumpstart my experiments would be much appreciated :)
 
Update: I put the spare disk into the machine and tried ZFS with the generic kernel and /boot/loader.conf
Code:
vm.kmem_size="330M"
vm.kmem_size_max="330M"
vfs.zfs.arc_max="40M"
vfs.zfs.vdev.cache.size="5M"
After service zfs onestart, it says:
Code:
ZFS NOTICE: KSTACK_PAGES is 2 which could result in stack overflow panic!
Please consider adding 'options KSTACK_PAGES=4' to your kernel config
ZFS NOTICE: Prefetch is disabled by default on i386 -- to enable,
            add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf.
ZFS WARNING: Recommended minimum kmem_size is 512MB; expect unstable behavior.
             Consider tuning vm.kmem_size and vm.kmem_size_max
             in /boot/loader.conf.
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
But it worked well enough to create a pool and a couple sub-pools and set compression=gzip on one and copies=2 on the other. I didn't copy any files. Instead, I am compiling a stripped down kernel with these options:
Code:
options         KVA_PAGES=512
options         KSTACK_PAGES=4
And I am changing /boot/loader.conf to:
Code:
vm.kmem_size="512M"
vm.kmem_size_max="512M"
vfs.zfs.arc_max="40M"
vfs.zfs.vdev.cache.size="5M"
It will be interesting to see if anything else can run on the machine while ZFS is running.
 
Update: It occurred to me that this little single core Sempron might be sufficiently 64-bit enabled to run FreeBSD 10.3-amd64. So I installed it with zroot on [what was] the spare disk and it seems to be running fine. It's copying files from the UFS disk now. After that completes, I would like to add [what was] the UFS disk to [what will be] a mirror of [what is now] the ZFS boot disk.
 
Back
Top