Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6679447ybv; Wed, 12 Feb 2020 17:24:07 -0800 (PST) X-Google-Smtp-Source: APXvYqypliYEpPAct0OR5PZVfFd2L3ZgErKE2n6Op3qrZNNljX5JuRlgeEVrokNtf2+g402fSw2Y X-Received: by 2002:a9d:ecc:: with SMTP id 70mr11185734otj.182.1581557046828; Wed, 12 Feb 2020 17:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581557046; cv=none; d=google.com; s=arc-20160816; b=vdMa59n86mg1DaStjYTmIqURBj3KXSJG/Rx/WipKKoQfWv1HbQeU5suGHPMMwX4weL UZJjzi4DqM04Gr3IjQrzytoj9DcbJRYk1NeonjH6b5ISWlVRnl7WVfhVZgXp+qj2Opm+ slw45Z8+IV5B7VyVdEdvwoibZ81t6t8htQKP8uFmaoSLpRqu2ZteTduhW3dRUP2/gcTT Z/4jwUVSLJQ0Gh998j1nyeFLQAepdUjHaFo6iTDOWx+2G/bpuRBD8k1Wy+8M14aRrHt4 ifyomcJyTjX3YwaiYaggXt9n/en3uXiY4v57/TpzXVqS5kNzj1EQtjndHDjoH/IVWd8V YnEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Niu+kdfvvCIMBWkR6WeCCUnPagPYeQrbAxMdltvbKWQ=; b=mXZub4YPdgZgPdOUKlXR8QGim9Pij8HfBSpSc2QA1CIuscDwuBjTwi2LptEh/iQUIm niKR4ytxQBbElas4HjeXMF7bcB4h07aKdGNnzViY6W4nA67FLHKIytfpygC8VQRZYglc ek6diVpRDywyedwmcoNasR1m89DdzC5P3xacHu1vb7pDxMGF9QqtB4mR63go1cvS5DcJ wovye8DrcBVIDx10Qaav86iaKXrS60oA2H+kTiuNn3S3WKWzjkcMXKI4VkkjYCOQTE4m gnXRedI+/Skp1so6yKdXjUBR+hIeNoqg1F5j4PENoSQ73JHBIfox4JlEzlMJM44kIfiS N/cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MHkddpuL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si312680otc.104.2020.02.12.17.23.50; Wed, 12 Feb 2020 17:24:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MHkddpuL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729302AbgBMBXl (ORCPT + 99 others); Wed, 12 Feb 2020 20:23:41 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46725 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbgBMBXl (ORCPT ); Wed, 12 Feb 2020 20:23:41 -0500 Received: by mail-lj1-f193.google.com with SMTP id x14so4587035ljd.13 for ; Wed, 12 Feb 2020 17:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Niu+kdfvvCIMBWkR6WeCCUnPagPYeQrbAxMdltvbKWQ=; b=MHkddpuLQxWE6bwmmePSO7R3xQcz+c+j4MZzk1C0YQpt8ceysAGKLp8x91foJ7iQlD 4y4uMHC5B1VyhB0wx/cqmWqAC7pmpiG750t9dhUXqG0dLcNFXBoYwHITqKzQ4RKVJgzn DiaugaxGhLTsNZ922hTk3ke6o/ufyHGIdQX7cqkyjfFfxkGwhLQELjyIAGfawX4j1Dph GLtMGvROaXVjUgDtsoy5FSP5/4rbsblecCoFjlewYUy6iIFbvl0WWiQ0LpnrZojizfP7 RGsZtE4rHLdFR4Sguj4CLf0M1Opqona0TmUQqOOn/hZqvOu047byyWKLoyTOdmvQb8ut TZAw== 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; bh=Niu+kdfvvCIMBWkR6WeCCUnPagPYeQrbAxMdltvbKWQ=; b=KJFa+uNY3URy1kRTmqbuZop5cFZj6CUgxefXZu4u/rgvWdjLLSrsQqjT+/tNKHrma6 FtTmZWqeZu92JjJBob57cQvdxPUZ9gFwjHPaJGfnrCuilPg/pqRoT9HnKEfiVtYadRMa gpJgch98kwyI0+Ke4G2uhG6fMXvjpZOTKzz3Ed6reKRv6aCuwalLbGvPRkE4hdODBAJa ppkZUB3DvtMQ+7Wc2jSPo3b5IGvwD2h6wgkIZuCMc0pJIKG1SzgfRSHlVY2MGMXby2gu sW56guCqJ0Tu2AS7D2QLgy4FL/ErQL/4lilnqx9jbbZEt8CCHmR1zxMrtm28GyZI7hpI jY4A== X-Gm-Message-State: APjAAAUESghpn5Ligx41eRoydJSCQzgu3l13R+acXv2nakj0eU10AlUR A7n2uBeIJyCiBtolplMsS/RHhiZU8VcbGcEZvNRm X-Received: by 2002:a2e:86c8:: with SMTP id n8mr9208783ljj.205.1581557018182; Wed, 12 Feb 2020 17:23:38 -0800 (PST) MIME-Version: 1.0 References: <20200213003259.128938-1-zzyiwei@google.com> <20200213004029.GA2500609@kroah.com> In-Reply-To: <20200213004029.GA2500609@kroah.com> From: Yiwei Zhang Date: Wed, 12 Feb 2020 17:23:27 -0800 Message-ID: Subject: Re: [PATCH v2] Add gpu memory tracepoints To: Greg KH Cc: Steven Rostedt , mingo@redhat.com, elder@kernel.org, federico.vaga@cern.ch, tony.luck@intel.com, vilhelm.gray@gmail.com, linus.walleij@linaro.org, tglx@linutronix.de, yamada.masahiro@socionext.com, paul.walmsley@sifive.com, linux-kernel@vger.kernel.org, Prahlad Kilambi , Joel Fernandes , android-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, Thanks for your prompt response! For upstream drm gem based gfx drivers, the lower level device driver layer is able to implement such per-process gpu memory total counters but the common drm gem layer is probably not. At least the global total gpu memory counter is fairly easy to implement, and then this tracepoint can still be useful right away. For Android, the debugfs has already been forced to be deprecated in the coming Android 11 release. We have asked Android GPU vendors to implement such global and per-process total memory counters. So they can easily use this tracepoint inside the driver. This is mainly to serve the profiling needs as well as the runtime query needs(by attaching a eBPF program from userspace), and this patch helps standardize the tracepoint in the kernel. Many thanks! Yiwei On Wed, Feb 12, 2020 at 4:40 PM Greg KH wrote: > > On Wed, Feb 12, 2020 at 04:32:59PM -0800, zzyiwei@google.com wrote: > > From: Yiwei Zhang > > > > This change adds the below gpu memory tracepoint: > > gpu_mem/gpu_mem_total: track global or process gpu memory total counters > > > > Signed-off-by: Yiwei Zhang > > If this helps gpu drivers wean themselves off of debugfs, I am all for > it: > Acked-by: Greg Kroah-Hartman > > Thanks for doing this. > > greg k-h