Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "Matthew Auld" <matthew.auld@intel.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	intel-xe@lists.freedesktop.org
Cc: "Matthew Brost" <matthew.brost@intel.com>,
	stable@vger.kernel.org,
	"Christian König" <ckoenig.leichtzumerken@gmail.com>
Subject: Re: [PATCH v2 3/3] drm/xe: skip p2p for suspected display buffers
Date: Tue, 13 Oct 2026 13:50:12 +0200	[thread overview]
Message-ID: <9facad8e-6866-493e-99d4-71a491efb630@amd.com> (raw)
In-Reply-To: <eaa812b3-d576-4d63-a9cb-c7c0ec24f19f@intel.com>

On 10/13/26 11:40, Matthew Auld wrote:
...>>
>> It could be that this check doesn't work and because of low resolution and/or not busy PCIe it somehow works, but that would then clearly not be intended behavior.
>>
>> What could also be is that the frame is pulled over the PCIe bus using the SDMA multiple times, but that would then be a bug in userspace somewhere.
>>
>>>> Expectation is that buffer rather gets moved from VRAM to system memory when mapping the buffer with dma-buf, where it stays, and never negotiated to use p2p in the first place. I don't think p2p is really valid here.
>>
>> No, that is incorrect. When P2P is available it should be used, it's just that AMDs APUs can't scanout over P2P.
>>
>>>> What happened is that user updated their kernel and due to the MOVE_NOTIFY config getting removed and enabled by default on newer kernels this suddenly started negotiating p2p for things like the window buffer AFAICT, instead of moving it to system memory and keeping it there. On previous kernel versions the buffer would just get moved and pinned in system memory. From user pov this is a kernel regression, given the perf they are now getting.
>>>>
>>>> On AMD CPUs you allow p2p for everything. On Intel iGPUs we currently ban p2p. Maybe there is bigger question here for what is the story for p2p and iGPU? Should it really be blanket allowed like this? Should it not be opt-in with some userspace hints or something?
>>
>> Again no, P2P is mandatory for APUs. We have basically tons of customers using that with AMD dGPU and AMD iGPU and that works fine.
>>
>>>>
>>>> The other important part is that even when you move to system memory, it's no longer pinned (MOVE_NOTIFY) so can you now can also get violent ping-ponging, which is addressed in the first patch in this series.
>>
>> Yeah that is something which we have seen before as well. That should definately be prevented by the kernel.
>>
>> Does that patch help with the performance?
> 
> Mostly it's p2p that is the big killer. Series gives much as 10x FPS jump, if we stop negotiating p2p for the window buffer and prevent ping-ponging.
> 
> For example, in GravityMark,  we go from ~18 FPS -> ~180 FPS, which matches the previous performance the user was getting. The ping-ponging hurts, but from the reports it looked like it was only in some games and not as severe as p2p. User confirmed this with CONFIG_PCI_P2PDMA=n, and that fixed most of the workloads. Adding the ping-pong fix then fixes everything.

In that case I have not the slightest idea what going wrong here.

The only difference with P2P enabled I can see is that the buffer is pulled over the PCIe bus by the iGPU instead of pushed by the dGPU.

As I wrote in Thomas reply as well AMD uses exactly that setup with an dGPU and iGPU in the infotainment system found in Teslas and that works rather well as far as I know.

Regards,
Christian.

  reply	other threads:[~2026-10-13 11:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261007153605.1743626-5-matthew.auld@intel.com>
2026-10-07 15:36 ` [PATCH v2 1/3] drm/xe/dma-buf: keep non-p2p imported buffers in system memory Matthew Auld
2026-10-07 15:36 ` [PATCH v2 2/3] drm/xe/vm: make PREFETCH to TT sticky Matthew Auld
2026-10-07 15:36 ` [PATCH v2 3/3] drm/xe: skip p2p for suspected display buffers Matthew Auld
2026-10-07 18:11   ` Thomas Hellström
2026-10-08  9:46     ` Matthew Auld
2026-10-08  9:55       ` Christian König
2026-10-08 11:17         ` Matthew Auld
2026-10-09  9:16           ` Matthew Auld
2026-10-09  9:26             ` Christian König
2026-10-09 10:29               ` Matthew Auld
2026-10-09 11:38                 ` Christian König
2026-10-09 13:02                   ` Matthew Auld
2026-10-13  8:51                     ` Matthew Auld
2026-10-13  9:10                       ` Christian König
2026-10-13  9:18                         ` Thomas Hellström
2026-10-13  9:55                           ` Christian König
2026-10-13 10:16                             ` Thomas Hellström
2026-10-13 11:45                               ` Christian König
2026-10-13 12:36                                 ` Matthew Auld
2026-10-13  9:40                         ` Matthew Auld
2026-10-13 11:50                           ` Christian König [this message]
2026-10-13 13:15                             ` Matthew Auld
2026-10-09 13:06                   ` Thomas Hellström

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=9facad8e-6866-493e-99d4-71a491efb630@amd.com \
    --to=christian.koenig@amd.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=thomas.hellstrom@linux.intel.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