STRUCT BINDER_NODE(9)
π
struct binder_node(9) π
okay bestie, welcome to the Kernel API Manual glow-up of struct binder_node(9). This is the binder node bookkeeping page, and yes, it's giving kernel-internal main character energy. Let's get into it π«Ά
β¨ NAME β¨
struct binder_node β binder node bookkeeping, but make it make sense.
π» SYNOPSIS π»
struct binder_node {
int debug_id;
spinlock_t lock;
struct binder_work work;
union {
struct rb_node rb_node;
struct hlist_node dead_node;
};
struct binder_proc *proc;
struct hlist_head refs;
int internal_strong_refs;
int local_weak_refs;
int local_strong_refs;
int tmp_refs;
binder_uintptr_t ptr;
binder_uintptr_t cookie;
struct {
u8 has_strong_ref:1;
u8 pending_strong_ref:1;
u8 has_weak_ref:1;
u8 pending_weak_ref:1;
};
struct {
u8 accept_fds:1;
u8 txn_security_ctx:1;
u8 min_priority;
};
bool has_async_transaction;
struct list_head async_todo;
};
π«Ά Members π«Ά
debug_idβ the unique ID for debugging, and it's invariant after initialized. No cap, it just sits there being itself.lockβ the lock for node fields. Protect the vibes πworkβ worklist element for node work, and it's protected byproc->inner_lock.{unnamed_union}β anonymous. Literally just a union doing union things.rb_nodeβ element for theproc->nodestree, protected byproc->inner_lock.dead_nodeβ element for thebinder_dead_nodeslist, protected bybinder_dead_nodes_lock.procβ thebinder_procthat owns this node, and it's invariant after initialized.refsβ list of references on this node, protected bylock.internal_strong_refsβ used to take strong references when initiating a transaction. Protected byproc->inner_lockifprocand bylock.local_weak_refsβ weak user refs from the local process. Protected byproc->inner_lockifprocand bylock.local_strong_refsβ strong user refs from the local process. Protected byproc->inner_lockifprocand bylock.tmp_refsβ temporary kernel refs. Locking lore: protected byproc->inner_lockwhileprocis valid, and bybinder_dead_nodes_lockifprocisNULL. During inc/dec and node release it is also protected bylockto provide safety as the node dies andprocbecomesNULL. That's a lot of lock energy, bestie.ptrβ userspace pointer for the node. It's invariant, no lock needed.cookieβ userspace cookie for the node. Also invariant, no lock needed πͺ{unnamed_struct}β anonymous. Another little struct just existing.has_strong_refβ userspace notified of strong ref. Protected byproc->inner_lockifprocand bylock.pending_strong_refβ userspace has acked notification of strong ref. Protected byproc->inner_lockifprocand bylock.has_weak_refβ userspace notified of weak ref. Protected byproc->inner_lockifprocand bylock.pending_weak_refβ userspace has acked notification of weak ref. Protected byproc->inner_lockifprocand bylock.{unnamed_struct}β anonymous. Yes, another one. We love a mysterious bitfield moment.accept_fdsβ file descriptor operations supported for the node, and it's invariant after initialized.txn_security_ctxβ require sender's security context, also invariant after initialized.min_priorityβ minimum scheduling priority, invariant after initialized too.has_async_transactionβ async transaction to the node in progress, protected bylock.async_todoβ list of async work items, protected byproc->inner_lock.
πΈ Description πΈ
Bookkeeping structure for binder nodes. That's the whole plot. It's literally the bookkeeping structure for binder nodes, and it's iconic in a deeply kernel-internal way. Periodt π
π₯ SEE ALSO π₯
Kernel file ./drivers/android/binder_internal.h
struct binder_device(9)struct binder_work(9)struct binder_ref_data(9)struct binder_ref(9)struct binder_proc(9)struct binder_thread(9)struct binder_txn_fd_fixup(9)struct binder_object(9)
okay that's the page! sourced from ./drivers/android, dated October 2026, and it's literally struct binder_node(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