LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: "Jean-Marc Valin" <jmvalin@mozilla.com>,
	"Christian König" <christian.koenig@amd.com>,
	airlied@linux.ie, alexander.deucher@amd.com,
	Felix.Kuehling@amd.com, labbott@redhat.com,
	akpm@linux-foundation.org, michel.daenzer@amd.com,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: AMD graphics performance regression in 4.15 and later
Date: Mon, 9 Apr 2018 11:42:18 +0200	[thread overview]
Message-ID: <55e1712b-6567-50c5-3789-53dd1ccddb94@gmail.com> (raw)
In-Reply-To: <77866d66-2728-8295-d7ee-9975dbf64b99@mozilla.com>

Am 07.04.2018 um 00:00 schrieb Jean-Marc Valin:
> Hi Christian,
>
> Thanks for the info. FYI, I've also opened a Firefox bug for that at:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1448778
> Feel free to comment since you have a better understanding of what's
> going on.
>
> One last question: right now I'm running 4.15.0 with the "offending"
> patch reverted. Is that safe to run or are there possible bad
> interactions with other changes.

That should work without problems.

But I just had another idea as well, if you want you could still test 
the new code path which will be using in 4.17.

Backporting all the detection logic is to invasive, but you could just 
go into drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c and forcefull use the 
other code path.

Just look out for "#ifdef CONFIG_SWIOTLB" checks and disable those.

Regards,
Christian.

>
> Cheers,
>
> 	Jean-Marc
>
> On 04/06/2018 01:20 PM, Christian König wrote:
>> Am 06.04.2018 um 18:42 schrieb Jean-Marc Valin:
>>> Hi Christian,
>>>
>>> On 04/09/2018 07:48 AM, Christian König wrote:
>>>> Am 06.04.2018 um 17:30 schrieb Jean-Marc Valin:
>>>>> Hi Christian,
>>>>>
>>>>> Is there a way to turn off these huge pages at boot-time/run-time?
>>>> Only at compile time by not setting CONFIG_TRANSPARENT_HUGEPAGE.
>>> Any reason why
>>> echo never > /sys/kernel/mm/transparent_hugepage/enabled
>>> doesn't solve the problem?
>> Because we unfortunately try to allocate huge pages anyway, we
>> unfortunately just fail in 100% of all cases.
>>
>> That basically gives you both, the extra allocation overhead and the
>> still bad throughput.
>>
>>> Also, I assume that disabling CONFIG_TRANSPARENT_HUGEPAGE will disable
>>> them for everything and not just what your patch added, right?
>> Correct, that's why I wrote that disabling SWIOTLBs might be better.
>>
>>>>> I'm not sure what you mean by "We mitigated the problem by avoiding the
>>>>> slow coherent DMA code path on almost all platforms on newer
>>>>> kernels". I
>>>>> tested up to 4.16 and the performance regression is just as bad as
>>>>> it is
>>>>> for 4.15.
>>>> Indeed 4.16 still doesn't have that. You could use the
>>>> amd-staging-drm-next branch or wait for 4.17.
>>> Is there a way to pull just that change or is there too much
>>> interactions with other changes?
>> It adds a new detection if memory allocation needs to be coherent or
>> not, that is not something you can easily pull into older versions.
>>
>>>> That isn't related to the GFX hardware, but to your CPU/motherboard and
>>>> whatever else you have in the system.
>>> Well, I have an nvidia GPU in the same system (normally only used for
>>> CUDA) and if I use it instead of my RX 560 then I'm not seeing any
>>> performance issue with 4.15.
>> That's because you are probably using the Nvidia binary driver which has
>> a completely separate code base.
>>
>>>> Some part of your system needs SWIOTLB and that makes allocating memory
>>>> much slower.
>>> What would that part be? FTR, I have a complete description of my system
>>> at https://jmvalin.dreamwidth.org/15583.html
>>>
>>> I don't know if it's related, but I can maybe see one thing in common
>>> between my machine and the Core 2 Quad from the other bug report and
>>> that's the "NUMA part". I have a dual-socket Xeon and (AFAIK) the Core 2
>>> Quad is made of two two-core CPUs glued together with little
>>> communication between them.
>> Yeah, that is probably the reason.
>>
>>>> Intel doesn't use TTM because they don't have dedicated VRAM, but the
>>>> open source nvidia driver should be affected as well.
>>> I'm using the proprietary nvidia driver (because CUDA). Is that supposed
>>> to be affected as well?
>> No.
>>
>>>> We already mitigated that problem and I don't see any solution which
>>>> will arrive faster than 4.17.
>>> Is that supposed to make the slowdown unnoticeable or just slightly
>>> better?
>> It completely goes away. The issue with the coherent path is that it
>> tries to always allocate the lowest possible memory to make sure that it
>> fits into the DMA constrains of all devices in the system.
>>
>> But since AMD GPU can handle 40bits of addresses you would need at least
>> 1TB of memory in the system to trigger that (or a NUMA where some system
>> is low and some in a high area).
>>
>> Christian.
>>
>>>> The only quick workaround I can see is to avoid firefox, chrome for
>>>> example is reported to work perfectly fine.
>>> Or use an unaffected GPU/driver ;-)
>>>
>>> Cheers,
>>>
>>>      Jean-Marc
>>>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-04-09  9:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06  0:30 AMD graphics performance regression in 4.15 and later Jean-Marc Valin
2018-04-06  8:03 ` Christian König
2018-04-06  8:10   ` Christian König
2018-04-06 15:30   ` Jean-Marc Valin
2018-04-09 11:48     ` Christian König
2018-04-06 16:42       ` Jean-Marc Valin
2018-04-06 17:20         ` Christian König
2018-04-06 22:00           ` Jean-Marc Valin
2018-04-09  9:42             ` Christian König [this message]
2018-04-09 15:17               ` Jean-Marc Valin
2018-04-10  6:48                 ` Christian König
2018-04-11  4:00               ` Gabriel C
2018-04-11  5:02                 ` Gabriel C
2018-06-06 11:28                   ` Gabriel C
2018-06-06 11:33                     ` Christian König
2018-06-06 12:08                       ` Gabriel C
2018-06-06 12:19                         ` Christian König
2018-04-11  9:37                 ` Christian König
2018-04-11 14:26                   ` Gabriel C
2018-04-11 17:21                     ` Gabriel C
2018-04-11 18:35                   ` Jean-Marc Valin
2018-04-11 22:20                     ` Gabriel C
2018-04-12  1:47                       ` Gabriel C
2018-04-20 14:47                   ` Michel Dänzer
2018-04-20 19:40                     ` Felix Kuehling
2018-04-23 10:23                       ` Michel Dänzer
2018-07-13  2:23       ` Jean-Marc Valin

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=55e1712b-6567-50c5-3789-53dd1ccddb94@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jmvalin@mozilla.com \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michel.daenzer@amd.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;
as well as URLs for NNTP newsgroup(s).