STRUCT CALLBACK_HEAD(9)
π struct callback_head(9) β Kernel API Manual π
okay so bestie, this is the callback struct page and it's lowkey iconic for RCU girlies and task_work besties. let's get into it. β¨
πΈ NAME πΈ
struct callback_head β callback structure for use with RCU and task_work
β¨ SYNOPSIS β¨
struct callback_head {
struct callback_head *next;
void (*func)(struct callback_head *head);
};
π«Ά Members π«Ά
nextβ next update requests in a listfuncβ actual update function to call after the grace period.
π¦ Description π¦
Okay so the struct is aligned to size of pointer. On most architectures it happens naturally due ABI requirements, but some architectures (like CRIS) have weird ABI and we need to ask it explicitly. π
The alignment is required to guarantee that bit 0 of next will be clear under normal conditions -- as long as we use call_rcu or call_srcu to queue the callback. π₯
This guarantee is important for few reasons:
- future
call_rcu_lazywill make use of lower bits in the pointer; - the structure shares storage space in
struct pagewithcompound_info, which encodePageTailin bit 0. The guarantee is needed to avoid false-positivePageTail.
that's the tea, no cap. π
π SEE ALSO π
Kernel file ./include/linux/types.h β go peek, iykyk. π«Ά
π that's the whole page, bestie. source: ./include/linux Β· date: October 2026 Β· manual: struct callback_head(9). mwah π
π¦ 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