Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp117057ybh; Tue, 10 Mar 2020 20:45:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvIHoTbvkE/PZwpSb+zPcanc4NiJRI2DeDiRbO0enDGeqH9pPY1Vs4on0j2AXMEknlCzW7W X-Received: by 2002:aca:4c12:: with SMTP id z18mr576144oia.43.1583898358975; Tue, 10 Mar 2020 20:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583898358; cv=none; d=google.com; s=arc-20160816; b=GDZpOqTMP0ou1ynnOdxbQScoZp6cFUAVX0PgdrDgeO4MTHRXLqiyG2xYq3zCLrji9P cm1E1rxxl/rB90l9Q9qmHDKxfA80GvKVc1TAVylhcJx3QoeqXL6Voqn1dMlyypQA7vf2 FUqhXqaVg2NQ9KKpVV/jsCSAI9zH4B69/X3debo+h91eBFNMr5WH/ZXASv5v8d2NyaGG Ur8WWOkXKfqqnCipcAnI+Rv+l/3xalA32qHFM3JHdeaLMkE3Sk1N+X2+DSFtj95rZTk8 eQKlQFly23lerHSRTxQmPAqcdeodv5BVY8K97A5Frt3CLKSra8YaAdqr8sMKfXJDasoN UNyw== 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:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=wp2cFwnqDyNEEIaeviKHa2XHuK9yxoCAVHYH+F5foz4=; b=R0h4W2qGHoFS7DmMqHh21Z0GDyeKDjUr02bHJgXivaZ4b3BuWT7ggbaOR2BJtV6oCb YR0KkK00Yc86F22iiOFD3ZIuGzB0tJtMZ5ODZZ09lheVEmZQjY7jzfsuf9O1uaRFTJvm cv3zYDOYtOn985THR/ZGxSj/AxXzgq874wnymGXqtFP4qDylhUJHA6Y72VWF/bDbgQIW wiD5eum03UFGERUiC9cwOBUTpnWyS4627R5o5EFxDpa7aKgwRCaX1I1iO6ABuzmeBUsj lhUvTPQwVL990UZgabdysCRrIPCIW2iTlnb3KaJwpLiXFBFLiKkSbWpW1lkw6OlO81b/ IGfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="W/Q3/dTc"; 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 d11si518492oig.212.2020.03.10.20.45.46; Tue, 10 Mar 2020 20:45:58 -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="W/Q3/dTc"; 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 S1728148AbgCKDo6 (ORCPT + 99 others); Tue, 10 Mar 2020 23:44:58 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:41189 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727965AbgCKDo6 (ORCPT ); Tue, 10 Mar 2020 23:44:58 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200311034456epoutp01464b690fca77d9183b68ed9b752f5a23~7IxvbvEKh1735217352epoutp01u for ; Wed, 11 Mar 2020 03:44:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200311034456epoutp01464b690fca77d9183b68ed9b752f5a23~7IxvbvEKh1735217352epoutp01u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1583898296; bh=wp2cFwnqDyNEEIaeviKHa2XHuK9yxoCAVHYH+F5foz4=; h=From:To:Cc:Subject:Date:References:From; b=W/Q3/dTc6T0nY+lG4yukbI4L3Z0P2MB7JztVika1Bc1CxiETEgMmBfOqP1cePmlQY nRjRsvh1tzbid7VpWaS3vM7AMLWq5wkytX3lgs27REEaTKqxoOWNqP61XeHEe8gNik 2AMWe1/UmELpHHrMZaepHcvCB8dnVyGencG7+sBM= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20200311034455epcas1p44a809bb9190d877e69950d8bae1301dd~7Ixuykp281814418144epcas1p4J; Wed, 11 Mar 2020 03:44:55 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.162]) by epsnrtp1.localdomain (Postfix) with ESMTP id 48cdBZ6czBzMqYlm; Wed, 11 Mar 2020 03:44:54 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 07.D7.51241.6BE586E5; Wed, 11 Mar 2020 12:44:54 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200311034454epcas1p2ef0c0081971dd82282583559398e58b2~7IxtZu_na2491724917epcas1p2-; Wed, 11 Mar 2020 03:44:54 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200311034454epsmtrp1b7078a0cb278d44a6385cdacc92f46d7~7IxtY2hb33056430564epsmtrp1u; Wed, 11 Mar 2020 03:44:54 +0000 (GMT) X-AuditID: b6c32a39-163ff7000001c829-18-5e685eb6dac5 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 9E.9E.10238.6BE586E5; Wed, 11 Mar 2020 12:44:54 +0900 (KST) Received: from jaewon-linux.10.32.193.11 (unknown [10.253.104.82]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200311034454epsmtip186fee546420bed6a21c64897ebcbc7d5~7IxtLESTJ2352723527epsmtip1x; Wed, 11 Mar 2020 03:44:54 +0000 (GMT) From: Jaewon Kim To: 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 Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com, Jaewon Kim Subject: [RFC PATCH 0/3] meminfo: introduce extra meminfo Date: Wed, 11 Mar 2020 12:44:38 +0900 Message-Id: <20200311034441.23243-1-jaewon31.kim@samsung.com> X-Mailer: git-send-email 2.13.7 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnk+LIzCtJLcpLzFFi42LZdlhTV3dbXEacwbVJ5hbTG70s5qxfw2bR vXkmo0Xv+1dMFiv3/GCyuLxrDpvFvTX/WS2WfX3PbrGhZRa7xaMJk5gsTt39zO7A7bFz1l12 j02rOtk8Nn2axO5x59oeNo8TM36zeLzfd5XNo2/LKkaPnZ82s3p83iQXwBmVY5ORmpiSWqSQ mpecn5KZl26r5B0c7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkDdK2SQlliTilQKCCxuFhJ 386mKL+0JFUhI7+4xFYptSAlp8DQoECvODG3uDQvXS85P9fK0MDAyBSoMiEnY+m0k2wFa4Uq 7s3ZztbA2MjXxcjJISFgInFr2US2LkYuDiGBHYwS7dfOQjmfGCUO3dvHAuF8Y5T4uXweE0zL +f2fGSESexklnrf2MkE43xklVi6eyg5SxSagLfF+wSRWkISIwFpGib9NS1hAEswCpRJv35xg BrGFBSwltj2azwpiswioSqzdeh8szitgK7HyySMgmwNonbzEwv/MIHMkBA6wSRzsX8gGcYaL xLfmTV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LnfZp3LFJIID2xJDU7NbUgtQgmy8TBKdXAKDyV 3dqo4ZXUnVT3bRE8a8vD5DN+bXndm39/Tuz8+6utl+dp6uXxt1TPPPRftOu9NN8L/5pgFaZV eVadv7+aiDK9rfTc5PvyzfPvq94YSi3KW1Mwf/5JSzHFQ/+XxX1VVWNYVXCu8fmK0AU7uCwb Vn2bfSX+EGcC51afE1Kz7RPkS7k1c1tFlFiKMxINtZiLihMBTrrDYEUCAAA= X-CMS-MailID: 20200311034454epcas1p2ef0c0081971dd82282583559398e58b2 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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org /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 Jaewon Kim (3): proc/meminfo: introduce extra meminfo mm: zsmalloc: include zs page size in proc/meminfo android: ion: include system heap size in proc/meminfo drivers/staging/android/ion/ion.c | 2 + drivers/staging/android/ion/ion.h | 1 + drivers/staging/android/ion/ion_system_heap.c | 2 + fs/proc/meminfo.c | 103 ++++++++++++++++++++++++++ include/linux/mm.h | 4 + lib/show_mem.c | 1 + mm/zsmalloc.c | 2 + 7 files changed, 115 insertions(+) -- 2.13.7