Re: [PATCH v4] io: add io_pgtable abstraction
From: Boris Brezillon
Date: Fri Dec 19 2025 - 10:27:43 EST
On Fri, 19 Dec 2025 11:14:34 -0400
Jason Gunthorpe <jgg@xxxxxxxx> wrote:
> On Fri, Dec 19, 2025 at 04:11:53PM +0100, Boris Brezillon wrote:
>
> > There's actually a confusion between TLB invalidation and L1/L2 cache
> > flush/invalidation. The things we can decide to flush/invalidate around
> > map/unmap ops are L1/L2 caches. The TLB invalidate, we don't have
> > direct control on: it happens as part of the LOCK+UNLOCK sequence, and
> > no matter what you execute (map or unmap), you have to surround it with
> > a LOCK/UNLOCK to provide support for atomic updates (GPU is blocked if
> > anything accesses the locked range while an update is on-going).
>
> That makes more sense, so these GPU drivers just flush the entire TLB
> every time they change it - built into the UNLOCK operation?
I don't have implementation details, so I can't really tell what
happens internally. What's sure is that LOCK takes a range, so they
might be optimizing the TLB flush to only evict entries covered by this
range, dunno.