Page MenuHomeFreeBSD

ps.1: Use ISO/IEC byte units
ClosedPublic

Authored by ziaee on Mar 26 2025, 5:44 PM.
Tags
None
Referenced Files
F132148958: D49522.id152806.diff
Tue, Oct 14, 5:10 AM
F132121534: D49522.diff
Mon, Oct 13, 10:34 PM
Unknown Object (File)
Wed, Sep 24, 7:38 AM
Unknown Object (File)
Thu, Sep 18, 1:42 AM
Unknown Object (File)
Sep 10 2025, 3:22 AM
Unknown Object (File)
Sep 5 2025, 3:49 PM
Unknown Object (File)
Aug 30 2025, 2:43 PM
Unknown Object (File)
Aug 26 2025, 4:15 PM
Subscribers

Details

Summary

The ps(1) utility uses 1024 byte units, not 1000 byte units.

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

Fixes: 20bdda14fa5c (Consistent usage of Kbyte unit)
MFC after: 3 days

Diff Detail

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

Event Timeline

ziaee requested review of this revision.Mar 26 2025, 5:44 PM
ziaee created this revision.

Just my $0.02 https://en.wikichip.org/wiki/kibibyte and consistency is cool. and a certainly am convinced that https://github.com/freebsd/freebsd-src/commit/20bdda14fa5c7ccb96c814d09311db948b1d239a drops informations kBytes is not common usage for KiB

In D49522#1129122, @jsm wrote:

Just my $0.02 https://en.wikichip.org/wiki/kibibyte and consistency is cool. and a certainly am convinced that https://github.com/freebsd/freebsd-src/commit/20bdda14fa5c7ccb96c814d09311db948b1d239a drops informations kBytes is not common usage for KiB

Yea, the days of correcting marketing folks that say a new machine has 65kB of RAM are long since past. kB hasn't been a primary unit of measure of memory in maybe 40 years. So the sensibilities developed when it was (like I did) aren't a good judge for what's common (even though I read kBytes as 1024 always).

And we're now maybe 20 years past when the view of IEC standard started to shift from 'silly' to 'useful', so this is a good change.

This revision is now accepted and ready to land.Mar 26 2025, 9:04 PM

I sent a patch to llvm to fix 6 of them in contrib as well.

Contrib likely should be done upstream

Absolutely, that's what I meant I did, sorry.

This revision was automatically updated to reflect the committed changes.