cregit-Linux how code gets into the kernel

Release 4.14 arch/alpha/kernel/smp.c

// SPDX-License-Identifier: GPL-2.0
/*
 *      linux/arch/alpha/kernel/smp.c
 *
 *      2001-07-09 Phil Ezolt (Phillip.Ezolt@compaq.com)
 *            Renamed modified smp_call_function to smp_call_function_on_cpu()
 *            Created an function that conforms to the old calling convention
 *            of smp_call_function().
 *
 *            This is helpful for DCPI.
 *
 */

#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/kernel_stat.h>
#include <linux/module.h>
#include <linux/sched/mm.h>
#include <linux/mm.h>
#include <linux/err.h>
#include <linux/threads.h>
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/spinlock.h>
#include <linux/irq.h>
#include <linux/cache.h>
#include <linux/profile.h>
#include <linux/bitops.h>
#include <linux/cpu.h>

#include <asm/hwrpb.h>
#include <asm/ptrace.h>
#include <linux/atomic.h>

#include <asm/io.h>
#include <asm/irq.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
#include <asm/tlbflush.h>

#include "proto.h"
#include "irq_impl.h"



#define DEBUG_SMP 0
#if DEBUG_SMP

#define DBGS(args)	printk args
#else

#define DBGS(args)
#endif

/* A collection of per-processor data.  */

struct cpuinfo_alpha cpu_data[NR_CPUS];

EXPORT_SYMBOL(cpu_data);

/* A collection of single bit ipi messages.  */
static struct {
	
unsigned long bits ____cacheline_aligned;

} ipi_data[NR_CPUS] __cacheline_aligned;


enum ipi_message_type {
	
IPI_RESCHEDULE,
	
IPI_CALL_FUNC,
	
IPI_CPU_STOP,
};

/* Set to a secondary's cpuid when it comes online.  */

static int smp_secondary_alive = 0;


int smp_num_probed;		
/* Internal processor count */

int smp_num_cpus = 1;		
/* Number that came online.  */

EXPORT_SYMBOL(smp_num_cpus);

/*
 * Called by both boot and secondaries to move global data into
 *  per-processor storage.
 */

static inline void __init smp_store_cpu_info(int cpuid) { cpu_data[cpuid].loops_per_jiffy = loops_per_jiffy; cpu_data[cpuid].last_asn = ASN_FIRST_VERSION; cpu_data[cpuid].need_new_asn = 0; cpu_data[cpuid].asn_lock = 0; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)47100.00%6100.00%
Total47100.00%6100.00%

/* * Ideally sets up per-cpu profiling hooks. Doesn't do much now... */
static inline void __init smp_setup_percpu_timer(int cpuid) { cpu_data[cpuid].prof_counter = 1; cpu_data[cpuid].prof_multiplier = 1; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)29100.00%3100.00%
Total29100.00%3100.00%


static void __init wait_boot_cpu_to_stop(int cpuid) { unsigned long stop = jiffies + 10*HZ; while (time_before(jiffies, stop)) { if (!smp_secondary_alive) return; barrier(); } printk("wait_boot_cpu_to_stop: FAILED on CPU %d, hanging now\n", cpuid); for (;;) barrier(); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds5498.18%150.00%
Ivan Kokshaysky11.82%150.00%
Total55100.00%2100.00%

/* * Where secondaries begin a life of C. */
void __init smp_callin(void) { int cpuid = hard_smp_processor_id(); if (cpu_online(cpuid)) { printk("??, cpu 0x%x already present??\n", cpuid); BUG(); } set_cpu_online(cpuid, true); /* Turn on machine checks. */ wrmces(7); /* Set trap vectors. */ trap_init(); /* Set interrupt vector. */ wrent(entInt, 0); /* Get our local ticker going. */ smp_setup_percpu_timer(cpuid); init_clockevent(); /* Call platform-specific callin, if specified */ if (alpha_mv.smp_callin) alpha_mv.smp_callin(); /* All kernel threads share the same mm context. */ mmgrab(&init_mm); current->active_mm = &init_mm; /* inform the notifiers about the new cpu */ notify_cpu_starting(cpuid); /* Must have completely accurate bogos. */ local_irq_enable(); /* Wait boot CPU to stop with irq enabled before running calibrate_delay. */ wait_boot_cpu_to_stop(cpuid); mb(); calibrate_delay(); smp_store_cpu_info(cpuid); /* Allow master to continue only after we written loops_per_jiffy. */ wmb(); smp_secondary_alive = 1; DBGS(("smp_callin: commencing CPU %d current %p active_mm %p\n", cpuid, current, current->active_mm)); preempt_disable(); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)6241.06%422.22%
Ivan Kokshaysky3019.87%211.11%
Richard Henderson2214.57%211.11%
Linus Torvalds138.61%211.11%
Rusty Russell85.30%15.56%
Manfred Spraul63.97%15.56%
Thomas Gleixner42.65%211.11%
Frédéric Weisbecker31.99%15.56%
Vegard Nossum10.66%15.56%
Ingo Molnar10.66%15.56%
Matt Turner10.66%15.56%
Total151100.00%18100.00%

/* Wait until hwrpb->txrdy is clear for cpu. Return -1 on timeout. */
static int wait_for_txrdy (unsigned long cpumask) { unsigned long timeout; if (!(hwrpb->txrdy & cpumask)) return 0; timeout = jiffies + 10*HZ; while (time_before(jiffies, timeout)) { if (!(hwrpb->txrdy & cpumask)) return 0; udelay(10); barrier(); } return -1; }

Contributors

PersonTokensPropCommitsCommitProp
Richard Henderson7298.63%150.00%
Linus Torvalds (pre-git)11.37%150.00%
Total73100.00%2100.00%

/* * Send a message to a secondary's console. "START" is one such * interesting message. ;-) */
static void send_secondary_console_msg(char *str, int cpuid) { struct percpu_struct *cpu; register char *cp1, *cp2; unsigned long cpumask; size_t len; cpu = (struct percpu_struct *) ((char*)hwrpb + hwrpb->processor_offset + cpuid * hwrpb->processor_size); cpumask = (1UL << cpuid); if (wait_for_txrdy(cpumask)) goto timeout; cp2 = str; len = strlen(cp2); *(unsigned int *)&cpu->ipc_buffer[0] = len; cp1 = (char *) &cpu->ipc_buffer[1]; memcpy(cp1, cp2, len); /* atomic test and set */ wmb(); set_bit(cpuid, &hwrpb->rxrdy); if (wait_for_txrdy(cpumask)) goto timeout; return; timeout: printk("Processor %x not ready\n", cpuid); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)15295.00%360.00%
Richard Henderson74.38%120.00%
Linus Torvalds10.62%120.00%
Total160100.00%5100.00%

/* * A secondary console wants to send a message. Receive it. */
static void recv_secondary_console_msg(void) { int mycpu, i, cnt; unsigned long txrdy = hwrpb->txrdy; char *cp1, *cp2, buf[80]; struct percpu_struct *cpu; DBGS(("recv_secondary_console_msg: TXRDY 0x%lx.\n", txrdy)); mycpu = hard_smp_processor_id(); for (i = 0; i < NR_CPUS; i++) { if (!(txrdy & (1UL << i))) continue; DBGS(("recv_secondary_console_msg: " "TXRDY contains CPU %d.\n", i)); cpu = (struct percpu_struct *) ((char*)hwrpb + hwrpb->processor_offset + i * hwrpb->processor_size); DBGS(("recv_secondary_console_msg: on %d from %d" " HALT_REASON 0x%lx FLAGS 0x%lx\n", mycpu, i, cpu->halt_reason, cpu->flags)); cnt = cpu->ipc_buffer[0] >> 32; if (cnt <= 0 || cnt >= 80) strcpy(buf, "<<< BOGUS MSG >>>"); else { cp1 = (char *) &cpu->ipc_buffer[1]; cp2 = buf; memcpy(cp2, cp1, cnt); cp2[cnt] = '\0'; while ((cp2 = strchr(cp2, '\r')) != 0) { *cp2 = ' '; if (cp2[1] == '\n') cp2[1] = ' '; } } DBGS((KERN_INFO "recv_secondary_console_msg: on %d " "message is '%s'\n", mycpu, buf)); } hwrpb->txrdy = 0; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)24895.38%562.50%
Chen Gang S114.23%225.00%
Linus Torvalds10.38%112.50%
Total260100.00%8100.00%

/* * Convince the console to have a secondary cpu begin execution. */
static int secondary_cpu_start(int cpuid, struct task_struct *idle) { struct percpu_struct *cpu; struct pcb_struct *hwpcb, *ipcb; unsigned long timeout; cpu = (struct percpu_struct *) ((char*)hwrpb + hwrpb->processor_offset + cpuid * hwrpb->processor_size); hwpcb = (struct pcb_struct *) cpu->hwpcb; ipcb = &task_thread_info(idle)->pcb; /* Initialize the CPU's HWPCB to something just good enough for us to get started. Immediately after starting, we'll swpctx to the target idle task's pcb. Reuse the stack in the mean time. Precalculate the target PCBB. */ hwpcb->ksp = (unsigned long)ipcb + sizeof(union thread_union) - 16; hwpcb->usp = 0; hwpcb->ptbr = ipcb->ptbr; hwpcb->pcc = 0; hwpcb->asn = 0; hwpcb->unique = virt_to_phys(ipcb); hwpcb->flags = ipcb->flags; hwpcb->res1 = hwpcb->res2 = 0; #if 0 DBGS(("KSP 0x%lx PTBR 0x%lx VPTBR 0x%lx UNIQUE 0x%lx\n", hwpcb->ksp, hwpcb->ptbr, hwrpb->vptb, hwpcb->unique)); #endif DBGS(("Starting secondary cpu %d: state 0x%lx pal_flags 0x%lx\n", cpuid, idle->state, ipcb->flags)); /* Setup HWRPB fields that SRM uses to activate secondary CPU */ hwrpb->CPU_restart = __smp_callin; hwrpb->CPU_restart_data = (unsigned long) __smp_callin; /* Recalculate and update the HWRPB checksum */ hwrpb_update_checksum(hwrpb); /* * Send a "start" command to the specified processor. */ /* SRM III 3.4.1.3 */ cpu->flags |= 0x22; /* turn on Context Valid and Restart Capable */ cpu->flags &= ~1; /* turn off Bootstrap In Progress */ wmb(); send_secondary_console_msg("START\r\n", cpuid); /* Wait 10 seconds for an ACK from the console. */ timeout = jiffies + 10*HZ; while (time_before(jiffies, timeout)) { if (cpu->flags & 1) goto started; udelay(10); barrier(); } printk(KERN_ERR "SMP: Processor %d failed to start.\n", cpuid); return -1; started: DBGS(("secondary_cpu_start: SUCCESS for CPU %d!!!\n", cpuid)); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)24886.41%450.00%
Richard Henderson3411.85%112.50%
Al Viro31.05%112.50%
Linus Torvalds10.35%112.50%
Ivan Kokshaysky10.35%112.50%
Total287100.00%8100.00%

/* * Bring one cpu online. */
static int smp_boot_one_cpu(int cpuid, struct task_struct *idle) { unsigned long timeout; /* Signal the secondary to wait a moment. */ smp_secondary_alive = -1; /* Whirrr, whirrr, whirrrrrrrrr... */ if (secondary_cpu_start(cpuid, idle)) return -1; /* Notify the secondary CPU it can run calibrate_delay. */ mb(); smp_secondary_alive = 0; /* We've been acked by the console; wait one second for the task to start up for real. */ timeout = jiffies + 1*HZ; while (time_before(jiffies, timeout)) { if (smp_secondary_alive == 1) goto alive; udelay(10); barrier(); } /* We failed to boot the CPU. */ printk(KERN_ERR "SMP: Processor %d is stuck.\n", cpuid); return -1; alive: /* Another "Red Snapper". */ return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)7270.59%228.57%
Richard Henderson1716.67%114.29%
Linus Torvalds87.84%114.29%
Thomas Gleixner32.94%114.29%
Ivan Kokshaysky21.96%228.57%
Total102100.00%7100.00%

/* * Called from setup_arch. Detect an SMP system and which processors * are present. */
void __init setup_smp(void) { struct percpu_struct *cpubase, *cpu; unsigned long i; if (boot_cpuid != 0) { printk(KERN_WARNING "SMP: Booting off cpu %d instead of 0?\n", boot_cpuid); } if (hwrpb->nr_processors > 1) { int boot_cpu_palrev; DBGS(("setup_smp: nr_processors %ld\n", hwrpb->nr_processors)); cpubase = (struct percpu_struct *) ((char*)hwrpb + hwrpb->processor_offset); boot_cpu_palrev = cpubase->pal_revision; for (i = 0; i < hwrpb->nr_processors; i++) { cpu = (struct percpu_struct *) ((char *)cpubase + i*hwrpb->processor_size); if ((cpu->flags & 0x1cc) == 0x1cc) { smp_num_probed++; set_cpu_possible(i, true); set_cpu_present(i, true); cpu->pal_revision = boot_cpu_palrev; } DBGS(("setup_smp: CPU %d: flags 0x%lx type 0x%lx\n", i, cpu->flags, cpu->type)); DBGS(("setup_smp: CPU %d: PAL rev 0x%lx\n", i, cpu->pal_revision)); } } else { smp_num_probed = 1; } printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", smp_num_probed, cpumask_bits(cpu_present_mask)[0]); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)19089.20%436.36%
Rusty Russell104.69%327.27%
Ivan Kokshaysky62.82%19.09%
Motohiro Kosaki41.88%19.09%
Richard Henderson20.94%19.09%
Brian Uhrain says10.47%19.09%
Total213100.00%11100.00%

/* * Called by smp_init prepare the secondaries */
void __init smp_prepare_cpus(unsigned int max_cpus) { /* Take care of some initial bookkeeping. */ memset(ipi_data, 0, sizeof(ipi_data)); current_thread_info()->cpu = boot_cpuid; smp_store_cpu_info(boot_cpuid); smp_setup_percpu_timer(boot_cpuid); /* Nothing to do on a UP box, or when told not to. */ if (smp_num_probed == 1 || max_cpus == 0) { init_cpu_possible(cpumask_of(boot_cpuid)); init_cpu_present(cpumask_of(boot_cpuid)); printk(KERN_INFO "SMP mode deactivated.\n"); return; } printk(KERN_INFO "SMP starting up secondaries.\n"); smp_num_cpus = smp_num_probed; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)6272.09%440.00%
Rusty Russell1213.95%220.00%
Richard Henderson55.81%110.00%
Ivan Kokshaysky55.81%220.00%
Andrew Morton22.33%110.00%
Total86100.00%10100.00%


void smp_prepare_boot_cpu(void) { }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton466.67%133.33%
Linus Torvalds (pre-git)116.67%133.33%
Ivan Kokshaysky116.67%133.33%
Total6100.00%3100.00%


int __cpu_up(unsigned int cpu, struct task_struct *tidle) { smp_boot_one_cpu(cpu, tidle); return cpu_online(cpu) ? 0 : -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
Ivan Kokshaysky2475.00%240.00%
Thomas Gleixner721.88%240.00%
Linus Torvalds (pre-git)13.12%120.00%
Total32100.00%5100.00%


void __init smp_cpus_done(unsigned int max_cpus) { int cpu; unsigned long bogosum = 0; for(cpu = 0; cpu < NR_CPUS; cpu++) if (cpu_online(cpu)) bogosum += cpu_data[cpu].loops_per_jiffy; printk(KERN_INFO "SMP: Total of %d processors activated " "(%lu.%02lu BogoMIPS).\n", num_online_cpus(), (bogosum + 2500) / (500000/HZ), ((bogosum + 2500) / (5000/HZ)) % 100); }

Contributors

PersonTokensPropCommitsCommitProp
Ivan Kokshaysky7991.86%233.33%
Linus Torvalds (pre-git)66.98%350.00%
Andrew Morton11.16%116.67%
Total86100.00%6100.00%


int setup_profiling_timer(unsigned int multiplier) { return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)13100.00%2100.00%
Total13100.00%2100.00%


static void send_ipi_message(const struct cpumask *to_whom, enum ipi_message_type operation) { int i; mb(); for_each_cpu(i, to_whom) set_bit(operation, &ipi_data[i].bits); mb(); for_each_cpu(i, to_whom) wripir(i); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)3665.45%240.00%
Andrew Morton916.36%120.00%
Rusty Russell610.91%120.00%
Richard Henderson47.27%120.00%
Total55100.00%5100.00%


void handle_ipi(struct pt_regs *regs) { int this_cpu = smp_processor_id(); unsigned long *pending_ipis = &ipi_data[this_cpu].bits; unsigned long ops; #if 0 DBGS(("handle_ipi: on CPU %d ops 0x%lx PC 0x%lx\n", this_cpu, *pending_ipis, regs->pc)); #endif mb(); /* Order interrupt and bit testing. */ while ((ops = xchg(pending_ipis, 0)) != 0) { mb(); /* Order bit clearing and data access. */ do { unsigned long which; which = ops & -ops; ops &= ~which; which = __ffs(which); switch (which) { case IPI_RESCHEDULE: scheduler_ipi(); break; case IPI_CALL_FUNC: generic_smp_call_function_interrupt(); break; case IPI_CPU_STOP: halt(); default: printk(KERN_CRIT "Unknown IPI on CPU %d: %lu\n", this_cpu, which); break; } } while (ops); mb(); /* Order data access and bit testing. */ } cpu_data[this_cpu].ipi_count++; if (hwrpb->txrdy) recv_secondary_console_msg(); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)13788.96%457.14%
Richard Henderson117.14%114.29%
Peter Zijlstra31.95%114.29%
Jens Axboe31.95%114.29%
Total154100.00%7100.00%


void smp_send_reschedule(int cpu) { #ifdef DEBUG_IPI_MSG if (cpu == hard_smp_processor_id()) printk(KERN_WARNING "smp_send_reschedule: Sending IPI to self.\n"); #endif send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)3186.11%350.00%
Al Viro25.56%116.67%
Andrew Morton25.56%116.67%
Rusty Russell12.78%116.67%
Total36100.00%6100.00%


void smp_send_stop(void) { cpumask_t to_whom; cpumask_copy(&to_whom, cpu_possible_mask); cpumask_clear_cpu(smp_processor_id(), &to_whom); #ifdef DEBUG_IPI_MSG if (hard_smp_processor_id() != boot_cpu_id) printk(KERN_WARNING "smp_send_stop: Not on boot cpu.\n"); #endif send_ipi_message(&to_whom, IPI_CPU_STOP); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)3362.26%342.86%
Motohiro Kosaki1018.87%114.29%
Andrew Morton713.21%114.29%
Al Viro23.77%114.29%
Rusty Russell11.89%114.29%
Total53100.00%7100.00%


void arch_send_call_function_ipi_mask(const struct cpumask *mask) { send_ipi_message(mask, IPI_CALL_FUNC); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)950.00%240.00%
Rusty Russell527.78%120.00%
Linus Torvalds211.11%120.00%
Jens Axboe211.11%120.00%
Total18100.00%5100.00%


void arch_send_call_function_single_ipi(int cpu) { send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds950.00%125.00%
Jens Axboe738.89%125.00%
Rusty Russell15.56%125.00%
Jiang Liu15.56%125.00%
Total18100.00%4100.00%


static void ipi_imb(void *ignored) { imb(); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)13100.00%4100.00%
Total13100.00%4100.00%


void smp_imb(void) { /* Must wait other processors to flush their icache before continue. */ if (on_each_cpu(ipi_imb, NULL, 1)) printk(KERN_CRIT "smp_imb: timed out\n"); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)2496.00%150.00%
Andrew Morton14.00%150.00%
Total25100.00%2100.00%

EXPORT_SYMBOL(smp_imb);
static void ipi_flush_tlb_all(void *ignored) { tbia(); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)13100.00%4100.00%
Total13100.00%4100.00%


void flush_tlb_all(void) { /* Although we don't have any data to pass, we do want to synchronize with the other processors. */ if (on_each_cpu(ipi_flush_tlb_all, NULL, 1)) { printk(KERN_CRIT "flush_tlb_all: timed out\n"); } }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)2696.30%375.00%
Andrew Morton13.70%125.00%
Total27100.00%4100.00%

#define asn_locked() (cpu_data[smp_processor_id()].asn_lock)
static void ipi_flush_tlb_mm(void *x) { struct mm_struct *mm = (struct mm_struct *) x; if (mm == current->active_mm && !asn_locked()) flush_tlb_current(mm); else flush_tlb_other(mm); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)45100.00%6100.00%
Total45100.00%6100.00%


void flush_tlb_mm(struct mm_struct *mm) { preempt_disable(); if (mm == current->active_mm) { flush_tlb_current(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; } preempt_enable(); return; } } if (smp_call_function(ipi_flush_tlb_mm, mm, 1)) { printk(KERN_CRIT "flush_tlb_mm: timed out\n"); } preempt_enable(); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)10384.43%675.00%
Ivan Kokshaysky108.20%112.50%
Andrew Morton97.38%112.50%
Total122100.00%8100.00%

EXPORT_SYMBOL(flush_tlb_mm); 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 = (struct flush_tlb_page_struct *)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); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)62100.00%5100.00%
Total62100.00%5100.00%


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; if (smp_call_function(ipi_flush_tlb_page, &data, 1)) { printk(KERN_CRIT "flush_tlb_page: timed out\n"); } preempt_enable(); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)14388.27%675.00%
Ivan Kokshaysky106.17%112.50%
Andrew Morton95.56%112.50%
Total162100.00%8100.00%

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); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)2180.77%266.67%
Linus Torvalds519.23%133.33%
Total26100.00%3100.00%

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); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)45100.00%2100.00%
Total45100.00%2100.00%


void flush_icache_user_range(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; } preempt_enable(); return; } } if (smp_call_function(ipi_flush_icache_page, mm, 1)) { printk(KERN_CRIT "flush_icache_page: timed out\n"); } preempt_enable(); }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)12982.69%240.00%
Ivan Kokshaysky106.41%120.00%
Andrew Morton95.77%120.00%
Paul Mackerras85.13%120.00%
Total156100.00%5100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)216875.86%2230.56%
Ivan Kokshaysky1836.40%79.72%
Richard Henderson1786.23%34.17%
Linus Torvalds983.43%56.94%
Andrew Morton541.89%34.17%
Rusty Russell441.54%45.56%
Al Viro371.29%34.17%
Thomas Gleixner140.49%45.56%
Motohiro Kosaki140.49%11.39%
Jens Axboe120.42%11.39%
Chen Gang S110.38%22.78%
Paul Mackerras80.28%11.39%
Manfred Spraul60.21%11.39%
Alexey Dobriyan60.21%22.78%
Adrian Bunk50.17%11.39%
Arnaldo Carvalho de Melo30.10%11.39%
William Lee Irwin III30.10%11.39%
Frédéric Weisbecker30.10%11.39%
Peter Zijlstra30.10%11.39%
Ingo Molnar20.07%22.78%
Jiang Liu10.03%11.39%
Arun Sharma10.03%11.39%
Greg Kroah-Hartman10.03%11.39%
Matt Turner10.03%11.39%
Brian Uhrain says10.03%11.39%
Vegard Nossum10.03%11.39%
Total2858100.00%72100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.