relay_subbufs_consumed(9)
π relay_subbufs_consumed β bestie's guide to the kernel API manual β¨
okay so like, the manual name is relay_subbufs_consumed(9) and honestly? it's giving "one tiny function that keeps the books balanced" and I'm obsessed. let's get into it π
πΈ NAME πΈ
relay_subbufs_consumed β update the buffer's sub-buffers-consumed count π«
like, that's literally it. it bumps a counter. main character energy for a counter, but still. π«Ά
β¨ SYNOPSIS β¨
void relay_subbufs_consumed (struct rchan *chan , unsigned int cpu ,
size_t subbufs_consumed );
no return value, so don't go looking for one, bestie β it's void, it says what it means π
π¦ ARGUMENTS π¦
chanβ the channel π like, the whole relay channel you're working with, that's the vibecpuβ the cpu associated with the channel buffer to update π because every cpu gets its own little buffer situation, iykyksubbufs_consumedβ number of sub-buffers to add to current buf's count β this is the delta, not the total, and that distinction is gonna matter in like two seconds, hold that thought
π§ DESCRIPTION π§
so what does it actually do? it adds to the channel buffer's consumed sub-buffer count. that's the whole bit. β¨
and here's the part where I need you to lock in π₯: subbufs_consumed should be the number of sub-buffers newly consumed, not the total consumed. so if you hand it the running total, you're gonna double-count and the numbers will be a whole mess π don't do that to yourself.
NOTE. Kernel clients don't need to call this function if the channel mode is'overwrite'. π for real, if you're in'overwrite'mode, just... don't. you're free. go live your life π¦
π SEE ALSO π
all the sibling functions, the whole relay.c friend group, no cap π
Kernel file ./kernel/relay.c:
relay_mmap_prepare_buf(9)relay_alloc_buf(9)relay_create_buf(9)relay_destroy_channel(9)relay_destroy_buf(9)relay_remove_buf(9)relay_buf_empty(9)relay_buf_full(9)wakeup_readers(9)__relay_reset(9)relay_reset(9)relay_close_buf(9)relay_open(9)relay_switch_subbuf(9)relay_close(9)relay_flush(9)relay_stats(9)relay_file_open(9)relay_file_mmap_prepare(9)relay_file_poll(9)relay_file_release(9)relay_file_read_subbuf_avail(9)relay_file_read_start_pos(9)relay_file_read_end_pos(9)
and that's the whole page, bestie π this one lives in ./kernel, dated October 2026, and it's the relay_subbufs_consumed(9) page from the Kernel API Manual. go forth and count your sub-buffers correctly, ily ππ
π₯
π¦ 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