Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Matthew Auld" <matthew.auld@intel.com>,
	linux-mm@kvack.org
Cc: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Mika Penttilä" <mpenttil@redhat.com>,
	"Leon Romanovsky" <leon@kernel.org>,
	"Jason Gunthorpe" <jgg@ziepe.ca>,
	"John Hubbard" <jhubbard@nvidia.com>
Subject: Re: [PATCH] mm/hmm: skip NUMA balancing on protnone faults
Date: Fri, 13 Nov 2026 22:19:06 +0100	[thread overview]
Message-ID: <6af3d5d2-4fab-4a3f-85d9-34564fca8ffe@kernel.org> (raw)
In-Reply-To: <0b794f803517c27ea818a2e894761095300b4da4.camel@linux.intel.com>

On 11/13/26 21:56, Thomas Hellström wrote:
> On Fri, 2026-11-13 at 21:43 +0100, David Hildenbrand (Arm) wrote:
>> On 11/13/26 21:34, Thomas Hellström wrote:
>>> Hi, David
>>>
>>>
>>> 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
> 
> Wouldn't the net effect be that content stays put instead of being
> migrated? In both cases a later CPU access will not trigger NUMA
> hinting except that the proposed change doesn't send content to an
> irrelevant node?

My point is that you are essentially disabling NUMA hinting because the CPU will
no longer trigger NUMA hinting faults.

But then, just disable it entirely. Maybe John knows what to do.

> 
>>
>> I recall that John (cc) kept saying "GPUs and NUMA balancing is
>> inherently
>> incompatible, you have to disable NUMA balancing".
> 
> Perhaps we could force hmm_range_fault() to run on the node closest to
> the GPU. Then at least the migration might be beneficial.

That's also true.

> 
>>
>> You could likely implement something similar to GUP, where you would
>> allow for
>> bypassing protnone for reading.
> 
> We could ofc look at that. Might help in some cases.
Would be interesting if that already solves most of your problem. Apparently for
KVM it did, but not sure why the write side was never that important.

-- 
Cheers,

David


      reply	other threads:[~2026-11-13 21:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 16:25 [PATCH] mm/hmm: skip NUMA balancing on protnone faults Matthew Auld
2026-11-13 18:27 ` David Hildenbrand (Arm)
2026-11-13 20:34   ` Thomas Hellström
2026-11-13 20:43     ` David Hildenbrand (Arm)
2026-11-13 20:53       ` Gregory Price (Meta)
2026-11-13 20:56       ` Thomas Hellström
2026-11-13 21:19         ` David Hildenbrand (Arm) [this message]

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=6af3d5d2-4fab-4a3f-85d9-34564fca8ffe@kernel.org \
    --to=david@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mpenttil@redhat.com \
    --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