Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4838415pxu; Thu, 10 Dec 2020 06:45:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFhIXsmHlw3TXktZxqBeeIhHn9TB6HOAboCXTSfOTu79iWQL7cUGYmJygZqb33+nijesTU X-Received: by 2002:a17:907:d09:: with SMTP id gn9mr3577950ejc.349.1607611526234; Thu, 10 Dec 2020 06:45:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607611526; cv=none; d=google.com; s=arc-20160816; b=mOVC0kqzO0xdlJDc7oUfUCTW89C/lW6p/Sxp6h23WQe7fESXH8efp2I+Uojelijrkz LW/I0DegNyGrHiD/j7GsmETPerC/cxAoRCdmed/CxYZwz0SRxTXNFBCWf02rP6ltjqQo LzvqDst4A5t7Wly5gULSLuvG7cSZKHDwCyw24l/GYTZP/cnvggBkLKWvu2aYb893AaEl 3mLOmB0pR6epoqWKU0FOJWP3dqg0++QJQsuJkJWNLyAsAjCoB9Qo3Z1aIzC/ebuu4Z1F Cn0L1efxImeDGaebjK+Uxd49igHxH6nI1loNr9ZN9gEGbbGndR4ep3pxQywtQ0w6Qlwk i+lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5SZx0SF1+bmdIPGDx8XS9Yvh6cMFc1HMujYWwx4oFXo=; b=cfu9bAzl8UnjQZKQiC2BnXsbyffEDnu0QHusOk3qGM+1HM/ZNupujGiJsrMxfvjcKZ knx0pheoVNpJ3UOuqjYqS03fBtXQUEtN27VrWXVm83Q+e2ZNsk062AFGUuBIY55XKSP5 u5VXXXrxKYAYmI9KG7vlBleR/uPtZFQuwM+VU+78S2Bpel9/r6EwiOjnF0HMjm7XIA5H O7qVs47oUt1YY0Z2R+gKHQXLBoF7A3WH7qqCnwNsQn7/Ct+mGOFIy7UG42C+//eTTGjz gVy5APRbEKl3CCJlb+TL0qWnZ5vt4bUXw6DPX84Akzw1MkcLNjJojzt32l4mgaDYJqPf iIZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="ljmsD/nZ"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si2088955ejc.678.2020.12.10.06.45.01; Thu, 10 Dec 2020 06:45:26 -0800 (PST) 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=@ffwll.ch header.s=google header.b="ljmsD/nZ"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389075AbgLJNLO (ORCPT + 99 others); Thu, 10 Dec 2020 08:11:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389173AbgLJNLD (ORCPT ); Thu, 10 Dec 2020 08:11:03 -0500 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5B30C061793 for ; Thu, 10 Dec 2020 05:10:22 -0800 (PST) Received: by mail-ot1-x341.google.com with SMTP id o11so4781895ote.4 for ; Thu, 10 Dec 2020 05:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=5SZx0SF1+bmdIPGDx8XS9Yvh6cMFc1HMujYWwx4oFXo=; b=ljmsD/nZGyo/+nDuS0o0wS7bR94cQDN8VGl9oI3x9gF6FY1HbovjAwtbwEL91ATJtm 1xTzwHF+H8teshZzyQ3IR9ZGQiWUlsBu2AfAUddntFcJyQQeHRNrIFzGacznjrhKTKvg zGEZhXmHkuly95lHRKyzmo3PZkbgX74s/29oM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=5SZx0SF1+bmdIPGDx8XS9Yvh6cMFc1HMujYWwx4oFXo=; b=eQOC9umQVNCByeclxw7UnlDmq1nCFwnKoZRKC65meOUMTBk947v+52yn6PNydn7QVj kzgDw9C+Db4eu1yD7IwTNucXnSloeajYq8UMhf0pyh3QMBGe7KLF9cZWMAb977j53jVW 5pA0gd9+DK1GqLFyO0/rEU0r0dsnTOxCzm1+lDKHwgN1zfeT0qsa8cE4EbWyYLnFlM6G dIsbC+wibAItvKdx/VRCU9NJqQqNHrp+2WuqPssnYyooRLCeNLEZVTsLzGVYnnf9y+MH CrsoZsPd16ZpVkgb2SszI4P2tEBq952v+x3Q7E3s85LBP/tIdV31GqwFjI00aSHjleHO SvbA== X-Gm-Message-State: AOAM530Gkpl+NXMNsNVB2sbgUu4qauZFPwS5w7gjnWFt//2LD7W4jLP0 /ECZ6zqcrPL6+w4f5k/6UjGooJ+nwcQt54OUeIPzCIM8hbk= X-Received: by 2002:a9d:23ca:: with SMTP id t68mr5751241otb.281.1607605822145; Thu, 10 Dec 2020 05:10:22 -0800 (PST) MIME-Version: 1.0 References: <20201210044400.1080308-1-hridya@google.com> <20201210102727.GE401619@phenom.ffwll.local> In-Reply-To: From: Daniel Vetter Date: Thu, 10 Dec 2020 14:10:10 +0100 Message-ID: Subject: Re: [PATCH] dmabuf: Add the capability to expose DMA-BUF stats in sysfs To: Greg KH Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , Suren Baghdasaryan , Linux Kernel Mailing List , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Hridya Valsaraju , Android Kernel Team , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 10, 2020 at 1:06 PM Greg KH wrote: > > On Thu, Dec 10, 2020 at 12:26:01PM +0100, Daniel Vetter wrote: > > On Thu, Dec 10, 2020 at 11:55 AM Greg KH w= rote: > > > > > > On Thu, Dec 10, 2020 at 11:27:27AM +0100, Daniel Vetter wrote: > > > > On Thu, Dec 10, 2020 at 11:10:45AM +0100, Greg KH wrote: > > > > > On Thu, Dec 10, 2020 at 10:58:50AM +0100, Christian K=C3=B6nig wr= ote: > > > > > > In general a good idea, but I have a few concern/comments here. > > > > > > > > > > > > Am 10.12.20 um 05:43 schrieb Hridya Valsaraju: > > > > > > > This patch allows statistics to be enabled for each DMA-BUF i= n > > > > > > > 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 ear= lier [1] > > > > > > > in order to allow userspace to track DMA-BUF usage across dif= ferent > > > > > > > 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. > > > > > > > > > > > > Mhm, this makes it part of the UAPI. What is the justification = for this? > > > > > > > > > > > > In other words do we really need those debug information in a p= roduction > > > > > > environment? > > > > > > > > > > Production environments seem to want to know who is using up memo= ry :) > > > > > > > > This only shows shared memory, so it does smell a lot like $specifi= c_issue > > > > and we're designing a narrow solution for that and then have to car= ry it > > > > forever. > > > > > > I think the "issue" is that this was a feature from ion that people > > > "missed" in the dmabuf move. Taking away the ability to see what kin= d > > > of allocations were being made didn't make a lot of debugging tools > > > happy :( > > > > If this is just for dma-heaps then why don't we add the stuff back > > over there? It reinforces more that the android gpu stack and the > > non-android gpu stack on linux are fairly different in fundamental > > ways, but that's not really new. > > Back "over where"? > > dma-bufs are not only used for the graphics stack on android from what I > can tell, so this shouldn't be a gpu-specific issue. dma-buf heaps exist because android, mostly because google mandates it. There's not a whole lot (meaning zero) of actually open gpu stacks around that run on android and use dma-buf heaps like approved google systems, largely because the gralloc implementation in mesa just doesnt. So if android needs some quick debug output in sysfs, we can just add that in dma-buf heaps, for android only, problem solved. And much less annoying review to make sure it actually fits into the wider ecosystem because as-is (and I'm not seeing that chance anytime soon), dma-buf heaps is for android only. dma-buf at large isn't, so merging a debug output sysfs api that's just for android but misses a ton of the more generic features and semantics of dma-buf is not great. -Daniel -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch