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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 0E246C4361B for ; Thu, 10 Dec 2020 09:44:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B0FA6235F7 for ; Thu, 10 Dec 2020 09:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731253AbgLJJo1 (ORCPT ); Thu, 10 Dec 2020 04:44:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:46752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726475AbgLJJo0 (ORCPT ); Thu, 10 Dec 2020 04:44:26 -0500 Date: Thu, 10 Dec 2020 10:45:00 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1607593426; bh=tW8e+ZIMytQ67f0yQ5yA8t6EHe8cmb+Lh+QmxW6LBx8=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=M6/TTmEAydmbO5m1IjQqVv5WTsGFBBIl97FuFODGzM248Dw7oVpUk6nmSAWTU6tYP NVSG/WaqVlDa7iE1wG48Q2CyVbSAgAcVpkbZ5GNI/iLMEcyOD1ZExlJm23OHd+9SxF plDcqLf34ZbytFkCxi/KkkKgG9s8TXB+9y39JBh0= From: Greg KH To: Hridya Valsaraju Cc: Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, kernel-team@android.com, surenb@google.com, john.stultz@linaro.org Subject: Re: [PATCH] dmabuf: Add the capability to expose DMA-BUF stats in sysfs Message-ID: References: <20201210044400.1080308-1-hridya@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201210044400.1080308-1-hridya@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 08:43:57PM -0800, Hridya Valsaraju wrote: > This patch allows statistics to be enabled for each DMA-BUF in > sysfs by enabling the config CONFIG_DMABUF_SYSFS_STATS. > > The following stats will be exposed by the interface: > > /sys/kernel/dmabuf//exporter_name > /sys/kernel/dmabuf//size > /sys/kernel/dmabuf//dev_map_info > > The inode_number is unique for each DMA-BUF and was added earlier [1] > in order to allow userspace to track DMA-BUF usage across different > processes. > > Currently, this information is exposed in > /sys/kernel/debug/dma_buf/bufinfo. > However, since debugfs is considered unsafe to be mounted in production, > it is being duplicated in sysfs. > > This information is intended to help with root-causing > low-memory kills and the debugging/analysis of other memory-related issues. > > It will also be used to derive DMA-BUF > per-exporter stats and per-device usage stats for Android Bug reports. > > [1]: https://lore.kernel.org/patchwork/patch/1088791/ > > Signed-off-by: Hridya Valsaraju Thanks for adding all of this, nice work! Reviewed-by: Greg Kroah-Hartman