On Fri, 24 Jan 2025 at 23:52, Dmitry Osipenko <dmitry.osipenko@xxxxxxxxxxxxx> wrote: > > - ret = drm_mm_insert_node(&vgdev->host_visible_mm, &vram->vram_node, > > - bo->base.base.size); > > + ret = drm_mm_insert_node_generic(&vgdev->host_visible_mm, &vram->vram_node, > > + bo->base.base.size, MAX_PAGE_SIZE, 0, 0); > > This change only reserves extra space in the memory allocator, but > doesn't change actual size of allocated BO. Instead, you likely need to > replace all ALIGN(size, PAGE_SIZE) occurrences in the driver code with > ALIGN(args->size, MAX_PAGE_SIZE) This approach is good enough for my usecase, where the vmm can cope with sub-page gpu allocations (by rounding up to full page), but can't deal with non page aligned ones.