Skip to main content

SCHED_IDENTITY

Static SCHED_IDENTITY 

Source
pub(crate) static SCHED_IDENTITY: RwLock<SchedIdentity>
Expand description

Identity maps : cold path: PID/TID lookups, process groups, sessions, parent/child.

Separate from GLOBAL_SCHED_STATE so that identity lookups (getpid, getpgid, setpgid, etc.) never contend with fork/exit/zombie management.

Upgraded to an RwLock so that concurrent readers (getpid, gettid, getppid, getpgid, getsid, get_task_by_pid) do not serialize on each other. Only writers (fork, exit, setpgid, setsid, kill) acquire the exclusive write lock.

Lock order: SCHED_IDENTITY before LOCAL (never the reverse). SCHED_IDENTITY and BLOCKED_TASKS are independent : never hold both.