Page MenuHomeFreeBSD

nanobsd: Unify makefs(8) ffs options
AbandonedPublic

Authored by jlduran on May 24 2026, 10:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 8, 9:52 AM
Unknown Object (File)
Sun, Jun 7, 2:15 PM
Unknown Object (File)
Sun, Jun 7, 2:11 PM
Unknown Object (File)
Fri, Jun 5, 1:19 PM
Unknown Object (File)
Fri, Jun 5, 1:15 PM
Unknown Object (File)
Wed, Jun 3, 8:13 PM
Unknown Object (File)
Tue, Jun 2, 4:24 PM
Unknown Object (File)
Sun, May 31, 12:51 PM
Subscribers

Details

Reviewers
imp
Summary

Move the minfree=0 and optimization=space options to the global
NANO_MAKEFS variable.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73401
Build 70284: arc lint + arc unit

Event Timeline

So minfree=1 or =2 will avoid n^2 behavior in block allocations. If it's a read-only image, then that doesn't matter, but if the final image does a lot of that minfree=0 could be a problem and at least needs an note somewhere.

So on the whole, it's a good change, I think.

This revision is now accepted and ready to land.May 24 2026, 11:29 PM
In D57218#1311215, @imp wrote:

So minfree=1 or =2 will avoid n^2 behavior in block allocations. If it's a read-only image, then that doesn't matter, but if the final image does a lot of that minfree=0 could be a problem and at least needs an note somewhere.

That is an interesting observation, my original motivation comes from:
https://github.com/freebsd/poudriere/commit/fd09f8b79b321f318794e5063eae11063e904e8f
where minfree=0 just removes the need to have an 8% free space. I'll look into it (mkimg/ffs code) before committing.

So on the whole, it's a good change, I think.

OK, good to know!

In D57218#1311215, @imp wrote:

So minfree=1 or =2 will avoid n^2 behavior in block allocations. If it's a read-only image, then that doesn't matter, but if the final image does a lot of that minfree=0 could be a problem and at least needs an note somewhere.

I have analyzed this change a little better. I will abandon it, and remove it from the stack.
Note to self:
By moving minfree=0,optimization=space to the global variable, the _populate_part() function will use this setting as well. _populate_part() is used to create /cfg and /data, which are not read-only, and runtime block allocation could go quadratic.