From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support Date: Tue, 20 Mar 2018 21:16:40 +0100 Message-ID: <7bbc4bc8-1b44-efc3-44b7-47ebcb4b9c76@amd.com> References: <1520033110-29964-1-git-send-email-Samuel.Li@amd.com> <13996c5e-dc4c-5a9a-b6c3-7fe6bb63ec5d@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1774027606==" Return-path: In-Reply-To: Content-Language: en-US List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: "Deucher, Alexander" , =?UTF-8?B?TWFyZWsgT2zFocOhaw==?= Cc: Alex Deucher , =?UTF-8?Q?Michel_D=c3=a4nzer?= , amd-gfx list , "Li, Samuel" This is a multi-part message in MIME format. --===============1774027606== Content-Type: multipart/alternative; boundary="------------92A51A8B08371CE6ABD1EC44" Content-Language: en-US This is a multi-part message in MIME format. --------------92A51A8B08371CE6ABD1EC44 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs. My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong. So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..). Christian. Am 20.03.2018 um 21:04 schrieb Deucher, Alexander: > > I think we can also have the case of systems with similar amounts of > carve out and system ram.  E.g., on a system with 4 GB of system > memory with 1 GB carved out for vram.  It would be a big waste not to > use VRAM.  We'll probably need a heuristic at some point. > > > Alex > > ------------------------------------------------------------------------ > *From:* Christian König > *Sent:* Tuesday, March 20, 2018 2:32:49 PM > *To:* Marek Olšák; Koenig, Christian > *Cc:* Alex Deucher; Deucher, Alexander; Michel Dänzer; Li, Samuel; > amd-gfx list > *Subject:* Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display > support > I don't think that is a good idea. > > Ideally GTT should now have the same performance as VRAM on APUs and > we should use VRAM only for things where we absolutely have to and to > actually use up the otherwise unused VRAM. > > Can you run some tests with all BOs forced to GTT and see if there is > any performance regression? > > Christian. > > Am 20.03.2018 um 15:51 schrieb Marek Olšák: >> On Tue, Mar 20, 2018 at 9:55 AM, Christian König >> > > wrote: >> >> Yes, exactly. And if I remember correctly Mesa used to always set >> GTT as fallback on APUs, correct? >> >> >> "used to" is the key part. Mesa doesn't force GTT on APUs anymore. It >> expects that the combination of BO priorities and BO move throttling >> will result in optimal BO placements over time. >> >> Marek >> >> >> The problem seems to be that this fallback isn't set for >> displayable BOs. >> >> So what needs to be done is to just enable this fallback for >> displayable BOs as well if the kernel can handle it. >> >> Christian. >> >> >> Am 20.03.2018 um 00:01 schrieb Marek Olšák: >>> In theory, Mesa doesn't have to do anything. It can continue >>> setting VRAM and if the kernel has to put a display buffer into >>> GTT, it doesn't matter (for Mesa). Whether the VRAM placement is >>> really used is largely determined by BO priorities. >>> >>> The way I understand scather/gather is that it only allows the >>> GTT placement. It doesn't force the GTT placement. Mesa also >>> doesn't force the GTT placement. >>> >>> Marek >>> >>> On Mon, Mar 19, 2018 at 5:12 PM, Alex Deucher >>> > wrote: >>> >>> On Mon, Mar 19, 2018 at 4:29 PM, Li, Samuel >>> > wrote: >>> >>to my earlier point, there may be cases where it is >>> advantageous to put >>> >> display buffers in vram even if s/g display is supported >>> > >>> > Agreed. That is also why the patch has the options to let >>> user select where >>> > to put display buffers. >>> > >>> > As whether to put the option in Mesa or kernel, it seems >>> the difference is >>> > not much. Also, since amdgpufb can request even without >>> mesa, kernel might >>> > be a better choice. In addition, putting in the kernel can >>> save client’s >>> > duplicate work(mesa, ogl, vulkan, 2d, kernel…) >>> >>> Why do we even expose different memory pools to the UMDs in >>> the first >>> place ;)  Each pool has performance characteristics that may be >>> relevant for a particular work load. Only the UMDs really >>> know the >>> finer points of those workloads. In general, you don't want >>> the kernel >>> dictating policy if you can avoid it. The kernel exposes >>> functionality and userspace sets the policy.  With the >>> location set in >>> userspace, each app/user can have whatever policy makes >>> sense for >>> their use case all at the same time without needing to tweak >>> their >>> kernel for every use case. >>> >>> Alex >>> >>> >>> >>> _______________________________________________ >>> amd-gfx mailing list >>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org >>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx >>> >> >> >> >> >> _______________________________________________ >> amd-gfx mailing list >> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org >> https://lists.freedesktop.org/mailman/listinfo/amd-gfx > --------------92A51A8B08371CE6ABD1EC44 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit
That's what I meant with use up the otherwise unused VRAM. I don't see any disadvantage of always setting GTT as second domain on APUs.

My assumption was that we dropped this in userspace for displayable surfaces, but Marek proved that wrong.

So what we should do is actually to add GTT as fallback to all BOs on APUs in Mesa and only make sure that the kernel is capable of handling GTT with optimal performance (e.g. have user huge pages etc..).

Christian.

Am 20.03.2018 um 21:04 schrieb Deucher, Alexander:

I think we can also have the case of systems with similar amounts of carve out and system ram.  E.g., on a system with 4 GB of system memory with 1 GB carved out for vram.  It would be a big waste not to use VRAM.  We'll probably need a heuristic at some point.


Alex


From: Christian König <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Tuesday, March 20, 2018 2:32:49 PM
To: Marek Olšák; Koenig, Christian
Cc: Alex Deucher; Deucher, Alexander; Michel Dänzer; Li, Samuel; amd-gfx list
Subject: Re: [PATCH 1/2] drm/amdgpu: Enable scatter gather display support
 
I don't think that is a good idea.

Ideally GTT should now have the same performance as VRAM on APUs and we should use VRAM only for things where we absolutely have to and to actually use up the otherwise unused VRAM.

Can you run some tests with all BOs forced to GTT and see if there is any performance regression?

Christian.

Am 20.03.2018 um 15:51 schrieb Marek Olšák:
On Tue, Mar 20, 2018 at 9:55 AM, Christian König <ckoenig.leichtzumerken@gmail.com> wrote:
Yes, exactly. And if I remember correctly Mesa used to always set GTT as fallback on APUs, correct?

"used to" is the key part. Mesa doesn't force GTT on APUs anymore. It expects that the combination of BO priorities and BO move throttling will result in optimal BO placements over time.

Marek
 

The problem seems to be that this fallback isn't set for displayable BOs.

So what needs to be done is to just enable this fallback for displayable BOs as well if the kernel can handle it.

Christian.


Am 20.03.2018 um 00:01 schrieb Marek Olšák:
In theory, Mesa doesn't have to do anything. It can continue setting VRAM and if the kernel has to put a display buffer into GTT, it doesn't matter (for Mesa). Whether the VRAM placement is really used is largely determined by BO priorities.

The way I understand scather/gather is that it only allows the GTT placement. It doesn't force the GTT placement. Mesa also doesn't force the GTT placement.

Marek

On Mon, Mar 19, 2018 at 5:12 PM, Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
On Mon, Mar 19, 2018 at 4:29 PM, Li, Samuel <Samuel.Li-5C7GfCeVMHo@public.gmane.org> wrote:
>>to my earlier point, there may be cases where it is advantageous to put
>> display buffers in vram even if s/g display is supported
>
> Agreed. That is also why the patch has the options to let user select where
> to put display buffers.
>
> As whether to put the option in Mesa or kernel, it seems the difference is
> not much. Also, since amdgpufb can request even without mesa, kernel might
> be a better choice. In addition, putting in the kernel can save client’s
> duplicate work(mesa, ogl, vulkan, 2d, kernel…)

Why do we even expose different memory pools to the UMDs in the first
place ;)  Each pool has performance characteristics that may be
relevant for a particular work load.  Only the UMDs really know the
finer points of those workloads. In general, you don't want the kernel
dictating policy if you can avoid it.  The kernel exposes
functionality and userspace sets the policy.  With the location set in
userspace, each app/user can have whatever policy makes sense for
their use case all at the same time without needing to tweak their
kernel for every use case.

Alex



_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


--------------92A51A8B08371CE6ABD1EC44-- --===============1774027606== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4Cg== --===============1774027606==--