All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "Rob Clark" <robdclark@gmail.com>,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	"Boris Brezillon" <boris.brezillon@collabora.com>,
	"Christopher Healy" <healych@amazon.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Rob Clark" <robdclark@chromium.org>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 5/6] drm: Add fdinfo memory stats
Date: Fri, 21 Apr 2023 12:59:09 +0100	[thread overview]
Message-ID: <e16dc626-30bf-be19-8668-bdc14dfd051a@linux.intel.com> (raw)
In-Reply-To: <CACvgo53dP03r1BuxntyyoYjua5k6XPvVhu4iTGqXJq31UMUgxg@mail.gmail.com>


On 21/04/2023 12:45, Emil Velikov wrote:
> On Fri, 21 Apr 2023 at 12:23, Tvrtko Ursulin
> <tvrtko.ursulin@linux.intel.com> wrote:
> 
>> On 21/04/2023 11:26, Emil Velikov wrote:
>>> On Wed, 12 Apr 2023 at 23:43, Rob Clark <robdclark@gmail.com> 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 <emil.l.velikov@gmail.com>
>>
>> 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.

Hard to guess the reasons. :)

Anyway, at a minimum I suggest that if the no opt out version has to go 
in, it is clearly documented drm-*-memory-* is *not* about the full 
memory use of the client, but about memory belonging to user visible 
buffer objects *only*. Possibly going as far as naming the keys as 
drm-user-bo-memory-... That way there is a way to implement proper 
drm-*-memory- in the future.

Regards,

Tvrtko

>>> 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

WARNING: multiple messages have this Message-ID (diff)
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "Rob Clark" <robdclark@chromium.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Jonathan Corbet" <corbet@lwn.net>,
	linux-arm-msm@vger.kernel.org,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	"Christopher Healy" <healych@amazon.com>,
	dri-devel@lists.freedesktop.org,
	"open list" <linux-kernel@vger.kernel.org>,
	"Boris Brezillon" <boris.brezillon@collabora.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	freedreno@lists.freedesktop.org,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH v4 5/6] drm: Add fdinfo memory stats
Date: Fri, 21 Apr 2023 12:59:09 +0100	[thread overview]
Message-ID: <e16dc626-30bf-be19-8668-bdc14dfd051a@linux.intel.com> (raw)
In-Reply-To: <CACvgo53dP03r1BuxntyyoYjua5k6XPvVhu4iTGqXJq31UMUgxg@mail.gmail.com>


On 21/04/2023 12:45, Emil Velikov wrote:
> On Fri, 21 Apr 2023 at 12:23, Tvrtko Ursulin
> <tvrtko.ursulin@linux.intel.com> wrote:
> 
>> On 21/04/2023 11:26, Emil Velikov wrote:
>>> On Wed, 12 Apr 2023 at 23:43, Rob Clark <robdclark@gmail.com> 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 <emil.l.velikov@gmail.com>
>>
>> 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.

Hard to guess the reasons. :)

Anyway, at a minimum I suggest that if the no opt out version has to go 
in, it is clearly documented drm-*-memory-* is *not* about the full 
memory use of the client, but about memory belonging to user visible 
buffer objects *only*. Possibly going as far as naming the keys as 
drm-user-bo-memory-... That way there is a way to implement proper 
drm-*-memory- in the future.

Regards,

Tvrtko

>>> 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

  reply	other threads:[~2023-04-21 12:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 22:42 [PATCH v4 0/6] drm: fdinfo memory stats Rob Clark
2023-04-12 22:42 ` Rob Clark
2023-04-12 22:42 ` Rob Clark
2023-04-12 22:42 ` [Intel-gfx] " Rob Clark
2023-04-12 22:42 ` [PATCH v4 1/6] drm: Add common fdinfo helper Rob Clark
2023-04-12 22:42   ` Rob Clark
2023-04-13  8:07   ` Christian König
2023-04-13  8:07     ` Christian König
2023-04-13  8:46     ` Daniel Vetter
2023-04-13  8:46       ` Daniel Vetter
2023-04-13 10:34       ` Christian König
2023-04-13 13:03       ` Tvrtko Ursulin
2023-04-12 22:42 ` [PATCH v4 2/6] drm/msm: Switch to " Rob Clark
2023-04-12 22:42   ` Rob Clark
2023-04-20 14:00   ` Dmitry Baryshkov
2023-04-20 14:00     ` Dmitry Baryshkov
2023-04-12 22:42 ` [PATCH v4 3/6] drm/amdgpu: " Rob Clark
2023-04-12 22:42   ` Rob Clark
2023-04-12 22:42   ` Rob Clark
2023-04-13 10:37   ` Christian König
2023-04-13 10:37     ` Christian König
2023-04-13 10:37     ` Christian König
2023-04-12 22:42 ` [Intel-gfx] [PATCH v4 4/6] drm/i915: " Rob Clark
2023-04-12 22:42   ` Rob Clark
2023-04-12 22:42   ` Rob Clark
2023-04-13 13:07   ` [Intel-gfx] " Tvrtko Ursulin
2023-04-13 13:07     ` Tvrtko Ursulin
2023-04-13 13:07     ` Tvrtko Ursulin
2023-04-13 15:42     ` [Intel-gfx] " Rob Clark
2023-04-13 15:42       ` Rob Clark
2023-04-13 15:42       ` Rob Clark
2023-04-12 22:42 ` [PATCH v4 5/6] drm: Add fdinfo memory stats Rob Clark
2023-04-12 22:42   ` Rob Clark
2023-04-21 10:26   ` Emil Velikov
2023-04-21 10:26     ` Emil Velikov
2023-04-21 11:23     ` Tvrtko Ursulin
2023-04-21 11:23       ` Tvrtko Ursulin
2023-04-21 11:45       ` Emil Velikov
2023-04-21 11:45         ` Emil Velikov
2023-04-21 11:59         ` Tvrtko Ursulin [this message]
2023-04-21 11:59           ` Tvrtko Ursulin
2023-04-21 14:50           ` Rob Clark
2023-04-21 14:50             ` Rob Clark
2023-04-12 22:42 ` [PATCH v4 6/6] drm/msm: Add memory stats to fdinfo Rob Clark
2023-04-12 22:42   ` Rob Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e16dc626-30bf-be19-8668-bdc14dfd051a@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=corbet@lwn.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=freedreno@lists.freedesktop.org \
    --cc=healych@amazon.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robdclark@chromium.org \
    --cc=robdclark@gmail.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.