drivers/md/dm-cache-policy-smq.c
Source file repositories/reference/linux-study-clean/drivers/md/dm-cache-policy-smq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-cache-policy-smq.c- Extension
.c- Size
- 46128 bytes
- Lines
- 1975
- Domain
- Driver Families
- Bucket
- drivers/md
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dm-cache-background-tracker.hdm-cache-policy-internal.hdm-cache-policy.hdm.hlinux/hash.hlinux/jiffies.hlinux/module.hlinux/mutex.hlinux/vmalloc.hlinux/math64.h
Detected Declarations
struct entrystruct entry_spacestruct iliststruct queuestruct statsstruct smq_hash_tablestruct entry_allocstruct smq_policyenum performanceenum promote_resultfunction safe_divfunction safe_modfunction space_initfunction space_exitfunction to_indexfunction l_initfunction l_emptyfunction l_add_headfunction l_add_tailfunction l_add_beforefunction l_delfunction q_initfunction q_sizefunction q_pushfunction q_push_frontfunction q_push_beforefunction q_delfunction q_set_targets_subrange_function q_set_targetsfunction q_redistributefunction q_requeuefunction stats_initfunction stats_resetfunction stats_level_accessedfunction stats_missfunction stats_assessfunction h_initfunction h_exitfunction __h_insertfunction h_insertfunction __h_unlinkfunction h_removefunction init_allocatorfunction init_entryfunction free_entryfunction allocator_emptyfunction get_indexfunction __update_writeback_sentinels
Annotated Snippet
module_init(smq_init);
module_exit(smq_exit);
MODULE_AUTHOR("Joe Thornber <dm-devel@lists.linux.dev>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("smq cache policy");
MODULE_ALIAS("dm-cache-default");
MODULE_ALIAS("dm-cache-mq");
MODULE_ALIAS("dm-cache-cleaner");
Annotation
- Immediate include surface: `dm-cache-background-tracker.h`, `dm-cache-policy-internal.h`, `dm-cache-policy.h`, `dm.h`, `linux/hash.h`, `linux/jiffies.h`, `linux/module.h`, `linux/mutex.h`.
- Detected declarations: `struct entry`, `struct entry_space`, `struct ilist`, `struct queue`, `struct stats`, `struct smq_hash_table`, `struct entry_alloc`, `struct smq_policy`, `enum performance`, `enum promote_result`.
- Atlas domain: Driver Families / drivers/md.
- Implementation status: integration 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.