mm/mm_slot.h
Source file repositories/reference/linux-study-clean/mm/mm_slot.h
File Facts
- System
- Linux kernel
- Corpus path
mm/mm_slot.h- Extension
.h- Size
- 1383 bytes
- Lines
- 56
- Domain
- Core OS
- Bucket
- Memory Management
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hashtable.hlinux/slab.h
Detected Declarations
struct mm_slotfunction mm_slot_free
Annotated Snippet
struct mm_slot {
struct hlist_node hash;
struct list_head mm_node;
struct mm_struct *mm;
};
#define mm_slot_entry(ptr, type, member) \
container_of(ptr, type, member)
static inline void *mm_slot_alloc(struct kmem_cache *cache)
{
if (!cache) /* initialization failed */
return NULL;
return kmem_cache_zalloc(cache, GFP_KERNEL);
}
static inline void mm_slot_free(struct kmem_cache *cache, void *objp)
{
kmem_cache_free(cache, objp);
}
#define mm_slot_lookup(_hashtable, _mm) \
({ \
struct mm_slot *tmp_slot, *mm_slot = NULL; \
\
hash_for_each_possible(_hashtable, tmp_slot, hash, (unsigned long)_mm) \
if (_mm == tmp_slot->mm) { \
mm_slot = tmp_slot; \
break; \
} \
\
mm_slot; \
})
#define mm_slot_insert(_hashtable, _mm, _mm_slot) \
({ \
_mm_slot->mm = _mm; \
hash_add(_hashtable, &_mm_slot->hash, (unsigned long)_mm); \
})
#endif /* _LINUX_MM_SLOT_H */
Annotation
- Immediate include surface: `linux/hashtable.h`, `linux/slab.h`.
- Detected declarations: `struct mm_slot`, `function mm_slot_free`.
- Atlas domain: Core OS / Memory Management.
- Implementation status: source implementation candidate.
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.