Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2673617pxy; Sun, 25 Apr 2021 00:38:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfZAeR5CPwvy2Fcn4nkiA3juqVJcB6IXmVsL+ndoQvh6Ke48RqvNp4+8BVfvBQi+uXM+pu X-Received: by 2002:a63:6545:: with SMTP id z66mr4965123pgb.292.1619336313487; Sun, 25 Apr 2021 00:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619336313; cv=none; d=google.com; s=arc-20160816; b=QWhKwZYcia4W83X/wA/88r6yIIqXN2sR18nws9A3T7kqLGLu5UhloPw193zWQGMR4p qhfJkmbcM6pgw5SSggTQHLb9C0UfT8xI9H2ZOq0uZSogxrQhjAkT33KaphTp6uKHqx0F wuR5fwnXgCmu4if6dnoi9ceHsNIcrA6eRfJ33bXcntWyIASUY2v1st5Mx/ReL90ZieXr /tN4/i9VNFZ3g8v1xMwO/r0KTxDvQUk/Q71J6RLUzdGHE3IlGsdIRSZDYOOLwjTJoLDd oiVMclCqcz/7xeeghiISXuyq+fqnfvgMWzPi2cMeWkiV8rReaKrILz5xZ4K1exwPCliA Cygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ROLjKVwG5bZ84MjYEA1oM3LaCiT6t6YOrzmlr7b6n4Y=; b=EHaCh+Ht5m2E91Amu3Kf+gJq7QuvnhCrLl2Fvvd/8DaZbVDB1Iu4jYvxLBzqi5Rwym 7L3KFo2lxory2f8pk9TvYmmDHTjb3TcNmPLsG/o+BWGhVE9JSHLmIxWKiuaCbYGGhoag x0MBg9R+q7wAADXGRttP21TOMHiJSPspJqzS4G/8N+vPslNDUXNNiczV3aAbEyn1xbRK AemQJ08jRLAQosW2HDEgP/vPrQNlobxXdA8JPFJJe937c83mOl7S2Q70im72V9972tva 2LxXKWCEMtCqbzOKoxbtNzOPpEPH+OZDm7LgcXLmLBl/xppmXWYSrccms0LEHaNmY3IN TnPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q1XswQI3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si12553650pfe.311.2021.04.25.00.38.09; Sun, 25 Apr 2021 00:38:33 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q1XswQI3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbhDYHeq (ORCPT + 99 others); Sun, 25 Apr 2021 03:34:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:34592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbhDYHeq (ORCPT ); Sun, 25 Apr 2021 03:34:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D18D961245; Sun, 25 Apr 2021 07:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619336046; bh=WCsSHB91cvmf5ZeAXu+txZXJ3S/cP/GNMzA77rjuNbE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q1XswQI3mxMpGcDvpMyZljYfgw5fSLCE1OaoEPKuANpgRNF/l1ND6Se160hAmXY2V WXsK309I7CYtICtk/SZ1nvEJRBpn1+vyAb/P6rKYKnqt7swUW4G1LM16V7f3Ki5hGL 6jIWwzqr2Uat6+NgotfFX1qhL914GSyag3QNQK8d6Fq1ux1vwZjFNqhCT53YkaLdTE TS2qfTejBqCr4vVDIHrt8whLwMVintjtCjDUVJJmyRNx/cBFyrNVGMPw+2ZKkhqhxJ c/I7P/Zd+iGUvrgWXjnwivWQGUZ9oTtanEw8H5/Digtge9jnfpQm/dvW+lGWyo3VLQ i6HJsRhSlKs+g== Date: Sun, 25 Apr 2021 10:33:57 +0300 From: Mike Rapoport To: Peter.Enderborg@sony.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, sumit.semwal@linaro.org, christian.koenig@amd.com, adobriyan@gmail.com, akpm@linux-foundation.org, songmuchun@bytedance.com, guro@fb.com, shakeelb@google.com, mhocko@suse.com, neilb@suse.de, samitolvanen@google.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, willy@infradead.org Subject: Re: [PATCH v5] dma-buf: Add DmaBufTotal counter in meminfo Message-ID: References: <176e7e71-59b7-b288-9483-10e0f42a7a3f@sony.com> <84e0c6d9-74c6-5fa8-f75a-45c8ec995ac2@sony.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 22, 2021 at 02:08:51PM +0000, Peter.Enderborg@sony.com wrote: > On 4/22/21 10:06 AM, Mike Rapoport wrote: > > So the flow is like this: > > > > * a user has a problem and reports it to an application developer; at best > > the user runs simple and limited app to collect some data > > * if the application developer considers this issue as a system related > > they can open adb and collect some more information about the system > > using non-root shell with selinux policy restrictions and send this > > information to the device manufacturer. > > * the manufacturer continues to debug the issue and at this point as much > > information is possible would have been useful. > > > > In this flow I still fail to understand why the manufacturer cannot provide > > userspace tools that will be able to collect the required information. > > These tools not necessarily need to target the end user, they may be only > > intended for the application developers, e.g. policy could allow such tool > > to access some of the system data only when the system is in developer > > mode. > > > The manufacture is trying to get the tool to work. This is what the > patch is about. Even for a application developer a commercial > phone is locked down. Right, but it's still in full control of the manufacturer what's flashed there, isn't it? So there could be some tools that are only available in the developer mode? These tools could have different permissions etc. > Many vendors allow that you flash some other software like a AOSP.? But > that can be very different. Like installing a ubuntu on a PC to debug a > Fedora issue. > > And sure we can pickup parts of what using the dma-buf. But > we can not get the total and be sure that is the total without a > proper counter. If I understand you correctly, a user space tool that scans fdinfo and accumulates dma-buf size from there is not accurate enough, that's why an atomic counter exposed by kernel is a must. But if the changes in consumption of dma-bufs are that frequent, I cannot see how a global counter will help to identify an issue. And if this counter is needed to see if there is a memory leak, summing sizes of dma-bufs from fdinfo will identify a leak. What am I missing? -- Sincerely yours, Mike.