STRUCT QUEUE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct queue(9) πŸŽ€

bestie we are in the Kernel API Manual right now and this is the whole glow-up of struct queue


✨ NAME ✨

struct queue β€” that's it, that's the name, she's just a struct and she's iconic for it πŸ’…


✨ SYNOPSIS ✨

struct queue {
    struct list_head list;
    void *mqd;
    struct kfd_mem_obj *mqd_mem_obj;
    uint64_t gart_mqd_addr;
    struct queue_properties properties;
    uint32_t mec;
    uint32_t pipe;
    uint32_t queue;
    unsigned int sdma_id;
    unsigned int doorbell_id;
    struct kfd_process      *process;
    struct kfd_node         *device;
    void *gws;
    struct kobject kobj;
    void *gang_ctx_bo;
    uint64_t gang_ctx_gpu_addr;
    void *gang_ctx_cpu_ptr;
    uint32_t gang_ctx_array_index;
    struct amdgpu_bo *wptr_bo_gart;
    bool needs_mqd_repin;
 };

like… look at her. twenty fields. main character energy fr fr πŸ‘‘


🌸 Members 🌸

okay so now we go field by field, no skipping, no cap:

  • list β€” the queue linked list. that's the lil thread that keeps everybody connected 🧡
  • mqd β€” the queue MQD (memory queue descriptor). yes the acronym is in the description, memorise it 🫢
  • mqd_mem_obj β€” the MQD local gpu memory object.
  • gart_mqd_addr β€” the MQD gart mc address.
  • properties β€” the queue properties. it's giving "everything you need to know about this queue" ✨
  • mec β€” used only in no cp scheduling mode, and it identifies the micro engine id that the queue should be executed on.
  • pipe β€” used only in no cp scheduling mode, and it identifies the queue's pipe id.
  • queue β€” used only in no cp scheduling mode, and it identifies the queue's slot. (also the struct is named queue and this member is named queue, and honestly? chaotic. love her πŸ’€)
  • process β€” the kfd process that created this queue. her parent, essentially πŸ’–
  • device β€” the kfd device that created this queue. the other parent πŸ–₯️
  • gws β€” pointing to gws kgd_mem if this is a gws control queue; NULL otherwise.
⚠️ real talk bestie: the synopsis lists more fields than the Members section actually describes β€” sdma_id, doorbell_id, kobj, gang_ctx_bo, gang_ctx_gpu_addr, gang_ctx_cpu_ptr, gang_ctx_array_index, wptr_bo_gart and needs_mqd_repin are all up there in the struct but the manpage doesn't hand out descriptions for them. don't invent lore, just know they're there 🌈

πŸ¦‹ Description πŸ¦‹

so this structure represents user mode compute queues and it contains all the necessary data to handle such queues. that's the whole vibe check: everything a compute queue needs to exist and be handled, all in one struct. slay πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, iykyk:

  • Kernel file ./drivers/gpu/drm/amd/amdkfd/kfd_priv.h enum
  • kfd_ioctl_flags(9)
  • enum kfd_unmap_queues_filter(9)
  • enum kfd_queue_type(9)
  • struct queue_properties(9)
  • amdkfd_ioctl_t(9)
  • enum kfd_config_dequeue_wait_counts_cmd(9)

and that's the page bestie πŸŽ€ ok so the sign-off: this came out of ./drivers/gpu/drm/amd/amdkfd and it's dated October 2026 β€” so yeah, from the future, obviously πŸ’œβœ¨ go touch some queues πŸ¦‹

πŸ“¦ where this page comes from