include/linux/futex_types.h
Source file repositories/reference/linux-study-clean/include/linux/futex_types.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/futex_types.h- Extension
.h- Size
- 3104 bytes
- Lines
- 99
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler_types.hlinux/mutex_types.hlinux/types.h
Detected Declarations
struct compat_robust_list_headstruct futex_pi_statestruct robust_list_headstruct futex_sched_datastruct futex_mm_phashstruct futex_mm_phashstruct futex_unlock_cs_rangestruct futex_unlock_cs_rangesstruct futex_unlock_cs_rangesstruct futex_mm_datastruct futex_sched_datastruct futex_mm_data
Annotated Snippet
struct futex_sched_data {
struct robust_list_head __user *robust_list;
#ifdef CONFIG_COMPAT
struct compat_robust_list_head __user *compat_robust_list;
#endif
struct list_head pi_state_list;
struct futex_pi_state *pi_state_cache;
struct mutex exit_mutex;
unsigned int state;
};
#ifdef CONFIG_FUTEX_PRIVATE_HASH
/**
* struct futex_mm_phash - Futex private hash related per MM data
* @lock: Mutex to protect the private hash operations
* @hash: RCU managed pointer to the private hash
* @hash_new: Pointer to a newly allocated private hash
* @batches: Batch state for RCU synchronization
* @rcu: RCU head for call_rcu()
* @atomic: Aggregate value for @hash_ref
* @ref: Per CPU reference counter for a private hash
*/
struct futex_mm_phash {
struct mutex lock;
struct futex_private_hash __rcu *hash;
struct futex_private_hash *hash_new;
unsigned long batches;
struct rcu_head rcu;
atomic_long_t atomic;
unsigned int __percpu *ref;
};
#else /* CONFIG_FUTEX_ROBUST_UNLOCK */
struct futex_mm_phash { };
#endif /* !CONFIG_FUTEX_ROBUST_UNLOCK */
#ifdef CONFIG_FUTEX_ROBUST_UNLOCK
/**
* struct futex_unlock_cs_range - Range for the VDSO unlock critical section
* @start_ip: The start IP of the robust futex unlock critical section (inclusive)
* @len: The length of the robust futex unlock critical section
* @pop_size32: Pending OP pointer size indicator. 0 == 64-bit, 1 == 32-bit
*/
struct futex_unlock_cs_range {
unsigned long start_ip;
unsigned int len;
unsigned int pop_size32;
};
#define FUTEX_ROBUST_MAX_CS_RANGES (1 + IS_ENABLED(CONFIG_COMPAT))
/**
* struct futex_unlock_cs_ranges - Futex unlock VSDO critical sections
* @cs_ranges: Array of critical section ranges
*/
struct futex_unlock_cs_ranges {
struct futex_unlock_cs_range cs_ranges[FUTEX_ROBUST_MAX_CS_RANGES];
};
#else /* CONFIG_FUTEX_ROBUST_UNLOCK */
struct futex_unlock_cs_ranges { };
#endif /* !CONFIG_FUTEX_ROBUST_UNLOCK */
/**
* struct futex_mm_data - Futex related per MM data
* @phash: Futex private hash related data
* @unlock: Futex unlock VDSO critical sections
*/
struct futex_mm_data {
struct futex_mm_phash phash;
struct futex_unlock_cs_ranges unlock;
};
#else /* CONFIG_FUTEX */
struct futex_sched_data { };
struct futex_mm_data { };
#endif /* !CONFIG_FUTEX */
#endif /* _LINUX_FUTEX_TYPES_H */
Annotation
- Immediate include surface: `linux/compiler_types.h`, `linux/mutex_types.h`, `linux/types.h`.
- Detected declarations: `struct compat_robust_list_head`, `struct futex_pi_state`, `struct robust_list_head`, `struct futex_sched_data`, `struct futex_mm_phash`, `struct futex_mm_phash`, `struct futex_unlock_cs_range`, `struct futex_unlock_cs_ranges`, `struct futex_unlock_cs_ranges`, `struct futex_mm_data`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.