oa_buffer_check_unlocked(9)
π
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 π
- Kernel file
./drivers/gpu/drm/i915/i915_perf.c i915 Perf Overview(9)i915 Perf History and Comparison with Core Perf(9)OA Tail Pointer Race(9)struct perf_open_properties(9)append_oa_status(9)append_oa_sample(9)gen8_append_oa_reports(9)gen8_oa_read(9)gen7_append_oa_reports(9)gen7_oa_read(9)i915_oa_wait_unlocked(9)i915_oa_poll_wait(9)i915_oa_read(9)oa_get_render_ctx_id(9)oa_put_render_ctx_id(9)i915_oa_stream_enable(9)i915_oa_stream_disable(9)i915_oa_stream_init(9)i915_perf_read(9)i915_perf_poll_locked(9)i915_perf_poll(9)i915_perf_enable_locked(9)i915_perf_disable_locked(9)i915_perf_ioctl_locked(9)i915_perf_ioctl(9)i915_perf_destroy_locked(9)i915_perf_release(9)i915_perf_open_ioctl_locked(9)read_properties_unlocked(9)i915_perf_open_ioctl(9)i915_perf_register(9)i915_perf_unregister(9)i915_perf_add_config_ioctl(9)i915_perf_remove_config_ioctl(9)i915_perf_init(9)i915_perf_fini(9)i915_perf_ioctl_version(9)
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
- 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