Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2120303rwr; Fri, 21 Apr 2023 04:49:33 -0700 (PDT) X-Google-Smtp-Source: AKy350by0xCos4rmHis0gd4SOF42FYj7HGgW5btcvpkralP3X+FGQdVwi9c8R+Gh0pNhgqR9UwOG X-Received: by 2002:a17:902:dacd:b0:1a1:956d:2281 with SMTP id q13-20020a170902dacd00b001a1956d2281mr5715558plx.3.1682077773057; Fri, 21 Apr 2023 04:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682077773; cv=none; d=google.com; s=arc-20160816; b=LEugpOV4tjVNQUMZFBh0PyOsFQG2bCqdlo0ymhsUzK0FicovYj51X19RHcnvA82maC sAMcrKKFaLR7gaFc5gbJmd+eNQFXd04bYuTWpllv0FLSdWzq6tjTyn0Jaas+Pe8R26eF B/SEmlYKODNMg3xLF0cExYSxAq8S9YtcMIgIajT/rAzgxo6BJ9dHV8C8BXE1SdOXx2AK 6Na/O6I9KhYcPu7iqwoDFqxYDSMY9QAs0hHGhgt52FyhP+oyFpqM3aiGusgop29rSVEE tBfQyplQi7LopT2tgaycu25N7bXWeXCwdfIY32UONhAplL+0OByvLQB89HUxVFzCU6k/ IInQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cpExu34liiyV+GAi+/eT3EAKnCiqG6Ffpw4DRQDPAno=; b=cD89F8l/W8k+Us7GH+seWM2w18o/wU2YyF1e/7pfI5p1Gi0YC2900O88F7VZC+lSIC NSgiW/T3bf6LD0tI5wSw5xqaq3X5Be8+hrZMfzxg7z1b5k5fnhXJl+WpPNcV9/R6Z/cI 96jbdC31JOSnv0VY32K4bbdyBT1xTk47g9bnX4kkm2surw6csN5XD9bREPQD+WvCPHyp R6wGQrCJlw/SdURNFk9egBMhg0z5y7yelndSDQPiqcq+x9PgqHAF8PTyjrqzhk5iLYZp O1RJ4iBsPSqf7yoT0IGvG5GJsCQh4J0NMWHaimOuAu+HCKmfHxaNzDEXQ8lTsjvy2f/E K+uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=X357dpjF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a17090301c900b001a6d872c84csi4642248plh.15.2023.04.21.04.49.22; Fri, 21 Apr 2023 04:49:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=X357dpjF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231821AbjDULpo (ORCPT + 99 others); Fri, 21 Apr 2023 07:45:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbjDULpn (ORCPT ); Fri, 21 Apr 2023 07:45:43 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21114C3; Fri, 21 Apr 2023 04:45:42 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-b8f557b241fso672366276.0; Fri, 21 Apr 2023 04:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682077541; x=1684669541; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=cpExu34liiyV+GAi+/eT3EAKnCiqG6Ffpw4DRQDPAno=; b=X357dpjFwt18aofQ0wDrq5xS25zQymH1kkZ7nx1QoezkPpsctPIFFhRm7lHDtLaWU/ leznEkIpKE+UutrPj+vIDvHUvepfMSVv2O/FhGzpxfyxrGyc2Se+g0FTJt15uLyo1l5m hQ8VnTH7tb9c4cu9NcS0tiw6kxJvV/6MWP0Dwm2Pg0gQ1bM6gi0DQUUOmITt/jBRS0UH cJVNYj7C2D/uCIZrngQ/8ubwO/63Va8rs4mpyr1W+aQBfPIAmvZP8lZlqxM7GqjAWTJX e1yqWbDs2olaaSsMgp2AL3mmpHPl2LbdU/oqkTz0pkbm2Y/x+13Bm4DQ5j3P9Nsxe5bU Z+xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682077541; x=1684669541; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cpExu34liiyV+GAi+/eT3EAKnCiqG6Ffpw4DRQDPAno=; b=F1SH8Giyl1ZB0KOYj2DWMSFLxDcK2VEST7gDImjsnHFCef2xlIEF0OXPvq5BtX6cqs jXl5yvyj3UFmlJXXpHxSWqfIhVrmnqCR1Sx0gEdE38luHws8H9AjmCjkUpQuyw+dFTeT vU+rRefoWavbTTRkzlIlxfuZBULwHKoHnrp/K0SxIvWRiVY0yfWr4UzlL3Kt4NMA+0F/ ZQ1NOw3s3e66x1GipEN1qbdaB8/E2/OA/vhpmE9IJ7xQwNdi/71m6ElvlGjz7Ga+KKAG NElfKaLuKcbf/u7SdmNpp2zbGFmbAU4cSizxUEdi2EhPSMrra+fa4pKuwkLkymmnbW8J Tf6Q== X-Gm-Message-State: AAQBX9coDexaH4tuKPSg43ccxQdO5O6tdYQJO9QeSUat2RJ0Nnb6HSus meZy516r93aKRD/pLt2j84sGRcYw7heF29iDg94= X-Received: by 2002:a25:d7d1:0:b0:b92:5a0e:d5e9 with SMTP id o200-20020a25d7d1000000b00b925a0ed5e9mr1999465ybg.28.1682077541278; Fri, 21 Apr 2023 04:45:41 -0700 (PDT) MIME-Version: 1.0 References: <20230412224311.23511-1-robdclark@gmail.com> <20230412224311.23511-6-robdclark@gmail.com> In-Reply-To: From: Emil Velikov Date: Fri, 21 Apr 2023 12:45:29 +0100 Message-ID: Subject: Re: [PATCH v4 5/6] drm: Add fdinfo memory stats To: Tvrtko Ursulin Cc: Rob Clark , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Boris Brezillon , Christopher Healy , =?UTF-8?Q?Christian_K=C3=B6nig?= , Daniel Vetter , Rob Clark , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Jonathan Corbet , "open list:DOCUMENTATION" , open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 21 Apr 2023 at 12:23, Tvrtko Ursulin wrote: > On 21/04/2023 11:26, Emil Velikov wrote: > > On Wed, 12 Apr 2023 at 23:43, Rob Clark wrote: > > > >> +/** > >> + * enum drm_gem_object_status - bitmask of object state for fdinfo reporting > >> + * @DRM_GEM_OBJECT_RESIDENT: object is resident in memory (ie. not unpinned) > >> + * @DRM_GEM_OBJECT_PURGEABLE: object marked as purgeable by userspace > >> + * > >> + * Bitmask of status used for fdinfo memory stats, see &drm_gem_object_funcs.status > >> + * and drm_show_fdinfo(). Note that an object can DRM_GEM_OBJECT_PURGEABLE if > >> + * it still active or not resident, in which case drm_show_fdinfo() will not > > > > nit: s/can/can be/;s/if it still/if it is still/ > > > >> + * account for it as purgeable. So drivers do not need to check if the buffer > >> + * is idle and resident to return this bit. (Ie. userspace can mark a buffer > >> + * as purgeable even while it is still busy on the GPU.. it does not _actually_ > >> + * become puregeable until it becomes idle. The status gem object func does > > > > nit: s/puregeable/purgeable/ > > > > > > I think we want a similar note in the drm-usage-stats.rst file. > > > > With the above the whole series is: > > Reviewed-by: Emil Velikov > > Have you maybe noticed my slightly alternative proposal? (*) I am not a > fan of putting this flavour of accounting into the core with no way to > opt out. I think it leaves no option but to add more keys in the future > for any driver which will not be happy with the core accounting. > > *) https://patchwork.freedesktop.org/series/116581/ > Indeed I saw it. Not a fan of it, I'm afraid. > > Fwiw: Keeping the i915 patch as part of this series would be great. > > Sure i915_drm_client->id becomes dead code, but it's a piece one can > > live with for a release or two. Then again it's not my call to make. > > Rob can take the i915 patch from my RFC too. > Indeed. -Emil