arch/alpha/kernel/smp.c
Source file repositories/reference/linux-study-clean/arch/alpha/kernel/smp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/kernel/smp.c- Extension
.c- Size
- 16553 bytes
- Lines
- 759
- Domain
- Architecture Layer
- Bucket
- arch/alpha
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/kernel.hlinux/kernel_stat.hlinux/module.hlinux/sched/mm.hlinux/mm.hlinux/err.hlinux/threads.hlinux/smp.hlinux/interrupt.hlinux/init.hlinux/delay.hlinux/spinlock.hlinux/irq.hlinux/cache.hlinux/profile.hlinux/bitops.hlinux/cpu.hasm/hwrpb.hasm/ptrace.hlinux/atomic.hasm/io.hasm/irq.hasm/mmu_context.hasm/tlbflush.hasm/cacheflush.hproto.hirq_impl.h
Detected Declarations
struct flush_tlb_page_structenum ipi_message_typefunction smp_store_cpu_infofunction smp_setup_percpu_timerfunction wait_boot_cpu_to_stopfunction smp_callinfunction wait_for_txrdyfunction send_secondary_console_msgfunction recv_secondary_console_msgfunction secondary_cpu_startfunction smp_boot_one_cpufunction setup_smpfunction smp_prepare_cpusfunction __cpu_upfunction smp_cpus_donefunction send_ipi_messagefunction handle_ipifunction arch_smp_send_reschedulefunction smp_send_stopfunction arch_send_call_function_ipi_maskfunction arch_send_call_function_single_ipifunction ipi_imbfunction smp_imbfunction ipi_flush_tlb_allfunction flush_tlb_allfunction ipi_flush_tlb_mmfunction flush_tlb_mmfunction ipi_flush_tlb_pagefunction flush_tlb_pagefunction flush_tlb_rangefunction ipi_flush_icache_pagefunction flush_icache_user_pageexport cpu_dataexport smp_num_cpusexport smp_imbexport flush_tlb_mmexport flush_tlb_pageexport flush_tlb_range
Annotated Snippet
struct flush_tlb_page_struct {
struct vm_area_struct *vma;
struct mm_struct *mm;
unsigned long addr;
};
static void
ipi_flush_tlb_page(void *x)
{
struct flush_tlb_page_struct *data = x;
struct mm_struct * mm = data->mm;
if (mm == current->active_mm && !asn_locked())
flush_tlb_current_page(mm, data->vma, data->addr);
else
flush_tlb_other(mm);
}
void
flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
{
struct flush_tlb_page_struct data;
struct mm_struct *mm = vma->vm_mm;
preempt_disable();
if (mm == current->active_mm) {
flush_tlb_current_page(mm, vma, addr);
if (atomic_read(&mm->mm_users) <= 1) {
int cpu, this_cpu = smp_processor_id();
for (cpu = 0; cpu < NR_CPUS; cpu++) {
if (!cpu_online(cpu) || cpu == this_cpu)
continue;
if (mm->context[cpu])
mm->context[cpu] = 0;
}
preempt_enable();
return;
}
}
data.vma = vma;
data.mm = mm;
data.addr = addr;
smp_call_function(ipi_flush_tlb_page, &data, 1);
preempt_enable();
}
EXPORT_SYMBOL(flush_tlb_page);
void
flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
{
/* On the Alpha we always flush the whole user tlb. */
flush_tlb_mm(vma->vm_mm);
}
EXPORT_SYMBOL(flush_tlb_range);
static void
ipi_flush_icache_page(void *x)
{
struct mm_struct *mm = (struct mm_struct *) x;
if (mm == current->active_mm && !asn_locked())
__load_new_mm_context(mm);
else
flush_tlb_other(mm);
}
void
flush_icache_user_page(struct vm_area_struct *vma, struct page *page,
unsigned long addr, int len)
{
struct mm_struct *mm = vma->vm_mm;
if ((vma->vm_flags & VM_EXEC) == 0)
return;
preempt_disable();
if (mm == current->active_mm) {
__load_new_mm_context(mm);
if (atomic_read(&mm->mm_users) <= 1) {
int cpu, this_cpu = smp_processor_id();
for (cpu = 0; cpu < NR_CPUS; cpu++) {
if (!cpu_online(cpu) || cpu == this_cpu)
continue;
if (mm->context[cpu])
mm->context[cpu] = 0;
}
Annotation
- Immediate include surface: `linux/errno.h`, `linux/kernel.h`, `linux/kernel_stat.h`, `linux/module.h`, `linux/sched/mm.h`, `linux/mm.h`, `linux/err.h`, `linux/threads.h`.
- Detected declarations: `struct flush_tlb_page_struct`, `enum ipi_message_type`, `function smp_store_cpu_info`, `function smp_setup_percpu_timer`, `function wait_boot_cpu_to_stop`, `function smp_callin`, `function wait_for_txrdy`, `function send_secondary_console_msg`, `function recv_secondary_console_msg`, `function secondary_cpu_start`.
- Atlas domain: Architecture Layer / arch/alpha.
- 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.