On 2026-11-13 21:43 +0100, David Hildenbrand (Arm) wrote:
> On 11/13/26 21:34, Thomas Hellström wrote:
> >
> > There are two major problems with the current behaviour.
> >
> > 1) The work item executing hmm_range_fault() might have no affinity at
> > all to the GPU about to access the memory.
> >
> > 2) If migration happens, then hmm_range_fault() will stop and retry
> > leading to excessive execution time.
> >
> > While perhaps Matt's commit message doesn't correctly describe the GUP
> > behaviour, do you have any alternative suggestion than to avoid
> > migration in this case? I think it's a reasonable idea given the
> > problems with the current code?
>
> Adding fault reasons that hack around NUMA hinting such that a actual CPU
> accessing it later will not trigger ... NUMA hinting?
>
> I might be missing the "reasonable" in here :P
>
Ehhh... I think the hint faulting code is already very tenuous, so yeah,
lets maybe not try to go down that route.
> I recall that John (cc) kept saying "GPUs and NUMA balancing is inherently
> incompatible, you have to disable NUMA balancing".
>
If this is a NUMA-hotplugged GPU, then this is resolved by a private
node, because this:
@@ -6404,6 +6404,9 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf)
if (!folio || folio_is_zone_device(folio))
changes to
if (!folio || folio_is_common_memory(folio))
And all folios on the GPU node are never subject to NUMA Balancing
so balancing can stay enabled while the GPU memory is not subject to
PROT_NONE spew.
~Gregory
--
~Gregory