From: "Welty, Brian" <brian.welty@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>, Kenny Ho <y2kenny@gmail.com>
Cc: "Kenny Ho" <Kenny.Ho@amd.com>,
dri-devel <dri-devel@lists.freedesktop.org>,
jsparks@cray.com, "amd-gfx list" <amd-gfx@lists.freedesktop.org>,
lkaplan@cray.com, "Alex Deucher" <alexander.deucher@amd.com>,
kraxel@redhat.com, joseph.greathouse@amd.com,
"Tejun Heo" <tj@kernel.org>,
"Christian König" <christian.koenig@amd.com>
Subject: Re: [RFC PATCH v3 07/11] drm, cgroup: Add TTM buffer allocation stats
Date: Thu, 27 Jun 2019 18:16:48 -0700 [thread overview]
Message-ID: <01a6efa8-802c-b8b1-931e-4f0c1c63beca@intel.com> (raw)
In-Reply-To: <20190627060113.GC12905@phenom.ffwll.local>
On 6/26/2019 11:01 PM, Daniel Vetter wrote:
> On Thu, Jun 27, 2019 at 12:06:13AM -0400, Kenny Ho wrote:
>> On Wed, Jun 26, 2019 at 12:12 PM Daniel Vetter <daniel@ffwll.ch> wrote:
>>>
>>> I think with all the ttm refactoring going on I think we need to de-ttm
>>> the interface functions here a bit. With Gerd Hoffmans series you can just
>>> use a gem_bo pointer here, so what's left to do is have some extracted
>>> structure for tracking memory types. I think Brian Welty has some ideas
>>> for this, even in patch form. Would be good to keep him on cc at least for
>>> the next version. We'd need to explicitly hand in the ttm_mem_reg (or
>>> whatever the specific thing is going to be).
>>
>> I assume Gerd Hoffman's series you are referring to is this one?
>> https://www.spinics.net/lists/dri-devel/msg215056.html
>
> There's a newer one, much more complete, but yes that's the work.
>
>> I can certainly keep an eye out for Gerd's refactoring while
>> refactoring other parts of this RFC.
>>
>> I have added Brian and Gerd to the thread for awareness.
>
> btw just realized that maybe building the interfaces on top of ttm_mem_reg
> is maybe not the best. That's what you're using right now, but in a way
> that's just the ttm internal detail of how the backing storage is
> allocated. I think the structure we need to abstract away is
> ttm_mem_type_manager, without any of the actual management details.
>
Any de-ttm refactoring should probably not spam all the cgroups folks.
So I removed cgroups list.
As Daniel mentioned, some of us are looking at possible refactoring of TTM
for reuse in i915 driver.
Here is a brief summary of some ideas to be considered:
1) refactor part of ttm_mem_type_manager into a new drm_mem_type_region.
Really, should then move the array from ttm_bo_device.man[] into drm_device.
Relevant to drm_cgroup, you could then perhaps access these stats through
drm_device and don't need the mem_stats array in drmcgrp_device_resource.
1a) doing this right means replacing TTM_PL_XXX memory types with new DRM
defines. But could keep the TTM ones as redefinition of (new) DRM ones.
Probably those private ones (TTM_PL_PRIV) make this difficult.
All of the above could be eventually leveraged by the vram support being
implemented now in i915 driver.
2) refactor ttm_mem_reg + ttm_bus_placement into something generic for
any GEM object, maybe call it drm_gem_object_placement.
ttm_mem_reg could remain as a wrapper for TTM drivers.
This hasn't been broadly discussed with intel-gfx folks, so not sure
this fits well into i915 or not.
Relevant to drm_cgroup, maybe this function:
drmcgrp_mem_track_move(struct ttm_buffer_object *old_bo, bool evict,
struct ttm_mem_reg *new_mem)
could potentially become:
drmcgrp_mem_track_move(struct drm_gem_object *old_bo, bool evict,
struct drm_gem_object_placement *new_place)
Though from ttm_mem_reg, you look to only be using mem_type and size.
I think Daniel is noting that ttm_mem_reg wasn't truly needed here, so
you could just pass in the mem_type and size instead.
Would appreciate any feedback (positive or negative) on above....
Perhaps this should move to a new thread? I could send out basic RFC
patches for (1) if helpful but as it touches all the TTM drivers, nice to
hear some feedback first.
Anyway, this doesn't necessarily need to block forward progress on drm_cgroup,
as refactoring into common base structures could happen incrementally.
Thanks,
-Brian
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-06-28 1:16 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 15:05 [RFC PATCH v3 00/11] new cgroup controller for gpu/drm subsystem Kenny Ho
[not found] ` <20190626150522.11618-1-Kenny.Ho-5C7GfCeVMHo@public.gmane.org>
2019-06-26 15:05 ` [RFC PATCH v3 01/11] cgroup: Introduce cgroup for drm subsystem Kenny Ho
[not found] ` <20190626150522.11618-2-Kenny.Ho-5C7GfCeVMHo@public.gmane.org>
2019-06-26 15:49 ` Daniel Vetter
2019-06-26 19:35 ` Kenny Ho
[not found] ` <CAOWid-dyGwf=e0ikBEQ=bnVM_bC8-FeTOD8fJVMJKUgPv6vtyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-26 20:12 ` Daniel Vetter
2019-06-26 15:05 ` [RFC PATCH v3 05/11] drm, cgroup: Add peak GEM buffer allocation limit Kenny Ho
2019-06-26 15:05 ` [RFC PATCH v3 06/11] drm, cgroup: Add GEM buffer allocation count stats Kenny Ho
2019-06-26 15:05 ` [RFC PATCH v3 09/11] drm, cgroup: Add per cgroup bw measure and control Kenny Ho
[not found] ` <20190626150522.11618-10-Kenny.Ho-5C7GfCeVMHo@public.gmane.org>
2019-06-26 16:25 ` Daniel Vetter
[not found] ` <20190626162554.GU12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-27 4:34 ` Kenny Ho
[not found] ` <CAOWid-dO5QH4wLyN_ztMaoZtLM9yzw-FEMgk3ufbh1ahHJ2vVg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-27 6:11 ` Daniel Vetter
[not found] ` <20190627061153.GD12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-28 19:49 ` Kenny Ho
[not found] ` <CAOWid-dCkevUiN27pkwfPketdqS8O+ZGYu8vRMPY2GhXGaVARA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-07-02 13:20 ` Daniel Vetter
2019-06-26 15:05 ` [RFC PATCH v3 11/11] drm, cgroup: Allow more aggressive memory reclaim Kenny Ho
[not found] ` <20190626150522.11618-12-Kenny.Ho-5C7GfCeVMHo@public.gmane.org>
2019-06-26 16:44 ` Daniel Vetter
2019-06-26 22:52 ` Kenny Ho
2019-06-27 6:15 ` Daniel Vetter
2019-06-26 15:05 ` [RFC PATCH v3 02/11] cgroup: Add mechanism to register DRM devices Kenny Ho
[not found] ` <20190626150522.11618-3-Kenny.Ho-5C7GfCeVMHo@public.gmane.org>
2019-06-26 15:56 ` Daniel Vetter
2019-06-26 20:37 ` Kenny Ho
2019-06-26 21:03 ` Daniel Vetter
[not found] ` <CAKMK7uERvn7Ed2trGQShM94Ozp6+x8bsULFyGj9CYWstuzb56A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-26 21:58 ` Kenny Ho
2019-06-26 15:05 ` [RFC PATCH v3 03/11] drm/amdgpu: Register AMD devices for DRM cgroup Kenny Ho
2019-06-26 15:05 ` [RFC PATCH v3 04/11] drm, cgroup: Add total GEM buffer allocation limit Kenny Ho
[not found] ` <20190626150522.11618-5-Kenny.Ho-5C7GfCeVMHo@public.gmane.org>
2019-06-26 16:05 ` Daniel Vetter
[not found] ` <20190626160553.GR12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-26 21:27 ` Kenny Ho
[not found] ` <CAOWid-eurCMx1F7ciUwx0e+p=s=NP8=UxQUhhF-hdK-iAna+fA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-26 21:41 ` Daniel Vetter
[not found] ` <20190626214113.GA12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-26 22:41 ` Kenny Ho
[not found] ` <CAOWid-egYGijS0a6uuG4mPUmOWaPwF-EKokR=LFNJ=5M+akVZw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-27 5:43 ` Daniel Vetter
2019-06-27 18:42 ` Kenny Ho
[not found] ` <CAOWid-cT4TQ7HGzcSWjmLGjAW_D1hRrkNguEiV8N+baNiKQm_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-27 21:24 ` Daniel Vetter
2019-06-28 18:43 ` Kenny Ho
[not found] ` <CAOWid-dZQhpKHxYEFn+X+WSep+B66M_LtN6v0=4-uO3ecZ0pcg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-07-02 13:16 ` Daniel Vetter
2019-06-26 15:05 ` [RFC PATCH v3 07/11] drm, cgroup: Add TTM buffer allocation stats Kenny Ho
2019-06-26 16:12 ` Daniel Vetter
[not found] ` <20190626161254.GS12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-27 4:06 ` Kenny Ho
[not found] ` <CAOWid-f3kKnM=4oC5Bba5WW5WNV2MH5PvVamrhO6LBr5ydPJQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-06-27 6:01 ` Daniel Vetter
2019-06-27 20:17 ` Kenny Ho
2019-06-27 21:33 ` Daniel Vetter
2019-06-28 1:16 ` Welty, Brian [this message]
[not found] ` <01a6efa8-802c-b8b1-931e-4f0c1c63beca-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2019-06-28 6:53 ` Daniel Vetter
2019-06-26 15:05 ` [RFC PATCH v3 08/11] drm, cgroup: Add TTM buffer peak usage stats Kenny Ho
2019-06-26 16:16 ` Daniel Vetter
2019-06-26 15:05 ` [RFC PATCH v3 10/11] drm, cgroup: Add soft VRAM limit Kenny Ho
2019-06-27 7:24 ` [RFC PATCH v3 00/11] new cgroup controller for gpu/drm subsystem Daniel Vetter
2019-06-30 5:10 ` Kenny Ho
2019-07-02 13:21 ` Daniel Vetter
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=01a6efa8-802c-b8b1-931e-4f0c1c63beca@intel.com \
--to=brian.welty@intel.com \
--cc=Kenny.Ho@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=joseph.greathouse@amd.com \
--cc=jsparks@cray.com \
--cc=kraxel@redhat.com \
--cc=lkaplan@cray.com \
--cc=tj@kernel.org \
--cc=y2kenny@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox