STRUCT DRM_MODESET_ACQUIRE_CTX(9)
π struct drm_modeset_acquire_ctx(9) π
okay so bestie, welcome to the Kernel API Manual β yes we're in the kernel manual, yes it's giving big-brain energy, and yes this page is literally about a struct. Stay with me, it's actually cute π¦
β¨ NAME β¨
struct drm_modeset_acquire_ctx β the locking context (see ww_acquire_ctx) π
πΈ SYNOPSIS πΈ
struct drm_modeset_acquire_ctx {
struct ww_acquire_ctx ww_ctx;
struct drm_modeset_lock *contended;
depot_stack_handle_t stack_depot;
struct list_head locked;
bool trylock_only;
bool interruptible;
};
π§ MEMBERS π§
ww_ctxβ the base acquire ctx, the main character of the whole struct ngl πcontendedβ used internally for-EDEADLKhandling, like the little drama manager behind the scenes πstack_depotβ used internally for contention debugging, so when things get messy there's receipts π«Άlockedβ alist_headof the held locks, i.e. the guest list of everything currently locked in πβ¨trylock_onlyβ trylock mode, used in atomic contexts and panic notifiers, so basically the "no waiting around, we're in a crisis" mode ππ₯interruptibleβ whether interruptible locking should be used, like, can we bail or not π
π DESCRIPTION π
So here's the vibe: every thread that's competing for a set of locks has to use one acquire ctx. One. Per thread. No sharing, no cap. π
And if any lock fxn returns -EDEADLK, it must back off and retry β like babe, don't fight the deadlock, just step back and try again πβ¨
lowkey important: this isn't optional behaviour, it's the rule fr fr π«‘
β SEE ALSO β
Kernel file ./include/drm/drm_modeset_lock.h struct drm_modeset_lock(9), drm_modeset_lock_fini(9), drm_modeset_is_locked(9), drm_modeset_lock_assert_held(9), DRM_MODESET_LOCK_ALL_BEGIN(9), DRM_MODESET_LOCK_ALL_END(9) β go read those too, iykyk π
and that's the whole page bestie π sourced straight from ./include/drm, dated October 2026, and yes we slayed the entire acquire ctx ππ
periodt πβ
π¦ 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