Re: [PATCH] mm/gup: restore the ability to pin more than 2GB at a time
From: Jason Gunthorpe
Date: Wed Oct 30 2024 - 08:05:13 EST
On Wed, Oct 30, 2024 at 09:34:51AM +0100, David Hildenbrand wrote:
> The unusual thing is not the amount of system memory we are pinning but *how
> many* pages we try pinning in the single call.
>
> If you stare at vfio_pin_pages_remote, we seem to be batching it.
>
> long req_pages = min_t(long, npage, batch->capacity);
>
> Which is
>
> #define VFIO_BATCH_MAX_CAPACITY (PAGE_SIZE / sizeof(struct page *))
>
> So you can fix this in your driver ;)
Yeah, everything batches that I'm aware of. RDMA also uses a 4k batch
size, and iommufd uses 64k.
Jason