Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754647AbbKBSgm (ORCPT ); Mon, 2 Nov 2015 13:36:42 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:1203 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753964AbbKBSgl (ORCPT ); Mon, 2 Nov 2015 13:36:41 -0500 Date: Mon, 2 Nov 2015 13:36:29 -0500 From: Dave Jones To: Linux Kernel CC: Linus Torvalds , Andrew Morton , Subject: mm: remove vmalloc info from /proc/meminfo Message-ID: <20151102183629.GA10347@fb.com> Mail-Followup-To: Dave Jones , Linux Kernel , Linus Torvalds , Andrew Morton , shli@fb.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-11-02_10:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2578 Lines: 77 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 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 #include #include -#include #ifdef CONFIG_CMA #include #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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/