drivers/gpu/buddy.c
Source file repositories/reference/linux-study-clean/drivers/gpu/buddy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/buddy.c- Extension
.c- Size
- 36561 bytes
- Lines
- 1537
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- 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
linux/bug.hlinux/export.hlinux/kmemleak.hlinux/module.hlinux/sizes.hlinux/gpu_buddy.hkunit/test-bug.h
Detected Declarations
function gpu_buddy_block_statefunction gpu_buddy_block_is_allocatedfunction gpu_buddy_block_is_splitfunction gpu_buddy_block_offset_alignmentfunction gpu_block_freefunction get_block_treefunction rbtree_get_free_blockfunction rbtree_last_free_blockfunction rbtree_is_emptyfunction rbtree_insertfunction rbtree_removefunction clear_resetfunction mark_clearedfunction mark_allocatedfunction mark_freefunction mark_splitfunction overlapsfunction containsfunction __get_buddyfunction __gpu_buddy_freefunction __force_mergefunction for_each_free_treefunction gpu_buddy_initfunction for_each_free_treefunction gpu_buddy_finifunction split_blockfunction gpu_buddy_reset_clearfunction rbtree_postorder_for_each_entry_safefunction gpu_buddy_free_blockfunction __gpu_buddy_free_listfunction list_for_each_entry_safefunction gpu_buddy_free_list_internalfunction gpu_buddy_free_listfunction block_incompatiblefunction __alloc_range_biasfunction __gpu_buddy_alloc_range_biasfunction get_maxblockfunction alloc_from_freetreefunction gpu_buddy_can_offset_alignfunction gpu_buddy_subtree_can_satisfyfunction gpu_buddy_find_block_alignedfunction gpu_buddy_offset_aligned_allocationfunction __alloc_rangefunction __gpu_buddy_alloc_rangefunction __alloc_contig_try_harderfunction for_each_free_treefunction gpu_buddy_block_trimfunction __gpu_buddy_alloc_blocks
Annotated Snippet
module_init(gpu_buddy_module_init);
module_exit(gpu_buddy_module_exit);
MODULE_DESCRIPTION("GPU Buddy Allocator");
MODULE_LICENSE("Dual MIT/GPL");
Annotation
- Immediate include surface: `linux/bug.h`, `linux/export.h`, `linux/kmemleak.h`, `linux/module.h`, `linux/sizes.h`, `linux/gpu_buddy.h`, `kunit/test-bug.h`.
- Detected declarations: `function gpu_buddy_block_state`, `function gpu_buddy_block_is_allocated`, `function gpu_buddy_block_is_split`, `function gpu_buddy_block_offset_alignment`, `function gpu_block_free`, `function get_block_tree`, `function rbtree_get_free_block`, `function rbtree_last_free_block`, `function rbtree_is_empty`, `function rbtree_insert`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration 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.