drm_pagemap_...late_ram_pfn(9)
β¨ drm_pagemap_migrate_populate_ram_pfn π
okay so bestie, this is a page straight out of the Kernel API Manual and honestly? it's giving "internal DRM pagemap lore" and i'm obsessed. sit down, grab a strawberry π, and let's get into it.
πΈ NAME πΈ
drm_pagemap_migrate_populate_ram_pfn β literally just populating RAM PFNs for a VM area. that's the whole vibe. no cap.
β¨ SYNOPSIS β¨
int drm_pagemap_migrate_populate_ram_pfn (struct vm_area_struct *vas ,
struct page *fault_page , unsigned long npages , unsigned long *mpages ,
unsigned long *src_mpfn , unsigned long *mpfn , unsigned long addr );
likeβ¦ look at all those arguments. main character energy fr fr π«Ά
π ARGUMENTS π
vasβ pointer to the VM area structure, and yes bestie it can be NULL. that's not a typo, it's a lifestyle. πfault_pageβ the fault page. iconic. does exactly what it says on the tin.npagesβ how many pages you wanna populate. the count. the number. the quantity.mpagesβ how many pages to migrate. slightly different number, don't mix them up πsrc_mpfnβ the source array of migrate PFNs. the "where you came from" of it all.mpfnβ the array of migrate PFNs you're actually populating. the destination. the glow-up. β¨addrβ the start address for PFN allocation. where it all begins.
π¦ DESCRIPTION π¦
so what does this thing do? it populates the RAM migrate page frame numbers (PFNs) for the VM area structure you hand it. it allocates and locks pages in the VM area for RAM usage β like, it's out here doing both jobs, we love a multitasker π
and here's the tea on how it picks an allocator:
- if
vasis non-NULL β it usesalloc_page_vmafor allocation - if
vasis NULL β it usesalloc_pagefor allocation
that's it. that's the branch. simple, clean, slay. π
π₯ RETURN π₯
0on success π- a negative error code on failure π (classic)
π SEE ALSO π
okay this list is long but every single one of these is required reading, no skipping, i will know π
- Kernel file
./drivers/gpu/drm/drm_pagemap.cOverview(9) - Migration(9)
- struct
drm_pagemap_zdd(9) drm_pagemap_zdd_alloc(9)drm_pagemap_zdd_get(9)drm_pagemap_zdd_destroy(9)drm_pagemap_zdd_put(9)drm_pagemap_migration_unlock_put_folio(9)drm_pagemap_migration_unlock_put_pages(9)drm_pagemap_get_devmem_page(9)drm_pagemap_migrate_map_device_private_pages(9)- struct
drm_pagemap_iova_state(9) drm_pagemap_migrate_map_system_pages(9)drm_pagemap_migrate_populate_src_pages(9)drm_pagemap_migrate_unmap_pages(9)- struct
migrate_range_loc(9) drm_pagemap_cpages(9)drm_pagemap_migrate_to_devmem(9)- struct
drm_pagemap_dev_hold(9) drm_pagemap_reinit(9)drm_pagemap_init(9)drm_pagemap_put(9)drm_pagemap_page_get_flags(9)drm_pagemap_page_set_flags(9)drm_pagemap_retire_migrated_pages(9)drm_pagemap_skip_retired_pages(9)drm_pagemap_evict_to_ram(9)__drm_pagemap_migrate_to_ram(9)drm_pagemap_folio_free(9)drm_pagemap_migrate_to_ram(9)drm_pagemap_pagemap_ops_get(9)drm_pagemap_devmem_init(9)drm_pagemap_page_to_dpagemap(9)drm_pagemap_populate_mm(9)
bestie warning π¨ β the synopsis and every name above are literal. if you retype them, retype them exactly. no renaming, no "fixing", no merging. the kernel does not accept vibes-based spelling. π
and that's the page!! tysm for reading, you ate that πβ¨ this gem dropped from ./drivers/gpu/drm back in October 2026 β go forth and populate those PFNs, i'm rooting for you π«Άππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms