include/linux/rwbase_rt.h
Source file repositories/reference/linux-study-clean/include/linux/rwbase_rt.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/rwbase_rt.h- Extension
.h- Size
- 1025 bytes
- Lines
- 45
- 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/rtmutex.hlinux/atomic.h
Detected Declarations
struct rwbase_rtfunction rw_base_is_lockedfunction rw_base_is_write_lockedfunction rw_base_is_contended
Annotated Snippet
struct rwbase_rt {
atomic_t readers;
struct rt_mutex_base rtmutex;
};
#define __RWBASE_INITIALIZER(name) \
{ \
.readers = ATOMIC_INIT(READER_BIAS), \
.rtmutex = __RT_MUTEX_BASE_INITIALIZER(name.rtmutex), \
}
#define init_rwbase_rt(rwbase) \
do { \
rt_mutex_base_init(&(rwbase)->rtmutex); \
atomic_set(&(rwbase)->readers, READER_BIAS); \
} while (0)
static __always_inline bool rw_base_is_locked(const struct rwbase_rt *rwb)
{
return atomic_read(&rwb->readers) != READER_BIAS;
}
static __always_inline bool rw_base_is_write_locked(const struct rwbase_rt *rwb)
{
return atomic_read(&rwb->readers) == WRITER_BIAS;
}
static __always_inline bool rw_base_is_contended(const struct rwbase_rt *rwb)
{
return atomic_read(&rwb->readers) > 0;
}
#endif /* _LINUX_RWBASE_RT_H */
Annotation
- Immediate include surface: `linux/rtmutex.h`, `linux/atomic.h`.
- Detected declarations: `struct rwbase_rt`, `function rw_base_is_locked`, `function rw_base_is_write_locked`, `function rw_base_is_contended`.
- 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.