STRUCT BINDER_PROC(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– NAME ๐Ÿ’–

struct binder_proc โ€” binder process bookkeeping ๐Ÿ’–

Hey bestie, welcome to the struct binder_proc(9) page from the Kernel API Manual โœจ This is the bookkeeping struct for binder processes, and it's honestly giving the main-character planner of the whole operation ๐Ÿ“’๐Ÿ’…


โœจ SYNOPSIS โœจ

Here's the exact struct, bestie โ€” every field in its assigned little seat ๐Ÿช‘โœจ:

struct binder_proc {
    struct hlist_node proc_node;
    struct rb_root threads;
    struct rb_root nodes;
    struct rb_root refs_by_desc;
    struct rb_root refs_by_node;
    struct list_head waiting_threads;
    int pid;
    struct task_struct *tsk;
    const struct cred *cred;
    struct hlist_node deferred_work_node;
    int deferred_work;
    int outstanding_txns;
    bool is_dead;
    bool is_frozen;
    bool sync_recv;
    bool async_recv;
    wait_queue_head_t freeze_wait;
    struct dbitmap dmap;
    struct list_head todo;
    struct binder_stats stats;
    struct list_head delivered_death;
    struct list_head delivered_freeze;
    u32 max_threads;
    int requested_threads;
    int requested_threads_started;
    int tmp_ref;
    long default_priority;
    struct dentry *debugfs_entry;
    struct binder_alloc alloc;
    struct binder_context *context;
    spinlock_t inner_lock;
    spinlock_t outer_lock;
    struct dentry *binderfs_entry;
    bool oneway_spam_detection_enabled;
};

๐Ÿงš Members ๐Ÿงš

Okay, member-by-member tea time โ˜• โ€” all the lock notes are staying, no cap:

  • proc_node โ€” the element for the binder_procs list ๐Ÿ”—
  • threads โ€” an rbtree of binder_threads in this proc (protected by inner_lock) ๐ŸŒณ
  • nodes โ€” an rbtree of binder nodes associated with this proc, ordered by node->ptr (protected by inner_lock) ๐Ÿงญ
  • refs_by_desc โ€” an rbtree of refs ordered by ref->desc (protected by outer_lock) ๐Ÿ“‡
  • refs_by_node โ€” an rbtree of refs ordered by ref->node (protected by outer_lock) ๐Ÿ—‚๏ธ
  • waiting_threads โ€” threads currently waiting for proc work (protected by inner_lock) โณ
  • pid โ€” PID of group_leader of process (invariant after initialized) ๐Ÿ†”
  • tsk โ€” task_struct for group_leader of process (invariant after initialized) ๐Ÿงต
  • cred โ€” struct cred associated with the struct file in binder_open (invariant after initialized) ๐Ÿชช
  • deferred_work_node โ€” element for binder_deferred_list (protected by binder_deferred_lock) ๐Ÿ“‹
  • deferred_work โ€” bitmap of deferred work to perform (protected by binder_deferred_lock) ๐Ÿ—’๏ธ
  • outstanding_txns โ€” number of transactions to be transmitted before processes in freeze_wait are woken up (protected by inner_lock) ๐Ÿ”
  • is_dead โ€” process is dead and awaiting free when outstanding transactions are cleaned up (protected by inner_lock) ๐Ÿ’€
  • is_frozen โ€” process is frozen and unable to service binder transactions (protected by inner_lock) ๐ŸงŠ
  • sync_recv โ€” process received sync transactions since last frozen; bit 0: received sync transaction after being frozen; bit 1: new pending sync transaction during freezing (protected by inner_lock) ๐Ÿ“ฅ
  • async_recv โ€” process received async transactions since last frozen (protected by inner_lock) ๐Ÿ“จ
  • freeze_wait โ€” waitqueue of processes waiting for all outstanding transactions to be processed (protected by inner_lock) ๐Ÿ•ฐ๏ธ
  • dmap โ€” dbitmap to manage available reference descriptors (protected by outer_lock) ๐Ÿ—บ๏ธ
  • todo โ€” list of work for this process (protected by inner_lock) โœ…
  • stats โ€” per-process binder statistics (atomics, no lock needed) ๐Ÿ“Š
  • delivered_death โ€” list of delivered death notification (protected by inner_lock) ๐Ÿชฆ
  • delivered_freeze โ€” list of delivered freeze notification (protected by inner_lock) โ„๏ธ
  • max_threads โ€” cap on number of binder threads (protected by inner_lock) ๐Ÿšฆ
  • requested_threads โ€” number of binder threads requested but not yet started; in current implementation, can only be 0 or 1 (protected by inner_lock) ๐Ÿ™‹โ€โ™€๏ธ
  • requested_threads_started โ€” number binder threads started (protected by inner_lock) ๐Ÿ
  • tmp_ref โ€” temporary reference to indicate proc is in use (protected by inner_lock) ๐Ÿ“Œ
  • default_priority โ€” default scheduler priority (invariant after initialized) ๐ŸŽš๏ธ
  • debugfs_entry โ€” debugfs node ๐Ÿž
  • alloc โ€” binder allocator bookkeeping ๐Ÿงฎ
  • context โ€” binder_context for this proc (invariant after initialized) ๐Ÿง 
  • inner_lock โ€” can nest under outer_lock and/or node lock ๐Ÿ”’
  • outer_lock โ€” no nesting under innor or node lock; Lock order: 1) outer, 2) node, 3) inner ๐Ÿšจ
  • binderfs_entry โ€” process-specific binderfs log file ๐Ÿ“
  • oneway_spam_detection_enabled โ€” process enabled oneway spam detection or not ๐Ÿšซ

๐Ÿ’ซ Description ๐Ÿ’ซ

Bookkeeping structure for binder processes โ€” literally that, bestie. It's the planner, the ledger, the whole binder-process vibe in one struct ๐Ÿ“š๐Ÿ’…


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

Kernel file ./drivers/android/binder_internal.h โ€” plus the whole squad of structs:

  • struct binder_device(9)
  • struct binder_work(9)
  • struct binder_node(9)
  • struct binder_ref_data(9)
  • struct binder_ref(9)
  • struct binder_thread(9)
  • struct binder_txn_fd_fixup(9)
  • struct binder_object(9)

That's the page, bestie ๐Ÿ’– Source/version: ./drivers/android ยท date: October 2026 ยท page: struct binder_proc(9) โ€” slay and goodbye ๐ŸŽ€๐Ÿ’…

๐Ÿ“ฆ where this page comes from