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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 BD9D6C433ED for ; Tue, 20 Apr 2021 08:22:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B8926109E for ; Tue, 20 Apr 2021 08:22:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B8926109E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=sony.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B95E289DD5; Tue, 20 Apr 2021 08:22:54 +0000 (UTC) Received: from JPTOSEGREL01.sonyericsson.com (jptosegrel01.sonyericsson.com [124.215.201.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC79589DD5 for ; Tue, 20 Apr 2021 08:22:52 +0000 (UTC) From: Peter Enderborg To: , , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alexey Dobriyan , Andrew Morton , Muchun Song , Roman Gushchin , Shakeel Butt , Michal Hocko , NeilBrown , Sami Tolvanen , Mike Rapoport , , , , Matthew Wilcox , Jonathan Corbet , Randy Dunlap , Kees Cook , Mauro Carvalho Chehab , Alexey Gladkov , Feng Tang , Subject: [PATCH 2/2 V6] lib/show_mem.c: Add dma-buf counter to show_mem dump. Date: Tue, 20 Apr 2021 10:22:20 +0200 Message-ID: <20210420082220.7402-3-peter.enderborg@sony.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210420082220.7402-1-peter.enderborg@sony.com> References: <20210420082220.7402-1-peter.enderborg@sony.com> MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.3 cv=DLnxHBFb c=1 sm=1 tr=0 a=fZcToFWbXLKijqHhjJ02CA==:117 a=3YhXtTcJ-WEA:10 a=iox4zFpeAAAA:8 a=z6gsHLkEAAAA:8 a=BIgLedd4eyWhQ11BBNUA:9 a=WzC6qhA0u3u7Ye7llzcV:22 a=d-OLMTCWyvARjPbQ-enb:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=jd6J4Gguk5HxikPWLKER:22 X-SEG-SpamProfiler-Score: 0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Enderborg Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On system where dma-buf is used it can be many clients that adds up to a lot of memory. This can be relevant for OOM handling when running out of memory or how system handle this memory. It may be to free with a kill. Suggested-by: Michal Hocko Signed-off-by: Peter Enderborg --- lib/show_mem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/show_mem.c b/lib/show_mem.c index 1c26c14ffbb9..ec4748c64353 100644 --- a/lib/show_mem.c +++ b/lib/show_mem.c @@ -7,6 +7,7 @@ #include #include +#include void show_mem(unsigned int filter, nodemask_t *nodemask) { @@ -41,4 +42,8 @@ void show_mem(unsigned int filter, nodemask_t *nodemask) #ifdef CONFIG_MEMORY_FAILURE printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages)); #endif +#ifdef CONFIG_DMA_SHARED_BUFFER + printk("%lu pages dma-buf\n", dma_buf_allocated_pages()); +#endif + } -- 2.17.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel