STRUCT DRM_PAGEMAP_ZDD(9)
π STRUCT DRM_PAGEMAP_ZDD β GPU SVM zone device data
Okay bestie, so this is the struct drm_pagemap_zdd(9) page from the Kernel API Manual β yes it's a kernel manual, we're built different here. Sit down, grab a strawberry drink π, and let's get into it.
β¨ SYNOPSIS β¨
struct drm_pagemap_zdd {
struct kref refcount;
struct drm_pagemap_devmem *devmem_allocation;
struct drm_pagemap *dpagemap;
};
That's the whole vibe of the struct right there. Three members, no notes, iconic. π
π«Ά MEMBERS π«Ά
refcountβ the reference count for the zdd. Literally just keeping track of how many besties are still holding onto it πdevmem_allocationβ the device memory allocation. That's the goods right there β¨dpagemapβ a refcounted pointer to the underlyingstruct drm_pagemap. Not a plain pointer, a refcounted one β do not forget, iykyk π₯
πΈ DESCRIPTION πΈ
So this structure is doing a lot of main character work, let's talk about it. It serves as a generic wrapper installed in page->zone_device_data β like, that's where it lives, that's its home π
What it gives you is infrastructure for two things:
- Looking up a device memory allocation upon a CPU page fault π
- Asynchronously releasing device memory once the CPU has no page references left π¦
And the asynchronous release part? Highkey important. Because CPU page references can get dropped in IRQ contexts, but releasing device memory likely requires sleeping locks π so you literally cannot do it inline. Asynchronous release is the whole slay here. No cap.
π Fr fr, don't try to release device memory synchronously from an IRQ context. The asynchronous machinery exists for a reason.
π SEE ALSO π
Grab a snack, this list is long and every single one of these is required reading bestie:
- Kernel file
./drivers/gpu/drm/drm_pagemap.c Overview(9)Migration(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)drm_pagemap_migrate_populate_ram_pfn(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)
Like I said. Long. But we read all of them. π
That's the whole page bestie, and it's sourced from ./drivers/gpu/drm, dated October 2026, and it's literally titled struct drm_pagemap_zdd(9) in case you forgot. Mwah π go read your Overview(9) and hydrate π§ββοΈβ¨
π¦ 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