include/asm-generic/tlb.h
Source file repositories/reference/linux-study-clean/include/asm-generic/tlb.h
File Facts
- System
- Linux kernel
- Corpus path
include/asm-generic/tlb.h- Extension
.h- Size
- 25102 bytes
- Lines
- 855
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- 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/mmu_notifier.hlinux/swap.hlinux/hugetlb_inline.hasm/tlbflush.hasm/cacheflush.h
Detected Declarations
struct mmu_table_batchstruct mmu_gather_batchstruct mmu_gatherfunction __tlb_remove_tablefunction tlb_remove_tablefunction tlb_remove_table_sync_onefunction tlb_flush_rmapsfunction __tlb_adjust_rangefunction __tlb_reset_rangefunction tlb_start_vmafunction tlb_flushfunction tlb_update_vma_flagsfunction tlb_flush_mmu_tlbonlyfunction tlb_remove_page_sizefunction tlb_remove_pagefunction tlb_remove_ptdescfunction tlb_change_page_sizefunction tlb_get_unmap_shiftfunction tlb_get_unmap_sizefunction tlb_start_vmafunction tlb_end_vmafunction tlb_free_vmasfunction tlb_flush_pte_rangefunction tlb_flush_pmd_rangefunction tlb_flush_pud_rangefunction tlb_flush_p4d_rangefunction __tlb_remove_tlb_entryfunction tlb_remove_tlb_entryfunction pte_needs_flushfunction huge_pmd_needs_flushfunction tlb_unshare_pmd_ptdescfunction tlb_flush_unshared_tablesfunction tlb_remove_table_sync_one
Annotated Snippet
struct mmu_table_batch {
#ifdef CONFIG_MMU_GATHER_RCU_TABLE_FREE
struct rcu_head rcu;
#endif
unsigned int nr;
void *tables[];
};
#define MAX_TABLE_BATCH \
((PAGE_SIZE - sizeof(struct mmu_table_batch)) / sizeof(void *))
#ifndef CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE
static inline void __tlb_remove_table(void *table)
{
struct ptdesc *ptdesc = (struct ptdesc *)table;
pagetable_dtor_free(ptdesc);
}
#endif
extern void tlb_remove_table(struct mmu_gather *tlb, void *table);
#else /* !CONFIG_MMU_GATHER_TABLE_FREE */
static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page);
/*
* Without MMU_GATHER_TABLE_FREE the architecture is assumed to have page based
* page directories and we can use the normal page batching to free them.
*/
static inline void tlb_remove_table(struct mmu_gather *tlb, void *table)
{
struct ptdesc *ptdesc = (struct ptdesc *)table;
pagetable_dtor(ptdesc);
tlb_remove_page(tlb, ptdesc_page(ptdesc));
}
#endif /* CONFIG_MMU_GATHER_TABLE_FREE */
#ifdef CONFIG_MMU_GATHER_RCU_TABLE_FREE
/*
* This allows an architecture that does not use the linux page-tables for
* hardware to skip the TLBI when freeing page tables.
*/
#ifndef tlb_needs_table_invalidate
#define tlb_needs_table_invalidate() (true)
#endif
void tlb_remove_table_sync_one(void);
void tlb_remove_table_sync_rcu(void);
#else
#ifdef tlb_needs_table_invalidate
#error tlb_needs_table_invalidate() requires MMU_GATHER_RCU_TABLE_FREE
#endif
static inline void tlb_remove_table_sync_one(void) { }
static inline void tlb_remove_table_sync_rcu(void) { }
#endif /* CONFIG_MMU_GATHER_RCU_TABLE_FREE */
#ifndef CONFIG_MMU_GATHER_NO_GATHER
/*
* If we can't allocate a page to make a big batch of page pointers
* to work on, then just handle a few from the on-stack structure.
*/
#define MMU_GATHER_BUNDLE 8
struct mmu_gather_batch {
struct mmu_gather_batch *next;
unsigned int nr;
unsigned int max;
struct encoded_page *encoded_pages[];
};
#define MAX_GATHER_BATCH \
((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *))
/*
* Limit the maximum number of mmu_gather batches to reduce a risk of soft
* lockups for non-preemptible kernels on huge machines when a lot of memory
* is zapped during unmapping.
* 10K pages freed at once should be safe even without a preemption point.
*/
#define MAX_GATHER_BATCH_COUNT (10000UL/MAX_GATHER_BATCH)
extern bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page, int page_size);
Annotation
- Immediate include surface: `linux/mmu_notifier.h`, `linux/swap.h`, `linux/hugetlb_inline.h`, `asm/tlbflush.h`, `asm/cacheflush.h`.
- Detected declarations: `struct mmu_table_batch`, `struct mmu_gather_batch`, `struct mmu_gather`, `function __tlb_remove_table`, `function tlb_remove_table`, `function tlb_remove_table_sync_one`, `function tlb_flush_rmaps`, `function __tlb_adjust_range`, `function __tlb_reset_range`, `function tlb_start_vma`.
- Atlas domain: Repository Root And Misc / include.
- 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.