xe_bo_set_purgeable_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xe_bo_set_purgeable_state(9) β€” like, the Kernel API Manual page, bestie πŸŽ€

okay so real quick β€” this is a page from the Kernel API Manual, and it's about xe_bo_set_purgeable_state, which sounds intimidating but honestly? It's giving "glorified setter with trust issues" and we're gonna get through it together. 🫢


✨ NAME ✨

xe_bo_set_purgeable_state β€” sets the BO purgeable state, but like… with validation. She does not just take your word for it. πŸ’…


🌸 SYNOPSIS 🌸

void xe_bo_set_purgeable_state (struct xe_bo *bo , enum
       xe_madv_purgeable_state new_state );

no return value. void. she simply does the thing and leaves. main character energy fr fr. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • bo β€” the Buffer object in question. your little guy. πŸ“
  • new_state β€” the new purgeable state you want to give it. the glow-up you're proposing. ✨

πŸ’– DESCRIPTION πŸ’–

So what this does: it sets the purgeable state, and along the way it's got lockdep assertions doing vibe checks and it validates state transitions. No cap. 🫢

And here's the big one, bestie β€” once a BO is PURGED, it cannot transition to any other state. That's it. That's the whole door. Locked. Permanently. Not me being dramatic, that's literally the rule. πŸ’€

Invalid transitions get caught by xe_assert. So if you try something spicy and wrong, the assert will absolutely call you out in front of everyone. πŸ™ˆ

Oh and β€” shrinker page accounting is updated automatically. You don't gotta do a thing, it just handles itself. iconic behavior tbh. 🌈

⚠️ lowkey important: PURGED is a one-way trip. don't go planning any transitions after that, because the assert said no. πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

like a whole group chat of related functions, and you should absolutely go say hi to all of them β€” plus the kernel file itself, ./drivers/gpu/drm/xe/xe_bo.c:

xe_bo_has_single_placement(9), xe_bo_is_stolen_devmem(9), xe_bo_is_vm_bound(9), xe_bo_pin_account(9), xe_bo_unpin_account(9), xe_bo_is_visible_vram(9), xe_bo_move_notify(9), xe_bo_set_purgeable_shrinker(9), xe_ttm_bo_purge(9), xe_bo_shrink(9), xe_bo_notifier_prepare_pinned(9), xe_bo_notifier_unprepare_pinned(9), xe_bo_evict_pinned(9), xe_bo_restore_pinned(9), xe_bo_read(9), xe_bo_alloc(9), xe_bo_free(9), xe_bo_init_locked(9), xe_bo_create_locked(9), xe_bo_create_user(9), xe_bo_create_pin_range_novm(9), xe_bo_create_pin_map_at_novm(9), xe_bo_create_pin_map(9), xe_bo_create_pin_map_novm(9), xe_managed_bo_reinit_in_vram(9), xe_bo_pin_external(9), xe_bo_pin(9), xe_bo_unpin_external(9), xe_bo_validate(9), xe_bo_decompress(9), xe_bo_lock(9), xe_bo_unlock(9), xe_bo_can_migrate(9), xe_bo_migrate(9), xe_bo_evict(9), xe_bo_needs_ccs_pages(9), __xe_bo_release_dummy(9), xe_bo_put_commit(9), xe_bo_dev_init(9), xe_bo_dev_fini(9), xe_bo_dumb_create(9)


that's the whole page, bestie, you ate that πŸ“βœ¨ and just so we're keeping it a hundred β€” this came from ./drivers/gpu/drm/xe, dated October 2026, and the page itself is xe_bo_set_purgeable_state(9). mwah πŸ’‹πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from