mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] proc: meminfo: Replace kB with KiB in output
@ 2016-04-10 15:23 Alexandru Juncu
  2016-04-10 15:23 ` [PATCH] " Alexandru Juncu
  0 siblings, 1 reply; 6+ messages in thread
From: Alexandru Juncu @ 2016-04-10 15:23 UTC (permalink / raw)
  To: linux-kernel, den, mhocko, redkoi, rkagan, hannes, alexj



Hi!

I was helping somebody write some documentation about meminfo and
I started explaining that memory values are mostly multiples of
1024 and that binary prefixes are preferred. The output of
/proc/meminfo is hardcoded to be in 'kB' which should mean 1000
bytes (one kilobytes). But judging by the definition of the K()
macro it is based on page size which is a multiple of 1024.
So the values are actually kibibytes (KiB). Therefore we got
stuck with writing the documentation because there is a
discrepancy between the output and the code.

If I am mistaken, please correct me and ignore the rest of
the message.

I know there is a big debate about using binary prefixes versus
using the de facto definitions based on powers of 10. The
technically correct usage in this case would be KiB but I am
thinking that nobody changed this because it might break things.

Therefore I am writing this email with the main purpose of
finding out what is the reason what the output is as it is.
Is it because changing it would break userspace tools that
read /proc/meminfo ? Or is it because the technical correctness
of the binary prefix side in the debate lost? Or just because
nobody bothered fixing this?

If the last reason is the answer I would like to take the
first step in addressing it with this RFC.

Thank you!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-11  7:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-10 15:23 [RFC] proc: meminfo: Replace kB with KiB in output Alexandru Juncu
2016-04-10 15:23 ` [PATCH] " Alexandru Juncu
2016-04-11  6:12   ` Michal Hocko
2016-04-11  6:35     ` Alexandru Juncu
2016-04-11  6:48       ` Michal Hocko
2016-04-11  7:53   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome