Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1290854ybh; Thu, 12 Mar 2020 21:42:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt/ewzMNDpy+qqUni1W8RmRxin3cckVBGFPOUw2iSEwdttB+1xZbvzZsxCe7LD8y/vMn+5A X-Received: by 2002:aca:5345:: with SMTP id h66mr3703982oib.110.1584074548160; Thu, 12 Mar 2020 21:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584074548; cv=none; d=google.com; s=arc-20160816; b=YyTdMRxnya3ABDMKilUtEfNW9rhm+liu9whv38CAgHLz9d4B7myPNgyKMKFg0y66FS wfHwKJWITDO2YfTb/SI0JS6cPlbh/4Fzy6wduI0m5jCRXHYKcn+f3Mad9BwUXm3ewT2P YS2Fwuwt9KEDC4OeEx8xepmHxj5hz1u1fqNouocjtRlyh/e61TCBi8Xso2oi+9eRvuoo YKaM6DAbmuYveg7gjzL7JLuVbkPt0ImLB9aVhzv2/lTBm3vd7+lfnSGLcS4TtBLI+jYk bOr2VCIPMoDIkI5+NRH9HMY4rrgSUc2UB4EHmB/eWDNjoWFh+q12ggcyadR3nJhCK2na qOdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=v6r4BUQaJ3xXd6EYWNNxfOhW2h7BdAHlbj5DlJaTm7k=; b=gdpDr74UyZZeuoP6E5LrkqIaS+DE70YR7C3/nwMh5SInSGdVTbE1+SNq0NLpyG+Dth +jEBXFbhX95HQxDSvBPB/jY8hgxDBtsG8Mm6HtdBYqvxUY5iyRv4GbW6nELqNa4GHItj w2hlGfk0h5dCe3YHV8oS/YdG8s8DtlP1nvEFHgJOtS0D0auIuCJg7h4bSXFXnPsoXzWj F8Og9CRpXWckfIkFOiUWfs3amd67pJ/GYOV+WJQ+2KTgfCeBkkZ8fjbX1S14MimrhS3U 1++VtUne+F0SCqD6knN9x1NGkl1ZiT6zMUWQKUZQfb6F0KRla7bvul246xvdLNjce+C9 XTlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=u+gfPm+L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i24si3986040otp.282.2020.03.12.21.42.01; Thu, 12 Mar 2020 21:42:28 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=u+gfPm+L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726331AbgCMEj1 (ORCPT + 99 others); Fri, 13 Mar 2020 00:39:27 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:46387 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbgCMEj0 (ORCPT ); Fri, 13 Mar 2020 00:39:26 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20200313043923epoutp04e7196ab85d1f249f409b6717669d3c90~7wz23Rdis1524015240epoutp04i for ; Fri, 13 Mar 2020 04:39:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20200313043923epoutp04e7196ab85d1f249f409b6717669d3c90~7wz23Rdis1524015240epoutp04i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1584074363; bh=v6r4BUQaJ3xXd6EYWNNxfOhW2h7BdAHlbj5DlJaTm7k=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=u+gfPm+LB4ZBytdbJIbp03DOPmEsa0V4szTatMh+OGfBgWhS6TGXlFRUxjfIO+y6E zTCiPFEJHwzo3kQ9UT57k5kvB2AkitrzJOUx5SQ1Dr/oY6rFsHd8f0W/8eknC0I9TA ZBCZbRxJQb5t7aw9lmC8wv7HCuzRhAUAQHZphXyE= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20200313043923epcas1p3fb9b3b974760ce2b159531276b356dae~7wz2ejdqZ2220422204epcas1p3B; Fri, 13 Mar 2020 04:39:23 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.161]) by epsnrtp2.localdomain (Postfix) with ESMTP id 48dtJV34h7zMqYkj; Fri, 13 Mar 2020 04:39:22 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id EA.3B.51241.A7E0B6E5; Fri, 13 Mar 2020 13:39:22 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200313043921epcas1p2ac0409f87cb53825ee30ea0f53d5ca80~7wz1JEtAu2834228342epcas1p2p; Fri, 13 Mar 2020 04:39:21 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200313043921epsmtrp2ffc8db3f6e2a08191883cc1b991288b2~7wz1ISogs1081510815epsmtrp2s; Fri, 13 Mar 2020 04:39:21 +0000 (GMT) X-AuditID: b6c32a39-14bff7000001c829-56-5e6b0e7a8211 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D9.C9.06963.97E0B6E5; Fri, 13 Mar 2020 13:39:21 +0900 (KST) Received: from [10.253.104.82] (unknown [10.253.104.82]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200313043920epsmtip1140f9ee444857f5e308c601b276dfd5a~7wzz_Nj6g2619526195epsmtip1c; Fri, 13 Mar 2020 04:39:20 +0000 (GMT) Subject: Re: [RFC PATCH 0/3] meminfo: introduce extra meminfo To: Leon Romanovsky Cc: adobriyan@gmail.com, akpm@linux-foundation.org, labbott@redhat.com, sumit.semwal@linaro.org, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com From: Jaewon Kim Message-ID: <5E6B0E72.7010305@samsung.com> Date: Fri, 13 Mar 2020 13:39:14 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20200311072509.GH4215@unreal> Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA01TfWwLYRj39trrDZ3TTb1ZhDohMfvoqc6ZbSSbuSCxICH+WN22Szv6lV7L SIitizDmYya0hiZCbBmb1mjZmEnYLES2TCRU4msMW+lUZj7m2qvYf7/nfX6/5/c8z/u+GCK/ gyZhpSYbazUxBgKdKL5+b35a6q74bYWqlt5E6mT5KqquqRGlDnqdgKpvHRFRtaMXEKr3Zh1K vWwck1AXw0Ep1VzpklKvj9aIqIeBYenySbTfFZDSnoYDKO0J1UjpF09bUbrz1E8xHbzdh9L+ kFdCD3tmFmCbDVl6lilhrUrWVGwuKTXpsonV67W5Wk2Gikwll1CLCaWJMbLZRN6agtT8UgPf KKHczhjs/FEBw3FEek6W1Wy3sUq9mbNlE6ylxGAhVZY0jjFydpMurdhszCRVqoUanrnFoH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SKxfcZQWxhQQ2MUq8W8IF0sAs8BNo6OJ+ sKFsAtoS7xdMAiviFdCSOLZxAROIzQLUvHnKW7ChogIREqvXXWOGqBGUODnzCVgvJ0jvoa/s IAcxC6hLrJ8nBBJmFpCXaN46m3kCo+AsJB2zEKpmIalawMi8ilEytaA4Nz232LDAMC+1XK84 Mbe4NC9dLzk/dxMjOI60NHcwXl4Sf4hRgINRiYfXQCwrTog1say4MvcQowQHs5IIb7x8epwQ b0piZVVqUX58UWlOavEhRmkOFiVx3qd5xyKFBNITS1KzU1MLUotgskwcnFINjKrtfP6iRQFc 38NZnCun3v4myvfkn9/5bUlVa9cET58mueTC+kfX647Ii/5a3nZ2t6a4k88OH/azM1izmdYy 7hKVY54Yv/HC2Yy9e5s9fsb9M3aIE2j84j5nS7oHu8fDyeVc/UpnWjbwq2hy+sb+PuqvePz2 /jmGDXzzVx+SW+yatUJ3QZtEqBJLcUaioRZzUXEiAH5QI6+fAgAA X-CMS-MailID: 20200313043921epcas1p2ac0409f87cb53825ee30ea0f53d5ca80 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200311034454epcas1p2ef0c0081971dd82282583559398e58b2 References: <20200311034441.23243-1-jaewon31.kim@samsung.com> <20200311072509.GH4215@unreal> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020년 03월 11일 16:25, Leon Romanovsky wrote: > On Wed, Mar 11, 2020 at 12:44:38PM +0900, Jaewon Kim wrote: >> /proc/meminfo or show_free_areas does not show full system wide memory >> usage status. There seems to be huge hidden memory especially on >> embedded Android system. Because it usually have some HW IP which do not >> have internal memory and use common DRAM memory. >> >> 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 >> useful if /proc/meminfo shows all those extra memory information. And >> show_mem also need to print the info in oom situation. >> >> Fortunately vmalloc pages is alread 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_extra_meminfo(atomic_long_t *val, int shift, >> const char *name); >> int unregister_extra_meminfo(atomic_long_t *val); >> >> Currently register ION system heap allocator and zsmalloc pages. >> Additionally tested on local graphics driver. >> >> i.e) cat /proc/meminfo | tail -3 >> IonSystemHeap: 242620 kB >> ZsPages: 203860 kB >> GraphicDriver: 196576 kB >> >> i.e.) show_mem on oom >> <6>[ 420.856428] Mem-Info: >> <6>[ 420.856433] IonSystemHeap:32813kB ZsPages:44114kB GraphicDriver::13091kB >> <6>[ 420.856450] active_anon:957205 inactive_anon:159383 isolated_anon:0 > The idea is nice and helpful, but I'm sure that the interface will be abused > almost immediately. I expect that every driver will register to such API. > > First it will be done by "large" drivers and after that everyone will copy/paste. I thought using it is up to driver developers. If it is abused, /proc/meminfo will show too much info. for that device. What about a new node, /proc/meminfo_extra, to gather those info. and not corrupting original /proc/meminfo. Thank you > Thanks > >