public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Juncu <alexj@linux.com>
To: linux-kernel@vger.kernel.org, den@openvz.org, mhocko@suse.com,
	redkoi@virtuozzo.com, rkagan@virtuozzo.com, hannes@cmpxchg.org,
	alexj@linux.com
Subject: [RFC] proc: meminfo: Replace kB with KiB in output
Date: Sun, 10 Apr 2016 17:23:10 +0200	[thread overview]
Message-ID: <1460301791-15645-1-git-send-email-alexj@linux.com> (raw)



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!

             reply	other threads:[~2016-04-10 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-10 15:23 Alexandru Juncu [this message]
2016-04-10 15:23 ` [PATCH] proc: meminfo: Replace kB with KiB in output 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460301791-15645-1-git-send-email-alexj@linux.com \
    --to=alexj@linux.com \
    --cc=den@openvz.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=redkoi@virtuozzo.com \
    --cc=rkagan@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox