kq_acquire_packet_buffer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

kq_acquire_packet_buffer(9) πŸŽ€

okay bestie, this is the kq_acquire_packet_buffer(9) page from the Kernel API Manual, and it's giving kernel-queue ring-buffer realness. let's get into it πŸ’…


✨ NAME ✨

kq_acquire_packet_buffer β€” returns a pointer to the location in the kernel queue ring buffer where the calling function can write its packet. It is Guaranteed that there is enough space for that packet. It also updates the pending write pointer to that location so subsequent calls to acquire_packet_buffer will get a correct write pointer. periodt ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

int kq_acquire_packet_buffer (struct kernel_queue *kq , size_t
packet_size_in_dwords , unsigned int **buffer_ptr );

that's the whole signature, no cap 🫢


πŸ’œ ARGUMENTS πŸ’œ

  • kq β€” -- undescribed --
  • packet_size_in_dwords β€” -- undescribed --
  • buffer_ptr β€” -- undescribed --
the original page literally leaves all three as -- undescribed --, so I'm not gonna invent lore for them. iykyk πŸ™ˆ

🌸 DESCRIPTION 🌸

the DESCRIPTION section also name-drops these two routines, so here's the tea:

  • kq_submit_packet β€” update the write pointer and doorbell of a kernel queue.
  • kq_rollback_packet β€” this routine is called if we failed to build an acquired packet for some reason. it just overwrites the pending wptr with the current one.

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.h

mwah πŸ’‹ β€” this cutie came from ./drivers/gpu/drm/amd/amdkfd, dated October 2026, and the page is kq_acquire_packet_buffer(9). bye bestie πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from