Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp252465yba; Wed, 15 May 2019 00:15:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDEb/oWf98CTXSwuTluy/bZ+9+N2TZVo7wUFUsJQ1KKsCvKHzAw303u21OL69hYWq/QDTC X-Received: by 2002:a17:902:28c9:: with SMTP id f67mr23136862plb.190.1557904531638; Wed, 15 May 2019 00:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557904531; cv=none; d=google.com; s=arc-20160816; b=WvUhayJpPHtytXPMt+M1kR6LScdXlXRNE4eNG5t2c9hqOCY33tDiUOemkxGeXk32M+ eEmCumc6M0slHnbctDSmVZWCB6FkygeV98btWrQ8hdrSh+86HzbGBLa/43wpCO/eNSbP 4LUuGw8xyy69JhtRFxjSj7fODzgGG72HZOEJ4YTRNng4as+DMzsgvwHuM+CXx66hSqoa CpRDBXV5s4KmRGaxfbx/dtAz4m9rmcHv2nM1RCbxzvzVj1PC9sup6aqXJi4Yz01F9cPg wBoXClEjHVXt+9KpvvKi+SlxmRnXjlGXastAfV/4BZSRWgHGnTUeXJttLQyrSkmsZsaB euUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=o5rH6YVmKO4jCp+PFEKStkeanvorAeNQRq8+hiToFrI=; b=aUVmxtm2HFApmXeWfUkgjByWjd6F9Y4jLTd7AGbjQ82mpBNHUO59Or+cYkR80LzcYR JPNcPAtsdYnPjI+Dwc1HeCBTbybvX7nWoBLLmz5t7/WEmO+KMWi4puKvSJ0HatIX//Mh T7DzD3n7cUsYRzdr9kXVglTACipGlOllKSaDsaj002Yej8Zpt8Qtei3sC6UqaYjmIriO m0dmeiWfCNOQtj7o0auxWah53xuYRy5bxkeFI4T4lKiLk4/kPsYMcznKaCcrjKVj5Aou cFPA1mtE+6Pp0804rQ+2Wpu/vAs93ETO1wXeemA4Y1bwr3F3xoSetTKZ0rSbsDY+PqWQ kUhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p7si1077947pgi.276.2019.05.15.00.15.16; Wed, 15 May 2019 00:15:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726039AbfEOHOL (ORCPT + 99 others); Wed, 15 May 2019 03:14:11 -0400 Received: from foss.arm.com ([217.140.101.70]:37204 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbfEOHOL (ORCPT ); Wed, 15 May 2019 03:14:11 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 161C9374; Wed, 15 May 2019 00:14:11 -0700 (PDT) Received: from [10.163.1.137] (unknown [10.163.1.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C13ED3F71E; Wed, 15 May 2019 00:14:07 -0700 (PDT) Subject: Re: [PATCH RESEND] mm: show number of vmalloc pages in /proc/meminfo To: Roman Gushchin , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Johannes Weiner References: <20190514235111.2817276-1-guro@fb.com> <20190514235111.2817276-2-guro@fb.com> From: Anshuman Khandual Message-ID: Date: Wed, 15 May 2019 12:44:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190514235111.2817276-2-guro@fb.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/15/2019 05:21 AM, Roman Gushchin wrote: > Vmalloc() is getting more and more used these days (kernel stacks, > bpf and percpu allocator are new top users), and the total % > of memory consumed by vmalloc() can be pretty significant > and changes dynamically. > > /proc/meminfo is the best place to display this information: > its top goal is to show top consumers of the memory. > > Since the VmallocUsed field in /proc/meminfo is not in use > for quite a long time (it has been defined to 0 by the > commit a5ad88ce8c7f ("mm: get rid of 'vmalloc_info' from > /proc/meminfo")), let's reuse it for showing the actual > physical memory consumption of vmalloc(). The primary concern which got addressed with a5ad88ce8c7f was that computing get_vmalloc_info() was taking long time. But here its reads an already updated value which gets added or subtracted during __vmalloc_area_node/__vunmap cycle. Hence this should not cost much (like get_vmalloc_info). But is not this similar to the caching solution Linus mentioned.