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: [PATCH] proc: meminfo: Replace kB with KiB in output
Date: Sun, 10 Apr 2016 17:23:11 +0200	[thread overview]
Message-ID: <1460301791-15645-2-git-send-email-alexj@linux.com> (raw)
In-Reply-To: <1460301791-15645-1-git-send-email-alexj@linux.com>

Current values are based on multiples of 1024 (powers of 2)
which means that the values in meminfo are not kilobytes
(1000 bytes) but kibibytes (1024 bytes). The correct
prefix for that would be 'Ki' so the output should be 'KiB'.

Signed-off-by: Alexandru Juncu <alexj@linux.com>
---
 fs/proc/meminfo.c | 90 +++++++++++++++++++++++++++----------------------------
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 8372046..5f0015e 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -33,7 +33,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 	int lru;
 
 /*
- * display in kilobytes.
+ * display in kibibytes.
  */
 #define K(x) ((x) << (PAGE_SHIFT - 10))
 	si_meminfo(&i);
@@ -54,61 +54,61 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 	 * Tagged format, for easy grepping and expansion.
 	 */
 	seq_printf(m,
-		"MemTotal:       %8lu kB\n"
-		"MemFree:        %8lu kB\n"
-		"MemAvailable:   %8lu kB\n"
-		"Buffers:        %8lu kB\n"
-		"Cached:         %8lu kB\n"
-		"SwapCached:     %8lu kB\n"
-		"Active:         %8lu kB\n"
-		"Inactive:       %8lu kB\n"
-		"Active(anon):   %8lu kB\n"
-		"Inactive(anon): %8lu kB\n"
-		"Active(file):   %8lu kB\n"
-		"Inactive(file): %8lu kB\n"
-		"Unevictable:    %8lu kB\n"
-		"Mlocked:        %8lu kB\n"
+		"MemTotal:       %8lu KiB\n"
+		"MemFree:        %8lu KiB\n"
+		"MemAvailable:   %8lu KiB\n"
+		"Buffers:        %8lu KiB\n"
+		"Cached:         %8lu KiB\n"
+		"SwapCached:     %8lu KiB\n"
+		"Active:         %8lu KiB\n"
+		"Inactive:       %8lu KiB\n"
+		"Active(anon):   %8lu KiB\n"
+		"Inactive(anon): %8lu KiB\n"
+		"Active(file):   %8lu KiB\n"
+		"Inactive(file): %8lu KiB\n"
+		"Unevictable:    %8lu KiB\n"
+		"Mlocked:        %8lu KiB\n"
 #ifdef CONFIG_HIGHMEM
-		"HighTotal:      %8lu kB\n"
-		"HighFree:       %8lu kB\n"
-		"LowTotal:       %8lu kB\n"
-		"LowFree:        %8lu kB\n"
+		"HighTotal:      %8lu KiB\n"
+		"HighFree:       %8lu KiB\n"
+		"LowTotal:       %8lu KiB\n"
+		"LowFree:        %8lu KiB\n"
 #endif
 #ifndef CONFIG_MMU
-		"MmapCopy:       %8lu kB\n"
+		"MmapCopy:       %8lu KiB\n"
 #endif
-		"SwapTotal:      %8lu kB\n"
-		"SwapFree:       %8lu kB\n"
-		"Dirty:          %8lu kB\n"
-		"Writeback:      %8lu kB\n"
-		"AnonPages:      %8lu kB\n"
-		"Mapped:         %8lu kB\n"
-		"Shmem:          %8lu kB\n"
-		"Slab:           %8lu kB\n"
-		"SReclaimable:   %8lu kB\n"
-		"SUnreclaim:     %8lu kB\n"
-		"KernelStack:    %8lu kB\n"
-		"PageTables:     %8lu kB\n"
+		"SwapTotal:      %8lu KiB\n"
+		"SwapFree:       %8lu KiB\n"
+		"Dirty:          %8lu KiB\n"
+		"Writeback:      %8lu KiB\n"
+		"AnonPages:      %8lu KiB\n"
+		"Mapped:         %8lu KiB\n"
+		"Shmem:          %8lu KiB\n"
+		"Slab:           %8lu KiB\n"
+		"SReclaimable:   %8lu KiB\n"
+		"SUnreclaim:     %8lu KiB\n"
+		"KernelStack:    %8lu KiB\n"
+		"PageTables:     %8lu KiB\n"
 #ifdef CONFIG_QUICKLIST
-		"Quicklists:     %8lu kB\n"
+		"Quicklists:     %8lu KiB\n"
 #endif
-		"NFS_Unstable:   %8lu kB\n"
-		"Bounce:         %8lu kB\n"
-		"WritebackTmp:   %8lu kB\n"
-		"CommitLimit:    %8lu kB\n"
-		"Committed_AS:   %8lu kB\n"
-		"VmallocTotal:   %8lu kB\n"
-		"VmallocUsed:    %8lu kB\n"
-		"VmallocChunk:   %8lu kB\n"
+		"NFS_Unstable:   %8lu KiB\n"
+		"Bounce:         %8lu KiB\n"
+		"WritebackTmp:   %8lu KiB\n"
+		"CommitLimit:    %8lu KiB\n"
+		"Committed_AS:   %8lu KiB\n"
+		"VmallocTotal:   %8lu KiB\n"
+		"VmallocUsed:    %8lu KiB\n"
+		"VmallocChunk:   %8lu KiB\n"
 #ifdef CONFIG_MEMORY_FAILURE
-		"HardwareCorrupted: %5lu kB\n"
+		"HardwareCorrupted: %5lu KiB\n"
 #endif
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-		"AnonHugePages:  %8lu kB\n"
+		"AnonHugePages:  %8lu KiB\n"
 #endif
 #ifdef CONFIG_CMA
-		"CmaTotal:       %8lu kB\n"
-		"CmaFree:        %8lu kB\n"
+		"CmaTotal:       %8lu KiB\n"
+		"CmaFree:        %8lu KiB\n"
 #endif
 		,
 		K(i.totalram),
-- 
2.5.5

  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 [RFC] proc: meminfo: Replace kB with KiB in output Alexandru Juncu
2016-04-10 15:23 ` Alexandru Juncu [this message]
2016-04-11  6:12   ` [PATCH] " 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-2-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