From: Dave Jones <dsj@fb.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>, <shli@fb.com>
Subject: mm: remove vmalloc info from /proc/meminfo
Date: Mon, 2 Nov 2015 13:36:29 -0500 [thread overview]
Message-ID: <20151102183629.GA10347@fb.com> (raw)
Reading /proc/meminfo is really slow, as it requires recomputing the
vmalloc data every time, which is a lot of work, when most (all?)
consumers of meminfo don't even care about those statistics.
Linus mentioned[*] that he wanted to just remove these fields
from this file, and just break the ABI if no-one complains
(and if someone does, do some caching here instead, or just printing
the vmalloc fields as zero).
For people wanting the vmalloc stats, /proc/vmallocinfo should be more
interesting anyway.
As it turns out, Facebook also has workloads that were negatively
impacted by this, (while also not caring about the vmalloc info either).
The patch below removes all this unnecessary work.
[*] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg961636.html
Signed-off-by: Dave Jones <dsj@fb.com>
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index d3ebf2e61853..63b990811ef3 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -11,7 +11,6 @@
#include <linux/swap.h>
#include <linux/vmstat.h>
#include <linux/atomic.h>
-#include <linux/vmalloc.h>
#ifdef CONFIG_CMA
#include <linux/cma.h>
#endif
@@ -27,7 +26,6 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
{
struct sysinfo i;
unsigned long committed;
- struct vmalloc_info vmi;
long cached;
long available;
unsigned long pagecache;
@@ -49,8 +47,6 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
if (cached < 0)
cached = 0;
- get_vmalloc_info(&vmi);
-
for (lru = LRU_BASE; lru < NR_LRU_LISTS; lru++)
pages[lru] = global_page_state(NR_LRU_BASE + lru);
@@ -132,9 +128,6 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
"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"
#ifdef CONFIG_MEMORY_FAILURE
"HardwareCorrupted: %5lu kB\n"
#endif
@@ -189,10 +182,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
K(global_page_state(NR_BOUNCE)),
K(global_page_state(NR_WRITEBACK_TEMP)),
K(vm_commit_limit()),
- K(committed),
- (unsigned long)VMALLOC_TOTAL >> 10,
- vmi.used >> 10,
- vmi.largest_chunk >> 10
+ K(committed)
#ifdef CONFIG_MEMORY_FAILURE
, atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
#endif
next reply other threads:[~2015-11-02 18:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 18:36 Dave Jones [this message]
2015-11-02 19:29 ` mm: remove vmalloc info from /proc/meminfo Linus Torvalds
2015-11-02 20:10 ` Dave Jones
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=20151102183629.GA10347@fb.com \
--to=dsj@fb.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shli@fb.com \
--cc=torvalds@linux-foundation.org \
/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