arch/alpha/mm/tlbflush.c
Source file repositories/reference/linux-study-clean/arch/alpha/mm/tlbflush.c
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/mm/tlbflush.c- Extension
.c- Size
- 2902 bytes
- Lines
- 113
- Domain
- Architecture Layer
- Bucket
- arch/alpha
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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/mm.hlinux/smp.hlinux/sched.hasm/tlbflush.hasm/pal.hasm/mmu_context.h
Detected Declarations
struct tlb_mm_and_addrfunction Copyrightfunction ipi_flush_mm_and_pagefunction migrate_flush_tlb_pagefunction flush_tlb_mm
Annotated Snippet
struct tlb_mm_and_addr {
struct mm_struct *mm;
unsigned long addr;
int tbi_type; /* 2 = DTB, 3 = ITB+DTB */
};
static void ipi_flush_mm_and_page(void *x)
{
struct tlb_mm_and_addr *d = x;
/* Part 1: mm context side (Alpha uses ASN/context as a key mechanism). */
if (d->mm == current->active_mm && !asn_locked())
__load_new_mm_context(d->mm);
else
flush_tlb_other(d->mm);
/* Part 2: immediate per-VA invalidation on this CPU. */
tbi(d->tbi_type, d->addr);
}
void migrate_flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
{
struct mm_struct *mm = vma->vm_mm;
struct tlb_mm_and_addr d = {
.mm = mm,
.addr = addr,
.tbi_type = (vma->vm_flags & VM_EXEC) ? 3 : 2,
};
/*
* One synchronous rendezvous: every CPU runs ipi_flush_mm_and_page().
* This is the "combined" version of flush_tlb_mm + per-page invalidate.
*/
preempt_disable();
on_each_cpu(ipi_flush_mm_and_page, &d, 1);
/*
* mimic flush_tlb_mm()'s mm_users<=1 optimization.
*/
if (atomic_read(&mm->mm_users) <= 1) {
int cpu, this_cpu;
this_cpu = smp_processor_id();
for (cpu = 0; cpu < NR_CPUS; cpu++) {
if (!cpu_online(cpu) || cpu == this_cpu)
continue;
if (READ_ONCE(mm->context[cpu]))
WRITE_ONCE(mm->context[cpu], 0);
}
}
preempt_enable();
}
#endif
Annotation
- Immediate include surface: `linux/mm.h`, `linux/smp.h`, `linux/sched.h`, `asm/tlbflush.h`, `asm/pal.h`, `asm/mmu_context.h`.
- Detected declarations: `struct tlb_mm_and_addr`, `function Copyright`, `function ipi_flush_mm_and_page`, `function migrate_flush_tlb_page`, `function flush_tlb_mm`.
- Atlas domain: Architecture Layer / arch/alpha.
- 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.