oa_buffer_check_unlocked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… oa_buffer_check_unlocked(9) β€” like, the whole vibe

okay so bestie, welcome to the Kernel API Manual ✨ this one's a little function from the i915 perf crew and honestly? she's doing a LOT of behind-the-scenes work. let's get into it 🫢


✨ NAME ✨

oa_buffer_check_unlocked β€” check for data and update tail ptr state

πŸ¦‹ SYNOPSIS πŸ¦‹

bool oa_buffer_check_unlocked (struct i915_perf_stream *stream );

πŸŽ€ ARGUMENTS πŸŽ€

  • stream β€” the i915 stream instance. that's her. that's the one. πŸ’–

🌸 DESCRIPTION 🌸

so this function gets called from, like, two totally different places: either via fops (for blocking reads in user ctx) or from the poll check hrtimer (atomic ctx). the whole point is checking the OA buffer tail pointer and seeing if there's data available for userspace to read πŸ‘€

no cap, this function is central to providing a workaround for the OA unit tail pointer having a race with respect to what data is visible to the CPU. like, it's literally the main character of that whole situation. she's responsible for reading tail pointers from the hardware and giving the pointers time to 'age' before they're made available for reading. (see the description of OA_TAIL_MARGIN_NSEC above for further details, iykyk ✨)

besides returning true when there's data available to read, this function also updates the tail in the oa_buffer object. multitasking queen πŸ’…

πŸ”₯ NOTE πŸ”₯

it's safe to read OA config state here unlocked, assuming that this is only called while the stream is enabled, while the global OA configuration can't be modified. so like, that's the deal, don't come for her 🫢

⭐ RETURN ⭐

true if the OA buffer contains data, else false

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie, go off πŸ’œ this one came from ./drivers/gpu/drm/i915 and it's dated October 2026 β€” periodt, that's a wrap, slay 🧚🌈

πŸ“¦ where this page comes from