Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3147024pxb; Tue, 20 Apr 2021 01:24:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhe7ZmBO2+hn1jwgThU/ksTRhKfgoOqjEfGMC6yBm059Etkk1dUHFQJLD/vJQ+8WmenJ54 X-Received: by 2002:a63:f34e:: with SMTP id t14mr15775657pgj.205.1618907060588; Tue, 20 Apr 2021 01:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618907060; cv=none; d=google.com; s=arc-20160816; b=HJyQCBnZ3Rnyl7aUhoJ7Z+8n+4eoTg26LLp1D3e65mjo6Y2lpAV+eT0jlzUnj/7nBg o4+DTgZDthtpI9ow5jfem2A7nSc1e0YEzcVDIHL2j1t4kTIxuVLP9UWXgsXpYHLDzjXg UXjSSFfRDGoQTukDgm6hg4UmxX0cWIHGwXQtJQjTRbvf+m0giMDNyDKyPfAdIm/tsGno 229710o1qMjodJcEirA1vWYL5ganU9mB22lPkbOZm7Ziw77hVFjdOi6MAl9glGRIkA7g Nd1BWVfXG86PpiIquNzHr7WDLqaow3tJAYk7B1/8n/KpkjhhrKJFiSDGXhSWGupcxiFD BLpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=RoQGdb2V6LA1TMvN+PZwwGEQXL7tTpP9wyza3o24f14=; b=U5U2pl7JWxU1JRYsfMNp/VJG2z5ucEs7oAI4HVDTDVLVqMu96bRQYI3OmJyVJHnsZN KhjNGz4xCa1iFy65DDAkgdSqSauJFlwyO9FQvJ4IymA/6hC24xTflt+bspByGy9sgDpO TiAn1FQW3553CHtVJA9yJNGCGYzwDQWAnZLlLcwr/psAeviMxHaFnrkpDsdWh6kBWFIf 1lhrDJHe/94l8vIauYaNDPc9Vhw/ij/CWY3Tm90+qEZ18yVabfJIKwNXJUi+lfrByYRY GVPZuPwyKvBwrQ4kZieyVIwxRT/pUZqxgJzmZS029fSQfehOFLy7bSjfTQPgbf6I3dHN aFmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gx10si2366416pjb.108.2021.04.20.01.24.07; Tue, 20 Apr 2021 01:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231126AbhDTIXZ (ORCPT + 99 others); Tue, 20 Apr 2021 04:23:25 -0400 Received: from jptosegrel01.sonyericsson.com ([124.215.201.71]:7263 "EHLO JPTOSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbhDTIXY (ORCPT ); Tue, 20 Apr 2021 04:23:24 -0400 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 , CC: Peter Enderborg 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 Content-Type: text/plain 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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