Page MenuHomeFreeBSD

Enable soft updates by default for UFS2 filesystems
ClosedPublic

Authored by mckusick on May 15 2024, 12:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 30, 9:32 PM
Unknown Object (File)
Mon, Oct 21, 6:04 PM
Unknown Object (File)
Oct 5 2024, 12:28 PM
Unknown Object (File)
Oct 5 2024, 12:17 PM
Unknown Object (File)
Oct 5 2024, 10:32 AM
Unknown Object (File)
Sep 27 2024, 2:50 PM
Unknown Object (File)
Sep 24 2024, 4:00 PM
Unknown Object (File)
Sep 16 2024, 10:51 AM
Subscribers

Details

Summary

Soft updates dramatically improve the performance of UFS filesystems. The newfs(8) utility currently does not enable them by default. The FreeBSD installer enables soft updates by default. However custom built installations that do not specify the -U option to newfs(8) and the prebuilt UFS system images get filesystems without soft updates enabled.

There are several testing sites that run benchmarks comparing the performance of Linux distributions versus BSD distributions. When they run filesystem comparison benchmarks they use newfs(8) to create the UFS filesystem. Because it does not have soft updates enabled it runs poorly versus the Linux ext4 filesystem. When I have suggested to them that they should enable soft updates on the UFS filesystem in their testing their response is that they expect the utility that creates the filesystem to use optimal defaults and that they cannot be expected to fiddle with various option settings.

The purpose of this change is to give a filesystem created with newfs(8) reasonably optimal settings. For UFS2 this means enabling soft updates. For UFS1 which tends to be used on small systems with minimal memory and CPU speed, the lower memory footprint of running without soft updates is a more sensible default.

This change adds a note in the section of the newfs(8) manual page that describes the -U option for enabling soft updates that they are enabled by default for UFS2 filesystems and that they can be disabled by using tunefs(8).

Test Plan

Confirm that soft updates are enabled when running newfs(8).

Diff Detail

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

Event Timeline

I think it would be useful to have an option to disable SU, so that you still can format a volume with single command invocation regardless of SU enablement.

This revision is now accepted and ready to land.May 15 2024, 12:44 AM

I don't know.. has soft updates cooked enough ? :)