All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Honglei" <honghuan@amd.com>
To: Aveline Noir <jm5905938@gmail.com>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	amd-gfx@lists.freedesktop.org,
	"Christian König" <christian.koenig@amd.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	dri-devel@lists.freedesktop.org,
	"Felix Kuehling" <felix.kuehling@amd.com>,
	"Honglei Huang" <honglei1.huang@amd.com>,
	"Jenny Liu" <Jenny-Jing.Liu@amd.com>,
	"Junhua Shen" <Junhua.Shen@amd.com>,
	"Zhu Lingshan" <lingshan.zhu@amd.com>,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Oak Zeng" <Oak.Zeng@amd.com>,
	"Philip Yang" <Philip.Yang@amd.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Xiaogang Chen" <xiaogang.chen@amd.com>,
	"Yiru Ma" <yiru.ma@amd.com>, "Huang Rui" <ray.huang@amd.com>
Subject: Re: [PATCH v10 08/22] drm/amdgpu: implement SVM range notifier and GC helpers
Date: Tue, 10 Nov 2026 16:30:20 +0800	[thread overview]
Message-ID: <aa233f10-eb96-4bde-a44c-0855110bb151@amd.com> (raw)
In-Reply-To: <179424436564.222336.1790875367286789154.b4-reply@b4>



On 11/10/2026 1:12 AM, Aveline Noir wrote:
> Hi Ray,
> 
> On Wed, 21 Oct 2026 10:58:47 +0800 Huang Rui wrote:
> 
>> + * Invalidate the GPU view of @range over the notifier window: zap the
>> + * affected PTEs and clear the gpu_mapped flag. The range is not removed
>> + * here; structural removal if needed happens in the event-end phase.
> 
> I think this can leave stale PTEs behind when only part of a range is
> invalidated. Take a one-page notifier event on a larger system-memory
> range mapped with 4K PTEs. This zaps that one PTE but clears gpu_mapped
> for the whole range, and then the event-end callback unmaps DMA for the
> whole range. The other PTEs are still valid at that point, but their DMA
> mappings are gone. A later notifier won't zap them either, because
> gpu_mapped is already false.
> 
> Maybe the zap should cover the full range when its DMA mapping is
> going away?

Yes, the zep should cover the entire range, will fix it in next version.

> 
>> +			if (crosses_boundary) {
> 
> Another case is GPU_RO going from 1 to 0 over a whole mapped
> GPUSVM range. This branch isn't taken, so the PTEs are zapped but the
> old DMA_TO_DEVICE mapping stays around. The next get_pages() sees valid
> pages and reuses it, so the writable GPU PTE goes in without an
> HMM_PFN_REQ_WRITE fault or a DMA_BIDIRECTIONAL remap. If it's a VM_WRITE
> MAP_PRIVATE mapping whose CPU PTE still needs COW, I think it can miss
> the write fault. So could the old DMA mapping be dropped before the
> writable PTE goes in?

Will apply the drm_gpusvm_unmap_pages when attr is change, regardless of 
whether crosses_boundary.

> 
> I couldn't tell from the cover which drm_gpusvm base this is on, so I
> used 671b7825dbfe for both of these. I haven't reproduced either one on
> a GPU, though.

Regards,
Honglei

> 
> Thanks,
> Aveline Noir


  reply	other threads:[~2026-11-10  8:30 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21  2:58 [PATCH v10 00/22] drm/amdgpu: AMDGPU SVM support based on DRM (Phase 1: single GPU, XNACK on) Huang Rui
2026-10-21  2:58 ` [PATCH v10 01/22] drm/amdgpu: add SVM ioctl UAPI definitions Huang Rui
2026-11-09 12:26   ` Christian König
2026-10-21  2:58 ` [PATCH v10 02/22] drm/amdgpu: add SVM core header and VM integration Huang Rui
2026-11-09 12:33   ` Christian König
2026-11-10  2:51     ` Huang, Honglei
2026-11-10 14:46     ` Kuehling, Felix
2026-10-21  2:58 ` [PATCH v10 03/22] drm/amdgpu: implement SVM attribute tree and helper functions Huang Rui
2026-11-09 12:41   ` Christian König
2026-11-09 16:54     ` Aveline Noir
2026-11-10  2:55       ` Huang, Honglei
2026-10-21  2:58 ` [PATCH v10 04/22] drm/amdgpu: implement SVM attribute set/get/clear operations Huang Rui
2026-11-09 12:52   ` Christian König
2026-11-10  6:23     ` Huang, Honglei
2026-10-21  2:58 ` [PATCH v10 05/22] drm/amdgpu: add SVM range types and work queue interface Huang Rui
2026-11-09 13:48   ` Christian König
2026-11-10  6:44     ` Huang, Honglei
2026-10-21  2:58 ` [PATCH v10 06/22] drm/amdgpu/gmc: add get_svm_pte_flags callback Huang Rui
2026-11-09 13:52   ` Christian König
2026-11-10  6:57     ` Huang, Honglei
2026-11-10 10:01       ` Christian König
2026-11-10 10:24         ` Huang, Honglei
2026-10-21  2:58 ` [PATCH v10 07/22] drm/amdgpu: implement SVM range GPU mapping core Huang Rui
2026-11-09 13:55   ` Christian König
2026-11-10  7:01     ` Huang, Honglei
2026-10-21  2:58 ` [PATCH v10 08/22] drm/amdgpu: implement SVM range notifier and GC helpers Huang Rui
2026-11-09 17:12   ` Aveline Noir
2026-11-10  8:30     ` Huang, Honglei [this message]
2026-10-21  2:58 ` [PATCH v10 09/22] drm/amdgpu: add SVM notifier invalidate callback and checkpoint Huang Rui
2026-10-21  2:58 ` [PATCH v10 10/22] drm/amdgpu: implement SVM initialization and lifecycle Huang Rui
2026-11-09 16:59   ` Aveline Noir
2026-11-10  8:48     ` Huang, Honglei
2026-10-21  2:58 ` [PATCH v10 11/22] drm/amdgpu: add SVM ioctl entry and fault handler module Huang Rui
2026-11-09 16:47   ` Aveline Noir
2026-11-10  8:59     ` Huang, Honglei
2026-10-21  2:58 ` [PATCH v10 12/22] drm/amdgpu: integrate SVM into build system and VM fault path Huang Rui
2026-10-21  2:58 ` [PATCH v10 13/22] drm/amdgpu: make VM eviction lock read/write to match notifier lock Huang Rui
2026-10-21  2:58 ` [PATCH v10 14/22] drm/amdgpu: recheck range validity after page table allocation Huang Rui
2026-10-21  2:58 ` [PATCH v10 15/22] drm/amdgpu: use drm_gpusvm notifier lock for VM eviction Huang Rui
2026-10-21  2:58 ` [PATCH v10 16/22] drm/pagemap: fix page undercount for compound src entries Huang Rui
2026-10-21  2:58 ` [PATCH v10 17/22] drm/amdgpu: add VRAM migration infrastructure for drm_pagemap Huang Rui
2026-10-21  2:58 ` [PATCH v10 18/22] drm/amdgpu: implement drm_pagemap SDMA migration callbacks Huang Rui
2026-10-21  2:58 ` [PATCH v10 19/22] drm/amdgpu: implement synchronous TTM eviction for SVM BOs Huang Rui
2026-10-21  2:58 ` [PATCH v10 20/22] drm/amdgpu: hook up ZONE_DEVICE registration in device init and reset Huang Rui
2026-10-21  2:59 ` [PATCH v10 21/22] drm/amdgpu: add SVM range migration helpers for drm_pagemap Huang Rui
2026-10-21  2:59 ` [PATCH v10 22/22] drm/amdgpu: integrate VRAM migration into SVM fault and prefetch paths Huang Rui
2026-11-11 15:08 ` [PATCH v10 00/22] drm/amdgpu: AMDGPU SVM support based on DRM (Phase 1: single GPU, XNACK on) Huang, Honglei

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=aa233f10-eb96-4bde-a44c-0855110bb151@amd.com \
    --to=honghuan@amd.com \
    --cc=Jenny-Jing.Liu@amd.com \
    --cc=Junhua.Shen@amd.com \
    --cc=Oak.Zeng@amd.com \
    --cc=Philip.Yang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=aliceryhl@google.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=felix.kuehling@amd.com \
    --cc=honglei1.huang@amd.com \
    --cc=jm5905938@gmail.com \
    --cc=lingshan.zhu@amd.com \
    --cc=matthew.brost@intel.com \
    --cc=ray.huang@amd.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=xiaogang.chen@amd.com \
    --cc=yiru.ma@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 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.