From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v4 1/4] mm/mmu_notifier: Allow two-pass struct mmu_interval_notifiers
Date: Wed, 11 Mar 2026 09:25:03 +0100 [thread overview]
Message-ID: <68e7fbf84fe0a509db5a6de5a47d861b0cfcb5c1.camel@linux.intel.com> (raw)
In-Reply-To: <9986a822-c7e6-45ac-bf74-899ca1a9363f@kernel.org>
Replying to list address for reference.
On Fri, 2026-03-06 at 14:11 +0100, David Hildenbrand (Arm) wrote:
> On 3/6/26 14:05, Thomas Hellström wrote:
> > On Thu, 2026-03-05 at 15:00 +0100, David Hildenbrand (Arm) wrote:
> > > On 3/5/26 10:39, Thomas Hellström wrote:
> > > > GPU use-cases for mmu_interval_notifiers with hmm often involve
> > > > starting a gpu operation and then waiting for it to complete.
> > > > These operations are typically context preemption or TLB
> > > > flushing.
> > > >
> > > > With single-pass notifiers per GPU this doesn't scale in
> > > > multi-gpu scenarios. In those scenarios we'd want to first
> > > > start
> > > > preemption- or TLB flushing on all GPUs and as a second pass
> > > > wait
> > > > for them to complete.
> > > >
> > > > One can do this on per-driver basis multiplexing per-driver
> > > > notifiers but that would mean sharing the notifier "user" lock
> > > > across all GPUs and that doesn't scale well either, so adding
> > > > support
> > > > for multi-pass in the core appears to be the right choice.
> > > >
> > > > Implement two-pass capability in the mmu_interval_notifier. Use
> > > > a
> > > > linked list for the final passes to minimize the impact for
> > > > use-cases that don't need the multi-pass functionality by
> > > > avoiding
> > > > a second interval tree walk, and to be able to easily pass data
> > > > between the two passes.
> > > >
> > > > v1:
> > > > - Restrict to two passes (Jason Gunthorpe)
> > > > - Improve on documentation (Jason Gunthorpe)
> > > > - Improve on function naming (Alistair Popple)
> > > > v2:
> > > > - Include the invalidate_finish() callback in the
> > > > struct mmu_interval_notifier_ops.
> > > > - Update documentation (GitHub Copilot:claude-sonnet-4.6)
> > > > - Use lockless list for list management.
> > > > v3:
> > > > - Update kerneldoc for the struct
> > > > mmu_interval_notifier_finish::list member
> > > > (Matthew Brost)
> > > > - Add a WARN_ON_ONCE() checking for NULL invalidate_finish() op
> > > > if
> > > > if invalidate_start() is non-NULL. (Matthew Brost)
> > > > v4:
> > > > - Addressed documentation review comments by David Hildenbrand.
> > > >
> > > > Cc: Matthew Brost <matthew.brost@intel.com>
> > > > Cc: Christian König <christian.koenig@amd.com>
> > > > Cc: David Hildenbrand <david@kernel.org>
> > > > Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> > > > Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
> > > > Cc: Vlastimil Babka <vbabka@kernel.org>
> > > > Cc: Mike Rapoport <rppt@kernel.org>
> > > > Cc: Suren Baghdasaryan <surenb@google.com>
> > > > Cc: Michal Hocko <mhocko@suse.com>
> > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > > > Cc: Andrew Morton <akpm@linux-foundation.org>
> > > > Cc: Simona Vetter <simona.vetter@ffwll.ch>
> > > > Cc: Dave Airlie <airlied@gmail.com>
> > > > Cc: Alistair Popple <apopple@nvidia.com>
> > > > Cc: <dri-devel@lists.freedesktop.org>
> > > > Cc: <linux-mm@kvack.org>
> > > > Cc: <linux-kernel@vger.kernel.org>
> > > >
> > > > Assisted-by: GitHub Copilot:claude-sonnet-4.6 # Documentation
> > > > only.
> > > > Signed-off-by: Thomas Hellström
> > > > <thomas.hellstrom@linux.intel.com>
> > > > ---
> > >
> > > LGTM, thanks!
> > >
> > > Acked-by: David Hildenbrand (Arm) <david@kernel.org>
> >
> > Thanks, David.
> >
> > Ack to merge this through drm together with the drm/xe patches?
>
> Works for me, let me CC Andrew for awareness.
>
> >
> > If so, do I need an additional R-B in addition to any drm/xe
> > reviewers?
>
> Not from MM people :)
next prev parent reply other threads:[~2026-03-11 8:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 9:39 [PATCH v4 0/4] Two-pass MMU interval notifiers Thomas Hellström
2026-03-05 9:39 ` [PATCH v4 1/4] mm/mmu_notifier: Allow two-pass struct mmu_interval_notifiers Thomas Hellström
2026-03-05 14:00 ` David Hildenbrand (Arm)
[not found] ` <81917cd6035774c73cd40e638707e4148519b981.camel@linux.intel.com>
[not found] ` <9986a822-c7e6-45ac-bf74-899ca1a9363f@kernel.org>
2026-03-11 8:25 ` Thomas Hellström [this message]
2026-03-10 14:04 ` Maarten Lankhorst
2026-03-05 9:39 ` [PATCH v4 2/4] drm/xe/userptr: Convert invalidation to two-pass MMU notifier Thomas Hellström
2026-03-05 9:39 ` [PATCH v4 3/4] drm/xe: Split TLB invalidation into submit and wait steps Thomas Hellström
2026-03-05 9:39 ` [PATCH v4 4/4] drm/xe/userptr: Defer Waiting for TLB invalidation to the second pass if possible Thomas Hellström
2026-03-06 9:49 ` ✗ CI.checkpatch: warning for Two-pass MMU interval notifiers (rev4) Patchwork
2026-03-06 9:50 ` ✓ CI.KUnit: success " Patchwork
2026-03-06 10:34 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-03-07 11:04 ` ✗ Xe.CI.FULL: " Patchwork
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=68e7fbf84fe0a509db5a6de5a47d861b0cfcb5c1.camel@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
/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