From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E346DC2D0E5 for ; Wed, 25 Mar 2020 18:13:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A8E9F20774 for ; Wed, 25 Mar 2020 18:13:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B1+oS4Jx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8E9F20774 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 575EF6B00C8; Wed, 25 Mar 2020 14:13:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 54D966B00C9; Wed, 25 Mar 2020 14:13:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 463026B00CA; Wed, 25 Mar 2020 14:13:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id 2BA166B00C8 for ; Wed, 25 Mar 2020 14:13:00 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F1339181AD824 for ; Wed, 25 Mar 2020 18:12:59 +0000 (UTC) X-FDA: 76634680878.12.color38_8e8ec9392df5c X-HE-Tag: color38_8e8ec9392df5c X-Filterd-Recvd-Size: 5295 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Mar 2020 18:12:59 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id s1so4408811wrv.5 for ; Wed, 25 Mar 2020 11:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3QYyaGrQpYyWaZ6oYwhc56xJCsI+0fcYVeC22HIA+uc=; b=B1+oS4JxxUkN8An2JMtn4rbpXDh5oak3Nhzbu26gmN2zse3nygc/IXtxty0D4nLuej 0QeZ4DLTCdNKczDxfBsuNLSD9qClbxxsLJ5aHJFscskDE1Y1ZmJdmpW/+2qSVRRZaicv S/Ih42cnymRQVZ6yU4OgBPZEtJhLI4bcqazrqrAKM/iM0WRDxdv+Ee2dxeCnq7AFFl7L 037C5Y9HAQrMHdOxljt1hxOfO7i/ibEOeqGYj8vVWxWet88MhSoJPyg+XEQc8buXlpGN i8Ikon8CS3BDacMg4/IMbR5WHwfq72PeM9yhKAKXqCMvylgC/5JkvIBZQR1Y7SxraOMn rdeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3QYyaGrQpYyWaZ6oYwhc56xJCsI+0fcYVeC22HIA+uc=; b=uAlvHRFperw848R+RZWDYagMhKNgQobEv1xT4H7FFilhNRQHL3fsWN2t1Ey5OhvjD2 QnUG4DzQbNad+P3fzfk5eVJECr+Z7Fy+pPi9yugSB5CbNinPU6+nqdrnqaqH9Xjar3yt 4Bim33ZAj6kcL6qgyF1vmPEsARvGD6VGuc5SAR+hxa7c/8jmYZhWfK8QnWaXQ2o9Wu33 eW3jvkZpnLP1+WWHXG6rp2CMDa5OYrt5Bkj5yuWeSZYJNlMsVRKRER0nrHv4RIWLukla zCj7eUHy4Fs+EVf63U/hmrQvqk+DmmqiYnVUkwF9WHRp03XfrWsk7oAsLFp3+knnlbrM +GfA== X-Gm-Message-State: ANhLgQ1dw2T+DUZdDFxu2DvIqXctpy5mVoUCKg/q4o3AHHIoGJK3qnqL 2R15C3rj7QqUBXVGGcyTsg== X-Google-Smtp-Source: ADFU+vsK87vWZ86CZbSOPvStWKiJYDwyDfB/k0nWBadKFPEKNE8HclBtYUpqZ807F5qMdQXCmPxW5Q== X-Received: by 2002:adf:f6c8:: with SMTP id y8mr5033937wrp.403.1585159978286; Wed, 25 Mar 2020 11:12:58 -0700 (PDT) Received: from avx2 ([46.53.251.45]) by smtp.gmail.com with ESMTPSA id 71sm20166150wrc.53.2020.03.25.11.12.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 11:12:57 -0700 (PDT) Date: Wed, 25 Mar 2020 21:12:55 +0300 From: Alexey Dobriyan To: Jaewon Kim Cc: gregkh@linuxfoundation.org, leon@kernel.org, vbabka@suse.cz, akpm@linux-foundation.org, labbott@redhat.com, sumit.semwal@linaro.org, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, kasong@redhat.com, bhe@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com, linux-api@vger.kernel.org, kexec@lists.infradead.org Subject: Re: [RFC PATCH v2 0/3] meminfo_extra: introduce meminfo extra Message-ID: <20200325181255.GB18706@avx2> References: <20200323080503.6224-1-jaewon31.kim@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200323080503.6224-1-jaewon31.kim@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 23, 2020 at 05:05:00PM +0900, Jaewon Kim wrote: > /proc/meminfo or show_free_areas does not show full system wide memory > usage status because memory stats do not track all memory allocations. > There seems to be huge hidden memory especially on embedded system. It > is because some HW IPs in the system use common DRAM memory instead of > internal memory. Device drivers directly request huge pages from the > page allocator with alloc_pages. > > In Android system, most of those hidden memory seems to be vmalloc > pages, ion system heap memory, graphics memory, and memory for DRAM > based compressed swap storage. They may be shown in other node but it > seems to be useful if /proc/meminfo_extra shows all those extra memory > information. And show_mem also need to print the info in oom situation. > > Fortunately vmalloc pages is already shown by commit 97105f0ab7b8 > ("mm: vmalloc: show number of vmalloc pages in /proc/meminfo"). Swap > memory using zsmalloc can be seen through vmstat by commit 91537fee0013 > ("mm: add NR_ZSMALLOC to vmstat") but not on /proc/meminfo. > > Memory usage of specific driver can be various so that showing the usage > through upstream meminfo.c is not easy. To print the extra memory usage > of a driver, introduce following APIs. Each driver needs to count as > atomic_long_t. > > int register_meminfo_extra(atomic_long_t *val, int shift, > const char *name); > int unregister_meminfo_extra(atomic_long_t *val); > > Currently register ION system heap allocator and zsmalloc pages. > Additionally tested on local graphics driver. > > i.e) cat /proc/meminfo_extra | tail -3 > IonSystemHeap: 242620 kB > ZsPages: 203860 kB > GraphicDriver: 196576 kB In that case definitely delete ':', spaces and KB. They only slowdown generation and parsing in userspace. Values should be printed /proc/vmstat does it, maybe with tab instead of space. foo 1234 bar 0 zot 111