Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp11228pxb; Mon, 8 Feb 2021 13:40:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFUtGvubrpzggWiNjX9taM9W4GHHbP0xyLj5xsAcPHr6iNBEK3U0VEW5kBZuJ52/FNLHg+ X-Received: by 2002:aa7:c895:: with SMTP id p21mr19434273eds.165.1612820454131; Mon, 08 Feb 2021 13:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612820454; cv=none; d=google.com; s=arc-20160816; b=p+gX8iwilDjHeO+VCRS25rooMw9mQQ50Qfld2WeBeESXPFqCtxh6Oagg+WVjh/WeF2 IFjbk9Ov4ulBGoZBGIhGwGqqwriugr97lT8XwVYvG/QLBYCJ6/1byV4TyJ/i2DMVDT14 KBMXr7zAyy6s6soUAUre97OC4vNipFE6qZ08Y99L6K1qJq4bz7319VOzD2wkcJZ9S3/f QC36jIUl6nbwhKxzCB0GLj6Sq5aVqZORBabuJa0C472EjXKW894NlaFTWhZOXp9IF1lX W03k0oLEpeqJtJ6+yZGKzrzGPrJSXOXC1PqxvbnPLIevCxELHg1S8eNIxp6QT0i0Lcmw xxzg== 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=kTFr32bptu4tOZwE0ZuGkak5YWm4TyXH6EjCXCSCQOU=; b=ZCOKMXmtevWRdTNWYTAujbCf/ZAZCdEhsY+16S5bQTUJN/U1gPz8g4RSC2opnQa6Na 4oxlF2D0qKcJ6jstGDpFsrgOhdwLpK8fWlgR2pmQQ4145kh9BLClp/8LVtYIwSX4F106 m8y6GGBEYi/xXKjW4EqkJN0vp8XfeFSo6+ibJvv3uRF2E4Ll7ep4n1a5J00hK0pzAKSj Rfxwp4y6LErreVoXePBWTmWlPt4Df2dohM+0DlZgsyFHy8ovcVm5VtmyYqA7R8CT3olU v416wccSSo2FtGnUiFXoF6CLS8lfTRRH+XXPXZmji+TquS+Jt2Bw65WIclYSRnrdJPUJ 4M+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fPkzJbfp; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si10571211edj.524.2021.02.08.13.40.30; Mon, 08 Feb 2021 13:40:54 -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=@linaro.org header.s=google header.b=fPkzJbfp; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236850AbhBHVhT (ORCPT + 99 others); Mon, 8 Feb 2021 16:37:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233337AbhBHUv0 (ORCPT ); Mon, 8 Feb 2021 15:51:26 -0500 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2365DC061786 for ; Mon, 8 Feb 2021 12:51:05 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id e18so19029367lja.12 for ; Mon, 08 Feb 2021 12:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kTFr32bptu4tOZwE0ZuGkak5YWm4TyXH6EjCXCSCQOU=; b=fPkzJbfpY+rbqdzJyziCHL3LEul1WLLgf9TH3sO7UeY8/hZX3BuGEkSnMQTxrVxgmj ynhhO6rKYSPCXJzljB/G5dh6D/6Ab9HjYEOh0JNLDUnhL9Bikm3ewTtK18vfQq2JEyDk ZoW1LOAZ/DtcyppPbMaaXx48jvwDNvRjtHbftv8dLi2aOqVg0dhKdu5JcwKXY0Yfm8Wa 3YV9RLPJldP9edDqzPioO0VvHZMQunOEaQW3flqc42qLTH3EUWMaagZsHCE/moBpwaxa 3FBGgOlKrnB2Q2B7fz23YgzJDLywONpw9qFuo2JaPFyazzfndglQVbDBP++hmmXx2aqB 7/jQ== 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=kTFr32bptu4tOZwE0ZuGkak5YWm4TyXH6EjCXCSCQOU=; b=ev0wanVQuVC0ndMqOzu6jyBncNooxkuotmVBV/Zitdvj2JCZ4+5btBqUfkfcT754qx 5ckRqjrZjy/rDRUYAQFyr8NYcWDgSaemJW4M5BD68Dk70jbwykZLOJ8waXKcSxd8nQHM PgAf2G1G+CkCs3a8AztaLzcI74PS5TIoxhMJOREOukY106dY9MX+Ik0CbclMbvHKXSDk KbpPowtoXXWYQ6YGsNCENIbkTbn8PahiUROOfa/r91W7WmuNX52U97oaNkDet9ifYt4B +CQryGjL8bTpx5JHUYlfDZnb6ZkNKS5zOvYGgbAg9AaWOwVlzxiEEyhlLIz7Dyr1SWGJ dcCA== X-Gm-Message-State: AOAM532GS4aHqyhe0GgTUi1ltT0oDFV9UUrhyUP6qYOwvaYB+cMoiw2V xU0B85Z9xr03LbMkMsue6jogafXRZMkEICvGnCRf9A== X-Received: by 2002:a2e:8090:: with SMTP id i16mr12425346ljg.257.1612817463364; Mon, 08 Feb 2021 12:51:03 -0800 (PST) MIME-Version: 1.0 References: <20210206054748.378300-1-john.stultz@linaro.org> <20210206054748.378300-2-john.stultz@linaro.org> In-Reply-To: From: John Stultz Date: Mon, 8 Feb 2021 12:50:49 -0800 Message-ID: Subject: Re: [RFC][PATCH 2/2] dma-buf: heaps: Fix the name used when exporting dmabufs to be the actual heap name To: John Stultz , lkml , Sumit Semwal , Liam Mark , Chris Goldsworthy , Laura Abbott , Brian Starkey , Hridya Valsaraju , Suren Baghdasaryan , Sandeep Patil , Daniel Mentz , =?UTF-8?Q?=C3=98rjan_Eide?= , Robin Murphy , Ezequiel Garcia , Simon Ser , James Jones , linux-media , dri-devel Cc: Daniel Vetter 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 Mon, Feb 8, 2021 at 2:08 AM Daniel Vetter wrote: > On Sat, Feb 06, 2021 at 05:47:48AM +0000, John Stultz wrote: > > By default dma_buf_export() sets the exporter name to be > > KBUILD_MODNAME. Unfortunately this may not be identical to the > > string used as the heap name (ie: "system" vs "system_heap"). > > > > This can cause some minor confusion with tooling, and there is > > the future potential where multiple heap types may be exported > > by the same module (but would all have the same name). > > > > So to avoid all this, set the exporter exp_name to the heap name. > > > > Cc: Daniel Vetter > > Cc: Sumit Semwal > > Cc: Liam Mark > > Cc: Chris Goldsworthy > > Cc: Laura Abbott > > Cc: Brian Starkey > > Cc: Hridya Valsaraju > > Cc: Suren Baghdasaryan > > Cc: Sandeep Patil > > Cc: Daniel Mentz > > Cc: =C3=98rjan Eide > > Cc: Robin Murphy > > Cc: Ezequiel Garcia > > Cc: Simon Ser > > Cc: James Jones > > Cc: linux-media@vger.kernel.org > > Cc: dri-devel@lists.freedesktop.org > > Signed-off-by: John Stultz > > Looks reasonable to me. > > I guess the main worry is "does this mean heap names become uapi", in > which case I'm maybe not so sure anymore how this will tie into the > overall gpu memory accounting story. > > Since for dma-buf heaps one name per buffer is perfectly fine, since > dma-buf heaps aren't very dynamic. But on discrete gpu drivers buffers > move, so baking in the assumption that "exporter name =3D resource usage = for > this buffer" is broken. I suspect I'm missing a subtlety in what you're describing. My sense of the exporter name doesn't account for a buffer's usage, it just describes what code allocated it and implicitly which dmabuf_ops handles it. Maybe could you give a more specific example of what you're hoping to avoid? To me this patch is mostly just a consistency/least-surprise thing, so the heaps exporter name matches the string used for the heap's chardev device (the interface used to allocate it) in output like debugfs/dma_buf/bufinfo. thanks -john