Re: [PATCH v5 3/7] vfio/nvgrace-gpu: Add support for huge pfnmap
From: Jason Gunthorpe
Date: Mon Nov 24 2025 - 13:15:38 EST
On Mon, Nov 24, 2025 at 11:59:22AM +0000, ankita@xxxxxxxxxx wrote:
> +static size_t nvgrace_gpu_aligned_devmem_size(size_t memlength)
> +{
> +#ifdef CONFIG_ARCH_SUPPORTS_PMD_PFNMAP
> + return ALIGN(memlength, PMD_SIZE);
> +#endif
> +#ifdef CONFIG_ARCH_SUPPORTS_PUD_PFNMAP
> + return ALIGN(memlength, PUD_SIZE);
> +#endif
> + return memlength;
> +}
This needs a comment why it is OK to change the size up? Seems really
surprising (and wrong!). The commit message should explain it too.
Jason