Page MenuHomeFreeBSD

ps: Constistent usage of Kbyte unit in man page
ClosedPublic

Authored by olivier on Mar 25 2025, 10:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 8, 12:28 PM
Unknown Object (File)
Sat, Jun 7, 6:46 PM
Unknown Object (File)
May 1 2025, 11:06 PM
Unknown Object (File)
Apr 22 2025, 6:12 AM
Unknown Object (File)
Apr 21 2025, 10:28 PM
Unknown Object (File)
Apr 21 2025, 10:27 PM
Unknown Object (File)
Apr 21 2025, 9:36 PM
Unknown Object (File)
Apr 21 2025, 9:36 PM
Subscribers

Details

Summary

Fix the wording.
But need a confirmation that "in 1024 byte units" is equivalent to "Kbytes".

Diff Detail

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

Event Timeline

I do not like this. I like for it to be more terse, but kbytes is non-standard and ambiguous. Additional context:

"The International System of Units (SI) defines the prefix kilo as a multiplication factor of 1000 (103); therefore, one kilobyte is 1000 bytes.[1] The internationally recommended unit symbol for the kilobyte is kB." ~Wikipedia

"The kibibyte is defined as 1024 bytes, avoiding the ambiguity issues of the kilobyte." ~Wikipedia

kibibyte allegedly comes from "Amendment 2 to IEC International Standard IEC 60027-2: Letter symbols to be used in electrical technology - Part 2: Telecommunications and electronics".

We can start using kibibyte, but I don't remember we really do so in the manual much

I am sure we did not used these ugly names like kibibytes before. IMO the patch is fine as is.

This revision is now accepted and ready to land.Mar 26 2025, 8:25 AM
This revision was automatically updated to reflect the committed changes.

Except 1000 and 1024 are completely different, it was precise, and now you have made it ambiguous with a non-standard unit. I think this will result in users complaining that the kB values are substantially different than what they expect at gigabyte or terabyte increments. There was no need to touch it at all.

"Technically the IEC has weighed in with an official standard, but I'm not sure that's worth much.

Several options:
"1 KB" means 1024 bytes (as Windows would report it, traditional usage)
"1 kB" means 1000 bytes (as Mac OS would report it, IEC usage)
"1 KiB" means 1024 bytes (unambiguous, but perhaps unfamiliar terminology)
Not a huge deal since we're only talking a 2.4% difference for files in the KB range, but for MB the difference is ~5% and for GB it's ~8%."

"Technically the IEC has weighed in with an official standard, but I'm not sure that's worth much.

Several options:
"1 KB" means 1024 bytes (as Windows would report it, traditional usage)
"1 kB" means 1000 bytes (as Mac OS would report it, IEC usage)
"1 KiB" means 1024 bytes (unambiguous, but perhaps unfamiliar terminology)
Not a huge deal since we're only talking a 2.4% difference for files in the KB range, but for MB the difference is ~5% and for GB it's ~8%."

In BSD land, kB and KB mean 1024 bytes. But kbps (or sometimes Kbps though less often) means 1000 bits per second. It gets
worse for a bare M which can mean 2^20, 10^3 * 2^10 or 10^6 depending on the context. But there was a rough consistency
in the BSD stuff, for better or worse, that we've mostly kept.

Perhaps we should go all in on the IEC companion recommendations to SI unit multipliers. However, it should be throughtful
and thorough. It should also be the consensus. Or at close to a consensus as this issue can generate. Years ago, 10-15 maybe,
there was a discussion and the old guard hated the XiB notation so much that it went nowhere (and I think set us back in
the process). These days, I think we can say we're late to the game and need to support this standard more and in a more
thoughtful way. But this isn't the place to litigate this, and I suspect that it would take someone with drive, political savvy
and connections and respect in the community to get this issue over the finish line since I fear if we drop it into the mailing
lists we'll get a 3:1 split (which is at least a rough consensus), but with a lot of very loud complaining.

Actually, looking in our tree, this is not ambiguous. We are using the international specified standard language quite commonly:

git grep KiB | wc -l
      535
git grep KBytes | wc -l
      39

Actually, looking in our tree, this is not ambiguous. We are using the international specified standard language quite commonly:

git grep KiB | wc -l
      535
git grep KBytes | wc -l
      39

Great!
This will make it easier to convert the remaining units in all other places without needing a long discussion beforehand. :-)

Thank you for your understanding sir.

Additional thoughts; people have been attracted to FreeBSD for consistency, documentation, standards, and stability. These are our strengths. This is what will attract the next generation. We need to double down on these.